The non provisioned boxes will always be configured
to work on localhost. This includes the webadmin OAuth
records. After the cloudron gets provisioned, the FQDN
will be set to the correct value, which requires regeneration
of the OAuth client records.
Supervisor does not spawn a shell to run the application,
thus the process environment of supervisord will be inherited.
This can be overridden with 'environmen=...' in the config file
One of the motivations for this is to allow the node code to restart
nginx once the nginx config files have been written out. Without
supervisor, the app code needs to be root. With supervisor, we can
just ask supervisor to restart it for us (which helpfully listens
for commands in a tcp port 9001).
The supervisor configs are crude and need to somehow use environment
variables for log file paths and such. %(ENV)s format is supposed to
work but doesn't.
supervisor is not a daemon because it's easy to start/stop it through
run.sh (and Ctrl+C) works nicely during development. We can possibly
run it as a daemon once supervisor configs are more stable.
nginx is not a daemon anymore because it is run through supervisor.
supervisorctl seems to magically connect to supervisor even without
passing it -c <conf> file. Not sure how that works.