Details
In the same spirit of Q77, is there a way to tell phorge at runtime to use a different, out-of-tree local.json? For example by setting an environment variable to its path.
Again, the reason is that I'm packaging phorge and the package itself is immutable.
For now I'm working around the problem by symlinking phorge/conf/local/local.json to /etc/phorge/local.json at build time. This works fine and is probably enough for most distros, but in NixOS we prefer to specify our own immutable paths where possible, so this would be nice to have.
Answers
There's an "advanced mode", that allows you to specify a PHP file as configuration source - specified by either a file or envvar:
https://we.phorge.it/book/phorge/article/advanced_configuration/#configuration-files
I never tried it, but I understand it's part of the multi-instance hosting setup.
The path for local.json is hard-coded in PhabricatorConfigLocalSource.php, so the bin/config (PhabricatorConfigLocalSource.php) command will keep trying to edit this file. I guess one option would be to provide an alternative config command (or subcommand), and have the custom configuration PHP file just read a JSON file.