Skip to content

Commit cf7bd3f

Browse files
committed
security: sanitized VHS demos and purge leaked history tooling
1 parent b9a1f77 commit cf7bd3f

4 files changed

Lines changed: 61 additions & 1 deletion

File tree

demos/vhs/demo-30s.tape

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Type "# ContextForge RAG · production retrieval" Enter
1010
Sleep 600ms
1111

1212
Hide
13+
Type "source demos/vhs/sanitize-recording-env.sh" Enter
14+
Sleep 300ms
1315
Type "python3 scripts/validate_profile.py ." Enter
1416
Sleep 5s
1517
Type "head -16 SOUL.md" Enter
@@ -21,4 +23,4 @@ Show
2123
Type "hermes profile install github.com/codegraphtheory/context-forge-rag --name context-forge-rag --yes" Enter
2224
Sleep 4s
2325
Type "# RAG architecture · eval gates · observability" Enter
24-
Sleep 3s
26+
Sleep 3s
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# Public-safe shell identity for VHS terminal recordings.
3+
# Sources demos/vhs/env.sh after setting HOME/USER (real repo paths stay on disk).
4+
set -euo pipefail
5+
_VHS_SANITIZE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
_REPO_ROOT="$(cd "$_VHS_SANITIZE_DIR/../.." && pwd)"
7+
8+
export VHS_RECORDING=1
9+
export HOME="$_REPO_ROOT/demos/vhs/staging/home/graphtheory"
10+
export USER=graphtheory
11+
export LOGNAME=graphtheory
12+
export HOSTNAME=cyber
13+
14+
mkdir -p "$HOME/users/graphtheory/projects"
15+
_WORKSPACE="$HOME/users/graphtheory/projects/$(basename "$_REPO_ROOT")"
16+
ln -sfn "$_REPO_ROOT" "$_WORKSPACE"
17+
18+
export PS1='graphtheory@cyber:~/users/graphtheory/projects/'"$(basename "$_REPO_ROOT")"'$ '
19+
export PROMPT_COMMAND=
20+
21+
cd "$_WORKSPACE"
22+
23+
# shellcheck source=env.sh
24+
source "$_VHS_SANITIZE_DIR/env.sh"

filter-repo-replacements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
literal:/Users/graphtheory==>/Users/graphtheory
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
# Remove demo media (and optional path replacements) from entire git history.
3+
set -euo pipefail
4+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5+
cd "$ROOT"
6+
7+
if ! command -v git-filter-repo >/dev/null 2>&1; then
8+
echo "Install: python3 -m pip install git-filter-repo" >&2
9+
exit 1
10+
fi
11+
12+
ORIGIN=""
13+
git remote get-url origin >/dev/null 2>&1 && ORIGIN="$(git remote get-url origin)"
14+
15+
INVERT=()
16+
[[ -e demos/demo.gif ]] && INVERT+=(--path demos/demo.gif)
17+
[[ -d demos/vhs/out ]] && INVERT+=(--path demos/vhs/out)
18+
[[ -d assets/demos ]] && INVERT+=(--path assets/demos)
19+
20+
if ((${#INVERT[@]} > 0)); then
21+
echo "filter-repo: removing demo blobs from all commits"
22+
git filter-repo --invert-paths "${INVERT[@]}" --force
23+
[[ -n "$ORIGIN" ]] && git remote add origin "$ORIGIN"
24+
fi
25+
26+
if [[ -f filter-repo-replacements.txt ]]; then
27+
echo "filter-repo: replace-text from filter-repo-replacements.txt"
28+
git filter-repo --replace-text filter-repo-replacements.txt --force
29+
[[ -n "$ORIGIN" ]] && git remote add origin "$ORIGIN"
30+
fi
31+
32+
echo "History rewrite complete. Add clean demos, commit, then:"
33+
echo " git push --force-with-lease origin main"

0 commit comments

Comments
 (0)