diff --git a/setup_production.sh b/setup_production.sh index e3814cb..0caaa7c 100644 --- a/setup_production.sh +++ b/setup_production.sh @@ -98,13 +98,23 @@ echo "Setting up environment file..." if [ ! -f ".env" ]; then cp .env.example .env echo "" - echo "⚠️ IMPORTANT: Edit /opt/faction-war/app/.env with your configuration!" - echo " Generate secure secrets with:" - echo " - AUTH_PASSWORD: openssl rand -base64 32" - echo " - JWT_SECRET: openssl rand -hex 64" + echo "IMPORTANT: You need to configure /opt/faction-war/app/.env with your secrets!" echo "" - read -p "Press Enter to edit .env file now (or Ctrl+C to exit and edit later)..." - nano .env + echo "Generate secure secrets with:" + echo " - AUTH_PASSWORD: openssl rand -base64 32" + echo " - JWT_SECRET: openssl rand -hex 64" + echo "" + echo "You can either:" + 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 chown factionwar:factionwar .env @@ -195,9 +205,12 @@ echo " - Set password (if needed): sudo passwd factionwar" echo " - Application directory: /opt/faction-war/app" echo "" echo "Important next steps:" -echo "1. Visit https://$DOMAIN and log in with your AUTH_PASSWORD" -echo "2. Configure your API keys in the Settings page" -echo "3. Test the application functionality" +echo "1. Configure /opt/faction-war/app/.env with your secrets (if not done already)" +echo " - Edit with: sudo -u factionwar nano /opt/faction-war/app/.env" +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 "Useful commands:" echo " - Check status: sudo systemctl status faction-war"