Patch notes — server.py break-out + repo cleanup (2026-06-15, merge `24d2407`)
The ~8,500-line server.py monolith is now the ethica/ package — a behaviour-preserving
split, merged to main and deployed. Plus a Hugo dead-file cleanup and a docs centralisation.
Docker smoke 157/0 on the merged tree. Plan + final report:
../../ethica-no/migration/monofile-service.md.
1 — server.py break-out ✅
server.py is now a 7-line wrapper (from ethica.main import main); everything moved
verbatim into a focused package (no route URL, HTML, auth/CSRF, schema, or feature change):
ethica/ config · constants
core/ db · security · auth · csrf · oidc · mail · integrations
ui/ html · widgets · chrome · admin_nav
services/ search · monitoring · queries
handlers/ base · dispatch · ctx + route mixins (public, crm, billing,
servicedesk, newsletter, auth, account, settings)
app.py (composes Handler) · main.py (entrypoint)
- Done in 20 smoke-gated steps on
refactor/server-breakout(13 commits), then merged tomainwith--no-ffafter a 157/0 smoke on the merged tree. Branch kept. - The request
Handleris composed from the route-group mixin classes via MRO; each mixin imports its globals fromethica.handlers.ctx(a re-export hub). Strict dependency direction (handlers → ctx → ui/services/core → constants/config); no cycles. - Background threads (deploy/TLS monitor, newsletter sender) still start once in
main(). - Architecture doc rewritten:
admin-architecture.md§9. - One real defect was found by the smoke during the final step and fixed — see the bugfix
report:
../Bugfix/bugfix-report-2026-06-15-server-breakout.md.
2 — Hugo dead-file cleanup ✅
Removed leftovers from the old Hugo build that nothing referenced or served (verified: the only
asset-pipeline call is resources.Get "author.jpg", which doesn’t exist; Hugo build green):
the whole assets/ dir (~45 MB of orphaned AI/stock images + an unused custom.css),
static/about.txt (favicon-generator boilerplate), the dead archetypes/{host,incident,runbook, service}.md, and the stale homepageImage param. assets/css/DESIGN.md was preserved (moved
to the repo’s docs/).
3 — Engineering docs centralised ✅
The Ethica.no repo’s internal engineering docs (architecture, specs, patch notes, reviews) were
moved to the central homelab docs repo at Homelab-Doc → docs/services/ethica-no/, leaving
a pointer stub. (Customer-facing product docs remain here in EthicaDoc → dokument.ethica.no.)
Verification
py_compile of server.py + all ethica/** clean; docs_reader (27) + newsletter (7) unit
tests pass; Docker smoke 157/0 on the merged main (same build CI runs). Merged + pushed
(24d2407); the refactor/server-breakout branch is kept.