mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Update setup-docker.sh
This commit is contained in:
parent
204e950867
commit
7d79deb36e
1 changed files with 27 additions and 15 deletions
|
@ -70,12 +70,31 @@ else
|
||||||
echo "✅ Added TP_HOST to .env"
|
echo "✅ Added TP_HOST to .env"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "SSL_ENABLED" .env; then
|
echo ""
|
||||||
|
echo "⚠️ SSL Notes:"
|
||||||
|
echo " - SSL requires a real domain (not localhost/IP)"
|
||||||
|
echo " - Caddy will automatically get Let's Encrypt certificates"
|
||||||
|
echo " - Port 80 and 443 must be accessible from the internet"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
read -p "🔐 Do you want to enable SSL (HTTPS)? [y/N]: " ENABLE_SSL
|
||||||
|
ENABLE_SSL=$(echo "$ENABLE_SSL" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
if [ "$ENABLE_SSL" = "y" ] || [ "$ENABLE_SSL" = "yes" ]; then
|
||||||
|
SSL_ENABLED="on"
|
||||||
|
else
|
||||||
|
SSL_ENABLED="off"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q "SSL_ENABLED" .env; then
|
||||||
|
sed -i "s|SSL_ENABLED=.*|SSL_ENABLED=$SSL_ENABLED|" .env
|
||||||
|
echo "✅ Updated SSL_ENABLED to $SSL_ENABLED"
|
||||||
|
else
|
||||||
echo "" >> .env
|
echo "" >> .env
|
||||||
echo "# Docker-specific configuration" >> .env
|
echo "# Docker-specific configuration" >> .env
|
||||||
echo "SSL_ENABLED=off" >> .env
|
echo "SSL_ENABLED=$SSL_ENABLED" >> .env
|
||||||
echo "SSL_PORT=443" >> .env
|
echo "SSL_PORT=443" >> .env
|
||||||
echo "✅ Added Docker SSL configuration"
|
echo "✅ Added Docker SSL configuration (SSL_ENABLED=$SSL_ENABLED)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -83,16 +102,9 @@ echo "🎉 Docker setup complete!"
|
||||||
echo ""
|
echo ""
|
||||||
echo "📋 Next steps:"
|
echo "📋 Next steps:"
|
||||||
echo " 1. Run: docker-compose up"
|
echo " 1. Run: docker-compose up"
|
||||||
echo " 2. Open: http://$TP_HOST"
|
if [ "$SSL_ENABLED" = "on" ]; then
|
||||||
echo ""
|
echo " 2. Open: https://$TP_HOST"
|
||||||
echo "🔒 To enable HTTPS/SSL:"
|
else
|
||||||
echo " 1. Edit .env file and change:"
|
echo " 2. Open: http://$TP_HOST"
|
||||||
echo " SSL_ENABLED=off → SSL_ENABLED=on"
|
fi
|
||||||
echo " 2. Make sure your domain points to this server"
|
|
||||||
echo " 3. Restart: docker-compose down && docker-compose up"
|
|
||||||
echo ""
|
|
||||||
echo "⚠️ SSL Notes:"
|
|
||||||
echo " - SSL requires a real domain (not localhost/IP)"
|
|
||||||
echo " - Caddy will automatically get Let's Encrypt certificates"
|
|
||||||
echo " - Port 80 and 443 must be accessible from the internet"
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue