mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-14 01:20:27 +00:00
06266846ec
This allows for easy setup with no extra configuration. Also update docs to reflect the new and easy way to run PowerDNS-Admin. Signed-off-by: Felix Kaechele <felix@kaechele.ca>
22 lines
665 B
Bash
Executable File
22 lines
665 B
Bash
Executable File
#!/bin/sh
|
|
set -euo pipefail
|
|
cd /app
|
|
|
|
GUNICORN_TIMEOUT="${GUINCORN_TIMEOUT:-120}"
|
|
GUNICORN_WORKERS="${GUNICORN_WORKERS:-4}"
|
|
GUNICORN_LOGLEVEL="${GUNICORN_LOGLEVEL:-info}"
|
|
BIND_ADDRESS="${BIND_ADDRESS:-0.0.0.0:80}"
|
|
|
|
cat ./powerdnsadmin/default_config.py ./configs/docker_config.py > ./powerdnsadmin/docker_config.py
|
|
|
|
GUNICORN_ARGS="-t ${GUNICORN_TIMEOUT} --workers ${GUNICORN_WORKERS} --bind ${BIND_ADDRESS} --log-level ${GUNICORN_LOGLEVEL}"
|
|
if [ "$1" == gunicorn ]; then
|
|
# run as user pda so that if a SQLite database is generated it is writeable
|
|
# by that user
|
|
su pda -s /bin/sh -c "flask db upgrade"
|
|
exec "$@" $GUNICORN_ARGS
|
|
|
|
else
|
|
exec "$@"
|
|
fi
|