1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00
phorge-phorge/scripts
epriestley ba489f9d85 Add a local configuration source and a non-environmental ENV config source
Summary:
See discussion in T2221. Before we can move configuration to the database, we have a bootstrapping problem: we need database credentials to live //somewhere// if we can't guess them (and we can only really guess localhost / root / no password).

Some options for this are:

  - Have them live in ENV variables.
    - These are often somewhat unfamiliar to users.
    - Scripts would become a huge pain -- you'd have to dump a bunch of stuff into ENV.
    - Some environments have limited ability to set ENV vars.
    - SSH is also a pain.
  - Have them live in a normal config file.
    - This probably isn't really too awful, but:
    - Since we deploy/upgrade with git, we can't currently let them edit a file which already exists, or their working copy will become dirty.
    - So they have to copy or create a file, then edit it.
    - The biggest issue I have with this is that it will be difficult to give specific, easily-followed directions from Setup. The instructions need to be like "Copy template.conf.php to real.conf.php, then edit these keys: x, y, z". This isn't as easy to follow as "run script Y".
  - Have them live in an abnormal config file with script access (this diff).
    - I think this is a little better than a normal config file, because we can tell users 'run phabricator/bin/config set mysql.user phabricator' and such, which is easier to follow than editing a config file.

I think this is only a marginal improvement over a normal config file and am open to arguments against this approach, but I think it will be a little easier for users to deal with than a normal config file. In most cases they should only need to store three values in this file -- db user/host/pass -- since once we have those we can bootstrap everything else. Normal config files also aren't going away for more advanced users, we're just offering a simple alternative for most users.

This also adds an ENVIRONMENT file as an alternative to PHABRICATOR_ENV. This is just a simple way to specify the environment if you don't have convenient access to env vars.

Test Plan: Ran `config set x y`, verified writes. Wrote to ENVIRONMENT, ran `PHABRICATOR_ENV= ./bin/repository`.

Reviewers: btrahan, vrana, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2221

Differential Revision: https://secure.phabricator.com/D4294
2012-12-30 06:16:15 -08:00
..
aphront Delete license headers from files 2012-11-05 11:16:51 -08:00
calendar Delete license headers from files 2012-11-05 11:16:51 -08:00
celerity Use application icons for "Eye" menu and Crumbs 2012-12-07 13:37:28 -08:00
daemon Delete license headers from files 2012-11-05 11:16:51 -08:00
differential Delete license headers from files 2012-11-05 11:16:51 -08:00
drydock Allow leases to be explicitly released via web or CLI 2012-12-14 15:42:58 -08:00
fact Delete license headers from files 2012-11-05 11:16:51 -08:00
files Delete license headers from files 2012-11-05 11:16:51 -08:00
fpm Delete license headers from files 2012-11-05 11:16:51 -08:00
install Fix the RHEL install script, mostly for RHEL 5. 2012-11-27 12:52:37 -08:00
mail Delete license headers from files 2012-11-05 11:16:51 -08:00
profile Delete license headers from files 2012-11-05 11:16:51 -08:00
repository Add HarbormasterRunnerWorker, for running CI tests 2012-12-17 13:43:26 -08:00
search Improve Search architecture 2012-12-21 14:21:31 -08:00
setup Add a local configuration source and a non-environmental ENV config source 2012-12-30 06:16:15 -08:00
sql Delete license headers from files 2012-11-05 11:16:51 -08:00
ssh Fix various issues with SSH receivers 2012-12-19 11:11:32 -08:00
symbols Delete license headers from files 2012-11-05 11:16:51 -08:00
user Delete license headers from files 2012-11-05 11:16:51 -08:00
util Delete license headers from files 2012-11-05 11:16:51 -08:00
__init_script__.php Consolidate environmental initialization 2012-12-25 06:15:28 -08:00
celerity_mapper.php Modernize file uploads 2012-12-16 16:34:01 -08:00