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.

feat(manifest): finish appliance volumes + one-shot bootstrap (plan 35 ph2)

Juan Denisbe3a9f9bcd69
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f2f00c7..5d1697fb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,14 @@ awaiting a stable release:
issues — it refuses (nothing executed, no force flag) on a port conflict, a
remote/observed target, or an undetectable firewall, with a message that says
what the target can't provide and how to fix it.
+- **Appliance tier — finished volumes + one-shot first-boot bootstrap** — a
+ manifest disk's `size` is now recorded on the volume, its declared mounts are
+ emitted into the generated compose, and its `backup:` block resolves the
+ docker volume's live host mountpoint so backups capture the real data. A new
+ `bootstrap: { command, timeoutSeconds }` runs once (via `docker compose run
+ --rm`) after volumes exist — for appliances that generate a config tree on
+ first boot — and stamps the app so it never re-runs; re-arm it with
+ `POST /manifests/bootstrap/reset` (type the app name to confirm).
- **New Service wizard clarity** — each source card now shows a short explainer
strip when selected (what it does, what to have ready, the next steps), and a
"Docs" link to the matching serverkit.ai guide (hidden under White Label). The
diff --git a/backend/app/api/manifests.py b/backend/app/api/manifests.py
index 860dbc0f..42668993 100644
--- a/backend/app/api/manifests.py
+++ b/backend/app/api/manifests.py
@@ -176,3 +176,26 @@ def apply_manifest():
status = 200 if result['success'] else 207
return jsonify(result), status
+
+
+@manifests_bp.route('/bootstrap/reset', methods=['POST'])
+@jwt_required()
+def reset_bootstrap():
+ """POST /api/v1/manifests/bootstrap/reset {app_id, confirm}
+
+ Re-arm a one-shot appliance bootstrap so the next apply runs it again.
+ Destructive-ish (the bootstrap may regenerate config), so it requires
+ typing the app name in `confirm`.
+ """
+ user, err = _require_admin()
+ if err:
+ return err
+ data = request.get_json(silent=True) or {}
+ app = Application.query.get(data.get('app_id')) if data.get('app_id') else None
+ if not app:
+ return jsonify({'error': 'Application not found'}), 404
+ if (data.get('confirm') or '') != app.name:
+ return jsonify({'error': f'Type the app name "{app.name}" to confirm'}), 400
+ app.bootstrap_done = False
+ db.session.commit()
+ return jsonify({'success': True, 'app_id': app.id, 'bootstrap_done': False}), 200
diff --git a/backend/app/services/backup_policy_service.py b/backend/app/services/backup_policy_service.py
index 7ff055fb..55ed3b51 100644
--- a/backend/app/services/backup_policy_service.py
+++ b/backend/app/services/backup_policy_service.py
@@ -252,7 +252,21 @@ class BackupPolicyService:
if policy.target_type == 'files':
meta = policy.get_target_meta()
- file_paths = meta.get('paths') or []
+ file_paths = list(meta.get('paths') or [])
+ # Appliance tier (plan 35): a manifest disk backs a named docker
+ # volume, so back up its live HOST mountpoint, not the in-container
+ # path. Falls back to `paths` when the volume isn't resolvable yet.
+ vol_mount = meta.get('volume_mount')
+ if vol_mount and meta.get('app_id'):
+ try:
+ from app.models.application import Application
+ from app.services.volume_service import VolumeService
+ app = Application.query.get(meta['app_id'])
+ host_path = VolumeService.host_path_for_mount(app, vol_mount)
+ if host_path:
+ file_paths = [host_path]
+ except Exception:
+ pass
if not file_paths:
raise BackupPolicyError('Files target has no paths configured')
return {
diff --git a/backend/app/services/bootstrap_service.py b/backend/app/services/bootstrap_service.py
new file mode 100644
index 00000000..3e4397d0
--- /dev/null
+++ b/backend/app/services/bootstrap_service.py
@@ -0,0 +1,56 @@
+"""One-shot appliance first-boot bootstrap (plan 35).
+
+Some appliances generate a config/certificate tree exactly once, on first run.
+Abusing a compose init container leaves it behind; abusing an entrypoint reruns
+it every deploy. Instead this runs the declared ``bootstrap.command`` ONCE via
+``docker compose run --rm <service> <command>`` — after the volumes exist and
+before the first ``up`` — and flips ``Application.bootstrap_done`` on success so
+it never re-runs. Failure is a visible, retryable apply-step failure.
+
+The runner is injectable (``set_runner``) so the apply engine can be proven
+without Docker.
+"""
+
+import shlex
+from typing import Any, Callable, Dict, Optional
+
+
+class BootstrapService:
+
+ _runner: Optional[Callable] = None # test seam
+
+ @classmethod
+ def set_runner(cls, fn: Optional[Callable]) -> None:
+ """Install/clear an injected runner ``fn(app, service, command, timeout)``
+ returning ``{'success': bool, 'output'|'error': str}``."""
+ cls._runner = fn
+
+ @classmethod
+ def run_once(cls, app, command: str, timeout_seconds: Optional[int] = None,
+ service: Optional[str] = None) -> Dict[str, Any]:
+ service = service or app.name
+ if cls._runner is not None:
+ return cls._runner(app, service, command, timeout_seconds)
+ return cls._docker_run(app, service, command, timeout_seconds)
+
+ @staticmethod
+ def _docker_run(app, service: str, command: str,
+ timeout_seconds: Optional[int]) -> Dict[str, Any]:
+ import subprocess
+ root = getattr(app, 'root_path', None)
+ if not root:
+ return {'success': False,
+ 'error': 'app has no deployed compose project to run bootstrap in'}
+ cmd = ['docker', 'compose', 'run', '--rm', service] + shlex.split(command)
+ try:
+ proc = subprocess.run(cmd, cwd=root, capture_output=True, text=True,
+ timeout=timeout_seconds or 300)
+ except subprocess.TimeoutExpired:
+ return {'success': False,
+ 'error': f'bootstrap timed out after {timeout_seconds or 300}s'}
+ except Exception as exc: # docker missing, etc.
+ return {'success': False, 'error': str(exc)}
+ if proc.returncode != 0:
+ return {'success': False,
+ 'error': (proc.stderr or proc.stdout or 'bootstrap failed').strip()[:500]}
+ return {'success': True, 'output': (proc.stdout or '').strip()[:500]}
diff --git a/backend/app/services/manifest_apply_service.py b/backend/app/services/manifest_apply_service.py
index 0773b494..d86c097d 100644
--- a/backend/app/services/manifest_apply_service.py
+++ b/backend/app/services/manifest_apply_service.py
@@ -74,6 +74,7 @@ class ManifestApplyService:
'runtime': svc.get('runtime'),
'port': svc.get('port'),
'ports': svc.get('ports', []),
+ 'bootstrap': svc.get('bootstrap'),
'healthcheck_path': svc.get('healthcheck_path'),
'build_command': svc.get('build_command'),
'start_command': svc.get('start_command'),
@@ -328,6 +329,17 @@ class ManifestApplyService:
'files', app.id if app else None, backup):
steps.append(cls._files_backup_step(name, app, mount, backup))
+ # first-boot bootstrap (appliance tier, plan 35) — once per app
+ bootstrap = resolved.get('bootstrap')
+ if bootstrap and (app is None or not getattr(app, 'bootstrap_done', False)):
+ steps.append({
+ 'type': 'bootstrap', 'service': name,
+ 'description': f'Run first-boot bootstrap on `{name}`',
+ 'payload': {'app_id': app.id if app else None,
+ 'command': bootstrap['command'],
+ 'timeout_seconds': bootstrap.get('timeout_seconds')},
+ })
+
return steps
@classmethod
@@ -364,8 +376,8 @@ class ManifestApplyService:
'type': 'upsert_backup_policy', 'service': name,
'description': f'Backup policy for disk `{mount}` on `{name}` ({backup["schedule"]})',
'payload': {'target': 'files', 'app_id': app.id if app else None,
- 'mount_path': mount, 'schedule': backup['schedule'],
- 'retain': backup['retain']},
+ 'mount_path': mount, 'volume_mount': mount,
+ 'schedule': backup['schedule'], 'retain': backup['retain']},
}
# -- blockers engine (appliance tier, plan 35) --------------------------
@@ -696,7 +708,29 @@ class ManifestApplyService:
if any(v.mount_path == payload['mount_path'] for v in (app.volumes or [])):
return {'exists': True}
vol = VolumeService.create(app, payload['name'], payload['mount_path'])
- return {'volume_id': getattr(vol, 'id', None)}
+ # persist the manifest-declared size cap (plan 35); measured usage stays
+ # on size_bytes.
+ declared = payload.get('size')
+ if declared is not None and vol is not None:
+ vol.declared_size = str(declared)
+ db.session.commit()
+ return {'volume_id': getattr(vol, 'id', None), 'declared_size': declared}
+
+ @classmethod
+ def _do_bootstrap(cls, project, env, payload, user_id):
+ from app.services.bootstrap_service import BootstrapService
+ app = Application.query.get(payload.get('app_id') or cls._resolve_app_id(project, payload))
+ if not app:
+ raise RuntimeError('app not found')
+ if getattr(app, 'bootstrap_done', False):
+ return {'skipped': 'already bootstrapped'}
+ result = BootstrapService.run_once(
+ app, payload['command'], timeout_seconds=payload.get('timeout_seconds'))
+ if not result.get('success'):
+ raise RuntimeError(result.get('error') or 'bootstrap failed')
+ app.bootstrap_done = True
+ db.session.commit()
+ return {'bootstrapped': True, 'output': result.get('output')}
@classmethod
def _do_open_port(cls, project, env, payload, user_id):
@@ -724,11 +758,17 @@ class ManifestApplyService:
raise RuntimeError('managed database not found for backup policy')
ManagedDatabaseService.protect(managed, fields=fields)
return {'policy': 'database', 'db': payload['db_name']}
- # files
+ # files — for a manifest disk the real bytes live in the named docker
+ # volume, so record the volume mount so backup resolves the live HOST
+ # mountpoint (plan 35). `paths` stays as a graceful fallback.
app_id = payload.get('app_id') or cls._resolve_app_id(project, payload)
+ meta = {'paths': [payload['mount_path']], 'managed_by': 'manifest'}
+ if payload.get('volume_mount'):
+ meta['volume_mount'] = payload['volume_mount']
+ meta['app_id'] = app_id
policy = BackupPolicyService.get_or_create_policy(
target_type='files', target_id=app_id, target_subtype='pathlist',
- target_meta={'paths': [payload['mount_path']], 'managed_by': 'manifest'})
+ target_meta=meta)
BackupPolicyService.update_policy(policy, fields)
return {'policy': 'files', 'policy_id': policy.id}
diff --git a/backend/app/services/manifest_scaffold_service.py b/backend/app/services/manifest_scaffold_service.py
index 6929c987..c18a7e50 100644
--- a/backend/app/services/manifest_scaffold_service.py
+++ b/backend/app/services/manifest_scaffold_service.py
@@ -125,7 +125,10 @@ class ManifestScaffoldService:
def _disks(app: Application) -> List[Dict[str, Any]]:
disks = []
for vol in getattr(app, 'volumes', []) or []:
- disks.append({'name': vol.name, 'mountPath': vol.mount_path})
+ entry: Dict[str, Any] = {'name': vol.name, 'mountPath': vol.mount_path}
+ if getattr(vol, 'declared_size', None):
+ entry['size'] = vol.declared_size
+ disks.append(entry)
return disks
@staticmethod
diff --git a/backend/app/services/manifest_spec_service.py b/backend/app/services/manifest_spec_service.py
index 39f5587c..d1be7595 100644
--- a/backend/app/services/manifest_spec_service.py
+++ b/backend/app/services/manifest_spec_service.py
@@ -107,6 +107,7 @@ MANIFEST_SCHEMA: Dict[str, Any] = {
"startCommand": {"type": "string"},
"port": {"type": "integer", "minimum": 1, "maximum": 65535},
"ports": {"type": "array", "items": {"$ref": "#/definitions/portDecl"}},
+ "bootstrap": {"$ref": "#/definitions/bootstrap"},
"healthCheckPath": {"type": "string"},
"autoDeploy": {"type": "boolean"},
"version": {"type": ["string", "number"]},
@@ -124,6 +125,15 @@ MANIFEST_SCHEMA: Dict[str, Any] = {
},
},
},
+ "bootstrap": {
+ "type": "object",
+ "required": ["command"],
+ "additionalProperties": True,
+ "properties": {
+ "command": {"type": "string", "minLength": 1},
+ "timeoutSeconds": {"type": "integer", "minimum": 1},
+ },
+ },
"portDecl": {
"type": "object",
"required": ["port"],
@@ -382,6 +392,7 @@ class ManifestSpecService:
]
ports = cls._normalize_ports(svc.get('ports'), prefix, errors)
+ bootstrap = cls._normalize_bootstrap(svc.get('bootstrap'))
return {
'name': name,
@@ -394,6 +405,7 @@ class ManifestSpecService:
'start_command': cls._alias(svc, 'startCommand', 'start_command'),
'port': svc.get('port'),
'ports': ports,
+ 'bootstrap': bootstrap,
'healthcheck_path': cls._alias(svc, 'healthCheckPath', 'healthcheck_path'),
'auto_deploy': bool(cls._alias(svc, 'autoDeploy', 'auto_deploy', default=False)),
'engine_version': cls._stringify(svc.get('version')),
@@ -439,6 +451,20 @@ class ManifestSpecService:
})
return ports
+ @classmethod
+ def _normalize_bootstrap(cls, raw: Any) -> Optional[Dict[str, Any]]:
+ """First-boot bootstrap (plan 35): ``{command, timeoutSeconds?}``."""
+ if not isinstance(raw, dict):
+ return None
+ command = raw.get('command')
+ if not command:
+ return None
+ timeout = cls._alias(raw, 'timeoutSeconds', 'timeout_seconds')
+ return {
+ 'command': command,
+ 'timeout_seconds': int(timeout) if timeout else None,
+ }
+
@classmethod
def _normalize_env_var(cls, var: Dict[str, Any], where: str, errors: List[str]) -> Dict[str, Any]:
key = var.get('key')
diff --git a/backend/app/services/volume_service.py b/backend/app/services/volume_service.py
index 436cfab4..32cd9f79 100644
--- a/backend/app/services/volume_service.py
+++ b/backend/app/services/volume_service.py
@@ -194,6 +194,23 @@ class VolumeService:
'top_level': {v.docker_volume_name: {} for v in rows},
}
+ @classmethod
+ def host_path_for_mount(cls, app, mount_path):
+ """Live host mountpoint for the app's volume at ``mount_path`` (or None).
+
+ Used to route a manifest disk's backup at the real bytes rather than the
+ in-container path (plan 35)."""
+ if app is None:
+ return None
+ vol = AppVolume.query.filter_by(
+ application_id=app.id, mount_path=mount_path).first()
+ if not vol:
+ return None
+ live = DockerService.inspect_volume(vol.docker_volume_name)
+ if live.get('present') and live.get('mountpoint'):
+ return live['mountpoint']
+ return None
+
@classmethod
def host_paths_for_app(cls, app):
"""Live host mountpoints of an app's managed volumes, for backup
diff --git a/backend/tests/test_manifest_appliance_volumes_bootstrap.py b/backend/tests/test_manifest_appliance_volumes_bootstrap.py
new file mode 100644
index 00000000..ff32a947
--- /dev/null
+++ b/backend/tests/test_manifest_appliance_volumes_bootstrap.py
@@ -0,0 +1,195 @@
+"""Proving tests for Phase 2 of the Appliance tier (plan 35):
+declared volume size, disk-backup routing to the volume host mount, and the
+one-shot first-boot bootstrap."""
+
+import pytest
+
+import app.models.application_manifest # noqa: F401
+from app.services.manifest_spec_service import ManifestSpecService
+from app.services.manifest_apply_service import ManifestApplyService
+from app.services.bootstrap_service import BootstrapService
+from app.services.buildpack_service import BuildpackService
+
+
+VOL_BOOT_MANIFEST = {
+ 'version': 1,
+ 'services': [{
+ 'name': 'appliance', 'type': 'docker',
+ 'disks': [{'name': 'config', 'mountPath': '/config', 'size': '2GB',
+ 'backup': {'schedule': 'daily', 'retain': 5}}],
+ 'bootstrap': {'command': '/opt/gen-config.sh', 'timeoutSeconds': 60},
+ }],
+}
+
+
+def project(app):
+ from app import db
+ from app.models import Project, Environment
+ from app.services.workspace_service import WorkspaceService
+ ws = WorkspaceService.ensure_default_workspace()
+ proj = Project(workspace_id=ws.id, name='Appliance', slug='appliance')
+ db.session.add(proj)
+ db.session.commit()
+ env = Environment(project_id=proj.id, name='Production', slug='production', is_default=True)
+ db.session.add(env)
+ db.session.commit()
+ return proj
+
+
+def owner(app):
+ from app import db
+ from app.models import User
+ user = User.query.filter_by(username='testadmin').first()
+ if not user:
+ user = User(username='testadmin', email='[email protected]', role='admin')
+ if hasattr(user, 'set_password'):
+ user.set_password('admin')
+ db.session.add(user)
+ db.session.commit()
+ return user
+
+
[email protected](autouse=True)
+def _stub_side_effects(monkeypatch):
+ from app.services.docker_service import DockerService
+ monkeypatch.setattr(DockerService, 'create_volume',
+ classmethod(lambda cls, name, driver='local': {'success': True}))
+
+
+def runner_calls():
+ calls = []
+
+ def run(app, service, command, timeout):
+ calls.append({'service': service, 'command': command, 'timeout': timeout})
+ return {'success': True, 'output': 'generated'}
+
+ BootstrapService.set_runner(run)
+ yield calls
+ BootstrapService.set_runner(None)
+
+
+# -- normalizer -------------------------------------------------------------
+
+def test_disk_size_and_bootstrap_normalize():
+ n = ManifestSpecService.normalize(VOL_BOOT_MANIFEST)
+ svc = n['services'][0]
+ assert svc['disks'][0]['size'] == '2GB'
+ assert svc['bootstrap'] == {'command': '/opt/gen-config.sh', 'timeout_seconds': 60}
+
+
+def test_bootstrap_requires_command():
+ from app.services.manifest_spec_service import ManifestError
+ with pytest.raises(ManifestError):
+ ManifestSpecService.normalize({
+ 'version': 1,
+ 'services': [{'name': 'x', 'type': 'docker',
+ 'bootstrap': {'timeoutSeconds': 5}}],
+ })
+
+
+# -- generators -------------------------------------------------------------
+
+def test_generate_compose_mounts_declared_volumes():
+ compose = BuildpackService.generate_compose(
+ {'port': 3000}, 'app',
+ volumes=['serverkit-app-1-config:/config'],
+ named_volumes=['serverkit-app-1-config'])
+ assert 'serverkit-app-1-config:/config' in compose
+ assert 'volumes:' in compose
+
+
+def test_compose_fragment_consumed(project, owner):
+ from app import db
+ from app.models import Application
+ from app.services.volume_service import VolumeService
+ app_row = Application(name='frag', app_type='docker', user_id=owner.id,
+ project_id=project.id, status='stopped')
+ db.session.add(app_row)
+ db.session.commit()
+ VolumeService.create(app_row, 'data', '/var/data')
+ frag = VolumeService.compose_fragment(app_row)
+ assert any(spec.endswith(':/var/data') for spec in frag['service'])
+ assert frag['top_level'] # a top-level named volume is declared
+
+
+# -- apply ------------------------------------------------------------------
+
+def test_apply_persists_declared_size_and_backup_routing(project, owner, runner_calls):
+ from app.models import Application
+ from app.models.backup_policy import BackupPolicy
+ n = ManifestSpecService.normalize(VOL_BOOT_MANIFEST)
+ result = ManifestApplyService.apply(project, n, user_id=owner.id)
+ assert result['success'] is True, result
+
+ app_row = Application.query.filter_by(project_id=project.id, name='appliance').first()
+ vol = next(v for v in app_row.volumes if v.mount_path == '/config')
+ assert vol.declared_size == '2GB'
+
+ policy = BackupPolicy.query.filter_by(target_type='files', target_id=app_row.id).first()
+ assert policy is not None
+ meta = policy.get_target_meta()
+ assert meta.get('volume_mount') == '/config'
+ assert meta.get('app_id') == app_row.id
+
+ # bootstrap ran exactly once and is stamped
+ assert len(runner_calls) == 1
+ assert app_row.bootstrap_done is True
+
+ # idempotent: nothing left to do
+ plan2 = ManifestApplyService.plan(project, n)
+ assert plan2['step_count'] == 0, plan2['summary']
+
+
+def test_bootstrap_runs_only_once_across_applies(project, owner, runner_calls):
+ n = ManifestSpecService.normalize(VOL_BOOT_MANIFEST)
+ ManifestApplyService.apply(project, n, user_id=owner.id)
+ ManifestApplyService.apply(project, n, user_id=owner.id)
+ assert len(runner_calls) == 1 # second apply is a no-op for bootstrap
+
+
+def test_bootstrap_failure_fails_apply(project, owner):
+ def failing(app, service, command, timeout):
+ return {'success': False, 'error': 'cert generation blew up'}
+ BootstrapService.set_runner(failing)
+ try:
+ from app.models import Application
+ n = ManifestSpecService.normalize(VOL_BOOT_MANIFEST)
+ result = ManifestApplyService.apply(project, n, user_id=owner.id)
+ assert result['success'] is False
+ app_row = Application.query.filter_by(project_id=project.id, name='appliance').first()
+ assert app_row.bootstrap_done is False
+ assert any(r['status'] == 'error' and 'bootstrap' in (r.get('error') or '') or
+ r.get('type') == 'bootstrap' and r['status'] == 'error'
+ for r in result['results'])
+ finally:
+ BootstrapService.set_runner(None)
+
+
+# -- reset endpoint ---------------------------------------------------------
+
+def test_reset_bootstrap_endpoint(client, auth_headers, project, owner, runner_calls):
+ from app.models import Application
+ n = ManifestSpecService.normalize(VOL_BOOT_MANIFEST)
+ ManifestApplyService.apply(project, n, user_id=owner.id)
+ app_row = Application.query.filter_by(project_id=project.id, name='appliance').first()
+ assert app_row.bootstrap_done is True
+
+ # wrong confirm is refused
+ resp = client.post('/api/v1/manifests/bootstrap/reset', headers=auth_headers,
+ json={'app_id': app_row.id, 'confirm': 'nope'})
+ assert resp.status_code == 400
+
+ # correct confirm re-arms it
+ resp = client.post('/api/v1/manifests/bootstrap/reset', headers=auth_headers,
+ json={'app_id': app_row.id, 'confirm': 'appliance'})
+ assert resp.status_code == 200
+ from app import db
+ db.session.refresh(app_row)
+ assert app_row.bootstrap_done is False
+
+ # a fresh plan now schedules the bootstrap again
+ plan = ManifestApplyService.plan(project, n)
+ assert 'bootstrap' in [s['type'] for s in plan['steps']]
diff --git a/docs/SERVERKIT_YAML.md b/docs/SERVERKIT_YAML.md
index a09e5166..214999ce 100644
--- a/docs/SERVERKIT_YAML.md
+++ b/docs/SERVERKIT_YAML.md
@@ -178,11 +178,33 @@ disks:
backup: { schedule: daily, retain: 7 }
```
-`disks[]` become `AppVolume` rows; a `backup:` block becomes a `BackupPolicy` on
-the `files` target scoped to the mount path. `schedule` is one of
+`disks[]` become `AppVolume` rows; `size` is recorded as the volume's
+`declared_size` cap (not enforced by the local driver). A `backup:` block
+becomes a `BackupPolicy` on the `files` target that resolves the **live host
+mountpoint** of the named docker volume — so the backup captures the real bytes,
+not the empty in-container path. `schedule` is one of
`hourly` / `daily` / `weekly` / `monthly`; `retain` is the number of backups to
keep.
+## First-boot bootstrap
+
+Some appliances generate a config/certificate tree exactly once. A compose init
+container gets left behind; an entrypoint reruns every deploy. `bootstrap` runs
+the command **once**, via `docker compose run --rm`, after the volumes exist and
+before the first `up`:
+
+```yaml
+services:
+ - name: prosody
+ type: docker
+ bootstrap: { command: "/opt/bootstrap/generate-config.sh", timeoutSeconds: 120 }
+```
+
+Success flips `Application.bootstrap_done`, so it never re-runs; a failure is a
+visible, retryable apply-step error. To deliberately run it again (a fresh
+config generation), `POST /api/v1/manifests/bootstrap/reset` with the app name
+typed in `confirm`.
+
## Domains & SSL
```yaml
diff --git a/docs/serverkit-yaml.schema.json b/docs/serverkit-yaml.schema.json
index a60d0485..dd9112a3 100644
--- a/docs/serverkit-yaml.schema.json
+++ b/docs/serverkit-yaml.schema.json
@@ -78,6 +78,10 @@
"type": "array",
"items": { "$ref": "#/definitions/portDecl" }
},
+ "bootstrap": {
+ "description": "First-boot bootstrap (appliance tier). Runs once via `docker compose run --rm` after volumes exist and before the first up — for appliances that generate a config tree once.",
+ "$ref": "#/definitions/bootstrap"
+ },
"healthCheckPath": {
"description": "HTTP path used for health checks and the zero-downtime restart gate.",
"type": "string"
@@ -126,6 +130,23 @@
}
}
},
+ "bootstrap": {
+ "type": "object",
+ "required": ["command"],
+ "additionalProperties": true,
+ "properties": {
+ "command": {
+ "description": "Command run once inside a throwaway service container.",
+ "type": "string",
+ "minLength": 1
+ },
+ "timeoutSeconds": {
+ "description": "Max seconds the bootstrap may run before it is killed and the step fails.",
+ "type": "integer",
+ "minimum": 1
+ }
+ }
+ },
"portDecl": {
"type": "object",
"required": ["port"],