From 3b82c1f7c0b3a38b47c710b852fd05c6de51e845 Mon Sep 17 00:00:00 2001 From: shoemoney Date: Fri, 27 Nov 2026 19:42:16 -0600 Subject: [PATCH] docs: correct read-only setup and pin release installer downloads --- README.md | 2 +- scripts/release.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fbcbf57..65e3139 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ For a subdirectory or read-only checkout: ```bash devbox mount projects/my-app ~/work/my-app -devbox mount projects ~/mirror --readonly +devbox mount projects ~/mirror --ro ``` Run `devbox doctor` if the connection fails. Check that the hub is running, the diff --git a/scripts/release.sh b/scripts/release.sh index 31f1770..0450bad 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -13,6 +13,7 @@ DIST_BRANCH="${DIST_BRANCH:-main}" TOKEN="${FORGEJO_TOKEN:-$(cat ~/.config/forgejo/token 2>/dev/null || true)}" [ -n "$TOKEN" ] || { echo 'No Forgejo token configured' >&2; exit 1; } [[ "$TAG" =~ ^(latest|v[0-9]+\.[0-9]+\.[0-9]+)$ ]] || { echo 'Expected latest or vMAJOR.MINOR.PATCH' >&2; exit 1; } +hashes() { if command -v sha256sum >/dev/null 2>&1; then sha256sum "$@"; else shasum -a 256 "$@"; fi; } auth=(-H "Authorization: token $TOKEN") api() { curl --retry 2 --retry-delay 1 -fsSL "${auth[@]}" "$@"; } COMMIT=$(git rev-parse HEAD) @@ -25,7 +26,7 @@ fi [ "$(sed -n '1p' dist/BUILD_INFO)" = "$COMMIT" ] || { echo 'Build source revision does not match HEAD' >&2; exit 1; } BUILD_VERSION=$(sed -n '2p' dist/BUILD_INFO) [ "$TAG" = latest ] || [ "$BUILD_VERSION" = "$TAG" ] || { echo 'Build version does not match release tag' >&2; exit 1; } -(cd dist && sha256sum -c SHA256SUMS) +(cd dist && hashes -c SHA256SUMS) # Prepare the exact names downloaded by install.sh and checksum the installers too. STAGE=dist/release-assets @@ -39,7 +40,7 @@ for bin in devbox devbox-hub; do done done cp install.sh install.ps1 "$STAGE/" -(cd "$STAGE" && sha256sum devbox_* devbox-hub_* install.sh install.ps1 > SHA256SUMS) +(cd "$STAGE" && hashes devbox_* devbox-hub_* install.sh install.ps1 > SHA256SUMS) # Read errors fail the release; a 404 alone means the tag has no release. old_json=$(mktemp) @@ -56,7 +57,7 @@ if [ -n "$old_id" ] && [ "$TAG" != latest ]; then fi upload_tag="$TAG" [ "$TAG" != latest ] || upload_tag="latest-staging-${COMMIT:0:12}-$(date +%s)" -body=$(printf 'devbox %s — built from source `%s`, binary version `%s`.\n\nBuilt-in Tailscale in the hub: `devbox-hub serve --data ./hub-data --tailscale`. No separate Tailscale installation is required on the hub. Authenticate using the logged login URL or TS_AUTHKEY; identity persists under /tailscale. Clients use the regular Tailscale app. Existing HTTP/HTTPS deployments remain supported.\n\nInstall: `curl -fsSL https://git.shoemoney.ai/%s/releases/download/%s/install.sh | sh`\n\nAssets include 12 binaries, both installers, and SHA256SUMS. Building from source requires Go 1.27.4+.' "$TAG" "$COMMIT" "$BUILD_VERSION" "$REPO" "$TAG") +body=$(printf 'devbox %s — built from source `%s`, binary version `%s`.\n\nBuilt-in Tailscale in the hub: `devbox-hub serve --data ./hub-data --tailscale`. No separate Tailscale installation is required on the hub. Authenticate using the logged login URL or TS_AUTHKEY; identity persists under /tailscale. Clients use the regular Tailscale app. Existing HTTP/HTTPS deployments remain supported.\n\nInstall: `curl -fsSL https://git.shoemoney.ai/%s/releases/download/%s/install.sh -o install.sh && sh install.sh --release-url https://git.shoemoney.ai/%s/releases/download/%s`\n\nAssets include 12 binaries, both installers, and SHA256SUMS. Building from source requires Go 1.27.4+.' "$TAG" "$COMMIT" "$BUILD_VERSION" "$REPO" "$TAG" "$REPO" "$TAG") rel_id=$(api -X POST "$API/repos/$REPO/releases" -H 'Content-Type: application/json' \ -d "$(python3 -c 'import json,sys;print(json.dumps(dict(tag_name=sys.argv[1],target_commitish=sys.argv[2],name=sys.argv[3],body=sys.argv[4],draft=True,prerelease=False)))' "$upload_tag" "$DIST_BRANCH" "$TAG" "$body")" \ | python3 -c 'import json,sys;print(json.load(sys.stdin)["id"])')