Fix SSL config docker (#3616)
* Don't copy default nginx config at build time * Use http.d folder for nginx configs * Add default config back * Change the panel config name
This commit is contained in:
parent
4fa38b8e9c
commit
8b236c6907
|
@ -30,7 +30,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Checking if https is required."
|
echo "Checking if https is required."
|
||||||
if [ -f /etc/nginx/conf.d/default.conf ]; then
|
if [ -f /etc/nginx/http.d/panel.conf ]; then
|
||||||
echo "Using nginx config already in place."
|
echo "Using nginx config already in place."
|
||||||
if [ $LE_EMAIL ]; then
|
if [ $LE_EMAIL ]; then
|
||||||
echo "Checking for cert update"
|
echo "Checking for cert update"
|
||||||
|
@ -42,15 +42,17 @@ else
|
||||||
echo "Checking if letsencrypt email is set."
|
echo "Checking if letsencrypt email is set."
|
||||||
if [ -z $LE_EMAIL ]; then
|
if [ -z $LE_EMAIL ]; then
|
||||||
echo "No letsencrypt email is set using http config."
|
echo "No letsencrypt email is set using http config."
|
||||||
cp .github/docker/default.conf /etc/nginx/conf.d/default.conf
|
cp .github/docker/default.conf /etc/nginx/http.d/panel.conf
|
||||||
else
|
else
|
||||||
echo "writing ssl config"
|
echo "writing ssl config"
|
||||||
cp .github/docker/default_ssl.conf /etc/nginx/conf.d/default.conf
|
cp .github/docker/default_ssl.conf /etc/nginx/http.d/panel.conf
|
||||||
echo "updating ssl config for domain"
|
echo "updating ssl config for domain"
|
||||||
sed -i "s|<domain>|$(echo $APP_URL | sed 's~http[s]*://~~g')|g" /etc/nginx/conf.d/default.conf
|
sed -i "s|<domain>|$(echo $APP_URL | sed 's~http[s]*://~~g')|g" /etc/nginx/http.d/panel.conf
|
||||||
echo "generating certs"
|
echo "generating certs"
|
||||||
certbot certonly -d $(echo $APP_URL | sed 's~http[s]*://~~g') --standalone -m $LE_EMAIL --agree-tos -n
|
certbot certonly -d $(echo $APP_URL | sed 's~http[s]*://~~g') --standalone -m $LE_EMAIL --agree-tos -n
|
||||||
fi
|
fi
|
||||||
|
echo "Removing the default nginx config"
|
||||||
|
rm -rf /etc/nginx/http.d/default.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## check for DB up before starting the panel
|
## check for DB up before starting the panel
|
||||||
|
|
Loading…
Reference in New Issue