Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# User-generated config (created from config.json.template)
# User-generated config (created from config.minimal.json)
config.json

# Runtime artifacts
Expand Down
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion rigforge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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")" "<YOUR_POOL_HOST>"
TT="$(mktemp -d "$SANDBOX/tpl.XXXXXX")"
cp "$TPL" "$TT/config.json"
Expand Down