From d1076995a64153e1bfcbc26f8c39ddf62cb3bf34 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Wed, 1 Jul 2026 15:29:48 -0700 Subject: [PATCH] install.sh: create programs/ + deployments/ and seed a default castle.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- README.md | 7 +------ install.sh | 13 ++++++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7f8ed0c..50be11b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/install.sh b/install.sh index e7a774a..529c5c2 100755 --- a/install.sh +++ b/install.sh @@ -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" - log_ok + # 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 } # ---------------------------------------------------------------------------