diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4de293a..ffdbd06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: stage="rigforge-$TAG" mkdir -p "$stage" # Runtime files a user needs to deploy a worker — no tests/, .github/, or dev cruft. - cp -a rigforge.sh util systemd config.json.template config.advanced.example.json README.md docs images LICENSE VERSION "$stage/" + cp -a rigforge.sh util systemd config.minimal.json config.reference.json README.md docs images LICENSE VERSION "$stage/" zip -rq "$stage.zip" "$stage" tar -czf "$stage.tar.gz" "$stage" sha256sum "$stage.zip" "$stage.tar.gz" > SHA256SUMS diff --git a/.gitignore b/.gitignore index e2d1f9c..5816397 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# User-generated config (created from config.json.template) +# User-generated config (created from config.minimal.json) config.json # Runtime artifacts diff --git a/RELEASING.md b/RELEASING.md index 448fd0c..4f44d79 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -69,8 +69,8 @@ Pushing the tag triggers the release pipeline ([`.github/workflows/release.yml`](./.github/workflows/release.yml)), which: - verifies the tag matches `VERSION` (the build fails otherwise), -- packages the deploy bundle (`rigforge.sh`, `util/`, `systemd/`, `config.json.template`, - `config.advanced.example.json`, `README.md`, `docs/`, `images/`, `LICENSE`, `VERSION`) as +- packages the deploy bundle (`rigforge.sh`, `util/`, `systemd/`, `config.minimal.json`, + `config.reference.json`, `README.md`, `docs/`, `images/`, `LICENSE`, `VERSION`) as `rigforge-vX.Y.Z.zip` and `.tar.gz` (`tests/`, `.github/`, and other dev files are excluded), - generates `SHA256SUMS` for the artifacts, - pulls that version's section from [`CHANGELOG.md`](./CHANGELOG.md) as the release notes, diff --git a/config.json.template b/config.minimal.json similarity index 100% rename from config.json.template rename to config.minimal.json diff --git a/config.advanced.example.json b/config.reference.json similarity index 100% rename from config.advanced.example.json rename to config.reference.json diff --git a/docs/configuration.md b/docs/configuration.md index 63ce4ad..e647218 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -5,7 +5,7 @@ rest (CPU profile, thread count, HugePage sizing) is detected and applied for yo On first run, if there's no `config.json`, `setup` creates a minimal one interactively (it asks for your pool URL). You can also pre-create one from -[`config.json.template`](../config.json.template). +[`config.minimal.json`](../config.minimal.json). Setup validates every field when it parses the config. A malformed pool URL, an out-of-range port, a bad hostname, a non-boolean flag, or an unsafe `HOME_DIR` stops setup with a message rather than @@ -34,7 +34,7 @@ proxy listens on `3333`). The interactive first-run setup writes exactly this mi > [Connecting to a public pool](#connecting-to-a-public-pool-supportxmr-etc) for a copy-paste example. > Two-tier config (like Pithead): keep `config.json` minimal and add only the keys you want to change. -> [`config.advanced.example.json`](../config.advanced.example.json) lists every key with its default. +> [`config.reference.json`](../config.reference.json) lists every key with its default. > Copy in what you need; anything you omit keeps the default. The reference table below documents each > key. diff --git a/rigforge.sh b/rigforge.sh index 610b510..664ee82 100755 --- a/rigforge.sh +++ b/rigforge.sh @@ -229,7 +229,7 @@ ensure_config_exists() { log "Starting interactive setup..." # We only need the pool URL — every other key has a sensible default (see - # config.advanced.example.json for the full list). The URL is host:port (Pithead's proxy + # config.reference.json for the full list). The URL is host:port (Pithead's proxy # listens on 3333). read -r -p "Enter your pool URL (host:port, e.g. your-stack:3333): " IN_URL || true diff --git a/tests/e2e/macos.sh b/tests/e2e/macos.sh index fe3b5bf..347f9c1 100755 --- a/tests/e2e/macos.sh +++ b/tests/e2e/macos.sh @@ -46,7 +46,7 @@ trap cleanup EXIT mkdir -p "$HOME" # Writable copy of just the deploy bits (not .git / the suite / build artifacts). -(cd "$SRC" && cp -a rigforge.sh util systemd config.json.template config.advanced.example.json VERSION "$WORK"/) 2>/dev/null +(cd "$SRC" && cp -a rigforge.sh util systemd config.minimal.json config.reference.json VERSION "$WORK"/) 2>/dev/null cd "$WORK" || { echo "cannot enter $WORK" exit 1 diff --git a/tests/run.sh b/tests/run.sh index 576dc9c..7ecc680 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -3010,8 +3010,8 @@ if [[ "$ver" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-+.].*)?$ ]]; then ok "VERSION is SemVe # #23: the advanced example must be valid JSON and must document every config.json key parse_config # reads — so the reference can't silently drift from the code. -echo "== unit: config.advanced.example.json (#23) ==" -ADV="$ROOT/config.advanced.example.json" +echo "== unit: config.reference.json (#23) ==" +ADV="$ROOT/config.reference.json" if jq -e . "$ADV" >/dev/null 2>&1; then ok "advanced example is valid JSON"; else bad "advanced example is valid JSON" "jq parse failed"; fi # The advanced example documents exactly the user-facing keys. The rig label lives in pools[].user and # the template is internal, so WORKER_NAME / WORKER_CONFIG_FILE / POOL_HOST must NOT appear. @@ -3022,13 +3022,13 @@ for k in POOL_HOST WORKER_NAME WORKER_CONFIG_FILE; do assert_absent "advanced example has no $k key" "$(cat "$ADV")" "\"$k\"" done -# config.json.template is the copy-me starter (referenced by the docs and shipped in the release bundle). +# config.minimal.json is the copy-me starter (referenced by the docs and shipped in the release bundle). # It must be valid JSON, carry an obvious unreplaced placeholder, and be REJECTED by parse_config unedited # — so a user can't accidentally deploy the template and mine to a bogus host. (It can drift unnoticed -# otherwise: unlike config.advanced.example.json, nothing else validates it.) -echo "== unit: config.json.template (starter) ==" -TPL="$ROOT/config.json.template" -if jq -e . "$TPL" >/dev/null 2>&1; then ok "config.json.template is valid JSON"; else bad "config.json.template is valid JSON" "jq parse failed"; fi +# otherwise: unlike config.reference.json, nothing else validates it.) +echo "== unit: config.minimal.json (starter) ==" +TPL="$ROOT/config.minimal.json" +if jq -e . "$TPL" >/dev/null 2>&1; then ok "config.minimal.json is valid JSON"; else bad "config.minimal.json is valid JSON" "jq parse failed"; fi assert_contains "template carries an unreplaced pool placeholder" "$(jq -r '.pools[0].url' "$TPL")" "" TT="$(mktemp -d "$SANDBOX/tpl.XXXXXX")" cp "$TPL" "$TT/config.json"