monkeytype/docker/backend/applyConfig.sh
Christian Fehmer 9432602727
impr: add selfhosting using docker only (fehmer) (#5170)
* impr: add selfhosting using docker only

* add recaptcha config and docs

* add documentation on the backend-configuration.json file, remove ---redacted--- from example config

---------

Co-authored-by: Jack <jack@monkeytype.com>
2024-03-12 12:02:13 +01:00

22 lines
509 B
Bash
Executable file

#!/bin/sh
if [ -f backend-configuration.json ]; then
echo "waiting for backend..."
timeout 30 sh -c 'until nc -z $0 $1; do sleep 1; done' localhost 5005
if [ $? -ne 0 ]; then
echo "failed to apply config"
exit 1
fi
echo "apply server config"
wget -qO- --method=PATCH \
--body-data="`cat backend-configuration.json`" \
--header='Content-Type:application/json' \
http://localhost:5005/configuration
echo "server config applied"
else
echo "skip backend configuration"
fi