View Issue Details

IDProjectCategoryView StatusLast Update
0016850mantisbtcustomizationpublic2019-03-29 08:28
Reportervboctor Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.15 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0016850: Add config folder for customization files
Description

Currently customization files are mixed up with the distribution files. It would be useful to have a config folder that contains all these files. The files will include:

config/

  • custom_constants_inc.php
  • custom_strings_inc.php
  • custom_relationships_inc.php
  • custom_functions_inc.php
  • custom_config_inc.php
  • logo.png
  • header / footer includes?

I'm also thinking that we may want to continue to have config_inc.php which just contains the database connection details generated by installers. Then use the config/custom_config_inc.php to contain all the customization settings. This way all customizations can be backed up and possibly re-used independent of the database connection details.

I'm suggesting we implement this for 1.3.x, and still support the old files for upgrades to older installations. We can also add checks to recommend moving the files in the old location when found as part of admin/check/

TagsNo tags attached.

Relationships

related to 0008089 confirmed Make the location of config_inc.php relocatable outside htdocs 
related to 0008401 closedgrangeway Provide better out-of-the-box support for Mantis Server Farm 
related to 0017263 closeddregad config_get_global() returns default value for global variables overriden in config_inc.php 

Activities

atrol

atrol

2014-01-19 09:49

developer   ~0039085

+1 for having a separate folder

Then use the config/custom_config_inc.php
I don't think this a big advantage as we had to discuss also what should stay in config_inc.php
If you want database customization in it you maybe want also e-mail settings ...

There will also be users that change the same option in two files which will complicate support.

and still support the old files for upgrades to older installations
This introduces additional file operations for each request and complicates support.

We can also add checks to recommend moving the files ..
+1 for the checks, but force moving of the files.
Even better: Move them with installation process if access rights don't prevent it.

vboctor

vboctor

2014-01-19 14:28

manager   ~0039089

I like the separation of environment settings (database and email type/server/debug) from feature settings (statuses, notifications, etc). This makes it either in a MantisHub like environment and in environments where users want to have a test and production environments.

Having said that, I get your point about keeping it simple.

I've updated the issue description to all include logo.png which can override default logo when found. We can also recommend or require top_include_page / bottom_include_page in there.

atrol

atrol

2014-01-19 15:12

developer   ~0039092

Just a hint, nothing special at the moment:
Keep in mind that at least some of the options we are talking about can also be set in database and override file settings.
Users might think they have separate environments when cloning a database and changing just config_inc.php.

dregad

dregad

2014-01-22 12:19

developer   ~0039139

I like the idea of having a separate config directory for all the custom files.

Having backwards compatibility looks good on paper, but as atrol pointed out it could easily become a maintenance/support issue in the future so we need to find a good way to detect this situation and instruct the admin to move/rename the files as part of the upgrade process. Maybe in a highly visible message like a red warning on the login page like we do for the admin directory or the default root password.

Just a thought, not sure if it's a good idea or not, what about requiring that this directory is writable ? Other php apps do that (e.g. DokuWiki [1]). If we do that we can more easily enforce the new setup through the installer.

The separate file for DB/environment-specific configs could also potentially be a good idea. I actually faced this very issue @work managing the dev/test/prod envs, and ended up manually maintaining config files which is the occasional pain when a setting has to be modified.

However, we must ensure that this file contains only parameters which are restricted to config files (i.e. can never be in the DB), as per $g_global_settings.

We also need to be careful of how we design this in terms of the cascading configs, i.e. does it make sense to allow "system" settings to be overridden in the "custom" file or not ? Maybe we should think of these in terms of a "global" vs a "local" file, so we'd have

config_defaults_inc
=> config_global_inc (generic, cross-server configs)
=> config_local_inc (server-specific configs)
=> database

This needs to be thought through.

[1] https://www.dokuwiki.org/install:permissions#setting_up_file_permissions

Related Changesets

MantisBT: master 98917922

2014-04-12 20:22

mantishub


Details Diff
Fixes 0016850: Add config folder for customization files Affected Issues
0016850
mod - .gitignore Diff File
mod - admin/check/check_integrity_inc.php Diff File
mod - admin/install.php Diff File
mod - admin/test_email.php Diff File
mod - api/soap/mantisconnect.php Diff File
rm - api/soap/mc_config_defaults_inc.php Diff
mod - api/soap/mc_core.php Diff File
add - config/.htaccess Diff File
mod - config_defaults_inc.php Diff File
mod - core.php Diff File
mod - core/lang_api.php Diff File
mod - core/relationship_api.php Diff File
mod - docbook/Admin_Guide/en-US/Configuration.xml Diff File
mod - docbook/Admin_Guide/en-US/Customizing.xml Diff File
mod - readme.md Diff File

MantisBT: master 4b173463

2014-04-22 19:24

mantishub


Details Diff
Fixes 0016850: Add config folder for customization files
Fixes 0016446: Merge MantisConnect configs into MantisBT standard configs.

This change adds a config folder that includes all custom_*_inc.php files and config_inc.php file.

The SOAP API configs are now also merged into the standard configs. The fact that the separate configs was from the days where MantisConnect web service was separate from MantisBT. Now it is just confusing.

This change includes the addition of a configurable config path that can be set via an environment variable (MANTIS_CONFIG_FOLDER) or defaulted to MantisBT config subfolder. The change also includes all the necessary validation in admin/check/ and admin/install.php.

Conflicts:
api/soap/mc_config_defaults_inc.php
Affected Issues
0016446, 0016850
mod - .gitignore Diff File
mod - admin/check/check_config_inc.php Diff File
mod - admin/check/check_integrity_inc.php Diff File
mod - admin/check/check_paths_inc.php Diff File
mod - admin/check/check_webservice_inc.php Diff File
mod - admin/install.php Diff File
mod - admin/test_email.php Diff File
mod - api/soap/mantisconnect.php Diff File
mod - api/soap/mc_api.php Diff File
rm - api/soap/mc_config_defaults_inc.php Diff
mod - api/soap/mc_core.php Diff File
mod - api/soap/mc_enum_api.php Diff File
mod - api/soap/mc_issue_api.php Diff File
add - config/.htaccess Diff File
mod - config_defaults_inc.php Diff File
mod - core.php Diff File
mod - core/crypto_api.php Diff File
mod - core/lang_api.php Diff File
mod - core/obsolete.php Diff File
mod - core/relationship_api.php Diff File
mod - docbook/Admin_Guide/en-US/Configuration.xml Diff File
mod - docbook/Admin_Guide/en-US/Customizing.xml Diff File
mod - readme.md Diff File
mod - scripts/travis_before_script.sh Diff File
mod - tests/TestConfig.php Diff File

MantisBT: master d923f529

2019-03-27 08:25

dregad


Details Diff
Doc: custom_strings_file is obsolete

Config has been removed in 2014 (see issue 0016850, commit
2928756bbc621e04d691f9e9cce10cf673e0e742) but it was still referenced
in the Admin Guide.
Affected Issues
0016850
mod - docbook/Admin_Guide/en-US/Customizing.xml Diff File
mod - docbook/Admin_Guide/en-US/Installation.xml Diff File
mod - docbook/Admin_Guide/en-US/config/html.xml Diff File