Skip to content

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.

Improve port variable handling and add app cleanup CLI

Juan Denisf05d05667834
diff --git a/.gitignore b/.gitignore
index 3ed53d25..26976e3c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ nul
/.claude_
.env
/frontend/dist
+*.tmp
diff --git a/backend/app/services/template_service.py b/backend/app/services/template_service.py
index 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 containers
docker_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:
+ continue
except 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
@classmethod
def _get_docker_used_ports(cls) -> set:
@@ -314,9 +340,9 @@ class TemplateService:
# Substitute variables
compose = 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.py
index 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.yaml
index 1f996e87..95f73282 100644
--- a/backend/templates/authelia.yaml
+++ b/backend/templates/authelia.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "9091"
+ hidden: true
- name: JWT_SECRET
description: JWT secret
type: password
diff --git a/backend/templates/bookstack.yaml b/backend/templates/bookstack.yaml
index 1d37c02f..065c09fe 100644
--- a/backend/templates/bookstack.yaml
+++ b/backend/templates/bookstack.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: APP_URL
description: Application URL
default: http://localhost:8080
diff --git a/backend/templates/caddy.yaml b/backend/templates/caddy.yaml
index 34f89693..addafaa8 100644
--- a/backend/templates/caddy.yaml
+++ b/backend/templates/caddy.yaml
@@ -15,10 +15,12 @@ variables:
description: HTTP port
type: port
default: "80"
+ hidden: true
- name: HTTPS_PORT
description: HTTPS port
type: port
default: "443"
+ hidden: true
ports:
- port: 80
diff --git a/backend/templates/code-server.yaml b/backend/templates/code-server.yaml
index f0b9444f..6fdffc26 100644
--- a/backend/templates/code-server.yaml
+++ b/backend/templates/code-server.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: PASSWORD
description: Access password
type: password
diff --git a/backend/templates/crowdsec.yaml b/backend/templates/crowdsec.yaml
index 29fa1e6d..e265dad7 100644
--- a/backend/templates/crowdsec.yaml
+++ b/backend/templates/crowdsec.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port for API
type: port
default: "8080"
+ hidden: true
- name: COLLECTIONS
description: Collections to install (comma-separated)
default: crowdsecurity/linux,crowdsecurity/sshd
diff --git a/backend/templates/directus.yaml b/backend/templates/directus.yaml
index d20db0f1..ec1a9f23 100644
--- a/backend/templates/directus.yaml
+++ b/backend/templates/directus.yaml
@@ -16,6 +16,7 @@ variables:
description: HTTP port
type: port
default: "8055"
+ hidden: true
- name: ADMIN_EMAIL
description: Admin email
diff --git a/backend/templates/drone.yaml b/backend/templates/drone.yaml
index 3fbfd910..015738b1 100644
--- a/backend/templates/drone.yaml
+++ b/backend/templates/drone.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: GITEA_SERVER
description: Gitea server URL (e.g., https://gitea.example.com)
required: true
diff --git a/backend/templates/duplicati.yaml b/backend/templates/duplicati.yaml
index e10a2a81..9368e6ae 100644
--- a/backend/templates/duplicati.yaml
+++ b/backend/templates/duplicati.yaml
@@ -15,6 +15,7 @@ variables:
description: Web UI port
type: port
default: "8200"
+ hidden: true
- name: BACKUP_SOURCE
description: Path to backup source on host
default: /source
diff --git a/backend/templates/excalidraw.yaml b/backend/templates/excalidraw.yaml
index c8974ab5..0c5dd9f3 100644
--- a/backend/templates/excalidraw.yaml
+++ b/backend/templates/excalidraw.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "3000"
+ hidden: true
ports:
- port: 3000
diff --git a/backend/templates/filebrowser.yaml b/backend/templates/filebrowser.yaml
index 762bbd12..fe0d7a62 100644
--- a/backend/templates/filebrowser.yaml
+++ b/backend/templates/filebrowser.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: ROOT_PATH
description: Root path to browse on host
default: /srv
diff --git a/backend/templates/ghost.yaml b/backend/templates/ghost.yaml
index 5be906cf..b3d7a619 100644
--- a/backend/templates/ghost.yaml
+++ b/backend/templates/ghost.yaml
@@ -14,16 +14,19 @@ variables:
- name: HTTP_PORT
type: port
default: "2368"
+ hidden: true
description: Port to expose Ghost
+ hidden: true
- name: SITE_URL
type: string
default: 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_PASSWORD
type: password
length: 24
description: MySQL database password
+ hidden: true
compose:
services:
diff --git a/backend/templates/gitea.yaml b/backend/templates/gitea.yaml
index a17b8fa3..d976fd46 100644
--- a/backend/templates/gitea.yaml
+++ b/backend/templates/gitea.yaml
@@ -14,10 +14,12 @@ variables:
- name: HTTP_PORT
type: port
default: "3000"
+ hidden: true
description: Port for web interface
- name: SSH_PORT
type: port
default: "2222"
+ hidden: true
description: Port for SSH access
- name: DB_PASSWORD
type: password
diff --git a/backend/templates/grafana.yaml b/backend/templates/grafana.yaml
index a28f21af..a436b5cb 100644
--- a/backend/templates/grafana.yaml
+++ b/backend/templates/grafana.yaml
@@ -24,6 +24,7 @@ variables:
description: HTTP port
type: port
default: "3000"
+ hidden: true
ports:
- port: 3000
diff --git a/backend/templates/grav.yaml b/backend/templates/grav.yaml
index 19933b5b..b6b9cd4b 100644
--- a/backend/templates/grav.yaml
+++ b/backend/templates/grav.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
ports:
- port: 8080
diff --git a/backend/templates/homeassistant.yaml b/backend/templates/homeassistant.yaml
index d72c947e..1caf0f21 100644
--- a/backend/templates/homeassistant.yaml
+++ b/backend/templates/homeassistant.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8123"
+ hidden: true
- name: TZ
description: Timezone
default: UTC
diff --git a/backend/templates/immich.yaml b/backend/templates/immich.yaml
index 81423f20..b6b257f0 100644
--- a/backend/templates/immich.yaml
+++ b/backend/templates/immich.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "2283"
+ hidden: true
- name: UPLOAD_LOCATION
description: Path for uploaded photos on host
default: /photos
diff --git a/backend/templates/jaeger.yaml b/backend/templates/jaeger.yaml
index dfe6bc6e..44f074ba 100644
--- a/backend/templates/jaeger.yaml
+++ b/backend/templates/jaeger.yaml
@@ -15,10 +15,12 @@ variables:
description: Web UI port
type: port
default: "16686"
+ hidden: true
- name: COLLECTOR_PORT
description: Collector port for spans
type: port
default: "14268"
+ hidden: true
ports:
- port: 16686
diff --git a/backend/templates/jellyfin.yaml b/backend/templates/jellyfin.yaml
index f08d59f8..595d61cb 100644
--- a/backend/templates/jellyfin.yaml
+++ b/backend/templates/jellyfin.yaml
@@ -15,10 +15,12 @@ variables:
description: HTTP port
type: port
default: "8096"
+ hidden: true
- name: HTTPS_PORT
description: HTTPS port
type: port
default: "8920"
+ hidden: true
- name: MEDIA_PATH
description: Path to media files on host
default: /media
diff --git a/backend/templates/jenkins.yaml b/backend/templates/jenkins.yaml
index 9e87119b..8338df4d 100644
--- a/backend/templates/jenkins.yaml
+++ b/backend/templates/jenkins.yaml
@@ -15,10 +15,12 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: AGENT_PORT
description: Agent connection port
type: port
default: "50000"
+ hidden: true
- name: JAVA_OPTS
description: Java options
default: "-Xmx2048m"
diff --git a/backend/templates/jitsi.yaml b/backend/templates/jitsi.yaml
index 27134474..c941304d 100644
--- a/backend/templates/jitsi.yaml
+++ b/backend/templates/jitsi.yaml
@@ -15,10 +15,12 @@ variables:
description: HTTP port
type: port
default: "8000"
+ hidden: true
- name: HTTPS_PORT
description: HTTPS port
type: port
default: "8443"
+ hidden: true
- name: PUBLIC_URL
description: Public URL (e.g., https://meet.example.com)
required: true
diff --git a/backend/templates/keycloak.yaml b/backend/templates/keycloak.yaml
index 58bd1aea..b8072ea0 100644
--- a/backend/templates/keycloak.yaml
+++ b/backend/templates/keycloak.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: ADMIN_USER
description: Admin username
default: admin
diff --git a/backend/templates/loki.yaml b/backend/templates/loki.yaml
index fc19ed6c..1f8a8e1a 100644
--- a/backend/templates/loki.yaml
+++ b/backend/templates/loki.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "3100"
+ hidden: true
ports:
- port: 3100
diff --git a/backend/templates/matrix-synapse.yaml b/backend/templates/matrix-synapse.yaml
index 01724432..b1e31d75 100644
--- a/backend/templates/matrix-synapse.yaml
+++ b/backend/templates/matrix-synapse.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8008"
+ hidden: true
- name: SERVER_NAME
description: Server name (your domain, e.g., matrix.example.com)
required: true
diff --git a/backend/templates/mattermost.yaml b/backend/templates/mattermost.yaml
index 8f3d2e6c..f2536e29 100644
--- a/backend/templates/mattermost.yaml
+++ b/backend/templates/mattermost.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8065"
+ hidden: true
- name: SITE_URL
description: Site URL (e.g., https://mattermost.example.com)
default: http://localhost:8065
diff --git a/backend/templates/minio.yaml b/backend/templates/minio.yaml
index 2847a7c8..f2fa2bcb 100644
--- a/backend/templates/minio.yaml
+++ b/backend/templates/minio.yaml
@@ -15,10 +15,12 @@ variables:
description: API port
type: port
default: "9000"
+ hidden: true
- name: CONSOLE_PORT
description: Console port
type: port
default: "9001"
+ hidden: true
- name: ROOT_USER
description: Root username
default: admin
diff --git a/backend/templates/mongo-express.yaml b/backend/templates/mongo-express.yaml
index f8631da4..e5e004bf 100644
--- a/backend/templates/mongo-express.yaml
+++ b/backend/templates/mongo-express.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8081"
+ hidden: true
- name: MONGO_HOST
description: MongoDB server host
default: mongo
@@ -23,6 +24,7 @@ variables:
description: MongoDB server port
type: port
default: "27017"
+ hidden: true
- name: ADMIN_USERNAME
description: Basic auth username
default: admin
diff --git a/backend/templates/mosquitto.yaml b/backend/templates/mosquitto.yaml
index 629df7fd..05e4e2fb 100644
--- a/backend/templates/mosquitto.yaml
+++ b/backend/templates/mosquitto.yaml
@@ -15,10 +15,12 @@ variables:
description: MQTT port
type: port
default: "1883"
+ hidden: true
- name: WEBSOCKET_PORT
description: WebSocket port
type: port
default: "9001"
+ hidden: true
ports:
- port: 1883
diff --git a/backend/templates/n8n.yaml b/backend/templates/n8n.yaml
index 98254213..c163473a 100644
--- a/backend/templates/n8n.yaml
+++ b/backend/templates/n8n.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "5678"
+ hidden: true
- name: WEBHOOK_URL
description: Webhook URL (e.g., https://n8n.example.com)
required: true
diff --git a/backend/templates/navidrome.yaml b/backend/templates/navidrome.yaml
index d59cd509..4719a48c 100644
--- a/backend/templates/navidrome.yaml
+++ b/backend/templates/navidrome.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "4533"
+ hidden: true
- name: MUSIC_PATH
description: Path to music files on host
default: /music
diff --git a/backend/templates/netdata.yaml b/backend/templates/netdata.yaml
index 7b8a11de..767f18ea 100644
--- a/backend/templates/netdata.yaml
+++ b/backend/templates/netdata.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port for web interface
type: port
default: "19999"
+ hidden: true
ports:
- port: 19999
diff --git a/backend/templates/nextcloud.yaml b/backend/templates/nextcloud.yaml
index c6af15a4..fbf9a717 100644
--- a/backend/templates/nextcloud.yaml
+++ b/backend/templates/nextcloud.yaml
@@ -14,7 +14,9 @@ variables:
- name: HTTP_PORT
type: port
default: "8080"
+ hidden: true
description: Port to expose Nextcloud
+ hidden: true
- name: ADMIN_USER
type: string
default: admin
@@ -22,16 +24,17 @@ variables:
- name: ADMIN_PASSWORD
type: password
length: 16
- description: Admin password
- required: true
+ description: Admin password (auto-generated if empty)
- name: DB_PASSWORD
type: password
length: 24
description: Database password
+ hidden: true
- name: REDIS_PASSWORD
type: password
length: 16
description: Redis password
+ hidden: true
compose:
services:
diff --git a/backend/templates/nginx-proxy-manager.yaml b/backend/templates/nginx-proxy-manager.yaml
index 0ce072a9..a07e8185 100644
--- a/backend/templates/nginx-proxy-manager.yaml
+++ b/backend/templates/nginx-proxy-manager.yaml
@@ -14,14 +14,17 @@ variables:
- name: HTTP_PORT
type: port
default: "80"
+ hidden: true
description: HTTP port for proxied sites
- name: HTTPS_PORT
type: port
default: "443"
+ hidden: true
description: HTTPS port for proxied sites
- name: ADMIN_PORT
type: port
default: "81"
+ hidden: true
description: Admin panel port
- name: DB_PASSWORD
type: password
diff --git a/backend/templates/node-app.yaml b/backend/templates/node-app.yaml
index 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: port
default: "8300"
+ hidden: true
- name: NODE_VERSION
description: Node.js version (18, 20, 21)
type: string
diff --git a/backend/templates/nodered.yaml b/backend/templates/nodered.yaml
index 1bbac7d8..3d962f67 100644
--- a/backend/templates/nodered.yaml
+++ b/backend/templates/nodered.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "1880"
+ hidden: true
- name: TZ
description: Timezone
default: UTC
diff --git a/backend/templates/outline.yaml b/backend/templates/outline.yaml
index 0f1bded0..6d3bdae1 100644
--- a/backend/templates/outline.yaml
+++ b/backend/templates/outline.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "3000"
+ hidden: true
- name: SECRET_KEY
description: Secret key
type: password
diff --git a/backend/templates/payload.yaml b/backend/templates/payload.yaml
index b5a50139..02b1d0ec 100644
--- a/backend/templates/payload.yaml
+++ b/backend/templates/payload.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "3000"
+ hidden: true
- name: PAYLOAD_SECRET
description: Payload secret key
type: password
diff --git a/backend/templates/pgadmin.yaml b/backend/templates/pgadmin.yaml
index cdb481a3..2bc065e4 100644
--- a/backend/templates/pgadmin.yaml
+++ b/backend/templates/pgadmin.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "5050"
+ hidden: true
- name: ADMIN_EMAIL
description: Admin email for login
diff --git a/backend/templates/photoprism.yaml b/backend/templates/photoprism.yaml
index 32840d15..a3a63762 100644
--- a/backend/templates/photoprism.yaml
+++ b/backend/templates/photoprism.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "2342"
+ hidden: true
- name: ADMIN_PASSWORD
description: Admin password
type: password
diff --git a/backend/templates/php-app.yaml b/backend/templates/php-app.yaml
index 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 application
type: port
default: "8100"
+ hidden: true
- name: PHP_VERSION
description: PHP version (8.0, 8.1, 8.2, 8.3)
type: string
diff --git a/backend/templates/phpmyadmin.yaml b/backend/templates/phpmyadmin.yaml
index 56ad6b30..01f721d0 100644
--- a/backend/templates/phpmyadmin.yaml
+++ b/backend/templates/phpmyadmin.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: MYSQL_HOST
description: MySQL server host
default: mysql
@@ -23,6 +24,7 @@ variables:
description: MySQL server port
type: port
default: "3306"
+ hidden: true
ports:
- port: 8080
diff --git a/backend/templates/plausible.yaml b/backend/templates/plausible.yaml
index 08e29e0e..ea0d7fa7 100644
--- a/backend/templates/plausible.yaml
+++ b/backend/templates/plausible.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8000"
+ hidden: true
- name: BASE_URL
description: Base URL (e.g., https://analytics.example.com)
required: true
diff --git a/backend/templates/plex.yaml b/backend/templates/plex.yaml
index 97cdef5b..08ba7c90 100644
--- a/backend/templates/plex.yaml
+++ b/backend/templates/plex.yaml
@@ -22,6 +22,7 @@ variables:
description: Web interface port
type: port
default: "32400"
+ hidden: true
ports:
- port: 32400
diff --git a/backend/templates/portainer.yaml b/backend/templates/portainer.yaml
index 3f656cd7..feeef203 100644
--- a/backend/templates/portainer.yaml
+++ b/backend/templates/portainer.yaml
@@ -14,10 +14,12 @@ variables:
- name: HTTP_PORT
type: port
default: "9000"
+ hidden: true
description: Port for web interface (auto-assigned)
- name: HTTPS_PORT
type: port
default: "9443"
+ hidden: true
description: Port for HTTPS access (auto-assigned)
compose:
diff --git a/backend/templates/prometheus.yaml b/backend/templates/prometheus.yaml
index bd416ed5..8a98fee2 100644
--- a/backend/templates/prometheus.yaml
+++ b/backend/templates/prometheus.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "9090"
+ hidden: true
- name: RETENTION_TIME
description: Data retention period
default: 15d
diff --git a/backend/templates/python-app.yaml b/backend/templates/python-app.yaml
index 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 application
type: port
default: "8200"
+ hidden: true
- name: PYTHON_VERSION
description: Python version (3.9, 3.10, 3.11, 3.12)
type: string
diff --git a/backend/templates/redis-commander.yaml b/backend/templates/redis-commander.yaml
index 60bb6a6a..c9c1371c 100644
--- a/backend/templates/redis-commander.yaml
+++ b/backend/templates/redis-commander.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8081"
+ hidden: true
- name: REDIS_HOST
description: Redis server host
default: redis
@@ -23,6 +24,7 @@ variables:
description: Redis server port
type: port
default: "6379"
+ hidden: true
- name: REDIS_PASSWORD
description: Redis password (if any)
type: password
diff --git a/backend/templates/registry.yaml b/backend/templates/registry.yaml
index 9337bd4d..d499dbb7 100644
--- a/backend/templates/registry.yaml
+++ b/backend/templates/registry.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "5000"
+ hidden: true
- name: REGISTRY_AUTH
description: Enable basic authentication
options:
diff --git a/backend/templates/rocketchat.yaml b/backend/templates/rocketchat.yaml
index c40d5660..f03a0c48 100644
--- a/backend/templates/rocketchat.yaml
+++ b/backend/templates/rocketchat.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "3000"
+ hidden: true
- name: ROOT_URL
description: Root URL (e.g., https://chat.example.com)
default: http://localhost:3000
diff --git a/backend/templates/seafile.yaml b/backend/templates/seafile.yaml
index 135aa387..a94d1d63 100644
--- a/backend/templates/seafile.yaml
+++ b/backend/templates/seafile.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: SEAFILE_SERVER_HOSTNAME
description: Server hostname (e.g., seafile.example.com)
required: true
diff --git a/backend/templates/sonarqube.yaml b/backend/templates/sonarqube.yaml
index 51b771e7..921fa805 100644
--- a/backend/templates/sonarqube.yaml
+++ b/backend/templates/sonarqube.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "9000"
+ hidden: true
- name: DB_PASSWORD
description: PostgreSQL password
type: password
diff --git a/backend/templates/strapi.yaml b/backend/templates/strapi.yaml
index 1ee9b36d..31725964 100644
--- a/backend/templates/strapi.yaml
+++ b/backend/templates/strapi.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "1337"
+ hidden: true
- name: APP_KEYS
description: Application keys
type: password
diff --git a/backend/templates/syncthing.yaml b/backend/templates/syncthing.yaml
index 190a4ca0..dd8a1360 100644
--- a/backend/templates/syncthing.yaml
+++ b/backend/templates/syncthing.yaml
@@ -15,10 +15,12 @@ variables:
description: Web UI port
type: port
default: "8384"
+ hidden: true
- name: SYNC_PORT
description: Sync protocol port
type: port
default: "22000"
+ hidden: true
- name: DATA_PATH
description: Path to sync folder on host
default: /data
diff --git a/backend/templates/traefik.yaml b/backend/templates/traefik.yaml
index 4323f227..19e45899 100644
--- a/backend/templates/traefik.yaml
+++ b/backend/templates/traefik.yaml
@@ -15,14 +15,17 @@ variables:
description: HTTP port
type: port
default: "80"
+ hidden: true
- name: HTTPS_PORT
description: HTTPS port
type: port
default: "443"
+ hidden: true
- name: DASHBOARD_PORT
description: Dashboard port
type: port
default: "8080"
+ hidden: true
- name: ACME_EMAIL
description: Email for Let's Encrypt certificates
required: true
diff --git a/backend/templates/umami.yaml b/backend/templates/umami.yaml
index 09071f09..fc1af611 100644
--- a/backend/templates/umami.yaml
+++ b/backend/templates/umami.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "3000"
+ hidden: true
- name: APP_SECRET
description: Application secret
type: password
diff --git a/backend/templates/uptime-kuma.yaml b/backend/templates/uptime-kuma.yaml
index 428d9578..52f36f9a 100644
--- a/backend/templates/uptime-kuma.yaml
+++ b/backend/templates/uptime-kuma.yaml
@@ -13,6 +13,7 @@ variables:
- name: HTTP_PORT
type: port
default: "3001"
+ hidden: true
description: Port for web interface (auto-assigned if not specified)
compose:
diff --git a/backend/templates/vault.yaml b/backend/templates/vault.yaml
index 11c548fd..e57e9aaf 100644
--- a/backend/templates/vault.yaml
+++ b/backend/templates/vault.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8200"
+ hidden: true
- name: DEV_MODE
description: Run in development mode (not for production)
options:
diff --git a/backend/templates/vaultwarden.yaml b/backend/templates/vaultwarden.yaml
index 682e0411..e49aae9f 100644
--- a/backend/templates/vaultwarden.yaml
+++ b/backend/templates/vaultwarden.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: ADMIN_TOKEN
description: Admin panel token
type: password
diff --git a/backend/templates/wikijs.yaml b/backend/templates/wikijs.yaml
index f66d1db3..573f3152 100644
--- a/backend/templates/wikijs.yaml
+++ b/backend/templates/wikijs.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port
type: port
default: "3000"
+ hidden: true
- name: DB_PASSWORD
description: PostgreSQL password
type: password
diff --git a/backend/templates/wordpress-external-db.yaml b/backend/templates/wordpress-external-db.yaml
index 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 WordPress
type: port
default: "8080"
+ hidden: true
- name: DB_HOST
description: External database host (e.g., 192.168.1.100 or db.example.com)
type: string
diff --git a/backend/templates/wordpress.yaml b/backend/templates/wordpress.yaml
index 18d21932..0d955ba3 100644
--- a/backend/templates/wordpress.yaml
+++ b/backend/templates/wordpress.yaml
@@ -15,14 +15,17 @@ variables:
description: HTTP port
type: port
default: "8080"
+ hidden: true
- name: DB_PASSWORD
description: MySQL root password
type: password
generate: password
+ hidden: true
- name: WP_DB_PASSWORD
description: WordPress database password
type: password
generate: password
+ hidden: true
ports:
- port: 8080
diff --git a/backend/templates/zigbee2mqtt.yaml b/backend/templates/zigbee2mqtt.yaml
index a2701965..574b0ddb 100644
--- a/backend/templates/zigbee2mqtt.yaml
+++ b/backend/templates/zigbee2mqtt.yaml
@@ -15,6 +15,7 @@ variables:
description: HTTP port for web UI
type: port
default: "8080"
+ hidden: true
- name: MQTT_SERVER
description: MQTT server URL
default: mqtt://mosquitto
diff --git a/frontend/src/contexts/AuthContext.jsx b/frontend/src/contexts/AuthContext.jsx
index 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;
}