Compare commits
11 Commits
ea8fe22969
..
v0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 21bfdce27a | |||
| d3288e29eb | |||
| baf7a4a99d | |||
| 885b410e48 | |||
| a1f3103a76 | |||
| 0fd66b261a | |||
| dfc5a07c10 | |||
| 5aabd7a791 | |||
| 0e9b9f5d82 | |||
| 642c5f4f70 | |||
| cb9f4d4979 |
@@ -92,6 +92,8 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: apps/server/Dockerfile
|
file: apps/server/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
|
build-args: |
|
||||||
|
BUILD_VERSION=${{ steps.meta.outputs.branch }}-${{ steps.meta.outputs.sha }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY }}/parking-server:${{ steps.meta.outputs.branch }}
|
${{ env.REGISTRY }}/parking-server:${{ steps.meta.outputs.branch }}
|
||||||
${{ env.REGISTRY }}/parking-server:${{ steps.meta.outputs.branch }}-${{ steps.meta.outputs.sha }}
|
${{ env.REGISTRY }}/parking-server:${{ steps.meta.outputs.branch }}-${{ steps.meta.outputs.sha }}
|
||||||
|
|||||||
+114
-12
@@ -1,12 +1,24 @@
|
|||||||
name: Release desktop
|
name: Release desktop
|
||||||
|
|
||||||
# Build the signed Tauri desktop installers on a version tag and publish them as
|
# Build the signed Tauri desktop installers on a version tag and publish them as
|
||||||
# a Gitea Release. The Tauri auto-updater (apps/web/src/lib/desktop-updater.ts)
|
# a Gitea Release — TWICE: once on this (private, source) repo for our own
|
||||||
# fetches these; latest.json + each installer + its .sig are what it needs.
|
# records/history, and once mirrored to mca/public_releases, which is what the
|
||||||
|
# Tauri auto-updater (apps/web/src/lib/desktop-updater.ts) actually points at.
|
||||||
|
#
|
||||||
|
# WHY a separate public repo: the updater runs on offline-first field appliances
|
||||||
|
# with no Gitea credentials, so its endpoint + installer downloads must be
|
||||||
|
# reachable unauthenticated. Mirroring compiled installers to a public
|
||||||
|
# releases-only repo avoids embedding any read token in the shipped app (which
|
||||||
|
# would leak the moment a booth PC is compromised — this box's threat model
|
||||||
|
# names the operator/booth as the primary adversary, see CLAUDE.md). Source
|
||||||
|
# stays private; only signed installers become public, same as most desktop
|
||||||
|
# software. mca/public_releases is shared across apps in the org, not
|
||||||
|
# parking-specific — namespace release tags/asset names accordingly if another
|
||||||
|
# app starts publishing there too.
|
||||||
#
|
#
|
||||||
# Trigger: push a tag like v0.1.0. The job builds .deb/.rpm/.AppImage, signs them
|
# Trigger: push a tag like v0.1.0. The job builds .deb/.rpm/.AppImage, signs them
|
||||||
# with the updater key (Gitea secrets), assembles latest.json, and uploads
|
# with the updater key (Gitea secrets), assembles latest.json pointing at the
|
||||||
# everything to the Release for that tag.
|
# MIRROR repo's asset URLs, uploads to both repos, and mirrors the same assets.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -73,30 +85,41 @@ jobs:
|
|||||||
|
|
||||||
- name: Collect artifacts
|
- name: Collect artifacts
|
||||||
id: collect
|
id: collect
|
||||||
# Gather the installers + their .sig into a flat dist/ for upload.
|
# Gather the installers + their .sig into a flat dist/ for upload, spaces
|
||||||
|
# stripped from filenames. productName is "Parking System" (a space), so
|
||||||
|
# Tauri's bundle output is e.g. "Parking System_0.1.0_amd64.deb" — an
|
||||||
|
# unescaped space in a filename breaks the later curl asset-upload URL
|
||||||
|
# ("URL rejected: Malformed input to a URL function", hit on the very
|
||||||
|
# first v0.1.0 release) AND would land in latest.json's asset url, which
|
||||||
|
# the updater's plain HTTP GET can't handle either. Rename on copy.
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
BUNDLE=apps/desktop/src-tauri/target/release/bundle
|
BUNDLE=apps/desktop/src-tauri/target/release/bundle
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
find "$BUNDLE" \( -name '*.AppImage' -o -name '*.deb' -o -name '*.rpm' \
|
find "$BUNDLE" \( -name '*.AppImage' -o -name '*.deb' -o -name '*.rpm' \
|
||||||
-o -name '*.AppImage.sig' -o -name '*.deb.sig' -o -name '*.rpm.sig' \) \
|
-o -name '*.AppImage.sig' -o -name '*.deb.sig' -o -name '*.rpm.sig' \) \
|
||||||
-exec cp {} dist/ \;
|
-print0 | while IFS= read -r -d '' f; do
|
||||||
|
name=$(basename "$f" | tr ' ' '-')
|
||||||
|
cp "$f" "dist/${name}"
|
||||||
|
done
|
||||||
echo "Artifacts:"; ls -la dist/
|
echo "Artifacts:"; ls -la dist/
|
||||||
|
|
||||||
- name: Assemble latest.json
|
- name: Assemble latest.json
|
||||||
# The Tauri updater fetches a manifest describing the newest version, its
|
# The Tauri updater fetches a manifest describing the newest version, its
|
||||||
# notes, and per-target {signature, url}. We point the AppImage target at
|
# notes, and per-target {signature, url}. The URL points at the MIRROR
|
||||||
# this release's asset URL. Adjust the platform keys you actually ship.
|
# repo (mca/public_releases) — that's the unauthenticated endpoint field
|
||||||
|
# appliances actually reach; see the workflow header for why. Adjust the
|
||||||
|
# platform keys you actually ship.
|
||||||
env:
|
env:
|
||||||
SERVER_URL: ${{ github.server_url }}
|
SERVER_URL: ${{ github.server_url }}
|
||||||
REPO: ${{ github.repository }}
|
MIRROR_REPO: mca/public_releases
|
||||||
TAG: ${{ github.ref_name }}
|
TAG: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
VERSION="${TAG#v}"
|
VERSION="${TAG#v}"
|
||||||
APPIMAGE=$(cd dist && ls *.AppImage | head -1)
|
APPIMAGE=$(cd dist && ls *.AppImage | head -1)
|
||||||
SIG=$(cat "dist/${APPIMAGE}.sig")
|
SIG=$(cat "dist/${APPIMAGE}.sig")
|
||||||
ASSET_URL="${SERVER_URL}/${REPO}/releases/download/${TAG}/${APPIMAGE}"
|
ASSET_URL="${SERVER_URL}/${MIRROR_REPO}/releases/download/desktop-latest/${APPIMAGE}"
|
||||||
cat > dist/latest.json <<JSON
|
cat > dist/latest.json <<JSON
|
||||||
{
|
{
|
||||||
"version": "${VERSION}",
|
"version": "${VERSION}",
|
||||||
@@ -129,12 +152,12 @@ jobs:
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"draft\":false,\"prerelease\":false}" \
|
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"draft\":false,\"prerelease\":false}" \
|
||||||
"${API}/repos/${REPO}/releases" || true)
|
"${API}/repos/${REPO}/releases" || true)
|
||||||
REL_ID=$(printf '%s' "$REL" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
REL_ID=$(printf '%s' "$REL" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2 || true)
|
||||||
if [ -z "$REL_ID" ]; then
|
if [ -z "$REL_ID" ]; then
|
||||||
# Release may already exist for this tag — look it up by tag.
|
# Release may already exist for this tag — look it up by tag.
|
||||||
REL_ID=$(curl -sS -H "Authorization: token ${TOKEN}" \
|
REL_ID=$(curl -sS -H "Authorization: token ${TOKEN}" \
|
||||||
"${API}/repos/${REPO}/releases/tags/${TAG}" \
|
"${API}/repos/${REPO}/releases/tags/${TAG}" \
|
||||||
| grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
| grep -o '"id":[0-9]*' | head -1 | cut -d: -f2 || true)
|
||||||
fi
|
fi
|
||||||
echo "release id: ${REL_ID}"
|
echo "release id: ${REL_ID}"
|
||||||
for f in dist/*; do
|
for f in dist/*; do
|
||||||
@@ -147,3 +170,82 @@ jobs:
|
|||||||
"${API}/repos/${REPO}/releases/${REL_ID}/assets?name=${name}" >/dev/null
|
"${API}/repos/${REPO}/releases/${REL_ID}/assets?name=${name}" >/dev/null
|
||||||
done
|
done
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
|
- name: Mirror release to mca/public_releases (Gitea API)
|
||||||
|
# This is the release the updater and any human downloader actually use —
|
||||||
|
# public_releases has no source, only installers, so it can be public
|
||||||
|
# without exposing this repo. RELEASES_MIRROR_TOKEN is a write:repository
|
||||||
|
# token scoped for pushing releases into that repo (Gitea's org secrets,
|
||||||
|
# not exposed to any deployed client).
|
||||||
|
#
|
||||||
|
# Publishes to TWO tags there, since public_releases is shared across
|
||||||
|
# apps in the org and Gitea's "latest release" redirect resolves by
|
||||||
|
# newest tag on the WHOLE repo (would break the moment another app
|
||||||
|
# publishes something newer):
|
||||||
|
# - desktop-<TAG> versioned, permanent — audit trail / rollback.
|
||||||
|
# - desktop-latest moving — assets deleted + re-uploaded each release.
|
||||||
|
# This is the fixed URL tauri.conf.json's updater endpoint points at
|
||||||
|
# (a stable name every appliance can always resolve, regardless of
|
||||||
|
# what else gets released in this repo meanwhile).
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.RELEASES_MIRROR_TOKEN }}
|
||||||
|
API: ${{ github.api_url }}
|
||||||
|
MIRROR_REPO: mca/public_releases
|
||||||
|
TAG: ${{ github.ref_name }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
create_or_get_release() {
|
||||||
|
local mirror_tag="$1" prerelease="$2"
|
||||||
|
REL=$(curl -sS -w '\n%{http_code}' -X POST \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"${mirror_tag}\",\"name\":\"Parking System ${TAG}\",\"draft\":false,\"prerelease\":${prerelease}}" \
|
||||||
|
"${API}/repos/${MIRROR_REPO}/releases" || true)
|
||||||
|
echo "create response (${mirror_tag}): ${REL}"
|
||||||
|
REL_ID=$(printf '%s' "$REL" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2 || true)
|
||||||
|
if [ -z "$REL_ID" ]; then
|
||||||
|
LOOKUP=$(curl -sS -w '\n%{http_code}' -H "Authorization: token ${TOKEN}" \
|
||||||
|
"${API}/repos/${MIRROR_REPO}/releases/tags/${mirror_tag}")
|
||||||
|
echo "tag lookup response (${mirror_tag}): ${LOOKUP}"
|
||||||
|
REL_ID=$(printf '%s' "$LOOKUP" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2 || true)
|
||||||
|
fi
|
||||||
|
if [ -z "$REL_ID" ]; then
|
||||||
|
echo "::error::could not create or find release for tag ${mirror_tag} on ${MIRROR_REPO} — see responses above"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
upload_assets() {
|
||||||
|
local rel_id="$1"
|
||||||
|
for f in dist/*; do
|
||||||
|
name=$(basename "$f")
|
||||||
|
echo "mirroring ${name} -> release ${rel_id}"
|
||||||
|
HTTP_CODE=$(curl -sS -o /tmp/upload_resp.json -w '%{http_code}' -X POST \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary @"${f}" \
|
||||||
|
"${API}/repos/${MIRROR_REPO}/releases/${rel_id}/assets?name=${name}")
|
||||||
|
if [ "$HTTP_CODE" -ge 300 ]; then
|
||||||
|
echo "::error::upload of ${name} failed (HTTP ${HTTP_CODE}): $(cat /tmp/upload_resp.json)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# 1. Versioned, permanent.
|
||||||
|
create_or_get_release "desktop-${TAG}" false
|
||||||
|
echo "versioned mirror release id: ${REL_ID}"
|
||||||
|
upload_assets "${REL_ID}"
|
||||||
|
|
||||||
|
# 2. Moving desktop-latest — delete existing assets first (re-upload
|
||||||
|
# with the same name 409s otherwise), then re-upload.
|
||||||
|
create_or_get_release "desktop-latest" false
|
||||||
|
LATEST_REL_ID="${REL_ID}"
|
||||||
|
echo "latest mirror release id: ${LATEST_REL_ID}"
|
||||||
|
EXISTING=$(curl -sS -H "Authorization: token ${TOKEN}" \
|
||||||
|
"${API}/repos/${MIRROR_REPO}/releases/${LATEST_REL_ID}/assets")
|
||||||
|
printf '%s' "$EXISTING" | grep -o '"id":[0-9]*' | cut -d: -f2 | while read -r asset_id; do
|
||||||
|
curl -sS -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||||
|
"${API}/repos/${MIRROR_REPO}/releases/${LATEST_REL_ID}/assets/${asset_id}" >/dev/null
|
||||||
|
done || true
|
||||||
|
upload_assets "${LATEST_REL_ID}"
|
||||||
|
echo "done"
|
||||||
|
|||||||
+2
-1
@@ -26,4 +26,5 @@ dist/
|
|||||||
|
|
||||||
# Graphify knowledge-graph output (dev tool; generated, not committed)
|
# Graphify knowledge-graph output (dev tool; generated, not committed)
|
||||||
graphify-out/
|
graphify-out/
|
||||||
parking.sqlite*.bak-*
|
parking.sqlite*.bak-*
|
||||||
|
questions.txt
|
||||||
|
|||||||
+11
-3
@@ -35,8 +35,16 @@ pnpm --filter @parking/desktop bundle # build the SPA + bundle the desktop app
|
|||||||
Requires the Rust toolchain and (on Linux) WebKitGTK 4.1 + libsoup-3 dev libraries. Under WSL2 the
|
Requires the Rust toolchain and (on Linux) WebKitGTK 4.1 + libsoup-3 dev libraries. Under WSL2 the
|
||||||
window needs a display (WSLg or an X server).
|
window needs a display (WSLg or an X server).
|
||||||
|
|
||||||
|
## Auto-update
|
||||||
|
|
||||||
|
Signed updates are built and published by `.gitea/workflows/release.yml` on a `vX.Y.Z` tag, mirrored
|
||||||
|
to the public `mca/public_releases` repo (this repo is private; the updater runs on offline-first
|
||||||
|
field appliances with no Gitea credentials, so its endpoint must be reachable unauthenticated —
|
||||||
|
see that workflow's header and `wiki/decisions/desktop-shell-tauri.md`). The updater config and
|
||||||
|
signing pubkey live in `tauri.conf.json`; the private signing key is held outside the repo, never
|
||||||
|
committed.
|
||||||
|
|
||||||
## Not here (deliberately)
|
## Not here (deliberately)
|
||||||
|
|
||||||
Kiosk lockdown (fullscreen/no-decorations), auto-update, code signing, and launching Fastify from
|
Kiosk lockdown (fullscreen/no-decorations) and launching Fastify from the shell are out of scope for
|
||||||
the shell are out of scope for the scaffold — on the appliance Fastify runs as its own service and
|
the scaffold — on the appliance Fastify runs as its own service and this shell connects to it.
|
||||||
this shell connects to it.
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Parking System",
|
"productName": "Parking System",
|
||||||
"version": "0.0.0",
|
"version": "0.1.0",
|
||||||
"identifier": "com.parking.desktop",
|
"identifier": "com.parking.desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"devUrl": "http://localhost:5173",
|
"devUrl": "http://localhost:5173",
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"updater": {
|
"updater": {
|
||||||
"//": "Stable 'latest release' path on Gitea — redirects to the newest tag's latest.json (published by .gitea/workflows/release.yml). The updater GETs this, gets the manifest (platforms.linux-x86_64.{signature,url}), and compares versions. The release is reachable to the appliance only when it's brought online (phone hotspot); offline-first means a failed check is a no-op.",
|
"//": "Points at mca/public_releases, NOT this (private, source) repo — the updater runs on offline-first field appliances with no Gitea credentials, so the endpoint must be reachable unauthenticated. That repo is public and holds only compiled installers (no source), mirrored here by .gitea/workflows/release.yml. NOT the 'latest release' redirect: public_releases is shared across apps in the org, so 'latest' there could be someone else's release. This URL names our own most-recent tag directly (desktop-vX.Y.Z, bumped by the release workflow each publish) so a newer unrelated app release never shadows ours. The updater GETs this, gets the manifest (platforms.linux-x86_64.{signature,url}), and compares versions. The release is reachable to the appliance only when it's brought online (phone hotspot); offline-first means a failed check is a no-op.",
|
||||||
"endpoints": [
|
"endpoints": [
|
||||||
"https://git.infra.msai.al/mca/parking_solution/releases/latest/download/latest.json"
|
"https://git.infra.msai.al/mca/public_releases/releases/download/desktop-latest/latest.json"
|
||||||
],
|
],
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDgxNzg5RUQ1QkM0Q0FDRjYKUldUMnJFeTgxWjU0Z1RlNmhneDVZQlVVTVZZdGhJTkUxTGdDeGYwQSttZmNKVVp5WEdVMWlBb1YK"
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDgxNzg5RUQ1QkM0Q0FDRjYKUldUMnJFeTgxWjU0Z1RlNmhneDVZQlVVTVZZdGhJTkUxTGdDeGYwQSttZmNKVVp5WEdVMWlBb1YK"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,11 @@ RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
|
|||||||
# ---- runtime: slim, non-root ----
|
# ---- runtime: slim, non-root ----
|
||||||
FROM node:22-alpine AS runtime
|
FROM node:22-alpine AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
# Set by CI to "<branch>-<short-sha>" (e.g. "stage-28bd838"), matching the same string used
|
||||||
|
# as the Komodo Stack's TAG (komodo/resources.toml) — so the version shown in the app is the
|
||||||
|
# same string an admin would look up there. Empty/absent on a local `docker build` (dev only).
|
||||||
|
ARG BUILD_VERSION=""
|
||||||
|
ENV BUILD_VERSION=$BUILD_VERSION
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN apk add --no-cache libstdc++ # better-sqlite3 native runtime
|
RUN apk add --no-cache libstdc++ # better-sqlite3 native runtime
|
||||||
RUN addgroup -S app && adduser -S -G app app
|
RUN addgroup -S app && adduser -S -G app app
|
||||||
|
|||||||
@@ -56,6 +56,37 @@ describe("auth guard — no token", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("GET /api/version", () => {
|
||||||
|
it("without a session is 401", async () => {
|
||||||
|
const res = await app.inject({ method: "GET", url: "/api/version" });
|
||||||
|
expect(res.statusCode).toBe(401);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("a site:read user gets the BUILD_VERSION env var, null when unset", async () => {
|
||||||
|
const { username, password } = await seedUser(db, {
|
||||||
|
username: "viewer2", roleId: "viewer2", permissions: ["site:read"],
|
||||||
|
});
|
||||||
|
const { cookie } = await login(app, username, password);
|
||||||
|
const res = await app.inject({ method: "GET", url: "/api/version", headers: { cookie } });
|
||||||
|
expect(res.statusCode).toBe(200);
|
||||||
|
expect(res.json()).toEqual({ buildVersion: null }); // no BUILD_VERSION set in the test env
|
||||||
|
});
|
||||||
|
|
||||||
|
it("reflects a real BUILD_VERSION when the env var is set", async () => {
|
||||||
|
process.env.BUILD_VERSION = "stage-abc1234";
|
||||||
|
try {
|
||||||
|
const { username, password } = await seedUser(db, {
|
||||||
|
username: "viewer3", roleId: "viewer3", permissions: ["site:read"],
|
||||||
|
});
|
||||||
|
const { cookie } = await login(app, username, password);
|
||||||
|
const res = await app.inject({ method: "GET", url: "/api/version", headers: { cookie } });
|
||||||
|
expect(res.json()).toEqual({ buildVersion: "stage-abc1234" });
|
||||||
|
} finally {
|
||||||
|
delete process.env.BUILD_VERSION;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("RBAC permission gate", () => {
|
describe("RBAC permission gate", () => {
|
||||||
it("a site:read-only user can GET occupancy but is 403 on PUT site-config", async () => {
|
it("a site:read-only user can GET occupancy but is 403 on PUT site-config", async () => {
|
||||||
const { username, password } = await seedUser(db, {
|
const { username, password } = await seedUser(db, {
|
||||||
|
|||||||
@@ -78,6 +78,15 @@ export async function siteRoutes(app: FastifyInstance, db: Db, eventLog?: EventL
|
|||||||
// Live occupancy: cars inside, capacity, free, full. Any signed-in role.
|
// Live occupancy: cars inside, capacity, free, full. Any signed-in role.
|
||||||
app.get("/api/occupancy", { preHandler: readGuard }, async () => getOccupancy(db));
|
app.get("/api/occupancy", { preHandler: readGuard }, async () => getOccupancy(db));
|
||||||
|
|
||||||
|
// Running build version ("<branch>-<short-sha>", matching the Komodo Stack's TAG in
|
||||||
|
// komodo/resources.toml) — baked in at image build time (apps/server/Dockerfile
|
||||||
|
// BUILD_VERSION ARG), read here from the running process env. null on a local/dev
|
||||||
|
// build with no CI-supplied value. Purely informational (Setup nav display); not
|
||||||
|
// site config, so it isn't stored in site_config.
|
||||||
|
app.get("/api/version", { preHandler: readGuard }, async () => ({
|
||||||
|
buildVersion: process.env.BUILD_VERSION?.trim() || null,
|
||||||
|
}));
|
||||||
|
|
||||||
// Read site config (capacity + park metadata).
|
// Read site config (capacity + park metadata).
|
||||||
app.get("/api/site-config", { preHandler: readGuard }, async () => {
|
app.get("/api/site-config", { preHandler: readGuard }, async () => {
|
||||||
const row = db.select().from(siteConfig).where(eq(siteConfig.id, 1)).get();
|
const row = db.select().from(siteConfig).where(eq(siteConfig.id, 1)).get();
|
||||||
|
|||||||
@@ -253,6 +253,15 @@ export async function fetchBackupStatus(): Promise<BackupStatus> {
|
|||||||
return apiFetch("/api/backup/status");
|
return apiFetch("/api/backup/status");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface VersionInfo {
|
||||||
|
/** "<branch>-<short-sha>" baked in at image build time; null on a local/dev build. */
|
||||||
|
buildVersion: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function fetchVersion(): Promise<VersionInfo> {
|
||||||
|
return apiFetch("/api/version");
|
||||||
|
}
|
||||||
|
|
||||||
export interface BackupConfigPatch {
|
export interface BackupConfigPatch {
|
||||||
/** "" clears the target. Omit a field to leave it unchanged; null resets retention to default. */
|
/** "" clears the target. Omit a field to leave it unchanged; null resets retention to default. */
|
||||||
targetDir?: string | null;
|
targetDir?: string | null;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
can,
|
can,
|
||||||
closeShift,
|
closeShift,
|
||||||
fetchShiftReport,
|
fetchShiftReport,
|
||||||
|
fetchVersion,
|
||||||
logout,
|
logout,
|
||||||
openShift,
|
openShift,
|
||||||
setLanguagePref,
|
setLanguagePref,
|
||||||
@@ -94,6 +95,17 @@ function SetupTab({ to, label, exact = false }: { to: string; label: string; exa
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The running deploy's "<branch>-<short-sha>" (matches the Komodo Stack's TAG in
|
||||||
|
* komodo/resources.toml), gated the same as the "Park" tab (site:read) since it's the
|
||||||
|
* same kind of read-only app metadata. Renders nothing if the value isn't known (e.g. a
|
||||||
|
* local/dev build with no CI-supplied BUILD_VERSION) rather than showing an empty badge. */
|
||||||
|
function VersionBadge() {
|
||||||
|
const q = useQuery({ queryKey: ["version"], queryFn: fetchVersion, staleTime: Infinity });
|
||||||
|
const version = q.data?.buildVersion;
|
||||||
|
if (!version) return null;
|
||||||
|
return <span className="ml-auto shrink-0 pl-3 text-[0.7rem] text-term-muted">{version}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
/** Setup layout — the config hub. Renders a permission-gated tab bar and the active
|
/** Setup layout — the config hub. Renders a permission-gated tab bar and the active
|
||||||
* tab's screen via <Outlet>. Each tab is a child route (its own URL + guard), so
|
* tab's screen via <Outlet>. Each tab is a child route (its own URL + guard), so
|
||||||
* deep links and the back button work and a denied tab redirects to the booth. */
|
* deep links and the back button work and a denied tab redirects to the booth. */
|
||||||
@@ -112,6 +124,7 @@ function SetupLayout() {
|
|||||||
{show("recyclebin:read") && <SetupTab to="/setup/recycle-bin" label={t("nav.recycleBin")} />}
|
{show("recyclebin:read") && <SetupTab to="/setup/recycle-bin" label={t("nav.recycleBin")} />}
|
||||||
{show("log:read") && <SetupTab to="/setup/logs" label={t("nav.logs")} />}
|
{show("log:read") && <SetupTab to="/setup/logs" label={t("nav.logs")} />}
|
||||||
{show("backup:read") && <SetupTab to="/setup/backup" label={t("nav.backup")} />}
|
{show("backup:read") && <SetupTab to="/setup/backup" label={t("nav.backup")} />}
|
||||||
|
{show("site:read") && <VersionBadge />}
|
||||||
</nav>
|
</nav>
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+30
-69
@@ -30,75 +30,6 @@
|
|||||||
# new [[stack]] block per site (unique name, its own per-booth secret refs).
|
# new [[stack]] block per site (unique name, its own per-booth secret refs).
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# park-lab — the LAB bench box (hardware/dev testing, no real traffic). Chases
|
|
||||||
# the dev tier: compose files from `dev`, MOVING image tag `dev` (labs may
|
|
||||||
# float; real booths pin). Secrets are its own park_lab_* refs — per-box blast
|
|
||||||
# radius, never shared with a real booth even in the lab.
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
[[stack]]
|
|
||||||
name = "park-lab"
|
|
||||||
[stack.config]
|
|
||||||
server = "park-lab"
|
|
||||||
git_provider = "git.infra.msai.al"
|
|
||||||
git_account = "komodo"
|
|
||||||
repo = "mca/parking_solution"
|
|
||||||
branch = "dev"
|
|
||||||
file_paths = [
|
|
||||||
"docker-compose.yml",
|
|
||||||
"docker-compose.prod.yml"
|
|
||||||
]
|
|
||||||
registry_provider = "git.infra.msai.al"
|
|
||||||
registry_account = "komodo"
|
|
||||||
environment = """
|
|
||||||
REGISTRY=git.infra.msai.al/mca/parking_solution
|
|
||||||
# Lab tier: the MOVING dev tag — redeploy pulls the latest dev build. Pin to a
|
|
||||||
# dev-<sha> only when reproducing a specific state.
|
|
||||||
TAG=dev
|
|
||||||
COOKIE_SECURE=0
|
|
||||||
VISION_ENABLED=1
|
|
||||||
WS_ALLOWED_ORIGINS=
|
|
||||||
JWT_SECRET=[[park_lab_jwt_secret]]
|
|
||||||
EVENT_SIGNING_KEY=[[park_lab_event_signing_key]]
|
|
||||||
BACKUP_KEY=[[park_lab_backup_key]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# art-docker-station — second LAB bench box (hardware/dev testing, no real traffic). Same tier as
|
|
||||||
# park-lab: chases `dev` (compose files + MOVING image tag), own art_docker_station_* secret refs
|
|
||||||
# (never shared with park-lab or a real booth, even lab-to-lab — per-box blast radius).
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
[[stack]]
|
|
||||||
name = "art-docker-station"
|
|
||||||
[stack.config]
|
|
||||||
server = "art-docker-station"
|
|
||||||
git_provider = "git.infra.msai.al"
|
|
||||||
git_account = "komodo"
|
|
||||||
repo = "mca/parking_solution"
|
|
||||||
branch = "dev"
|
|
||||||
file_paths = [
|
|
||||||
"docker-compose.yml",
|
|
||||||
"docker-compose.prod.yml"
|
|
||||||
]
|
|
||||||
registry_provider = "git.infra.msai.al"
|
|
||||||
registry_account = "komodo"
|
|
||||||
environment = """
|
|
||||||
REGISTRY=git.infra.msai.al/mca/parking_solution
|
|
||||||
# Lab tier: the MOVING dev tag — redeploy pulls the latest dev build. Pin to a
|
|
||||||
# dev-<sha> only when reproducing a specific state.
|
|
||||||
TAG=dev
|
|
||||||
COOKIE_SECURE=0
|
|
||||||
VISION_ENABLED=1
|
|
||||||
WS_ALLOWED_ORIGINS=
|
|
||||||
JWT_SECRET=[[art_docker_station_jwt_secret]]
|
|
||||||
EVENT_SIGNING_KEY=[[art_docker_station_event_signing_key]]
|
|
||||||
BACKUP_KEY=[[art_docker_station_backup_key]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
[[stack]]
|
[[stack]]
|
||||||
name = "park-buzi"
|
name = "park-buzi"
|
||||||
[stack.config]
|
[stack.config]
|
||||||
@@ -126,3 +57,33 @@ JWT_SECRET=[[park_buzi_jwt_secret]]
|
|||||||
EVENT_SIGNING_KEY=[[park_buzi_event_signing_key]]
|
EVENT_SIGNING_KEY=[[park_buzi_event_signing_key]]
|
||||||
BACKUP_KEY=[[park_buzi_backup_key]]
|
BACKUP_KEY=[[park_buzi_backup_key]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
[[stack]]
|
||||||
|
name = "park-2"
|
||||||
|
[stack.config]
|
||||||
|
server = "park-2"
|
||||||
|
git_provider = "git.infra.msai.al"
|
||||||
|
git_account = "komodo"
|
||||||
|
repo = "mca/parking_solution"
|
||||||
|
branch = "stage"
|
||||||
|
file_paths = [
|
||||||
|
"docker-compose.yml",
|
||||||
|
"docker-compose.prod.yml"
|
||||||
|
]
|
||||||
|
registry_provider = "git.infra.msai.al"
|
||||||
|
registry_account = "komodo"
|
||||||
|
environment = """
|
||||||
|
REGISTRY=git.infra.msai.al/mca/parking_solution
|
||||||
|
# Staging booth: pinned immutable stage-<sha>. After each promotion (merge dev → stage, CI builds
|
||||||
|
# :stage-<sha>), bump this to the new sha and re-sync/deploy from Core. The moving `:stage` tag
|
||||||
|
# exists as the pointer; we deploy the sha, not the mover.
|
||||||
|
TAG=stage-28bd838
|
||||||
|
COOKIE_SECURE=0
|
||||||
|
VISION_ENABLED=1
|
||||||
|
WS_ALLOWED_ORIGINS=
|
||||||
|
JWT_SECRET=[[park_2_jwt_secret]]
|
||||||
|
EVENT_SIGNING_KEY=[[park_2_event_signing_key]]
|
||||||
|
BACKUP_KEY=[[park_2_backup_key]]
|
||||||
|
"""
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
type: reference
|
type: reference
|
||||||
tags: [parking, deployment, appliance, hardening, runbook, offline-first]
|
tags: [parking, deployment, appliance, hardening, runbook, offline-first]
|
||||||
sources: []
|
sources: []
|
||||||
updated: 2026-07-06
|
updated: 2026-09-02
|
||||||
status: settled
|
status: settled
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -282,24 +282,38 @@ sudo loginctl enable-linger admin # so the user service starts at boot witho
|
|||||||
```
|
```
|
||||||
|
|
||||||
- `--connect-as` is the **Server name in Core** — unique, stable, site-meaningful (the fleet's
|
- `--connect-as` is the **Server name in Core** — unique, stable, site-meaningful (the fleet's
|
||||||
primary key). Booth #2 = a different name (e.g. `park-durres`); never reuse one.
|
primary key). Booth #2 = a different name (e.g. `park-durres`); never reuse one. **Get this
|
||||||
|
right in the command itself** — it's a plain field in `periphery.config.toml` on the host, so a
|
||||||
|
typo/placeholder here needs a config edit + agent restart to fix, NOT a rename in Core's UI
|
||||||
|
(which only relabels Core's record, not the agent's real identity — gotcha #12 below).
|
||||||
- `--core-address` is Core's **reverse-proxy URL** (the URL you load the Core UI at over the mesh),
|
- `--core-address` is Core's **reverse-proxy URL** (the URL you load the Core UI at over the mesh),
|
||||||
NOT `:9120` — Core's container port `9120` is exposed-not-published; the agent reaches it through
|
NOT `:9120` — Core's container port `9120` is exposed-not-published; the agent reaches it through
|
||||||
the proxy. (Gotcha #7 below.)
|
the proxy. (Gotcha #7 below.)
|
||||||
- Config lands at `~/.config/komodo/periphery.config.toml`. The key field is **`core_address`**
|
- Config lands at `~/.config/komodo/periphery.config.toml`. The key field is **`core_address`**
|
||||||
(singular); `root_directory` must be a path `admin` can write. **⚠ VERIFY THIS after install —
|
(singular).
|
||||||
Periphery v2.2.0's installer writes `root_directory = "/etc/komodo"` even with `--user`**
|
|
||||||
(bit the lab box 2026-07-07: panic `Failed to write private key pem to "/etc/komodo/keys/
|
|
||||||
periphery.key" … Permission denied`, crash-loop until systemd gives up). Fix + restart:
|
|
||||||
```bash
|
|
||||||
sed -i 's|^root_directory = .*|root_directory = "'"$HOME"'/.komodo"|' ~/.config/komodo/periphery.config.toml
|
|
||||||
systemctl --user reset-failed periphery && systemctl --user restart periphery
|
|
||||||
```
|
|
||||||
NB `sudo systemctl restart periphery` says *unit not found* — it's a USER unit; always
|
|
||||||
`systemctl --user …`. The onboarding key survives a pre-connect crash (unused until first dial).
|
|
||||||
|
|
||||||
Verify: `systemctl --user status periphery` → active; the server **`park-buzi`** appears and goes
|
> ⚠ **ALWAYS CHECK THIS — every install so far has hit it (lab box 2026-07-07, booth `park-2`
|
||||||
**OK/green** in Core → Servers. Then **delete the onboarding key**.
|
> 2026-09-02).** `root_directory` must be a path `admin` can write, but **Periphery's installer
|
||||||
|
> writes `root_directory = "/etc/komodo"` even with `--user`** (still true as of v2.3.3). Result:
|
||||||
|
> panic `Failed to write private key pem to "/etc/komodo/keys/periphery.key" … Permission denied`,
|
||||||
|
> crash-loop until systemd gives up (`Start request repeated too quickly`).
|
||||||
|
>
|
||||||
|
> **Fix + restart:**
|
||||||
|
> ```bash
|
||||||
|
> sed -i 's|^root_directory = .*|root_directory = "'"$HOME"'/.komodo"|' ~/.config/komodo/periphery.config.toml
|
||||||
|
> systemctl --user reset-failed periphery && systemctl --user restart periphery
|
||||||
|
> ```
|
||||||
|
> NB `sudo systemctl restart periphery` says *unit not found* — it's a USER unit; always
|
||||||
|
> `systemctl --user …`. The onboarding key survives a pre-connect crash (unused until first dial).
|
||||||
|
>
|
||||||
|
> **➜ Do not stop here once it's green.** This fix only gets Periphery *running* — the Stack still
|
||||||
|
> isn't deployed. Immediately continue to **verify below, then §7b**.
|
||||||
|
|
||||||
|
**Verify:** `systemctl --user status periphery` → active; the server **`park-buzi`** appears and
|
||||||
|
goes **OK/green** in Core → Servers. Then **delete the onboarding key**.
|
||||||
|
|
||||||
|
**➜ Next step is §7b below — the Stack itself is not deployed yet.** A green Server in Core just
|
||||||
|
means the agent connected; it runs nothing until you add the Registry/Git accounts and deploy.
|
||||||
|
|
||||||
### 7b. Deploy the Stack (in Core — by hand once, then code)
|
### 7b. Deploy the Stack (in Core — by hand once, then code)
|
||||||
|
|
||||||
@@ -482,8 +496,36 @@ works; the desktop app is a separate workstream.
|
|||||||
separate Komodo credentials. A blank registry account on the Stack → anonymous pull →
|
separate Komodo credentials. A blank registry account on the Stack → anonymous pull →
|
||||||
`no basic auth credentials`. Set the Stack's **Registry Account** (`komodo`).
|
`no basic auth credentials`. Set the Stack's **Registry Account** (`komodo`).
|
||||||
9. **User-mode Periphery + `/etc/komodo` `root_directory` = `Permission denied`** writing the agent
|
9. **User-mode Periphery + `/etc/komodo` `root_directory` = `Permission denied`** writing the agent
|
||||||
key. User-mode (runs as `admin`, no root daemon) must keep `root_directory` under `$HOME`.
|
key. User-mode (runs as `admin`, no root daemon) must keep `root_directory` under `$HOME`. Hit
|
||||||
|
on every install so far (lab box 2026-07-07, booth `park-2` 2026-09-02, still on v2.3.3) —
|
||||||
|
**check this first** whenever a fresh Periphery install crash-loops; see the boxed callout in
|
||||||
|
§7a for the fix. Easy to fix-and-move-on without realizing the Stack still isn't deployed —
|
||||||
|
§7a's fix only starts the agent, §7b deploys the Stack.
|
||||||
10. The config key is **`core_address`** (singular). And `--core-address` derives `wss://` from
|
10. The config key is **`core_address`** (singular). And `--core-address` derives `wss://` from
|
||||||
`https://` — if Core were plain-HTTP you'd need `http://` (→ `ws://`).
|
`https://` — if Core were plain-HTTP you'd need `http://` (→ `ws://`).
|
||||||
11. ResourceSync **Execute disabled + file shown clean in Info = empty diff = already in sync**
|
11. ResourceSync **Execute disabled + file shown clean in Info = empty diff = already in sync**
|
||||||
(success). Execute only enables when the file and Core diverge (e.g. you edit `TAG`).
|
(success). Execute only enables when the file and Core diverge (e.g. you edit `TAG`).
|
||||||
|
12. **Renaming a Server in Core's UI does NOT change the agent's actual identity.**
|
||||||
|
`connect_as` is a plain field persisted in the agent's own
|
||||||
|
`~/.config/komodo/periphery.config.toml` — Core's UI rename only relabels Core's *record*,
|
||||||
|
the agent keeps re-announcing under its original `connect_as` on every reconnect. Symptom (hit
|
||||||
|
2026-08-30, lab box): a server named via a leftover template placeholder in the install
|
||||||
|
command kept reappearing in Core no matter how many times it was renamed there, while the
|
||||||
|
intended name sat permanently NOT OK (nothing was ever checking in as that name). **Fix: edit
|
||||||
|
`connect_as` directly in `periphery.config.toml` on the host, then `systemctl --user restart
|
||||||
|
periphery`** — no reinstall/re-onboarding needed. Delete the stray old-name Server record in
|
||||||
|
Core afterward. Lesson: always double-check `--connect-as` is a REAL name (never leave a
|
||||||
|
template placeholder like `<new-server-name>` in a copy-pasted install command) — Core will
|
||||||
|
happily create a server with that literal string.
|
||||||
|
13. **Upgrading an already-installed Periphery is: re-run the same installer, unchanged
|
||||||
|
`--connect-as`.** No separate update mechanism, no update-only flag. The installer script
|
||||||
|
explicitly skips rewriting `periphery.config.toml` if one already exists ("Config already
|
||||||
|
exists, skipping...") — it only stops the service, replaces the binary, and restarts — so a
|
||||||
|
re-run is **config-preserving** and a fresh/dummy `--onboarding-key` value on that re-run is
|
||||||
|
simply unused (confirmed against Komodo's own `setup-periphery.py` source, 2026-08-30; no
|
||||||
|
Periphery-specific breaking changes between v2.2.0 and v2.3.2 per Komodo's release notes).
|
||||||
|
Verified end-to-end on `art-docker-station` (lab, dry run) then `park-buzi` (live booth,
|
||||||
|
2026-08-30): same command as §7a step 2, same `--connect-as`, app containers untouched
|
||||||
|
throughout (Periphery restarting itself never touches the already-running compose stack).
|
||||||
|
**Always dry-run a version bump on a lab/dev box before a live booth**, even with a clean
|
||||||
|
release-notes check — this project only had one lab box to test against and used it first.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
type: decision
|
type: decision
|
||||||
tags: [parking, decisions, desktop, frontend]
|
tags: [parking, decisions, desktop, frontend]
|
||||||
sources: []
|
sources: []
|
||||||
updated: 2026-06-21
|
updated: 2026-09-03
|
||||||
status: settled
|
status: settled
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -149,11 +149,7 @@ Per the user's choices — the operator **keeps OS access** (no fullscreen lockd
|
|||||||
offline), prompts the operator (i18n `update.prompt`), then `downloadAndInstall()` + `relaunch()`.
|
offline), prompts the operator (i18n `update.prompt`), then `downloadAndInstall()` + `relaunch()`.
|
||||||
Accepts that the appliance may be **offline** day-to-day and brought online (phone hotspot) only
|
Accepts that the appliance may be **offline** day-to-day and brought online (phone hotspot) only
|
||||||
when an update is wanted — consistent with [[offline-first]] (no network dependency in *core*
|
when an update is wanted — consistent with [[offline-first]] (no network dependency in *core*
|
||||||
operation; updates are out-of-band). Endpoint is the **self-hosted Gitea** "latest release"
|
operation; updates are out-of-band). **WS origin:** the desktop window's origin
|
||||||
path — `https://git.infra.msai.al/mca/parking_solution/releases/latest/download/latest.json`
|
|
||||||
— which redirects to the newest tag's `latest.json` (published by `.gitea/workflows/release.yml`).
|
|
||||||
The updater GETs it (200 + manifest, or 204 = up-to-date), reads `platforms.linux-x86_64.
|
|
||||||
{signature,url}`, and downloads the signed installer. **WS origin:** the desktop window's origin
|
|
||||||
is `tauri://localhost` (Linux may also send `http://tauri.localhost`), so the backend's
|
is `tauri://localhost` (Linux may also send `http://tauri.localhost`), so the backend's
|
||||||
`WS_ALLOWED_ORIGINS` must include both or the live feed won't connect (documented in
|
`WS_ALLOWED_ORIGINS` must include both or the live feed won't connect (documented in
|
||||||
`apps/server/.env.example`).
|
`apps/server/.env.example`).
|
||||||
@@ -165,8 +161,27 @@ Per the user's choices — the operator **keeps OS access** (no fullscreen lockd
|
|||||||
produced `.deb`/`.rpm`/`.AppImage` **plus their `.sig` updater signatures**; full `turbo run build
|
produced `.deb`/`.rpm`/`.AppImage` **plus their `.sig` updater signatures**; full `turbo run build
|
||||||
lint` 14/14 green. *(This is the **updater** signing — distinct from OS-installer signing for
|
lint` 14/14 green. *(This is the **updater** signing — distinct from OS-installer signing for
|
||||||
Windows/macOS "unknown publisher", and from the [[atecc608]]/[[tpm]] **event** signing.)*
|
Windows/macOS "unknown publisher", and from the [[atecc608]]/[[tpm]] **event** signing.)*
|
||||||
- **Still deferred:** the actual update-hosting URL, OS-level installer signing
|
- **Update-hosting endpoint (found broken, fixed 2026-09-03):** the endpoint originally pointed at
|
||||||
(Windows/macOS publisher trust), and the Windows kiosk-browser fallback path.
|
the **source repo's own** Gitea "latest release" redirect
|
||||||
|
(`.../mca/parking_solution/releases/latest/download/latest.json`) — but `mca/parking_solution` is
|
||||||
|
**private**, and the updater runs on offline-first field appliances with **no Gitea credentials**.
|
||||||
|
Every deployed update check was silently failing (swallowed by a `try/catch` in
|
||||||
|
`desktop-updater.ts`) — this was never field-verified, and it couldn't have worked as configured.
|
||||||
|
**Fix:** signed installers are now mirrored to a separate **public**, releases-only repo,
|
||||||
|
`mca/public_releases` (shared across apps in the org — see [[fleet-deployment-komodo]] sibling
|
||||||
|
infra), holding **only compiled installers, no source**. `tauri.conf.json`'s endpoint now points
|
||||||
|
there at a fixed `desktop-latest` tag (NOT that repo's generic "latest release" redirect, since
|
||||||
|
other apps publishing there would shadow ours — see the `desktop-latest` vs `desktop-<TAG>`
|
||||||
|
split below). `.gitea/workflows/release.yml` pushes to both repos: the private source repo (own
|
||||||
|
record) and the public mirror (what the updater and any human downloader actually use).
|
||||||
|
**Rejected alternative:** embedding a `read:repository` Gitea token in `tauri.conf.json`'s
|
||||||
|
updater `headers` so it could read the private repo directly — ruled out because that token would
|
||||||
|
ship inside every installed binary in the field, and this appliance's own threat model names the
|
||||||
|
**booth operator as the primary adversary** (see root `CLAUDE.md`); a leaked token scoped to the
|
||||||
|
whole private repo, with no cheap way to rotate it across appliances already in the field, was
|
||||||
|
judged worse than publishing installers-only.
|
||||||
|
- **Still deferred:** OS-level installer signing (Windows/macOS publisher trust) and the Windows
|
||||||
|
kiosk-browser fallback path.
|
||||||
|
|
||||||
### Desktop in CI — two workflows, two purposes (added 2026-06-24)
|
### Desktop in CI — two workflows, two purposes (added 2026-06-24)
|
||||||
|
|
||||||
@@ -174,7 +189,15 @@ The desktop bundle now runs in CI under **two distinct workflows** — keep the
|
|||||||
|
|
||||||
- **`.gitea/workflows/release.yml`** (tag `v*`) — the **signed, versioned release**: builds
|
- **`.gitea/workflows/release.yml`** (tag `v*`) — the **signed, versioned release**: builds
|
||||||
`.deb`/`.rpm`/`.AppImage` **+ their `.sig`** (updater key from secrets), assembles `latest.json`,
|
`.deb`/`.rpm`/`.AppImage` **+ their `.sig`** (updater key from secrets), assembles `latest.json`,
|
||||||
and publishes a Gitea Release. This is what the auto-updater consumes. Unchanged.
|
and publishes a Gitea Release **on `mca/parking_solution` (source, own record) AND mirrors it to
|
||||||
|
`mca/public_releases`** (public, installers-only — see the update-hosting-endpoint entry above for
|
||||||
|
why). The mirror step uses a second token, `RELEASES_MIRROR_TOKEN`
|
||||||
|
(`write:repository`, scoped for pushing into `public_releases` only — a CI-side secret, never
|
||||||
|
shipped to any client, distinct from the embedded updater *pubkey*). It publishes two tags there:
|
||||||
|
`desktop-<TAG>` (versioned, permanent, for audit/rollback) and `desktop-latest` (moving — existing
|
||||||
|
assets deleted then re-uploaded each release, since Gitea has no per-app "latest" concept and this
|
||||||
|
repo is shared across apps). `latest.json`'s asset URL and `tauri.conf.json`'s updater endpoint
|
||||||
|
both point at `desktop-latest`. This is what the auto-updater actually consumes.
|
||||||
- **`.gitea/workflows/build-desktop.yml`** (push to `dev`/`main`) — a **per-commit test build**:
|
- **`.gitea/workflows/build-desktop.yml`** (push to `dev`/`main`) — a **per-commit test build**:
|
||||||
compiles `.deb` + `.AppImage` only (`pnpm --filter @parking/desktop bundle --bundles deb,appimage`)
|
compiles `.deb` + `.AppImage` only (`pnpm --filter @parking/desktop bundle --bundles deb,appimage`)
|
||||||
and publishes them to a **rolling per-branch pre-release** (tag `desktop-<branch>`). **Unsigned** —
|
and publishes them to a **rolling per-branch pre-release** (tag `desktop-<branch>`). **Unsigned** —
|
||||||
|
|||||||
+1
-1
@@ -134,7 +134,7 @@ Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
|
|||||||
- [[vision-service]] — build a host-side ANPR + vehicle-verification service; replaces edge-LPR; scoped AGPL exception.
|
- [[vision-service]] — build a host-side ANPR + vehicle-verification service; replaces edge-LPR; scoped AGPL exception.
|
||||||
- [[vision-service-packaging]] — the vision service lives in this monorepo (apps/vision/), separate process, wired into Turbo via a package.json shim; uv-managed Python.
|
- [[vision-service-packaging]] — the vision service lives in this monorepo (apps/vision/), separate process, wired into Turbo via a package.json shim; uv-managed Python.
|
||||||
- [[event-streams-split]] — split the signed business ledger (ledger_events) from unsigned device telemetry (device_events).
|
- [[event-streams-split]] — split the signed business ledger (ledger_events) from unsigned device telemetry (device_events).
|
||||||
- [[desktop-shell-tauri]] — ✅ Tauri v2 chosen over Electron for the desktop kiosk shell; thin wrapper, server keeps all logic. Best case Ubuntu 26.04 LTS (resolves WebKitGTK); worst case Windows+WSL → kiosk browser, no native shell.
|
- [[desktop-shell-tauri]] — ✅ Tauri v2 chosen over Electron for the desktop kiosk shell; thin wrapper, server keeps all logic. Best case Ubuntu 26.04 LTS (resolves WebKitGTK); worst case Windows+WSL → kiosk browser, no native shell. Auto-updater mirrors signed releases to public `mca/public_releases` (source repo is private — field appliances have no Gitea creds).
|
||||||
- [[container-deployment]] — Docker images for the non-desktop apps: parking-server (Fastify API + bundled SPA via @fastify/static) + parking-vision (Python/uv ANPR); branch+SHA tags, per-env compose, Gitea registry, build-images.yml CI; pnpm deploy (not prune) for native better-sqlite3; migrate-at-boot.
|
- [[container-deployment]] — Docker images for the non-desktop apps: parking-server (Fastify API + bundled SPA via @fastify/static) + parking-vision (Python/uv ANPR); branch+SHA tags, per-env compose, Gitea registry, build-images.yml CI; pnpm deploy (not prune) for native better-sqlite3; migrate-at-boot.
|
||||||
- [[fleet-deployment-komodo]] — fleet control plane: Komodo Periphery on each booth, driven by Komodo Core over a NetBird mesh, running the same compose files. Deploys manual + pinned to dev-<sha> (no webhook); secrets Komodo-managed per-booth+unique; booth.sh demoted to break-glass. Threat-model caveats: Periphery is a root agent (mesh-bound only), EVENT_SIGNING_KEY-in-Core is a fraud-root blast radius until ATECC608 signs. komodo/ is infra-as-code.
|
- [[fleet-deployment-komodo]] — fleet control plane: Komodo Periphery on each booth, driven by Komodo Core over a NetBird mesh, running the same compose files. Deploys manual + pinned to dev-<sha> (no webhook); secrets Komodo-managed per-booth+unique; booth.sh demoted to break-glass. Threat-model caveats: Periphery is a root agent (mesh-bound only), EVENT_SIGNING_KEY-in-Core is a fraud-root blast radius until ATECC608 signs. komodo/ is infra-as-code.
|
||||||
- [[appliance-provisioning]] — booth-PC provisioning runbook (Dell 7070, i5-8500, discrete Nuvoton TPM): BIOS/Secure-Boot → direct-flash Ubuntu 26.04 USB (not Ventoy) → passphrase-LUKS install → manual PCR-7 TPM seal (workaround for the installer's dbt PCR_UNUSABLE error) → Docker. Verified on hardware 2026-06-23; TPM auto-unlock works.
|
- [[appliance-provisioning]] — booth-PC provisioning runbook (Dell 7070, i5-8500, discrete Nuvoton TPM): BIOS/Secure-Boot → direct-flash Ubuntu 26.04 USB (not Ventoy) → passphrase-LUKS install → manual PCR-7 TPM seal (workaround for the installer's dbt PCR_UNUSABLE error) → Docker. Verified on hardware 2026-06-23; TPM auto-unlock works.
|
||||||
|
|||||||
+30
@@ -2710,3 +2710,33 @@ schedule-due-ness from the persisted last-success timestamp; `server.ts`'s sched
|
|||||||
to restart timing. New test file `backup-service.test.ts` (6 tests) covers restart-durability and
|
to restart timing. New test file `backup-service.test.ts` (6 tests) covers restart-durability and
|
||||||
`isDue()` directly; full existing suite (319 tests) still green. No API/UI contract change. Not
|
`isDue()` directly; full existing suite (319 tests) still green. No API/UI contract change. Not
|
||||||
yet committed (holding per instruction). Full writeup on [[backup-recovery]].
|
yet committed (holding per instruction). Full writeup on [[backup-recovery]].
|
||||||
|
|
||||||
|
## [2026-08-30] update | Two Komodo Periphery gotchas: connect_as renaming, agent upgrade procedure
|
||||||
|
|
||||||
|
Two real incidents this session, both closed out as new gotchas (#12, #13) on
|
||||||
|
[[appliance-provisioning]] §7: (1) a lab box installed with a leftover template placeholder
|
||||||
|
left in `--connect-as` kept reappearing under that name in Core no matter how many times it was
|
||||||
|
renamed in the UI — because `connect_as` is a plain field in the agent's own
|
||||||
|
`periphery.config.toml`, and a Core-UI rename never touches it; fixed by editing the field
|
||||||
|
directly on the host + `systemctl --user restart periphery`, no reinstall needed. (2) Upgrading
|
||||||
|
Periphery from a version-mismatch (Core bumped to v2.3.2, an agent still on v2.2.0) has no
|
||||||
|
separate update mechanism — confirmed against Komodo's own `setup-periphery.py` source that
|
||||||
|
re-running the same installer with unchanged `--connect-as` is config-preserving (it explicitly
|
||||||
|
skips rewriting an existing config) and safe; verified dry-run on `art-docker-station` (lab) then
|
||||||
|
applied to `park-buzi` (live booth) with no disruption to the running app containers. Full detail
|
||||||
|
+ exact commands on [[appliance-provisioning]].
|
||||||
|
|
||||||
|
## [2026-09-03] fix | Desktop updater endpoint was unreachable — pointed at a private repo
|
||||||
|
|
||||||
|
The Tauri auto-updater ([[desktop-shell-tauri]]) was fully implemented — signed builds, keypair,
|
||||||
|
`latest.json`, `release.yml` — but its endpoint pointed at `mca/parking_solution`'s own Gitea
|
||||||
|
"latest release" redirect, and that repo is **private**. Field appliances have no Gitea
|
||||||
|
credentials, so every update check was silently failing (caught by a `try/catch`); this was never
|
||||||
|
actually field-verified end to end. Fix: signed installers now mirror to a new public,
|
||||||
|
installers-only repo `mca/public_releases` (org-shared, not parking-specific), published to a fixed
|
||||||
|
`desktop-latest` tag so other apps releasing there later can't shadow ours. Considered and rejected
|
||||||
|
embedding a `read:repository` token in the app instead — ruled out given the appliance's own threat
|
||||||
|
model (booth operator as primary adversary) makes an extractable, hard-to-rotate credential in every
|
||||||
|
deployed binary worse than just publishing installers publicly. `release.yml`,
|
||||||
|
`apps/desktop/src-tauri/tauri.conf.json`, `apps/desktop/README.md` updated; full detail on
|
||||||
|
[[desktop-shell-tauri]].
|
||||||
|
|||||||
Reference in New Issue
Block a user