Details
I run a Phabricator cluster (although it's probably much simpler than the Phacility cluster). I'm curious as to how @epriestley manages the configuration for the Phacility cluster? Previously I had used a conf/custom/mydomain.php file for managing configuration, but I later moved to using local.json as I think (from memory, can't find any references anywhere) that the local.json approach is generally preferred over the conf/custom approach.
Is there a better way for managing configuration in a cluster though?
Answers
We copy a bunch of config files into conf/custom/ and then select one by writing to conf/local/ENVIRONMENT. (Some of them include others, which is why we just copy them all.)
The conf/custom/ stuff isn't exactly discouraged, it's just at the high end of the power/complexity scale so I generally try to recommend a lower-power/simpler option first if a use case doesn't need the higher-power stuff.
(We also manage a substantial amount of config by subclassing PhabricatorConfigSiteSource, which is the absolute high-end of the power spectrum.)
There's no right/best way to do things. I think reasonable options are:
- Low Power / Low Complexity: Copy or create a local.json when deploying.
- Medium Power / Medium Complexity: Use conf/custom/*.php files with an ENVIRONMENT file or PHABRICATOR_ENV environmental variable.
- High Power / High Complexity: Subclass PhabricatorConfigSiteSource.
The higher-power options can do more complex dynamic runtime config more readily, but are increasingly involved.