Files
antonym/.claude/hooks/block-risky-bash.sh
Dorian 814957cd37 feat: add eslint, image upload, tests, splash tagline, security hooks
- Restore CLAUDE.md with project conventions
- ESLint config with vue3-recommended + typescript
- Image upload endpoint (POST /api/admin/upload) with 5MB limit
- Admin product form now supports image upload/preview/removal
- Vitest config + 19 tests (crypto, validation, btcpay webhook, types)
- Restore .claude/ security hooks (block-risky-bash, protect-files)
- Logo splash now shows "EVERYTHING YOU LOVE IS A PSYOP" tagline
- Add .vite/ to gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 00:47:42 +00:00

33 lines
559 B
Bash
Executable File

#!/bin/bash
# Block dangerous bash commands
INPUT=$(cat)
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
if [ -z "$COMMAND" ]; then
exit 0
fi
# Block destructive operations
BLOCKED_PATTERNS=(
"rm -rf"
"git reset --hard"
"git push -f"
"git push --force"
"git clean -fd"
"chmod -R 777"
":(){ :|:& };:"
"mkfs"
"> /dev/"
"dd if="
)
for pattern in "${BLOCKED_PATTERNS[@]}"; do
if echo "$COMMAND" | grep -qF "$pattern"; then
echo "Destructive ${pattern%% *} blocked by security hook" >&2
exit 2
fi
done
exit 0