demo: each session's transcript, kept 7 days in a write-only drop box (#192)
Ruled 2026-11-21, "Write-only drop box": console.py writes each session's transcript, mode 0600, into /var/lib/starshipos-demo-transcripts (the owner's, group starshipos-demo, mode 1730: a session adds a file but cannot list or read the directory). transcripts-tidy.sh, run as root every 5 minutes by starshipos-demo-transcripts.timer, hands each file to the owner and deletes those over 7 days. starshipos-demo.service gets the directory writable and DEMO_TRANSCRIPTS; DEPLOY.md step 4 has the server steps and the check. "Nothing you do is kept" was no longer true. Ruled 2026-11-24, "Machine not kept; log 7 days": the session's banner, the Try it page and the old wiki page say nothing is kept on the machine and a transcript is kept for up to 7 days, then deleted, and the page says so before the console. demo/test_transcripts.py failed first (logs/20261121-demo-transcripts/before.txt) and passes its 10 checks (after.txt). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: LicenseRef-Starship-1.0
|
||||
# Copyright (c) 2023-2026 Robert A. James
|
||||
# transcripts-tidy.sh DIR OWNER -- the demo's transcripts (#192): each handed to OWNER, mode 0600, so only OWNER
|
||||
# reads it (the session's user wrote it, and cannot list the directory); every one older than 7 days deleted.
|
||||
# Run as root by starshipos-demo-transcripts.timer every 5 minutes. Tests: demo/test_transcripts.py.
|
||||
set -euo pipefail
|
||||
dir=${1:?usage: transcripts-tidy.sh DIR OWNER}
|
||||
owner=${2:?usage: transcripts-tidy.sh DIR OWNER}
|
||||
[ -d "$dir" ] || { echo "transcripts-tidy: no $dir" >&2; exit 1; }
|
||||
find "$dir" -maxdepth 1 -type f -name '*.log' -mmin +10080 -delete # 7 days
|
||||
find "$dir" -maxdepth 1 -type f -name '*.log' ! -user "$owner" -exec chown "$owner:" {} + -exec chmod 0600 {} +
|
||||
Reference in New Issue
Block a user