71475299
web: http server, sourcehut chrome, compare/commit pages
Implement the compare.sr.ht HTTP layer over the committed core/gitx/authz packages: - Server assembly (New) from shared SourceHut config: [git.sr.ht] repos, [meta.sr.ht]/[compare.sr.ht] origins, [sr.ht] site-name/environment, and the hashed stylesheet resolved by globbing the embedded static FS. - Routes: landing, repo page, compare (base..base...head, .patch escape hatch), single-commit (+.patch), embedded static assets, healthz. Compare form GET canonicalizes to a clean URL via 302. - SourceHut chrome port to html/template: nav service switcher (canonical order, paste/pages/hub excluded, compare active), login/logout with return_to, environment banner. - Embedded compare-data JSON (template.JS so html/template's script-context escaper leaves it verbatim; json.Marshal's HTML escaping blocks a </script> breakout) plus the vendored bundle.js scaffold. - httptest coverage with a stub Authorizer and a real git-CLI fixture repo. The cmd layer must wire, in order: RealIP, Recoverer, Logger, config.Middleware(conf,"compare.sr.ht"), authz.Middleware.
bigbes <bigbes@gmail.com> — 2026-07-18 18:15:04 UTC
Commit 714752996fc44e8b173a369b66e8648a74da5656 —
view raw patch
Parent(s):
9473e260
| File | Status | + | − |
|---|---|---|---|
web/chrome.go
|
A | +121 | |
web/handlers.go
|
A | +429 | |
web/router.go
|
A | +58 | |
web/server.go
|
A | +120 | |
web/templates.go
|
A | +94 | |
web/templates/commit.html
|
A | +81 | |
web/templates/compare.html
|
A | +83 | |
web/templates/error.html
|
A | +9 | |
web/templates/index.html
|
A | +54 | |
web/templates/layout.html
|
A | +61 | |
web/templates/repo.html
|
A | +72 | |
web/web_test.go
|
A | +485 |