ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
Improve port variable handling and add app cleanup CLI
Juan Denisf05d05667834
diff --git a/.gitignore b/.gitignoreindex 3ed53d25..26976e3c 100644--- a/.gitignore+++ b/.gitignore@@ -4,3 +4,4 @@ nul/.claude_.env/frontend/dist+*.tmpdiff --git a/backend/app/services/template_service.py b/backend/app/services/template_service.pyindex 58a1fc1d..c43baa26 100644--- a/backend/app/services/template_service.py+++ b/backend/app/services/template_service.py@@ -130,8 +130,13 @@ class TemplateService:return {'success': False, 'error': str(e)}@classmethod- def generate_value(cls, var_config: Dict) -> str:- """Generate a value for a variable based on its configuration."""+ def generate_value(cls, var_config: Dict, force_generate: bool = False) -> str:+ """Generate a value for a variable based on its configuration.++ Args:+ var_config: Variable configuration dict+ force_generate: If True, always generate new value even for ports+ """var_type = var_config.get('type', 'string')default = var_config.get('default', '')@@ -143,7 +148,9 @@ class TemplateService:return ''.join(secrets.choice(chars) for _ in range(length))elif var_type == 'port':- return str(cls._find_available_port(int(default) if default else 8000))+ # ALWAYS find an available port - never trust defaults+ start_port = int(default) if default else 8000+ return str(cls._find_available_port(start_port))elif var_type == 'uuid':import uuid@@ -217,45 +224,64 @@ class TemplateService:}@classmethod- def _find_available_port(cls, start_port: int = 8000, max_attempts: int = 100) -> int:- """Find an available port that's not in use by the system or Docker.+ def _find_available_port(cls, start_port: int = 8000, max_attempts: int = 1000) -> int:+ """Find an available port that's not in use by the system, Docker, or database.- Checks both socket binding and Docker container port mappings.+ Checks:+ 1. Ports assigned to existing applications in the database+ 2. Docker container port mappings+ 3. Socket binding test"""import socket+ # Get ports from database (assigned to apps)+ db_ports = cls._get_database_used_ports()+# Get ports currently used by Docker containersdocker_ports = cls._get_docker_used_ports()+ # Combine all used ports+ used_ports = db_ports | docker_ports+for port in range(start_port, start_port + max_attempts):- # Skip if Docker is using this port- if port in docker_ports:+ # Skip reserved/common ports+ if port < 1024:+ continue++ # Skip if already assigned in DB or Docker+ if port in used_ports:continue# Check if port is available on localhost (where Docker binds)try:- # Check 127.0.0.1 specifically since Docker binds there- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)- sock.settimeout(1)- result = sock.connect_ex(('127.0.0.1', port))- sock.close()-- # If connection failed, port is available- if result != 0:- # Double-check by trying to bind- try:- test_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)- test_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)- test_sock.bind(('127.0.0.1', port))- test_sock.close()- return port- except OSError:- continue+ # Try to bind - most reliable check+ test_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ test_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)+ test_sock.bind(('127.0.0.1', port))+ test_sock.close()+ return port+ except OSError:+ continueexcept Exception:continue- # Fallback: return a high port number- return start_port + max_attempts+ # Fallback: return a random high port+ import random+ return random.randint(10000, 60000)++ @classmethod+ def _get_database_used_ports(cls) -> set:+ """Get all ports assigned to applications in the database."""+ used_ports = set()+ try:+ from app.models import Application+ apps = Application.query.filter(Application.port.isnot(None)).all()+ for app in apps:+ if app.port:+ used_ports.add(app.port)+ except Exception:+ pass+ return used_ports@classmethoddef _get_docker_used_ports(cls) -> set:@@ -314,9 +340,9 @@ class TemplateService:# Substitute variablescompose = cls.substitute_in_dict(compose, variables)- # Add version if not present- if 'version' not in compose:- compose = {'version': '3.8', **compose}+ # Remove obsolete version field (not needed in modern Docker Compose)+ if 'version' in compose:+ del compose['version']return yaml.dump(compose, default_flow_style=False, sort_keys=False)@@ -461,7 +487,12 @@ class TemplateService:template_vars = {v['name']: v for v in template_vars if 'name' in v}for var_name, var_config in template_vars.items():- if user_variables and var_name in user_variables:+ var_type = var_config.get('type', 'string')++ # ALWAYS auto-generate ports - never use user values for ports+ if var_type == 'port':+ variables[var_name] = cls.generate_value(var_config)+ elif user_variables and var_name in user_variables and user_variables[var_name]:variables[var_name] = user_variables[var_name]elif var_config.get('required', False) and var_name not in (user_variables or {}):return {'success': False, 'error': f"Required variable not provided: {var_name}"}diff --git a/backend/cli.py b/backend/cli.pyindex df6c0319..42b5da0c 100644--- a/backend/cli.py+++ b/backend/cli.py@@ -267,5 +267,173 @@ def drop_db():click.echo(click.style('All tables dropped!', fg='yellow'))[email protected]('--delete-volumes', is_flag=True, help='Also delete Docker volumes')[email protected]('--keep-db', is_flag=True, help='Keep database records')[email protected]_option(prompt='Are you sure you want to delete ALL applications and their data?')+def cleanup_apps(delete_volumes, keep_db):+ """Delete all applications, containers, and app folders.++ This removes:+ - All Docker containers and networks for apps+ - All app folders in /var/serverkit/apps/+ - Optionally Docker volumes (--delete-volumes)+ - Database records (unless --keep-db)+ """+ import shutil+ import subprocess+ from app.models import Application++ app = create_app()+ with app.app_context():+ apps = Application.query.all()++ if not apps:+ click.echo('No applications found.')+ return++ click.echo(f'Found {len(apps)} application(s) to clean up...\n')++ for application in apps:+ click.echo(f'Cleaning up: {application.name}')++ # Stop and remove Docker containers+ if application.root_path and os.path.exists(application.root_path):+ try:+ cmd = ['docker', 'compose', 'down']+ if delete_volumes:+ cmd.append('-v')+ cmd.extend(['--remove-orphans'])++ subprocess.run(+ cmd,+ cwd=application.root_path,+ capture_output=True,+ timeout=60+ )+ click.echo(click.style(f' ✓ Stopped containers', fg='green'))+ except Exception as e:+ click.echo(click.style(f' ✗ Failed to stop containers: {e}', fg='red'))++ # Delete app folder+ try:+ shutil.rmtree(application.root_path)+ click.echo(click.style(f' ✓ Deleted folder: {application.root_path}', fg='green'))+ except Exception as e:+ click.echo(click.style(f' ✗ Failed to delete folder: {e}', fg='red'))++ # Delete database record+ if not keep_db:+ try:+ db.session.delete(application)+ click.echo(click.style(f' ✓ Removed from database', fg='green'))+ except Exception as e:+ click.echo(click.style(f' ✗ Failed to remove from database: {e}', fg='red'))++ if not keep_db:+ db.session.commit()++ click.echo(click.style('\nCleanup completed!', fg='green'))++[email protected]_option(prompt='This will delete ALL data and reset ServerKit. Continue?')+def factory_reset():+ """Complete factory reset - delete everything and start fresh.++ This removes:+ - All applications and Docker containers+ - All app folders+ - All Docker volumes+ - All database tables+ - Template installation cache+ """+ import shutil+ import subprocess+ from app.models import Application++ app = create_app()+ with app.app_context():+ click.echo('Starting factory reset...\n')++ # 1. Clean up all applications+ apps = Application.query.all()+ for application in apps:+ if application.root_path and os.path.exists(application.root_path):+ try:+ subprocess.run(+ ['docker', 'compose', 'down', '-v', '--remove-orphans'],+ cwd=application.root_path,+ capture_output=True,+ timeout=60+ )+ except Exception:+ pass++ # 2. Delete entire apps directory+ apps_dir = '/var/serverkit/apps'+ if os.path.exists(apps_dir):+ try:+ shutil.rmtree(apps_dir)+ os.makedirs(apps_dir, exist_ok=True)+ click.echo(click.style('✓ Deleted all app folders', fg='green'))+ except Exception as e:+ click.echo(click.style(f'✗ Failed to delete apps folder: {e}', fg='red'))++ # 3. Clear template installation cache+ template_config = '/etc/serverkit/templates.json'+ if os.path.exists(template_config):+ try:+ import json+ with open(template_config, 'r') as f:+ config = json.load(f)+ config['installed'] = {}+ with open(template_config, 'w') as f:+ json.dump(config, f, indent=2)+ click.echo(click.style('✓ Cleared template cache', fg='green'))+ except Exception as e:+ click.echo(click.style(f'✗ Failed to clear template cache: {e}', fg='red'))++ # 4. Drop and recreate database+ try:+ db.drop_all()+ db.create_all()+ click.echo(click.style('✓ Reset database', fg='green'))+ except Exception as e:+ click.echo(click.style(f'✗ Failed to reset database: {e}', fg='red'))++ click.echo(click.style('\nFactory reset completed!', fg='green'))+ click.echo('Run "serverkit create-admin" to create a new admin user.')+++def list_apps():+ """List all applications."""+ from app.models import Application++ app = create_app()+ with app.app_context():+ apps = Application.query.all()++ if not apps:+ click.echo('No applications found.')+ return++ click.echo(f"\n{'ID':<5} {'Name':<25} {'Type':<12} {'Status':<10} {'Port':<8} {'Path'}")+ click.echo('-' * 100)++ for application in apps:+ click.echo(+ f"{application.id:<5} "+ f"{application.name:<25} "+ f"{application.app_type:<12} "+ f"{application.status:<10} "+ f"{str(application.port or '-'):<8} "+ f"{application.root_path or '-'}"+ )++ click.echo(f"\nTotal: {len(apps)} application(s)")++if __name__ == '__main__':cli()diff --git a/backend/templates/authelia.yaml b/backend/templates/authelia.yamlindex 1f996e87..95f73282 100644--- a/backend/templates/authelia.yaml+++ b/backend/templates/authelia.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "9091"+ hidden: true- name: JWT_SECRETdescription: JWT secrettype: passworddiff --git a/backend/templates/bookstack.yaml b/backend/templates/bookstack.yamlindex 1d37c02f..065c09fe 100644--- a/backend/templates/bookstack.yaml+++ b/backend/templates/bookstack.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: APP_URLdescription: Application URLdefault: http://localhost:8080diff --git a/backend/templates/caddy.yaml b/backend/templates/caddy.yamlindex 34f89693..addafaa8 100644--- a/backend/templates/caddy.yaml+++ b/backend/templates/caddy.yaml@@ -15,10 +15,12 @@ variables:description: HTTP porttype: portdefault: "80"+ hidden: true- name: HTTPS_PORTdescription: HTTPS porttype: portdefault: "443"+ hidden: trueports:- port: 80diff --git a/backend/templates/code-server.yaml b/backend/templates/code-server.yamlindex f0b9444f..6fdffc26 100644--- a/backend/templates/code-server.yaml+++ b/backend/templates/code-server.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: PASSWORDdescription: Access passwordtype: passworddiff --git a/backend/templates/crowdsec.yaml b/backend/templates/crowdsec.yamlindex 29fa1e6d..e265dad7 100644--- a/backend/templates/crowdsec.yaml+++ b/backend/templates/crowdsec.yaml@@ -15,6 +15,7 @@ variables:description: HTTP port for APItype: portdefault: "8080"+ hidden: true- name: COLLECTIONSdescription: Collections to install (comma-separated)default: crowdsecurity/linux,crowdsecurity/sshddiff --git a/backend/templates/directus.yaml b/backend/templates/directus.yamlindex d20db0f1..ec1a9f23 100644--- a/backend/templates/directus.yaml+++ b/backend/templates/directus.yaml@@ -16,6 +16,7 @@ variables:description: HTTP porttype: portdefault: "8055"+ hidden: true- name: ADMIN_EMAILdescription: Admin emaildefault: [email protected]diff --git a/backend/templates/drone.yaml b/backend/templates/drone.yamlindex 3fbfd910..015738b1 100644--- a/backend/templates/drone.yaml+++ b/backend/templates/drone.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: GITEA_SERVERdescription: Gitea server URL (e.g., https://gitea.example.com)required: truediff --git a/backend/templates/duplicati.yaml b/backend/templates/duplicati.yamlindex e10a2a81..9368e6ae 100644--- a/backend/templates/duplicati.yaml+++ b/backend/templates/duplicati.yaml@@ -15,6 +15,7 @@ variables:description: Web UI porttype: portdefault: "8200"+ hidden: true- name: BACKUP_SOURCEdescription: Path to backup source on hostdefault: /sourcediff --git a/backend/templates/excalidraw.yaml b/backend/templates/excalidraw.yamlindex c8974ab5..0c5dd9f3 100644--- a/backend/templates/excalidraw.yaml+++ b/backend/templates/excalidraw.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "3000"+ hidden: trueports:- port: 3000diff --git a/backend/templates/filebrowser.yaml b/backend/templates/filebrowser.yamlindex 762bbd12..fe0d7a62 100644--- a/backend/templates/filebrowser.yaml+++ b/backend/templates/filebrowser.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: ROOT_PATHdescription: Root path to browse on hostdefault: /srvdiff --git a/backend/templates/ghost.yaml b/backend/templates/ghost.yamlindex 5be906cf..b3d7a619 100644--- a/backend/templates/ghost.yaml+++ b/backend/templates/ghost.yaml@@ -14,16 +14,19 @@ variables:- name: HTTP_PORTtype: portdefault: "2368"+ hidden: truedescription: Port to expose Ghost+ hidden: true- name: SITE_URLtype: stringdefault: http://localhost:2368- description: Full URL where Ghost will be accessible+ description: Full URL where Ghost will be accessible (e.g., https://blog.example.com)required: true- name: DB_PASSWORDtype: passwordlength: 24description: MySQL database password+ hidden: truecompose:services:diff --git a/backend/templates/gitea.yaml b/backend/templates/gitea.yamlindex a17b8fa3..d976fd46 100644--- a/backend/templates/gitea.yaml+++ b/backend/templates/gitea.yaml@@ -14,10 +14,12 @@ variables:- name: HTTP_PORTtype: portdefault: "3000"+ hidden: truedescription: Port for web interface- name: SSH_PORTtype: portdefault: "2222"+ hidden: truedescription: Port for SSH access- name: DB_PASSWORDtype: passworddiff --git a/backend/templates/grafana.yaml b/backend/templates/grafana.yamlindex a28f21af..a436b5cb 100644--- a/backend/templates/grafana.yaml+++ b/backend/templates/grafana.yaml@@ -24,6 +24,7 @@ variables:description: HTTP porttype: portdefault: "3000"+ hidden: trueports:- port: 3000diff --git a/backend/templates/grav.yaml b/backend/templates/grav.yamlindex 19933b5b..b6b9cd4b 100644--- a/backend/templates/grav.yaml+++ b/backend/templates/grav.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: trueports:- port: 8080diff --git a/backend/templates/homeassistant.yaml b/backend/templates/homeassistant.yamlindex d72c947e..1caf0f21 100644--- a/backend/templates/homeassistant.yaml+++ b/backend/templates/homeassistant.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8123"+ hidden: true- name: TZdescription: Timezonedefault: UTCdiff --git a/backend/templates/immich.yaml b/backend/templates/immich.yamlindex 81423f20..b6b257f0 100644--- a/backend/templates/immich.yaml+++ b/backend/templates/immich.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "2283"+ hidden: true- name: UPLOAD_LOCATIONdescription: Path for uploaded photos on hostdefault: /photosdiff --git a/backend/templates/jaeger.yaml b/backend/templates/jaeger.yamlindex dfe6bc6e..44f074ba 100644--- a/backend/templates/jaeger.yaml+++ b/backend/templates/jaeger.yaml@@ -15,10 +15,12 @@ variables:description: Web UI porttype: portdefault: "16686"+ hidden: true- name: COLLECTOR_PORTdescription: Collector port for spanstype: portdefault: "14268"+ hidden: trueports:- port: 16686diff --git a/backend/templates/jellyfin.yaml b/backend/templates/jellyfin.yamlindex f08d59f8..595d61cb 100644--- a/backend/templates/jellyfin.yaml+++ b/backend/templates/jellyfin.yaml@@ -15,10 +15,12 @@ variables:description: HTTP porttype: portdefault: "8096"+ hidden: true- name: HTTPS_PORTdescription: HTTPS porttype: portdefault: "8920"+ hidden: true- name: MEDIA_PATHdescription: Path to media files on hostdefault: /mediadiff --git a/backend/templates/jenkins.yaml b/backend/templates/jenkins.yamlindex 9e87119b..8338df4d 100644--- a/backend/templates/jenkins.yaml+++ b/backend/templates/jenkins.yaml@@ -15,10 +15,12 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: AGENT_PORTdescription: Agent connection porttype: portdefault: "50000"+ hidden: true- name: JAVA_OPTSdescription: Java optionsdefault: "-Xmx2048m"diff --git a/backend/templates/jitsi.yaml b/backend/templates/jitsi.yamlindex 27134474..c941304d 100644--- a/backend/templates/jitsi.yaml+++ b/backend/templates/jitsi.yaml@@ -15,10 +15,12 @@ variables:description: HTTP porttype: portdefault: "8000"+ hidden: true- name: HTTPS_PORTdescription: HTTPS porttype: portdefault: "8443"+ hidden: true- name: PUBLIC_URLdescription: Public URL (e.g., https://meet.example.com)required: truediff --git a/backend/templates/keycloak.yaml b/backend/templates/keycloak.yamlindex 58bd1aea..b8072ea0 100644--- a/backend/templates/keycloak.yaml+++ b/backend/templates/keycloak.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: ADMIN_USERdescription: Admin usernamedefault: admindiff --git a/backend/templates/loki.yaml b/backend/templates/loki.yamlindex fc19ed6c..1f8a8e1a 100644--- a/backend/templates/loki.yaml+++ b/backend/templates/loki.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "3100"+ hidden: trueports:- port: 3100diff --git a/backend/templates/matrix-synapse.yaml b/backend/templates/matrix-synapse.yamlindex 01724432..b1e31d75 100644--- a/backend/templates/matrix-synapse.yaml+++ b/backend/templates/matrix-synapse.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8008"+ hidden: true- name: SERVER_NAMEdescription: Server name (your domain, e.g., matrix.example.com)required: truediff --git a/backend/templates/mattermost.yaml b/backend/templates/mattermost.yamlindex 8f3d2e6c..f2536e29 100644--- a/backend/templates/mattermost.yaml+++ b/backend/templates/mattermost.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8065"+ hidden: true- name: SITE_URLdescription: Site URL (e.g., https://mattermost.example.com)default: http://localhost:8065diff --git a/backend/templates/minio.yaml b/backend/templates/minio.yamlindex 2847a7c8..f2fa2bcb 100644--- a/backend/templates/minio.yaml+++ b/backend/templates/minio.yaml@@ -15,10 +15,12 @@ variables:description: API porttype: portdefault: "9000"+ hidden: true- name: CONSOLE_PORTdescription: Console porttype: portdefault: "9001"+ hidden: true- name: ROOT_USERdescription: Root usernamedefault: admindiff --git a/backend/templates/mongo-express.yaml b/backend/templates/mongo-express.yamlindex f8631da4..e5e004bf 100644--- a/backend/templates/mongo-express.yaml+++ b/backend/templates/mongo-express.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8081"+ hidden: true- name: MONGO_HOSTdescription: MongoDB server hostdefault: mongo@@ -23,6 +24,7 @@ variables:description: MongoDB server porttype: portdefault: "27017"+ hidden: true- name: ADMIN_USERNAMEdescription: Basic auth usernamedefault: admindiff --git a/backend/templates/mosquitto.yaml b/backend/templates/mosquitto.yamlindex 629df7fd..05e4e2fb 100644--- a/backend/templates/mosquitto.yaml+++ b/backend/templates/mosquitto.yaml@@ -15,10 +15,12 @@ variables:description: MQTT porttype: portdefault: "1883"+ hidden: true- name: WEBSOCKET_PORTdescription: WebSocket porttype: portdefault: "9001"+ hidden: trueports:- port: 1883diff --git a/backend/templates/n8n.yaml b/backend/templates/n8n.yamlindex 98254213..c163473a 100644--- a/backend/templates/n8n.yaml+++ b/backend/templates/n8n.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "5678"+ hidden: true- name: WEBHOOK_URLdescription: Webhook URL (e.g., https://n8n.example.com)required: truediff --git a/backend/templates/navidrome.yaml b/backend/templates/navidrome.yamlindex d59cd509..4719a48c 100644--- a/backend/templates/navidrome.yaml+++ b/backend/templates/navidrome.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "4533"+ hidden: true- name: MUSIC_PATHdescription: Path to music files on hostdefault: /musicdiff --git a/backend/templates/netdata.yaml b/backend/templates/netdata.yamlindex 7b8a11de..767f18ea 100644--- a/backend/templates/netdata.yaml+++ b/backend/templates/netdata.yaml@@ -15,6 +15,7 @@ variables:description: HTTP port for web interfacetype: portdefault: "19999"+ hidden: trueports:- port: 19999diff --git a/backend/templates/nextcloud.yaml b/backend/templates/nextcloud.yamlindex c6af15a4..fbf9a717 100644--- a/backend/templates/nextcloud.yaml+++ b/backend/templates/nextcloud.yaml@@ -14,7 +14,9 @@ variables:- name: HTTP_PORTtype: portdefault: "8080"+ hidden: truedescription: Port to expose Nextcloud+ hidden: true- name: ADMIN_USERtype: stringdefault: admin@@ -22,16 +24,17 @@ variables:- name: ADMIN_PASSWORDtype: passwordlength: 16- description: Admin password- required: true+ description: Admin password (auto-generated if empty)- name: DB_PASSWORDtype: passwordlength: 24description: Database password+ hidden: true- name: REDIS_PASSWORDtype: passwordlength: 16description: Redis password+ hidden: truecompose:services:diff --git a/backend/templates/nginx-proxy-manager.yaml b/backend/templates/nginx-proxy-manager.yamlindex 0ce072a9..a07e8185 100644--- a/backend/templates/nginx-proxy-manager.yaml+++ b/backend/templates/nginx-proxy-manager.yaml@@ -14,14 +14,17 @@ variables:- name: HTTP_PORTtype: portdefault: "80"+ hidden: truedescription: HTTP port for proxied sites- name: HTTPS_PORTtype: portdefault: "443"+ hidden: truedescription: HTTPS port for proxied sites- name: ADMIN_PORTtype: portdefault: "81"+ hidden: truedescription: Admin panel port- name: DB_PASSWORDtype: passworddiff --git a/backend/templates/node-app.yaml b/backend/templates/node-app.yamlindex 597b62d5..6b2cbdea 100644--- a/backend/templates/node-app.yaml+++ b/backend/templates/node-app.yaml@@ -15,6 +15,7 @@ variables:description: HTTP port for the application (auto-assigned if not specified)type: portdefault: "8300"+ hidden: true- name: NODE_VERSIONdescription: Node.js version (18, 20, 21)type: stringdiff --git a/backend/templates/nodered.yaml b/backend/templates/nodered.yamlindex 1bbac7d8..3d962f67 100644--- a/backend/templates/nodered.yaml+++ b/backend/templates/nodered.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "1880"+ hidden: true- name: TZdescription: Timezonedefault: UTCdiff --git a/backend/templates/outline.yaml b/backend/templates/outline.yamlindex 0f1bded0..6d3bdae1 100644--- a/backend/templates/outline.yaml+++ b/backend/templates/outline.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "3000"+ hidden: true- name: SECRET_KEYdescription: Secret keytype: passworddiff --git a/backend/templates/payload.yaml b/backend/templates/payload.yamlindex b5a50139..02b1d0ec 100644--- a/backend/templates/payload.yaml+++ b/backend/templates/payload.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "3000"+ hidden: true- name: PAYLOAD_SECRETdescription: Payload secret keytype: passworddiff --git a/backend/templates/pgadmin.yaml b/backend/templates/pgadmin.yamlindex cdb481a3..2bc065e4 100644--- a/backend/templates/pgadmin.yaml+++ b/backend/templates/pgadmin.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "5050"+ hidden: true- name: ADMIN_EMAILdescription: Admin email for logindefault: [email protected]diff --git a/backend/templates/photoprism.yaml b/backend/templates/photoprism.yamlindex 32840d15..a3a63762 100644--- a/backend/templates/photoprism.yaml+++ b/backend/templates/photoprism.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "2342"+ hidden: true- name: ADMIN_PASSWORDdescription: Admin passwordtype: passworddiff --git a/backend/templates/php-app.yaml b/backend/templates/php-app.yamlindex 7b6e7fbc..d0078da1 100644--- a/backend/templates/php-app.yaml+++ b/backend/templates/php-app.yaml@@ -15,6 +15,7 @@ variables:description: HTTP port for the applicationtype: portdefault: "8100"+ hidden: true- name: PHP_VERSIONdescription: PHP version (8.0, 8.1, 8.2, 8.3)type: stringdiff --git a/backend/templates/phpmyadmin.yaml b/backend/templates/phpmyadmin.yamlindex 56ad6b30..01f721d0 100644--- a/backend/templates/phpmyadmin.yaml+++ b/backend/templates/phpmyadmin.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: MYSQL_HOSTdescription: MySQL server hostdefault: mysql@@ -23,6 +24,7 @@ variables:description: MySQL server porttype: portdefault: "3306"+ hidden: trueports:- port: 8080diff --git a/backend/templates/plausible.yaml b/backend/templates/plausible.yamlindex 08e29e0e..ea0d7fa7 100644--- a/backend/templates/plausible.yaml+++ b/backend/templates/plausible.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8000"+ hidden: true- name: BASE_URLdescription: Base URL (e.g., https://analytics.example.com)required: truediff --git a/backend/templates/plex.yaml b/backend/templates/plex.yamlindex 97cdef5b..08ba7c90 100644--- a/backend/templates/plex.yaml+++ b/backend/templates/plex.yaml@@ -22,6 +22,7 @@ variables:description: Web interface porttype: portdefault: "32400"+ hidden: trueports:- port: 32400diff --git a/backend/templates/portainer.yaml b/backend/templates/portainer.yamlindex 3f656cd7..feeef203 100644--- a/backend/templates/portainer.yaml+++ b/backend/templates/portainer.yaml@@ -14,10 +14,12 @@ variables:- name: HTTP_PORTtype: portdefault: "9000"+ hidden: truedescription: Port for web interface (auto-assigned)- name: HTTPS_PORTtype: portdefault: "9443"+ hidden: truedescription: Port for HTTPS access (auto-assigned)compose:diff --git a/backend/templates/prometheus.yaml b/backend/templates/prometheus.yamlindex bd416ed5..8a98fee2 100644--- a/backend/templates/prometheus.yaml+++ b/backend/templates/prometheus.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "9090"+ hidden: true- name: RETENTION_TIMEdescription: Data retention perioddefault: 15ddiff --git a/backend/templates/python-app.yaml b/backend/templates/python-app.yamlindex 5bb23078..987372da 100644--- a/backend/templates/python-app.yaml+++ b/backend/templates/python-app.yaml@@ -15,6 +15,7 @@ variables:description: HTTP port for the applicationtype: portdefault: "8200"+ hidden: true- name: PYTHON_VERSIONdescription: Python version (3.9, 3.10, 3.11, 3.12)type: stringdiff --git a/backend/templates/redis-commander.yaml b/backend/templates/redis-commander.yamlindex 60bb6a6a..c9c1371c 100644--- a/backend/templates/redis-commander.yaml+++ b/backend/templates/redis-commander.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8081"+ hidden: true- name: REDIS_HOSTdescription: Redis server hostdefault: redis@@ -23,6 +24,7 @@ variables:description: Redis server porttype: portdefault: "6379"+ hidden: true- name: REDIS_PASSWORDdescription: Redis password (if any)type: passworddiff --git a/backend/templates/registry.yaml b/backend/templates/registry.yamlindex 9337bd4d..d499dbb7 100644--- a/backend/templates/registry.yaml+++ b/backend/templates/registry.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "5000"+ hidden: true- name: REGISTRY_AUTHdescription: Enable basic authenticationoptions:diff --git a/backend/templates/rocketchat.yaml b/backend/templates/rocketchat.yamlindex c40d5660..f03a0c48 100644--- a/backend/templates/rocketchat.yaml+++ b/backend/templates/rocketchat.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "3000"+ hidden: true- name: ROOT_URLdescription: Root URL (e.g., https://chat.example.com)default: http://localhost:3000diff --git a/backend/templates/seafile.yaml b/backend/templates/seafile.yamlindex 135aa387..a94d1d63 100644--- a/backend/templates/seafile.yaml+++ b/backend/templates/seafile.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: SEAFILE_SERVER_HOSTNAMEdescription: Server hostname (e.g., seafile.example.com)required: truediff --git a/backend/templates/sonarqube.yaml b/backend/templates/sonarqube.yamlindex 51b771e7..921fa805 100644--- a/backend/templates/sonarqube.yaml+++ b/backend/templates/sonarqube.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "9000"+ hidden: true- name: DB_PASSWORDdescription: PostgreSQL passwordtype: passworddiff --git a/backend/templates/strapi.yaml b/backend/templates/strapi.yamlindex 1ee9b36d..31725964 100644--- a/backend/templates/strapi.yaml+++ b/backend/templates/strapi.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "1337"+ hidden: true- name: APP_KEYSdescription: Application keystype: passworddiff --git a/backend/templates/syncthing.yaml b/backend/templates/syncthing.yamlindex 190a4ca0..dd8a1360 100644--- a/backend/templates/syncthing.yaml+++ b/backend/templates/syncthing.yaml@@ -15,10 +15,12 @@ variables:description: Web UI porttype: portdefault: "8384"+ hidden: true- name: SYNC_PORTdescription: Sync protocol porttype: portdefault: "22000"+ hidden: true- name: DATA_PATHdescription: Path to sync folder on hostdefault: /datadiff --git a/backend/templates/traefik.yaml b/backend/templates/traefik.yamlindex 4323f227..19e45899 100644--- a/backend/templates/traefik.yaml+++ b/backend/templates/traefik.yaml@@ -15,14 +15,17 @@ variables:description: HTTP porttype: portdefault: "80"+ hidden: true- name: HTTPS_PORTdescription: HTTPS porttype: portdefault: "443"+ hidden: true- name: DASHBOARD_PORTdescription: Dashboard porttype: portdefault: "8080"+ hidden: true- name: ACME_EMAILdescription: Email for Let's Encrypt certificatesrequired: truediff --git a/backend/templates/umami.yaml b/backend/templates/umami.yamlindex 09071f09..fc1af611 100644--- a/backend/templates/umami.yaml+++ b/backend/templates/umami.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "3000"+ hidden: true- name: APP_SECRETdescription: Application secrettype: passworddiff --git a/backend/templates/uptime-kuma.yaml b/backend/templates/uptime-kuma.yamlindex 428d9578..52f36f9a 100644--- a/backend/templates/uptime-kuma.yaml+++ b/backend/templates/uptime-kuma.yaml@@ -13,6 +13,7 @@ variables:- name: HTTP_PORTtype: portdefault: "3001"+ hidden: truedescription: Port for web interface (auto-assigned if not specified)compose:diff --git a/backend/templates/vault.yaml b/backend/templates/vault.yamlindex 11c548fd..e57e9aaf 100644--- a/backend/templates/vault.yaml+++ b/backend/templates/vault.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8200"+ hidden: true- name: DEV_MODEdescription: Run in development mode (not for production)options:diff --git a/backend/templates/vaultwarden.yaml b/backend/templates/vaultwarden.yamlindex 682e0411..e49aae9f 100644--- a/backend/templates/vaultwarden.yaml+++ b/backend/templates/vaultwarden.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: ADMIN_TOKENdescription: Admin panel tokentype: passworddiff --git a/backend/templates/wikijs.yaml b/backend/templates/wikijs.yamlindex f66d1db3..573f3152 100644--- a/backend/templates/wikijs.yaml+++ b/backend/templates/wikijs.yaml@@ -15,6 +15,7 @@ variables:description: HTTP porttype: portdefault: "3000"+ hidden: true- name: DB_PASSWORDdescription: PostgreSQL passwordtype: passworddiff --git a/backend/templates/wordpress-external-db.yaml b/backend/templates/wordpress-external-db.yamlindex 4ffd5172..5dcdc30b 100644--- a/backend/templates/wordpress-external-db.yaml+++ b/backend/templates/wordpress-external-db.yaml@@ -16,6 +16,7 @@ variables:description: HTTP port for WordPresstype: portdefault: "8080"+ hidden: true- name: DB_HOSTdescription: External database host (e.g., 192.168.1.100 or db.example.com)type: stringdiff --git a/backend/templates/wordpress.yaml b/backend/templates/wordpress.yamlindex 18d21932..0d955ba3 100644--- a/backend/templates/wordpress.yaml+++ b/backend/templates/wordpress.yaml@@ -15,14 +15,17 @@ variables:description: HTTP porttype: portdefault: "8080"+ hidden: true- name: DB_PASSWORDdescription: MySQL root passwordtype: passwordgenerate: password+ hidden: true- name: WP_DB_PASSWORDdescription: WordPress database passwordtype: passwordgenerate: password+ hidden: trueports:- port: 8080diff --git a/backend/templates/zigbee2mqtt.yaml b/backend/templates/zigbee2mqtt.yamlindex a2701965..574b0ddb 100644--- a/backend/templates/zigbee2mqtt.yaml+++ b/backend/templates/zigbee2mqtt.yaml@@ -15,6 +15,7 @@ variables:description: HTTP port for web UItype: portdefault: "8080"+ hidden: true- name: MQTT_SERVERdescription: MQTT server URLdefault: mqtt://mosquittodiff --git a/frontend/src/contexts/AuthContext.jsx b/frontend/src/contexts/AuthContext.jsxindex 3e47b5f4..1a4290ad 100644--- a/frontend/src/contexts/AuthContext.jsx+++ b/frontend/src/contexts/AuthContext.jsx@@ -74,6 +74,12 @@ export function AuthProvider({ children }) {async function register(email, username, password) {const data = await api.register(email, username, password);setUser(data.user);+ // After first registration, setup is complete - update status+ setSetupStatus({+ needsSetup: false,+ registrationEnabled: false,+ checked: true+ });return data;}