ADR-005: Matrix federation deliberately OFF; real DNS server_name via a clean homeserver rebuild
Status: Accepted — 2026-06-26 (grill-with-docs session). Timing fixed: the clean rebuild runs early July, before any SDK-crypto work and before real carrier onboarding. · Datum: 2026-06-26
- Status: Accepted — 2026-06-26 (grill-with-docs session). Timing fixed: the clean rebuild runs early July, before any SDK-crypto work and before real carrier onboarding.
- Date: 2026-06-26
- Deciders: Frank + neusta (ops own the homeserver/SSH access)
- Related: [[1 Analysis/ADRS/ADR-004-chat-keep-custom-ui-adopt-matrix-sdk-megolm]] (SDK-Megolm adoption depends on stable MXIDs), findings K8-M09 / K8-M06 (insecure key handling) / DB-H04 / DB-M09 (bare-IP server_name baked into MXIDs)
PreDev implementation exception — 2026-07-11
The sequencing rule is amended for disposable PreDev validation only:
- SDK/Rust Megolm may run on the current legacy bare-IP namespace to prove application behavior before the ops-owned rebuild.
- All accounts, rooms, devices, and crypto stores created under that namespace are disposable and must not become the durable onboarding identity.
- The clean
matrix.oriso-dev.siterebuild with federation off remains mandatory before real carrier onboarding. - After the rebuild, repeat multi-user messaging, reload, multi-device/recovery, audio, and video proof.
This exception records observed reality; it does not make server_name mutable or accept the bare-IP namespace as the final architecture. Helm #31 tracks the rebuild. Helm PR #32 was closed without merge; UserService PR #370 remains open.
Context
Matrix federation in ORISO is currently misconfigured, not deliberately off — the worst of both worlds. Synapse runs federation on by default: the homeserver listener resources include federation, there is no federation_domain_whitelist / send_federation: false anywhere, a federation port (8009/8448) is exposed, and a .well-known/matrix/server delegation is advertised. At the same time it is broken and weakened:
server_nameis a bare IP (91.99.219.182, earlier91.99.183.160). This is the known anti-pattern: it bakes the IP into every MXID (@user:91.99.219.182), so any IP change orphans all users and rooms, and it cannot federate properly.accept_keys_insecurely: trueandsuppress_key_validation_warnings: trueactively weaken the federation that is left on.- The only "off" switch present is cosmetic and client-side (
ORISO-Element/config.jsondisable_federation: true), with a domain that doesn't even match.
server_name is immutable after the homeserver's first start and is already embedded in MXIDs, so this cannot be fixed in place. There are no production users today.
Decision drivers
- ORISO is a closed counselling platform on a single homeserver; there is no use case for federating with the open Matrix network, and federation only enlarges the attack surface.
- MXID stability is a hard prerequisite for adopting matrix-js-sdk Megolm crypto ([[1 Analysis/ADRS/ADR-004-chat-keep-custom-ui-adopt-matrix-sdk-megolm]]): device keys and key backup bind to MXIDs, so the
server_namemust be final before crypto is enabled. - No production users → no migration cost; delete + recreate is acceptable (consistent with the project's "pre-prod, skip migration" rule).
Decision
Do a clean homeserver rebuild with:
- environment-specific stable Matrix identity names, never a bare IP:
- Pre-Dev:
server_name = matrix.oriso-dev.site; - Dev:
server_name = matrix.oriso.org; - Production/Main is outside the authorized scope of this work;
- Pre-Dev:
- federation explicitly off —
federation_domain_whitelist: [](orsend_federation: false), and drop the federation listener / port 8009/8448 and the.well-known/matrix/serverdelegation; - remove
accept_keys_insecurelyandsuppress_key_validation_warnings.
Timing: early July — after June 30 (the rebuild is not a prerequisite for the June-30 features, which run on the current homeserver) and before any SDK-crypto work and before onboarding real carriers. No data migration: existing test accounts/rooms are discarded and recreated.
Ownership: neusta/ops own the homeserver and SSH/kubectl access; the AI cannot and will not perform the rebuild (it is unowned infra). The AI prepares config and verification steps only.
Considered options
- Leave the bare-IP, half-on configuration. Rejected: every additional account gets a broken
@user:IPidentity, federation stays on-yet-weakened, and SDK-crypto adoption stays blocked. The cleanup debt grows daily. - Keep federation ON, but do it properly (real DNS, key validation, a whitelist). Rejected: there is no counselling use case for federation; it is pure added attack surface and operational complexity.
- Fix
server_namein place without a rebuild. Impossible:server_nameis immutable after first start and is already in every MXID.
Consequences
Positive: stable, DNS-based MXIDs that survive IP changes; a smaller attack surface appropriate for a counselling tool; unblocks the SDK-Megolm crypto adoption in ADR-004; resolves DB-H04 / K8-M09 / K8-M06 in one move.
Negative / cost: requires a clean rebuild and ops bandwidth (neusta); all current test accounts/rooms are discarded; it must happen before crypto adoption or that work is redone. The dependency makes ADR-004 step 2 (SDK Megolm) wait on this.
Status & progress (updated 2026-07-02)
-
Environment mapping clarified 2026-07-10: Pre-Dev is the runtime source of truth for this initiative and must use
matrix.oriso-dev.site. The separate Dev environment may usematrix.oriso.org. ORISO-Helm PR #32 (basedev) makes the value configurable and adds red-green guard tests against bare-IP identity config, but itsmatrix.oriso.orgdefault must not be mistaken for the Pre-Dev overlay. The PR is green and open; the Pre-Dev value, DNS/TLS, and the clean live install remain pending. -
Partially executed on Pre-Dev (oriso-dev.site) 2026-07-02 as part of the full-Matrix migration: Synapse upgraded 1.153.0 → v1.155.0 (latest stable, pinned tag instead of
:latest), federation listener resource removed (/_matrix/federationnow 404),federation_domain_whitelist: []set, andaccept_keys_insecurely/suppress_key_validation_warningsremoved — applied viakubectlon the pre-dev node (same mechanism as the sanctioned UserService hot-deploy). Backups: configmap + SQLite online backup (/data/homeserver.db.bak-20260702-pre1155), local copies in~/ORISO/_e2e-artifacts/matrix-upgrade-20260702/. Note: the deployment is helm-managed (oriso-platform-matrix-synapse), so a futurehelm upgradefrom ORISO-Kubernetes will revert the image/config unless the chart is updated — that chart update belongs to the neusta rebuild. -
server_namedeliberately NOT touched — still the bare IP91.99.183.160. Changing it requires the clean rebuild (wipes MXIDs), which stays owned by neusta/ops. No AI action on that part: the homeserver rebuild itself is unowned infra. -
The June-30 frontend work ([[1 Analysis/ADRS/ADR-004-chat-keep-custom-ui-adopt-matrix-sdk-megolm]]) runs on the current bare-IP homeserver and does not touch crypto, so it is not blocked by this rebuild. The unrelated react-router v7 migration landing on
dev(PR #329) has no bearing here. -
Action for Frank/neusta: provision DNS/TLS for
matrix.oriso-dev.siteon Pre-Dev (andmatrix.oriso.orgseparately on Dev), then do the clean rebuild (federation off, drop the federation listener/.well-known, removeaccept_keys_insecurely). This is the first hard prerequisite for the July crypto step and must precedeinitRustCrypto.
ADR-004: Keep the custom chat UI; adopt matrix-js-sdk Megolm under it (don't embed Element Web)
Status: Accepted — 2026-06-26 (grill-with-docs session). June-30 scope and the crypto sequencing are fixed; the SDK-Megolm migration itself is scheduled, not yet built. · Datum: 2026-06-26
ADR-006: `conversation_type` as a persisted modality field, rolled out selector-first
Status: Accepted — 2026-06-28 (grill-with-docs session). Decision made; implementation scheduled. · Datum: 2026-06-28