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:
@@ -105,13 +105,9 @@ block set, a sensible default set (`claude`, `opencode`, `amplifier`, …) is of
|
|||||||
# Install the CLI (editable, onto your PATH)
|
# Install the CLI (editable, onto your PATH)
|
||||||
uv tool install --editable cli/
|
uv tool install --editable cli/
|
||||||
|
|
||||||
# Bootstrap infrastructure (Docker, Caddy, directories, containers)
|
# Bootstrap infrastructure + the ~/.castle tree and a default castle.yaml
|
||||||
./install.sh
|
./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 list # what's registered
|
||||||
castle deploy && castle start # apply config to the runtime, then bring it up
|
castle deploy && castle start # apply config to the runtime, then bring it up
|
||||||
open http://localhost:9000 # the dashboard
|
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/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)
|
- [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)
|
- [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
|
|
||||||
|
|||||||
11
install.sh
11
install.sh
@@ -214,14 +214,21 @@ ensure_caddy_dns_plugin() {
|
|||||||
create_directories() {
|
create_directories() {
|
||||||
log_step "Creating directory structure"
|
log_step "Creating directory structure"
|
||||||
|
|
||||||
# ~/.castle tree
|
# ~/.castle tree — globals (castle.yaml) plus one file per program/deployment.
|
||||||
mkdir -p "${CASTLE_HOME}/code"
|
mkdir -p "${CASTLE_HOME}/programs"
|
||||||
|
mkdir -p "${CASTLE_HOME}/deployments"
|
||||||
mkdir -p "${CASTLE_HOME}/artifacts/specs"
|
mkdir -p "${CASTLE_HOME}/artifacts/specs"
|
||||||
mkdir -p "${CASTLE_HOME}/artifacts/content"
|
mkdir -p "${CASTLE_HOME}/artifacts/content"
|
||||||
mkdir -p "${DATA_DIR}"
|
mkdir -p "${DATA_DIR}"
|
||||||
mkdir -p "${CASTLE_HOME}/secrets" && chmod 700 "${CASTLE_HOME}/secrets"
|
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
|
log_ok
|
||||||
|
else
|
||||||
|
printf 'gateway:\n port: 9000\n' > "${CASTLE_HOME}/castle.yaml"
|
||||||
|
log_ok "seeded ~/.castle/castle.yaml"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user