Repository navigation
Description
The gap
docs/architecture/sunset.md lists this under Known gaps:
The 410 body carries no
sunset_url.
Why it matters
While the hosted service is export-only, SunsetWriteBlockMiddleware answers every blocked write with 410 Gone and a detail sentence and nothing else. A client that hits that wall has no machine-readable way to reach the page explaining what happened — it would have to already know to call GET /health, which does return sunset_url. The two places a client learns the service is winding down should hand back the same URL.
The hosted data is purged on 18 Oct 2026, so anything that helps a user find the export page is worth doing soon.
Where
surfsense_backend/app/sunset.py— theJSONResponseat the end ofSunsetWriteBlockMiddleware.dispatch(), and the_DETAILconstant above it.sunset_url()already lives in that same module and is whatGET /healthreads, so the value is there for the taking. Don't add a second way to readSUNSET_URL.
What done looks like
- The 410 body carries
sunset_urlnext todetail. - It comes from
sunset_url(), so a deployment that setsSUNSET_URLchanges the health field and the 410 together. - The "Refusing writes" section of
docs/architecture/sunset.mdquotes the refusal body — update that quote. - Delete the Known gaps line in the same PR.
This is not a contract change: contract 4 covers GET /health only and says nothing about the 410 body, so you do not need sign-off from both sides.
How to verify
Tests for this middleware already exist in surfsense_backend/tests/unit/test_sunset_write_block.py. Add one that a blocked write returns 410 with sunset_url in the body, and one that a custom SUNSET_URL shows up there. Write the failing test first.
cd surfsense_backend
uv run pytest -m unit -k sunset
uv run ruff check .
python ../scripts/check_docs.pyBefore you start
Read CONTRIBUTING.md and the sunset doc. Open your PR against dev, not main. Comment here to claim this.
Activity
fix(sunset): include sunset_url in the 410 export-only body
MODSetter commentedon Sep 29, 2026
Fixed by #2022,
fix(sunset): include sunset_url in the 410 export-only body, by @MannXo. Merged intodev.Closing by hand rather than by keyword:
Fixes #1938only auto-closes on a merge to the default branch, and this repo merges throughdev(CONTRIBUTING), so this would have stayed open and claimable while the work was already done. It reachesmainwith the next release.Nothing left to pick up here.