Skip to content

Commit 681e03d

Browse files
committed
security: sanitized VHS demos and purge leaked history tooling
1 parent 4ca7022 commit 681e03d

4 files changed

Lines changed: 69 additions & 2 deletions

File tree

demos/vhs/demo-30s.tape

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ Set Height 720
66
Set Theme "Catppuccin Mocha"
77
Set TypingSpeed 50ms
88

9-
Type "# ChainForge · smart contracts and audits" Enter
9+
Hide
10+
Type "source demos/vhs/sanitize-recording-env.sh" Enter
11+
Sleep 400ms
12+
Show
13+
14+
Type "# ChainForge - smart contracts and audits" Enter
1015
Sleep 600ms
1116

1217
Hide
18+
Type "source demos/vhs/sanitize-recording-env.sh" Enter
19+
Sleep 300ms
1320
Type "python3 scripts/validate_profile.py ." Enter
1421
Sleep 5s
1522
Type "head -16 SOUL.md" Enter
@@ -20,5 +27,5 @@ Show
2027

2128
Type "hermes profile install github.com/codegraphtheory/chainforge --name chainforge --yes" Enter
2229
Sleep 4s
23-
Type "# Security-first profile · validate before you ship" Enter
30+
Type "# Security-first profile - validate before you ship" Enter
2431
Sleep 3s
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
# Public-safe shell identity for VHS terminal recordings.
3+
set -euo pipefail
4+
_VHS_SANITIZE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
_REPO_ROOT="$(cd "$_VHS_SANITIZE_DIR/../.." && pwd)"
6+
7+
export VHS_RECORDING=1
8+
export HOME="$_REPO_ROOT/demos/vhs/staging/home/graphtheory"
9+
export USER=graphtheory
10+
export LOGNAME=graphtheory
11+
export HOSTNAME=cyber
12+
13+
mkdir -p "$HOME/users/graphtheory/projects"
14+
_WORKSPACE="$HOME/users/graphtheory/projects/$(basename "$_REPO_ROOT")"
15+
ln -sfn "$_REPO_ROOT" "$_WORKSPACE"
16+
17+
export PS1='graphtheory@cyber:~/users/graphtheory/projects/'"$(basename "$_REPO_ROOT")"'$ '
18+
export PROMPT_COMMAND=
19+
cd "$_WORKSPACE"
20+
21+
if [[ -f "$_VHS_SANITIZE_DIR/env.sh" ]]; then
22+
# shellcheck source=env.sh
23+
source "$_VHS_SANITIZE_DIR/env.sh"
24+
else
25+
export REPO_ROOT="$_REPO_ROOT"
26+
fi

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)