env file edit option

This commit is contained in:
2026-01-28 11:51:25 -05:00
parent d11840cf13
commit b2626f56ea

View File

@@ -98,13 +98,23 @@ echo "Setting up environment file..."
if [ ! -f ".env" ]; then if [ ! -f ".env" ]; then
cp .env.example .env cp .env.example .env
echo "" echo ""
echo "⚠️ IMPORTANT: Edit /opt/faction-war/app/.env with your configuration!" echo "IMPORTANT: You need to configure /opt/faction-war/app/.env with your secrets!"
echo " Generate secure secrets with:" echo ""
echo "Generate secure secrets with:"
echo " - AUTH_PASSWORD: openssl rand -base64 32" echo " - AUTH_PASSWORD: openssl rand -base64 32"
echo " - JWT_SECRET: openssl rand -hex 64" echo " - JWT_SECRET: openssl rand -hex 64"
echo "" echo ""
read -p "Press Enter to edit .env file now (or Ctrl+C to exit and edit later)..." echo "You can either:"
nano .env echo " 1. Edit the .env file now"
echo " 2. Skip and edit it later before starting the application"
echo ""
read -p "Edit .env now? (y/n): " EDIT_NOW
if [[ "$EDIT_NOW" =~ ^[Yy]$ ]]; then
nano .env || true # Don't exit if user cancels nano
else
echo "Skipped. Remember to edit /opt/faction-war/app/.env before starting the service!"
fi
fi fi
chown factionwar:factionwar .env chown factionwar:factionwar .env
@@ -195,9 +205,12 @@ echo " - Set password (if needed): sudo passwd factionwar"
echo " - Application directory: /opt/faction-war/app" echo " - Application directory: /opt/faction-war/app"
echo "" echo ""
echo "Important next steps:" echo "Important next steps:"
echo "1. Visit https://$DOMAIN and log in with your AUTH_PASSWORD" echo "1. Configure /opt/faction-war/app/.env with your secrets (if not done already)"
echo "2. Configure your API keys in the Settings page" echo " - Edit with: sudo -u factionwar nano /opt/faction-war/app/.env"
echo "3. Test the application functionality" echo " - Then restart: sudo systemctl restart faction-war"
echo "2. Visit https://$DOMAIN and log in with your AUTH_PASSWORD"
echo "3. Configure your API keys in the Settings page (or use .env)"
echo "4. Test the application functionality"
echo "" echo ""
echo "Useful commands:" echo "Useful commands:"
echo " - Check status: sudo systemctl status faction-war" echo " - Check status: sudo systemctl status faction-war"