maint: Dependency upgrades and High backlog items (v2.11.0)

- All dependencies to current releases (97 known vulnerabilities -> 0),
  Python 3.14, uv pinned, requirements-test.txt, lxml/dateutil pinned
- CSRF tokens on admin forms, logout and IndieAuth consent
- IndieAuth client and crosspost link-card fetches via safe_get
- FLASK_DEBUG/FLASK_ENV default off/production; image sets them
- Foreign keys enforced on pooled connections; migration 018 removes orphans
- Rate limits shared across processes (rate_limits, migration 019)
- datetime.utcnow() and sqlite3 default adapters replaced
- compose.yaml fixed; duplicate dev_auth.py and test.ini removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-03 13:09:52 -07:00
1 parent 9f17e145ff
commit 75946be7b2
67 files changed
+885 -498

No files matched your search

+5 -1
View File
@@ -21,7 +21,7 @@ is in `../architecture/`; decisions are in `../decisions/` (ADRs).
## Contents
[v1.0.0](#v100) · [v1.1.1](#v111) · [v1.1.2](#v112) · [v1.2.0](#v120) · [v1.3.0](#v130) · [v1.3.1](#v131) · [v1.4.0](#v140) · [v1.4.1](#v141) · [v1.4.2](#v142) · [v1.5.0](#v150) · [v1.6.0](#v160) · [v2.0.0](#v200) · [v2.0.1](#v201) · [v2.0.2](#v202) · [v2.1.0](#v210) · [v2.2.0](#v220) · [v2.3.0](#v230) · [v2.3.1](#v231) · [v2.3.2](#v232) · [v2.3.3](#v233) · [v2.4.0](#v240) · [v2.5.0](#v250) · [v2.6.0](#v260) · [v2.6.1](#v261) · [v2.6.2](#v262) · [v2.6.3](#v263) · [v2.6.4](#v264) · [v2.6.5](#v265) · [v2.6.6](#v266) · [v2.6.7](#v267) · [v2.6.8](#v268) · [v2.6.9](#v269) · [v2.7.0](#v270) · [v2.7.1](#v271) · [v2.7.2](#v272) · [v2.8.0](#v280) · [v2.8.1](#v281) · [v2.9.0](#v290) · [v2.10.0](#v2100) · [v2.10.1](#v2101) · [v2.10.2](#v2102) · [hotfix](#hotfix)
[v1.0.0](#v100) · [v1.1.1](#v111) · [v1.1.2](#v112) · [v1.2.0](#v120) · [v1.3.0](#v130) · [v1.3.1](#v131) · [v1.4.0](#v140) · [v1.4.1](#v141) · [v1.4.2](#v142) · [v1.5.0](#v150) · [v1.6.0](#v160) · [v2.0.0](#v200) · [v2.0.1](#v201) · [v2.0.2](#v202) · [v2.1.0](#v210) · [v2.2.0](#v220) · [v2.3.0](#v230) · [v2.3.1](#v231) · [v2.3.2](#v232) · [v2.3.3](#v233) · [v2.4.0](#v240) · [v2.5.0](#v250) · [v2.6.0](#v260) · [v2.6.1](#v261) · [v2.6.2](#v262) · [v2.6.3](#v263) · [v2.6.4](#v264) · [v2.6.5](#v265) · [v2.6.6](#v266) · [v2.6.7](#v267) · [v2.6.8](#v268) · [v2.6.9](#v269) · [v2.7.0](#v270) · [v2.7.1](#v271) · [v2.7.2](#v272) · [v2.8.0](#v280) · [v2.8.1](#v281) · [v2.9.0](#v290) · [v2.10.0](#v2100) · [v2.10.1](#v2101) · [v2.10.2](#v2102) · [v2.11.0](#v2110) · [hotfix](#hotfix)
## v1.0.0
@@ -410,6 +410,10 @@ OIDC admin login and built-in IndieAuth server.
- [2026-11-03-reply-context-fetch.md](v2.10.2/2026-11-03-reply-context-fetch.md) - Reply contexts fetched again (fetch_source returns three values since v2.7.0)
## v2.11.0
- [2026-11-03-maintenance-release.md](v2.11.0/2026-11-03-maintenance-release.md) - Dependency upgrades (Python 3.14), foreign keys, CSRF, fetchers, debug default, shared rate limits
## hotfix
Not a release folder.
@@ -0,0 +1,60 @@
# v2.11.0: Maintenance release
Dependency upgrades and the five High items in the backlog (all re-checked
against the code first and still present).
## Dependencies
`pip-audit` on the v2.10.2 set found 97 published vulnerabilities in eight
packages (Pillow 64, PyJWT 22, gunicorn 4, Flask 2, Markdown 2,
python-dotenv 2, pytest 2, pillow-heif 1). All direct dependencies were moved
to their current minor series (`requirements.txt`); the new set has no known
vulnerabilities. Python moved from 3.11 to 3.14 (`python:3.14-slim`); the
whole suite passes with `-W error::DeprecationWarning`.
- `requirements-test.txt` (pytest, pytest-mock) is installed by the
Containerfile test stage; pytest left the runtime requirements.
- `lxml` and `python-dateutil` are pinned (used directly, previously only
transitive). `uv` is pinned to 0.9.28 in the Containerfile.
- `datetime.utcnow()` (34 calls in `starpunk/`, more in tests) became
`datetime.now(timezone.utc).replace(tzinfo=None)`: same naive-UTC values.
sqlite3's default datetime adapters, deprecated in 3.12, are registered
explicitly in `starpunk/database/__init__.py` with the same output.
## High backlog items
1. **Foreign keys.** `PRAGMA foreign_keys=ON` on every pooled connection
(`database/pool.py`); all deletes of notes, media and WebSub subscriptions
go through the pool. Every foreign key is `CASCADE` or `SET NULL`, so no
delete can be blocked. Migration 018 removes orphans (production: three
`note_tags` rows from hard-deleted notes). Crosspost rows still have no
foreign key on purpose.
2. **CSRF.** `starpunk/csrf.py`: token = HMAC-SHA256(SECRET_KEY,
"csrf:" + starpunk_session cookie); `before_request` checks the
`csrf_token` field or `X-CSRF-Token` header on every admin POST,
`auth.logout` and `indieauth.approve`; 400 otherwise. All 12 POST forms
carry it. `CSRF_ENABLED` (default true); test apps turn it off unless they
set it.
3. **Fetchers.** `indieauth.fetch_client_redirect_uris` and
`syndication._fetch_public` use `webmention_ssrf.safe_get` (per-hop
checks, DNS pinning, hard deadline). `safe_get` gained `truncate` for
reads that stop at the size limit.
4. **Debug default.** `FLASK_DEBUG` defaults to 0 and `FLASK_ENV` to
production; the runtime image sets both.
5. **Shared rate limits.** `SharedRateLimiter` keeps sliding-window counters
in `rate_limits` (migration 019): current window plus the previous one
weighted by overlap. Used by `/webmention` (per IP and per source domain)
and `/websub`; old windows are pruned every 200 calls.
## Housekeeping
`compose.yaml` no longer pins 0.6.0 or sets `VERSION`/`ENVIRONMENT`; the
unused root `dev_auth.py` and the committed `test.ini` were removed.
## Tests
New: `tests/test_csrf.py`, `tests/test_foreign_keys.py`,
`tests/test_shared_rate_limit.py`, IndieAuth client-metadata tests through the
fetcher (including a redirect to a private address). Crosspost tests route
link-card fetches through the fetcher's transport. Full suite: 1264 passed
on Python 3.14.