24 lines
631 B
Bash
Executable File
24 lines
631 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Make placeholder config directory
|
|
mkdir -p /config/frontend
|
|
|
|
# Set basic auth credentials
|
|
htpasswd -cb /etc/nginx/.htpasswd $USERNAME $PASSWORD
|
|
|
|
# Replace common.conf with default
|
|
cp -f /etc/nginx/common_default.conf /etc/nginx/common.conf
|
|
|
|
${USE_SSL:=false}
|
|
if $USE_SSL ; then
|
|
echo "include ssl.conf;" >> /etc/nginx/common.conf
|
|
|
|
# Create self-signed certificate if using ssl and keys do not exist.
|
|
# You can always replace these with your own keys later.
|
|
if [[ ! -f /config/frontend/ssl.key || ! -f /config/frontend/ssl.crt ]]; then
|
|
ssl-gen seedbox
|
|
fi
|
|
fi
|
|
|
|
nginx -g "daemon off;"
|