install.sh: create programs/ + deployments/ and seed a default castle.yaml

Moves the ~/.castle/{programs,deployments} dir creation and the minimal
castle.yaml (gateway.port: 9000) into install.sh's create_directories — seeded
only when absent, never clobbering an existing config. Drops the stale 'code/'
dir (program source lives in /data/repos now). README quick-start no longer
does the manual mkdir/printf; install.sh handles it.
This commit is contained in:
2026-07-01 15:29:48 -07:00
parent 06b301550a
commit d1076995a6
2 changed files with 11 additions and 9 deletions

View File

@@ -105,13 +105,9 @@ block set, a sensible default set (`claude`, `opencode`, `amplifier`, …) is of
# Install the CLI (editable, onto your PATH)
uv tool install --editable cli/
# Bootstrap infrastructure (Docker, Caddy, directories, containers)
# Bootstrap infrastructure + the ~/.castle tree and a default castle.yaml
./install.sh
# Minimal global config
mkdir -p ~/.castle/programs ~/.castle/deployments
printf 'gateway:\n port: 9000\n' > ~/.castle/castle.yaml
castle list # what's registered
castle deploy && castle start # apply config to the runtime, then bring it up
open http://localhost:9000 # the dashboard
@@ -263,4 +259,3 @@ and `CASTLE_API_MDNS_ENABLED`.
- [docs/dns-and-tls.md](docs/dns-and-tls.md) — gateway routing, DNS, the `off` / `acme` TLS modes
- [docs/stacks/](docs/stacks/) — per-stack guides (python-fastapi, python-cli, react-vite, supabase)
- [AGENTS.md](AGENTS.md) — the canonical, assistant-agnostic operator guide (recipes, gateway, tunnel, mesh)
- [CLAUDE.md](CLAUDE.md) — notes for developing Castle's own code, and the full API reference

View File

@@ -214,14 +214,21 @@ ensure_caddy_dns_plugin() {
create_directories() {
log_step "Creating directory structure"
# ~/.castle tree
mkdir -p "${CASTLE_HOME}/code"
# ~/.castle tree — globals (castle.yaml) plus one file per program/deployment.
mkdir -p "${CASTLE_HOME}/programs"
mkdir -p "${CASTLE_HOME}/deployments"
mkdir -p "${CASTLE_HOME}/artifacts/specs"
mkdir -p "${CASTLE_HOME}/artifacts/content"
mkdir -p "${DATA_DIR}"
mkdir -p "${CASTLE_HOME}/secrets" && chmod 700 "${CASTLE_HOME}/secrets"
# Seed a minimal global castle.yaml — never clobber an existing one.
if [[ -f "${CASTLE_HOME}/castle.yaml" ]]; then
log_ok
else
printf 'gateway:\n port: 9000\n' > "${CASTLE_HOME}/castle.yaml"
log_ok "seeded ~/.castle/castle.yaml"
fi
}
# ---------------------------------------------------------------------------