feat(nginx): add nginx + functionality to toggle between letsencrypt, custom-ssl and http-only modes in .env file

This commit is contained in:
2026-04-14 21:10:43 +08:00
parent b5e7422754
commit 2d00e454c9
5 changed files with 365 additions and 138 deletions

10
run.sh
View File

@@ -1,5 +1,4 @@
#!/usr/bin/env bash
set -e
GREEN='\033[0;32m'
@@ -42,7 +41,7 @@ echo "[STEP] Checking swap configuration..."
./scripts/setup-swap.sh || true
echo ""
echo "[STEP] Preparing SSL certificates (if HTTPS enabled)..."
echo "[STEP] Preparing SSL / Nginx configuration..."
./scripts/setup-ssl.sh || true
echo ""
@@ -62,6 +61,13 @@ do
sleep 5
done
# If letsencrypt mode, provision certs now that Nginx is running
if [[ "$SSL_MODE" == "letsencrypt" ]]; then
echo ""
echo "[STEP] Provisioning Let's Encrypt certificate..."
./scripts/setup-letsencrypt.sh
fi
echo "[STEP] Creating admin user..."
docker exec -u git gitea-server gitea admin user create \
--username "$GITEA_ROOT_USER" \