maintainers can restart signalboost w/ signal message + password
behavior
GIVEN a running instance of signalboost with a support channel and a password <PASSWORD>
(defined in encrypted/version-controlled config files)
- WHEN an admin of the support channel sends
RESTART <PASSWORD>
- THEN signalboost will spin all containers down and back up again
implementation
sadly this is not as simple as just calling bin/restart
(because that itself invokes docker-compose down && docker-compose up
which cannot be invoked from inside the docker container where signalboost would try to invoke the script. and we can't use the docker api from inside a container to shut down and restart that container...
instead we could try something like:
- create an
orchestrator
container. this can just run node (or python) on bare metal alpine - the orchestrator runs a simple http server that only accepts requests from the
app
container on the same network - it has a
POST /restart
endpoint that, when hit, uses the docker API (see: https://github.com/apocas/dockerode) to invoke the equivalent ofdocker-compose down && docker-compose --env-file .env up -d
- when
dispatcher.commands.execute
receivesRESTART
, it:- calls
channelRepository.isSysadmin(sender.phoneNumber)
(to see if the sender is an admin of the support channel and thus a sysadmin) - checks to see if the password matches the configured password
- proceeds to issue
POST /restart
toorchestrator
(and in so doing, dies and is reborn)
- calls
or something simpler if we can come up with it?
Edited by aguestuser