This commit is contained in:
Minecon724 2025-04-12 13:46:03 +02:00
commit 17d911b043
Signed by: Minecon724
GPG key ID: A02E6E67AB961189
3 changed files with 19 additions and 17 deletions

View file

@ -13,15 +13,16 @@ if [ $? -ne 0 ]; then
echo -e "\033[0;31mCouldn't install pyroute2. You must install it manually.\033[0m"
fi
echo "Issuing certificate..."
./scripts/update_config.sh
CERT_DIR=/etc/ssl/$DOMAIN
echo "Issuing certificate..."
docker compose up -d acme
docker compose exec acme mkdir $CERT_DIR
docker compose exec acme ln -s /etc/nginx/snakeoil.key $CERT_DIR/key.pem
docker compose exec acme ln -s /etc/nginx/snakeoil.pem $CERT_DIR/fullchain.pem
docker compose exec nginx mkdir /var/www/html/$DOMAIN
docker compose exec acme mkdir /etc/ssl/$DOMAIN
docker compose exec acme ln -s /etc/nginx/snakeoil.key /etc/ssl/$DOMAIN/key.pem
docker compose exec acme ln -s /etc/nginx/snakeoil.pem /etc/ssl/$DOMAIN/fullchain.pem
docker compose up -d nginx

View file

@ -2,18 +2,7 @@
cd "$(dirname "$0")"
. .env
echo "Updating config"
if [ "$GLUETUN" = true ]; then
export UPSTREAM=gluetun
else
export UPSTREAM=companion
fi
echo -e "# Don't edit this file. Edit the .tmpl file\n\n" > nginx/conf.d/companion.conf
DOMAIN=$DOMAIN envsubst '$DOMAIN,$UPSTREAM' < nginx/conf.d/companion.conf.tmpl >> nginx/conf.d/companion.conf
./scripts/update_config.sh
if [ -n "$IPV6_SUBNET" ]; then
echo "Rotating IP..."

12
scripts/update_config.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/bash
cd "$(dirname "$0")"
. ../.env
if [ "$GLUETUN" = true ]; then
export UPSTREAM=gluetun
else
export UPSTREAM=companion
fi
echo -e "# Don't edit this file. Edit the .tmpl file\n\n" > nginx/conf.d/companion.conf
DOMAIN=$DOMAIN envsubst '$DOMAIN,$UPSTREAM' < nginx/conf.d/companion.conf.tmpl >> nginx/conf.d/companion.conf