Compare commits

...
7 changed files with 47 additions and 17 deletions

No files matched your search

+13 -5
View File
@@ -2,8 +2,16 @@
set -Eeuo pipefail
umask 022
proxy_service=nginx
old_asset_origin="${PIIK_PUBLIC_ORIGIN:-}"
if [ "${1:-}" = '--demo-caddy' ]; then
proxy_service=caddy
old_asset_origin=http://127.0.0.1:8787
shift
fi
if [ "$#" -ne 1 ]; then
printf 'usage: PIIK_PUBLIC_ORIGIN=https://share.example.com %s /opt/piik/uploads/<release>.release.json\n' "$0" >&2
printf 'usage: PIIK_PUBLIC_ORIGIN=https://share.example.com %s [--demo-caddy] /opt/piik/uploads/<release>.release.json\n' "$0" >&2
exit 2
fi
@@ -161,7 +169,7 @@ test -f "$artifact"
test -f "$manifest"
test "$(sha256sum "$artifact" | awk '{print $1}')" = "$artifact_sha"
test "$(sha256sum "$manifest" | awk '{print $1}')" = "$manifest_sha"
for service in piik nginx; do
for service in piik "$proxy_service"; do
test "$(systemctl show "${service}.service" -p ActiveState --value)" = 'active'
test "$(systemctl show "${service}.service" -p NRestarts --value)" = '0'
done
@@ -245,7 +253,7 @@ test "$(stat -c '%U:%G %a' "$release")" = 'root:root 755'
# Compare rules without traffic counters; no operator-specific table name.
firewall_before="$(nft --stateless list ruleset | sha256sum | awk '{print $1}')"
nginx_restarts="$(systemctl show nginx.service -p NRestarts --value)"
proxy_restarts="$(systemctl show "${proxy_service}.service" -p NRestarts --value)"
cutover_since="$(date '+%Y-%m-%d %H:%M:%S')"
cutover_start="$(date +%s%3N)"
cutover_started=1
@@ -260,7 +268,7 @@ health_ready="$(date +%s%3N)"
test "$(systemctl show piik.service -p ActiveState --value)" = 'active'
test "$(systemctl show piik.service -p NRestarts --value)" = '0'
test "$(systemctl show nginx.service -p NRestarts --value)" = "$nginx_restarts"
test "$(systemctl show "${proxy_service}.service" -p NRestarts --value)" = "$proxy_restarts"
test "$(nft --stateless list ruleset | sha256sum | awk '{print $1}')" = "$firewall_before"
test "$(readlink -f -- "$current")" = "$release"
pid="$(systemctl show piik.service -p MainPID --value)"
@@ -272,7 +280,7 @@ curl -fsS --max-time 5 http://127.0.0.1:8787/ | grep -Fq "$main_asset"
curl -fsS --max-time 8 "$public_origin/" | grep -Fq "$main_asset"
test "$(curl -sS -o /dev/null -w '%{http_code}' --max-time 8 "$public_origin/$main_asset")" = '200'
if [ "$old_asset" != "$main_asset" ]; then
test "$(curl -sS -o /dev/null -w '%{http_code}' --max-time 8 "$public_origin/$old_asset")" = '404'
test "$(curl -sS -o /dev/null -w '%{http_code}' --max-time 8 "$old_asset_origin/$old_asset")" = '404'
fi
test -z "$(journalctl -u piik.service --since "$cutover_since" -p warning --no-pager --output=cat)"
+3 -3
View File
@@ -8,7 +8,7 @@ deployment record. [Status](./status.md) owns only the compact current product
and operational snapshot; it is not a per-release ledger.
The tracked `release-server.sh` updates an existing Go deployment with embedded
media, bare-metal nginx, nftables, and application port 8787. It requires an
media, bare-metal nginx (or the [managed Caddy Demo](./operations/website.md)), nftables, and application port 8787. It requires an
existing running Go release. Another proxy, firewall owner, application port,
first installation, or initial embedded-media cutover needs its own scoped
bootstrap/updater; do not call this wrapper generic.
@@ -195,7 +195,7 @@ sudo env PIIK_PUBLIC_ORIGIN=https://share.example.com \
The wrapper:
1. takes a deployment lock and validates the descriptor, revision, archive,
manifest, current Go process, Piik/nginx service state, and public origin;
manifest, current Go process, Piik and proxy service state, and public origin;
2. rejects unexpected archive paths, links, file types, or duplicate inodes;
3. extracts to a new release directory and verifies every file hash and size;
4. validates production configuration by running the packaged binary's
@@ -248,7 +248,7 @@ Verify only the surfaces relevant to the release:
- local and public `/healthz` return `{"status":"ok"}`;
- the public HTML references the new immutable main asset;
- Piik and nginx have expected active/restart state;
- Piik and the selected proxy have expected active/restart state;
- Piik owns each configured STUN/SFU UDP listener and public reachability
matches the configuration;
- the current symlink and served revision match the descriptor;
+7 -3
View File
@@ -78,9 +78,13 @@ and WebSocket signaling passes through to the room service. Media remains P2P.
For updates, follow the [application release boundary](../deployment.md#release-boundary)
and its artifact verification, health checks and recovery rules. Routine application
rollback restores the previous executable while keeping current room data. This
Caddy installation needs a scoped updater; the nginx-specific maintainer wrapper
does not manage it.
rollback restores the previous executable while keeping current room data. On the Demo host, set `RELEASE_DESCRIPTOR` to the uploaded descriptor's absolute path and run from the release checkout:
```sh
sudo env PIIK_PUBLIC_ORIGIN=https://demo.piik.tv bash deploy/release-server.sh --demo-caddy "$RELEASE_DESCRIPTOR"
```
The updater checks Caddy and verifies removal of the previous bundle directly at the origin.
## Maintenance
+4 -5
View File
@@ -1,6 +1,6 @@
# Current TODO Ledger
Last reviewed: 2026-11-09
Last reviewed: 2026-11-21
This ledger contains unfinished work and explicit owner holds. Product modules
own behavior; research and Git/PRs own evidence and completed history.
@@ -17,8 +17,9 @@ own behavior; research and Git/PRs own evidence and completed history.
to identify the failing transition before changing capture or service lifetime.
- [ ] **Release mirror platform integration.** Verify a supported way to create
the platform's Release tag or trigger its immediate synchronization during
publication. Do not assume disabling Pull synchronization makes the repository
writable. [Mirror operations](./operations/github.md#atomgit-download-mirror) owns setup.
publication. The v2.8.0 mirror is waiting for its tag. Resume from the
[original build](https://github.com/TNTcraftHIM/Piik/actions/runs/44881655913)
once the tag arrives. [Mirror operations](./operations/github.md#atomgit-download-mirror) owns setup.
- [ ] **Windows sound only works with exclusion (#534).** Compare the affected
application's playback endpoint with Piik's default-endpoint capture. The
[audio scope control](./research/native-client-media.md#windows-audio-exclusion)
@@ -95,8 +96,6 @@ own behavior; research and Git/PRs own evidence and completed history.
## Held By Owner
- [ ] **2.x maintenance release approval.** The owner reviews the tested candidate
and the complete change set since `v2.7.0` before publication.
- [ ] **iOS native App.** Paused in favor of Browser use. Preserve the isolated
implementation on `feat/ios-client`; native development and publication stay
outside the current phase.
+1
View File
@@ -30,6 +30,7 @@ const nonProductPaths = [
"scripts/*-gate.*", "scripts/*-probe.*", "scripts/browser-*", "scripts/encoded-*",
"scripts/*-gate-endpoint.ts", "scripts/embedded-sfu-page.ts", "scripts/peer-assisted-benchmark.ts",
"scripts/network-lab.ts", "scripts/network-lab/**",
"deploy/release-server.sh",
"cmd/piik-peer-gate/**",
].map((path) => `:(top,glob,exclude)${path}`);
+1 -1
View File
@@ -176,7 +176,7 @@ describe("release automation", () => {
for (const path of ["site/film/art.js", "site/docs/package.json", "site/docs/package-lock.json",
"site/docs/.vitepress/config.mjs", "docs/guide/troubleshooting.md", "docs/deployment.md", "README.zh-CN.md",
"scripts/build-website.mjs", "scripts/check-docs.mjs", "scripts/check-container.mjs", "scripts/markdown-slug.mjs", "scripts/release-notes.mjs",
"scripts/publish-container.mjs",
"scripts/publish-container.mjs", "deploy/release-server.sh",
"scripts/app-gate-endpoint.ts", "scripts/client-gate-endpoint.ts",
"scripts/network-lab.ts", "scripts/network-lab/endpoint.ts", "scripts/network-lab/stun/main.go",
"tests/room.test.ts", ".agents/skills/ponytail/SKILL.md", ".github/workflows/website.yml",
+18
View File
@@ -4,6 +4,24 @@ set -euo pipefail
repo_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
release_script="$repo_root/deploy/release-server.sh"
# Run the updater's argument parsing before it accesses the deployment filesystem.
for mode in nginx caddy; do
(
export PIIK_PUBLIC_ORIGIN=https://release.example
if [ "$mode" = caddy ]; then
set -- --demo-caddy /descriptor
expected_origin=http://127.0.0.1:8787
else
set -- /descriptor
expected_origin=$PIIK_PUBLIC_ORIGIN
fi
source <(sed '/^upload_root=/,$d' "$release_script")
test "$1" = /descriptor
test "$proxy_service" = "$mode"
test "$old_asset_origin" = "$expected_origin"
)
done
extract_function() {
awk -v name="$1" '
$0 == name "() {" { capture = 1 }