Add HTTPS support with Caddy and clean up legacy files
- Add Caddy reverse proxy for automatic HTTPS with Let's Encrypt - Update docker-compose.yml with Caddy service and internal networking - Remove all Redis dependencies (not needed for this deployment) - Fix Dockerfile permissions for instance and uploads directories - Move legacy scripts to old_code_documentation folder - add_muted_column.py, check_fix_player.py, migrate_add_edit_enabled.py - docker-start.sh, run_dev.sh, start.sh, clean_for_deployment.sh - Add HTTPS_SETUP.md documentation for Caddy configuration - Update .env.example with DOMAIN and EMAIL variables - Remove redis package from requirements.txt - Remove rate limiting Redis storage from config.py
This commit is contained in:
76
old_code_documentation/run_dev.sh
Executable file
76
old_code_documentation/run_dev.sh
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
# DigiServer v2 - Development Test Runner
|
||||
# This script sets up and runs the application in development mode
|
||||
|
||||
set -e
|
||||
|
||||
echo "================================================"
|
||||
echo " DigiServer v2 - Development Environment"
|
||||
echo "================================================"
|
||||
echo ""
|
||||
|
||||
# Check if we're in the right directory
|
||||
if [ ! -f "requirements.txt" ]; then
|
||||
echo "❌ Error: requirements.txt not found. Run this from the digiserver-v2 directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if virtual environment exists
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "📦 Creating virtual environment..."
|
||||
python3 -m venv venv
|
||||
echo "✅ Virtual environment created"
|
||||
else
|
||||
echo "✅ Virtual environment found"
|
||||
fi
|
||||
|
||||
# Activate virtual environment
|
||||
echo "🔄 Activating virtual environment..."
|
||||
source venv/bin/activate
|
||||
|
||||
# Install/update dependencies
|
||||
echo "📥 Installing dependencies..."
|
||||
pip install -q --upgrade pip
|
||||
pip install -q -r requirements.txt
|
||||
|
||||
echo "✅ Dependencies installed"
|
||||
echo ""
|
||||
|
||||
# Check if .env exists
|
||||
if [ ! -f ".env" ]; then
|
||||
echo "⚠️ Warning: .env file not found, using .env.example"
|
||||
cp .env.example .env
|
||||
fi
|
||||
|
||||
# Initialize database if it doesn't exist
|
||||
if [ ! -f "instance/dashboard.db" ]; then
|
||||
echo "🗄️ Initializing database..."
|
||||
export FLASK_APP=app.app:create_app
|
||||
flask init-db
|
||||
echo "✅ Database initialized"
|
||||
|
||||
echo "👤 Creating default admin user..."
|
||||
flask create-admin
|
||||
echo "✅ Admin user created (username: admin, password: admin123)"
|
||||
else
|
||||
echo "✅ Database found"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "================================================"
|
||||
echo " Starting Flask Development Server"
|
||||
echo "================================================"
|
||||
echo ""
|
||||
echo "🌐 Server will be available at: http://localhost:5000"
|
||||
echo "👤 Default admin: username=admin, password=admin123"
|
||||
echo ""
|
||||
echo "Press Ctrl+C to stop the server"
|
||||
echo ""
|
||||
|
||||
# Set Flask environment
|
||||
export FLASK_APP=app.app:create_app
|
||||
export FLASK_ENV=development
|
||||
|
||||
# Run Flask
|
||||
flask run --host=0.0.0.0 --port=5000
|
||||
Reference in New Issue
Block a user