- Add HTTPSConfig model for managing HTTPS settings - Add admin routes for HTTPS configuration management - Add beautiful admin template for HTTPS configuration - Add database migration for https_config table - Add CLI utility for HTTPS management - Add setup script for automated configuration - Add Caddy configuration generator and manager - Add comprehensive documentation (3 guides) - Add HTTPS Configuration card to admin dashboard - Implement input validation and security features - Add admin-only access control with audit trail - Add real-time configuration preview - Integrate with existing Caddy reverse proxy Features: - Enable/disable HTTPS from web interface - Configure domain, hostname, IP address, port - Automatic SSL certificate management via Let's Encrypt - Real-time Caddyfile generation and reload - Full audit trail with admin username and timestamps - Support for HTTPS and HTTP fallback access points - Beautiful, mobile-responsive UI Modified files: - app/models/__init__.py (added HTTPSConfig import) - app/blueprints/admin.py (added HTTPS routes) - app/templates/admin/admin.html (added HTTPS card) - docker-compose.yml (added Caddyfile mount and admin port) New files: - app/models/https_config.py - app/blueprints/https_config.html - app/utils/caddy_manager.py - https_manager.py - setup_https.sh - migrations/add_https_config_table.py - migrations/add_email_to_https_config.py - HTTPS_STATUS.txt - Documentation files (3 markdown guides)
48 lines
1.4 KiB
Python
Executable File
48 lines
1.4 KiB
Python
Executable File
"""Migration: Add edit_on_player_enabled column to playlist_content table."""
|
|
import sqlite3
|
|
import os
|
|
|
|
DB_PATH = 'instance/dashboard.db'
|
|
|
|
def migrate():
|
|
"""Add edit_on_player_enabled column to playlist_content."""
|
|
if not os.path.exists(DB_PATH):
|
|
print(f"Database not found at {DB_PATH}")
|
|
return False
|
|
|
|
conn = sqlite3.connect(DB_PATH)
|
|
cursor = conn.cursor()
|
|
|
|
try:
|
|
# Check if column already exists
|
|
cursor.execute("PRAGMA table_info(playlist_content)")
|
|
columns = [col[1] for col in cursor.fetchall()]
|
|
|
|
if 'edit_on_player_enabled' in columns:
|
|
print("Column 'edit_on_player_enabled' already exists!")
|
|
return True
|
|
|
|
# Add the new column with default value False
|
|
print("Adding 'edit_on_player_enabled' column to playlist_content table...")
|
|
cursor.execute("""
|
|
ALTER TABLE playlist_content
|
|
ADD COLUMN edit_on_player_enabled BOOLEAN DEFAULT 0
|
|
""")
|
|
|
|
conn.commit()
|
|
print("✅ Migration completed successfully!")
|
|
print("Column 'edit_on_player_enabled' added with default value False (0)")
|
|
|
|
return True
|
|
|
|
except Exception as e:
|
|
conn.rollback()
|
|
print(f"❌ Migration failed: {e}")
|
|
return False
|
|
|
|
finally:
|
|
conn.close()
|
|
|
|
if __name__ == '__main__':
|
|
migrate()
|