2 Commits

Author SHA1 Message Date
Joshua King c6d812cca2 ci: rename rolling release tag dev -> dev-latest
Build (Dev) / build (push) Successful in 11s
CI / quality (push) Successful in 12s
CI / quality (pull_request) Failing after 0s
A release tag named "dev" collides with the dev branch, making refs
ambiguous ("refname 'dev' is ambiguous") and breaking git push/checkout.
Publish the rolling build to tag "dev-latest" instead; pi-update.sh pulls
from there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 11:48:15 -04:00
Joshua King d2222d4947 setup-pi: default service user to invoking sudo user, not "pi"
The service unit hard-defaulted to User=pi, but not every Pi has a 'pi'
user (e.g. this hub uses 'overseer') — systemd then fails with 217/USER.
Default SERVICE_USER to ${SUDO_USER:-pi} so the service + /opt/remoterig
ownership match the actual operator. Override with --service-user.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 11:47:09 -04:00
3 changed files with 11 additions and 8 deletions
+8 -5
View File
@@ -9,6 +9,9 @@ import { createHash } from 'node:crypto';
const { TOKEN, SERVER, REPO, SHA } = process.env; const { TOKEN, SERVER, REPO, SHA } = process.env;
const BIN = 'remoterig'; const BIN = 'remoterig';
// Rolling release tag. NOT "dev" — that would collide with the dev branch
// and make refs ambiguous (git push/checkout dev breaks).
const TAG = 'dev-latest';
const VERSION = SHA.slice(0, 8); const VERSION = SHA.slice(0, 8);
const API = `${SERVER}/api/v1/repos/${REPO}`; const API = `${SERVER}/api/v1/repos/${REPO}`;
const H = { Authorization: `token ${TOKEN}` }; const H = { Authorization: `token ${TOKEN}` };
@@ -27,21 +30,21 @@ const files = {
'version.txt': Buffer.from(VERSION + '\n'), 'version.txt': Buffer.from(VERSION + '\n'),
}; };
// Roll the "dev" release forward to this commit: delete the old release + tag. // Roll the release forward to this commit: delete the old release + tag.
const existing = await fetch(`${API}/releases/tags/dev`, { headers: H }); const existing = await fetch(`${API}/releases/tags/${TAG}`, { headers: H });
if (existing.ok) { if (existing.ok) {
const rel = await existing.json(); const rel = await existing.json();
await fetch(`${API}/releases/${rel.id}`, { method: 'DELETE', headers: H }); await fetch(`${API}/releases/${rel.id}`, { method: 'DELETE', headers: H });
} }
await fetch(`${API}/tags/dev`, { method: 'DELETE', headers: H }); // ignore if absent await fetch(`${API}/tags/${TAG}`, { method: 'DELETE', headers: H }); // ignore if absent
const rel = await ok(await fetch(`${API}/releases`, { const rel = await ok(await fetch(`${API}/releases`, {
method: 'POST', method: 'POST',
headers: { ...H, 'Content-Type': 'application/json' }, headers: { ...H, 'Content-Type': 'application/json' },
body: JSON.stringify({ body: JSON.stringify({
tag_name: 'dev', tag_name: TAG,
target_commitish: SHA, target_commitish: SHA,
name: `dev (${VERSION})`, name: `${TAG} (${VERSION})`,
body: `Rolling dev build ${SHA}`, body: `Rolling dev build ${SHA}`,
prerelease: true, prerelease: true,
}), }),
+1 -1
View File
@@ -24,7 +24,7 @@ REPO="${REPO:-CubeCraft-Creations/remote-rig}"
DEPLOY_DIR="/opt/remoterig" DEPLOY_DIR="/opt/remoterig"
DEPLOY_PATH="${DEPLOY_PATH:-$DEPLOY_DIR/remoterig}" DEPLOY_PATH="${DEPLOY_PATH:-$DEPLOY_DIR/remoterig}"
SERVICE="${SERVICE:-remoterig}" SERVICE="${SERVICE:-remoterig}"
TAG="dev" TAG="dev-latest"
DL="$GITEA_BASE/$REPO/releases/download/$TAG" DL="$GITEA_BASE/$REPO/releases/download/$TAG"
VERSION_FILE="$DEPLOY_DIR/VERSION" VERSION_FILE="$DEPLOY_DIR/VERSION"
+2 -2
View File
@@ -8,7 +8,7 @@
# #
# Options: # Options:
# --config PATH Path to config.yaml template to copy to /opt/remoterig/ # --config PATH Path to config.yaml template to copy to /opt/remoterig/
# --service-user USER Systemd service user (default: pi) # --service-user USER Systemd service user (default: invoking sudo user, else pi)
# --static-ip IP Static IP for wlan0 (default: 192.168.8.56/24) # --static-ip IP Static IP for wlan0 (default: 192.168.8.56/24)
# --gateway IP Gateway for wlan0 (default: 192.168.8.1) # --gateway IP Gateway for wlan0 (default: 192.168.8.1)
# --help Show this help # --help Show this help
@@ -19,7 +19,7 @@ set -euo pipefail
# Defaults # Defaults
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
CONFIG_TEMPLATE="" CONFIG_TEMPLATE=""
SERVICE_USER="pi" SERVICE_USER="${SUDO_USER:-pi}" # default to the invoking user (not every Pi has a 'pi' user)
STATIC_IP="192.168.8.56/24" STATIC_IP="192.168.8.56/24"
GATEWAY="192.168.8.1" GATEWAY="192.168.8.1"
MOSQUITTO_PKG="mosquitto mosquitto-clients" MOSQUITTO_PKG="mosquitto mosquitto-clients"