View Issue Details

IDProjectCategoryView StatusLast Update
0016850mantisbtcustomizationpublic2014-12-08 00:34
ReportervboctorAssigned 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-13 00:22:00

mantishub

Details Diff
Fixes 0016850: Add config folder for customization files
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 File
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 23:24:57

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
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 File
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

Issue History

Date Modified Username Field Change
2014-01-18 22:19 vboctor New Issue
2014-01-18 22:19 vboctor Status new => assigned
2014-01-18 22:19 vboctor Assigned To => vboctor
2014-01-19 09:49 atrol Note Added: 0039085
2014-01-19 14:28 vboctor Note Added: 0039089
2014-01-19 14:28 vboctor Description Updated View Revisions
2014-01-19 15:12 atrol Note Added: 0039092
2014-01-21 16:13 atrol Relationship added related to 0008089
2014-01-21 16:17 atrol Relationship added related to 0008401
2014-01-22 12:19 dregad Note Added: 0039139
2014-04-22 23:52 mantishub Changeset attached => MantisBT master 98917922
2014-04-22 23:52 mantishub Changeset attached => MantisBT master 4b173463
2014-04-22 23:52 mantishub Assigned To vboctor => mantishub
2014-04-22 23:52 mantishub Status assigned => resolved
2014-04-22 23:52 mantishub Resolution open => fixed
2014-04-22 23:52 mantishub Fixed in Version => 1.3.0-beta.1
2014-04-28 06:46 dregad Relationship added related to 0017263
2014-04-28 06:47 dregad Assigned To mantishub => vboctor
2014-12-08 00:34 vboctor Status resolved => closed