HTTP Display Server
HTTP Display Server
Read references/specification.md, references/engineering-contract.md and references/health-checks.md before implementation. The fixed Python module inventory appears in references/specification.md.
- Inspect the frozen BMGeoIP HTTP examples under
references/source/bmgeoip/bmgeoip/server/. These illustrate transport only, not an application to copy wholesale. - For human-facing HTML, inspect the frozen BMDynIP
references/source/bmdynip/bmdynip/server/static/index.htmlandstyle.css. Follow the dark, organized panel/table design, not BMDynIP’s DNS logic, branding or exact colors. Let the AI choose an application-specific dark palette with saturated primary accents and high contrast; no pastels. Use CSS tokens, readable forms and statuses, visible focus and mobile-friendly layouts. The GUI acceptance contract is inreferences/specification.md. API-only services need no GUI. - Build an application-owned
http.server.ThreadingHTTPServerand request handler; choose actual routes, bind port/interface, templates, and configuration from this application’s requirements. Use Jinja2 only when rendering HTML. No Flask, FastAPI, Django or replacement framework without approval. - Supply an on-demand
GET /healththrough this HTTP application, including relevant internal checks on existing component interfaces. No new monitoring daemon. - When providing a user-facing UI, apply the already-installed
bmforge-localizationskill for translated text, request-local language selection and HTMLlang, without changing the HTTP transport’s approved Python module list. - Display timestamps in the application’s local timezone (default: server local time), consistently in server and browser views. Use
yyyy-mm-dd hh:mm:ss, zero padding and a 24-hour clock; never display fractional seconds. Apply this to tooltips and selected visualization/timeline views too. Keep UTC/offset-bearing machine timestamps and persistence separate from display strings; follow the specification’s timezone and daylight-saving checks. - Only when a security-event producer is selected: resolve the real client source at the HTTP ingress boundary. Behind a proxy, trust the forwarded address only from an explicitly trusted immediate peer and an overwriting proxy header. Reject forged/missing/invalid values, normalize numeric IPv4/IPv6, bind per-request context for
bmforge-security-eventsand restore it reliably. Business logic emits an event name only; HTTP does not import Fail2ban/ZMQ, count attempts or request bans. Test both direct and proxied paths and installed listener exposure. - Keep workflow logic in
activity/, external and domain bridges ininterface/, and data values inentity/. Request handlers must not issue SQL directly. - Place the literal
BMFORGE_COMPONENTmarker with IDbmforge.http-serverand spec version0.5.1in the owning implementation module. - Run the contract’s acceptance tests in the consumer. Do not treat copying the example as completion.