soyailabs / fix_history.sh
SOY NV AI
Security: Remove all hardcoded Hugging Face tokens from history
4434cfe
raw
history blame
895 Bytes
#!/bin/bash
TOKEN="YOUR_HUGGINGFACE_TOKEN_HERE"
REPLACEMENT="YOUR_HUGGINGFACE_TOKEN_HERE"
FILES=(
"remove_token_from_history.ps1"
"EXAONE_์ถ”๊ฐ€_์•ˆ๋‚ด.md"
"add_exaone_with_token.py"
"download_exaone_model.py"
"install_exaone_direct.py"
"install_exaone_simple.py"
)
echo "Git ํžˆ์Šคํ† ๋ฆฌ์—์„œ ํ† ํฐ ์ œ๊ฑฐ ์ค‘..."
for file in "${FILES[@]}"; do
echo "์ฒ˜๋ฆฌ ์ค‘: $file"
# PowerShell์„ ์‚ฌ์šฉํ•˜์—ฌ ํŒŒ์ผ ๋‚ด์šฉ ๊ต์ฒด
git filter-branch --force --tree-filter \
"if [ -f \"$file\" ]; then \
powershell -Command \"(Get-Content '$file' -Raw) -replace '$TOKEN', '$REPLACEMENT' | Set-Content '$file' -NoNewline\" 2>/dev/null || \
sed -i 's/$TOKEN/$REPLACEMENT/g' \"$file\" 2>/dev/null; \
fi" \
--prune-empty --tag-name-filter cat -- --all 2>&1 | grep -E "(Rewrite|Already)" || true
done
echo "์™„๋ฃŒ!"