blob: 906641f675f8758ff0b162ac25ddf2d2b2282624 [file] [log] [blame]
#!/bin/sh
set -e
if [ -n "$ADMIN_USER" ] && [ -n "$ADMIN_PASS" ]; then
htpasswd -c -b /etc/nginx/.htpasswd "$ADMIN_USER" "$ADMIN_PASS"
export SERVER_CONF='
auth_basic "DevLake Config UI";
auth_basic_user_file /etc/nginx/.htpasswd;
'
fi
envsubst '${DEVLAKE_ENDPOINT} ${GRAFANA_ENDPOINT} ${SERVER_CONF} ${DNS}' \
< /etc/nginx/conf.d/default.conf.tpl \
> /etc/nginx/conf.d/default.conf
nginx -g 'daemon off;'