Commit graph

4 commits

Author SHA1 Message Date
Forge
edf5db2499 Fix: move expires_at migration before index creation 2026-05-20 20:19:49 +00:00
Viktor
d77c14b328 fix: validate Content-Length + add paste expiry/TTL
Fixes #1 and #2:

1. Content-Length validation (security):
   - Reject negative Content-Length values that cause rfile.read(-1) to hang
   - Handle non-integer Content-Length gracefully

2. Paste expiry / TTL:
   - Add expires_at column to pastes table
   - Default TTL: 30 days (configurable via --max-age or FORGE_PASTE_MAX_AGE)
   - Opportunistic cleanup on each paste creation (at most once/hour)
   - Expired pastes excluded from reads immediately
   - Auto-migration for existing databases (backfills expiry on existing pastes)
   - Expiry info shown in paste viewer UI
   - --max-age 0 disables expiry entirely

Closes #1
Closes #2
2026-05-19 11:17:01 +00:00
Pelican Installer Bot
335e5b8e36 fix: move global declaration before use 2026-05-17 13:36:27 +00:00
Pelican Installer Bot
8e777431ba feat: Forge Paste — lightweight self-hosted paste server
- Zero dependencies (Python 3 stdlib + SQLite)
- Hastebin-compatible API
- Clean dark UI matching Forge Panel
- systemd service included
- ~330 lines, single file
2026-05-17 13:36:02 +00:00