Moderating gitGost
GitGost provides moderation tools to combat abuse while preserving user privacy.Panic Button
The panic button immediately suspends all push operations when abuse is detected.How It Works
When activated:- ✅ Service continues running (health checks pass)
- ❌ All push operations are rejected
- 📢 Users see suspension message
- 🔄 Can be toggled on/off instantly
Activate Panic Mode
Suspend the service immediately:Deactivate Panic Mode
Restore normal service:Shell Aliases for Quick Access
Add to~/.zshrc or ~/.bashrc for instant access:
User Experience During Suspension
When users attempt to push while panic mode is active:internal/http/handlers.go:142-157:
Implementation Details
Implementation Details
The panic mode check occurs early in the push handler, before any processing:This ensures zero resource consumption for suspended requests.
Burst Rollback
When bot attacks create many PRs, you can close them all in bulk.How Burst Rollback Works
Detection
GitGost monitors push activity globally across all IPs. When suspicious patterns emerge:
- 20+ pushes within 60 seconds, OR
- 10+ distinct IPs pushing simultaneously
Execute Rollback
Rollback Rate Limiting
To prevent abuse of the rollback endpoint:- Maximum: 5 rollback requests per minute per IP
- Response:
429 Too Many Requestsif exceeded
internal/http/handlers.go:844-860
ntfy Alert Integration
Real-time alerts help you respond quickly to abuse.Configure ntfy Alerts
Alert Types
1. Rate Limit Exceeded
Triggered when a single IP exceeds 5 PRs/hour:2. Suspicious Burst Activity
Triggered during coordinated attacks:internal/http/handlers.go:707-730
ntfy Action Buttons
Alerts include single-use tokens valid for 10 minutes:How Action Tokens Work
How Action Tokens Work
- Each alert generates unique tokens per button
- Tokens expire after 10 minutes
- Tokens are consumed on first use
- Prevents accidental double-triggers
- Never exposes your
PANIC_PASSWORDin notifications
internal/http/handlers.go:617-641Subscribe to Alerts
On your phone:- Install ntfy app (iOS/Android)
- Subscribe to your topic:
https://ntfy.sh/secret-admin-channel-xyz - Enable notifications
https://ntfy.sh/secret-admin-channel-xyz
Via command line:
Hash Reporting System
GitGost includes a karma-based identity system for anonymous comments on issues/PRs.How It Works
Report Thresholds
Frominternal/http/handlers.go:610-614:
| Reports | State | Action |
|---|---|---|
| 0-2 | registered | Internal log only |
| 3-5 | flagged | 6h cooldown, karma → 0 |
| 6+ | blocked | Comments deleted, hash banned |
Report Workflow
User visits report link:- Current report count
- Hash state (registered/flagged/blocked)
- Moderation policy
- Submit button (one report per IP)
Rate Limiting
Multiple rate limits protect against abuse:1. Per-IP PR Rate Limit
- Limit: 5 PRs per hour per IP
- Window: Rolling 1-hour window
- Enforcement:
internal/http/handlers.go:733-759
2. Admin Endpoint Rate Limit
- Limit: 10 requests per minute per IP
- Applies to:
/admin/panic,/admin/rollback - Enforcement:
internal/http/router.go:22-46
3. Rollback Rate Limit
- Limit: 5 rollback calls per minute
- Purpose: Prevent accidental mass PR closures
- Enforcement:
internal/http/handlers.go:844-860
Moderation Best Practices
Response Workflow
When you receive an alert:
- Assess severity
- Single IP rate limit → Monitor, may be legitimate
- Burst from many IPs → Likely bot attack
- Activate panic if needed
- Tap action button OR use shell alias
- Stops attack immediately
- Review created PRs
- Check GitHub for spam PRs
- Verify if rollback is needed
- Execute rollback
- Close all burst PRs in one operation
- Deactivate panic
- Restore service once threat is neutralized
- Post-mortem
- Review logs for patterns
- Consider adjusting rate limits if needed
Prevention Tips
- Monitor trends: Watch for gradual increases in push rates
- Test alerts: Periodically test your ntfy subscription
- Document incidents: Keep a log of abuse patterns
- Update rate limits: Adjust thresholds based on traffic patterns
Moderation Commands Reference
Quick Command Reference
Quick Command Reference
Panic button:Rollback burst:Check service status:Using action tokens (from ntfy alerts):
Next Steps
Monitoring
Set up health checks and metrics monitoring
Troubleshooting
Diagnose and fix common operational issues