How to keep your public fork of this architecture safe from credential leaks, doxxing, and operational disclosure.
Never fork the private repo. Always git init a fresh repo. Copying is how secrets leak.
Run all three:
# Install if needed
brew install gitleaks detect-secrets
pip install trufflehog
# Scan your working directory
gitleaks detect --no-git
trufflehog filesystem .
detect-secrets scan --all-files .Fix every finding before committing.
| Category | What to look for | Replace with |
|---|---|---|
| IPs | 10.27.1.x, specific private ranges |
10.0.0.x, 192.168.1.x (RFC 1918 examples) |
| Public IPs | Real Hetzner/AWS IPs | <YOUR_VPS_IP> |
| Domains | Real domain | example.com, <YOUR_DOMAIN> |
| Subdomains | msam.guatulab.com |
msam.example.com |
| Usernames | Real usernames | <YOUR_USER>, user |
| Email addresses | Personal emails | <YOUR_EMAIL> |
| UUIDs | Paperclip/Linear/service UUIDs | <YOUR_WORKSPACE_ID> |
| API keys | sk-..., ghp_..., eyJ... |
<YOUR_API_KEY> |
| Tokens | Bearer tokens, Matrix tokens | Remove entirely or <YOUR_TOKEN> |
| Bucket names | tofu-state, backups-<company> |
<YOUR_BUCKET> |
| Node names | bifrost, fenrir |
Generic (node-01) or keep if not sensitive |
| GPU specs | If specific to your hardware | Generic (<YOUR_GPU>) |
| Company names | References to your company | <YOUR_COMPANY> (unless self-promoting in README) |
- Architecture patterns (naming conventions, layer structure)
- Script logic (with paths replaced by env vars)
- Mermaid diagrams (with labels anonymized)
- Best practice documentation
- Research and references
Manual curation only. Never automate this.
Bad: git pull private && git push public (will leak secrets eventually)
Good: for each update, review the diff, copy sanitized version to public repo, commit separately
Suggested workflow:
- Make the change in your private repo
- Verify it works
- Manually create the equivalent change in the public repo directory
- Run
gitleaksandtrufflehogon the public repo - Commit and push
If you accidentally commit a secret:
- Rotate the secret immediately — do not assume the commit will save you
- Use
git-filter-repoto rewrite history:git filter-repo --path <leaked-file> --invert-paths git push --force origin main
- Force-push (you're rewriting history — coordinate with any collaborators)
- Check if GitHub caching surfaces the secret at
github.com/<user>/<repo>/blame/<commit-hash>/<file>— if yes, contact GitHub Support - Scan GitHub/Google for the leaked value to see where else it's indexed
Drop this in .git/hooks/pre-commit:
#!/bin/bash
# Block commits containing common credential patterns
if git diff --cached | grep -E 'sk-[A-Za-z0-9]{32}|ghp_[A-Za-z0-9]{36}|AKIA[A-Z0-9]{16}|eyJ[A-Za-z0-9_-]{20}\.[A-Za-z0-9_-]{20}'; then
echo "BLOCKED: Commit contains what looks like a credential"
echo "If this is a false positive, use git commit --no-verify"
exit 1
fiMake it executable: chmod +x .git/hooks/pre-commit
Run ./scripts/check-sanitization.sh (provided in this repo) before publishing.