rouse-context/docs
Jason Monk ca5d1cab13 Fix #70: Parameterize base domain for self-hosting
Extract the hardcoded "rousecontext.com" base domain to a single Gradle
property (`-Pdomain`) that flows through BuildConfig to all Kotlin call
sites, and to a matching optional config field on the Rust relay. A fork
can now point a deployment at their own domain by setting one value.

Kotlin:
- New `BASE_DOMAIN` buildConfigField in :app, driven by `-Pdomain`
  Gradle property (default "rousecontext.com"). `RELAY_HOST` derives
  from it unless `-Prelay.host` is set explicitly.
- `McpUrlProvider` default reads `BuildConfig.BASE_DOMAIN`.
- `AppModule` session hostname uses `BuildConfig.BASE_DOMAIN` directly
  instead of stripping "relay." from `RELAY_HOST`.
- `CertProvisioningFlow` / `CertRenewalFlow` / `CtLogMonitor` accept
  base domain via constructor (still with a safe default so tests don't
  need to change).

Rust relay:
- New `base_domain` field on `ServerConfig`. Empty (default) means
  "derive by stripping 'relay.' from relay_hostname" -- the existing
  convention. Operators with non-conforming hostnames can set it.
- `ServerConfig::resolved_base_domain()` helper centralizes the lookup.
- `RELAY_BASE_DOMAIN` env var override.
- Removed duplicate `strip_prefix("relay.")` logic in main.rs, api/register.rs,
  api/renew.rs in favor of the helper.

Docs:
- `docs/self-hosting.md` walks through Cloudflare + Firebase + keystore
  setup, Android build with `-Pdomain=...`, Rust relay cross-compile and
  systemd deployment, and verification steps.

Test fixtures (test-only hostnames like "test.rousecontext.com",
@Preview composables, e2e helpers) remain as-is -- they're load-bearing
assertions about the URL format, not deployment-specific constants.

Verified:
- ./gradlew :app:compileDebugKotlin ktlintCheck :app:testDebugUnitTest
- ./gradlew -Pdomain=example.com :app:compileDebugKotlin (BuildConfig
  shows BASE_DOMAIN="example.com", RELAY_HOST="relay.example.com")
- ./gradlew -Pdomain=example.com :app:testDebugUnitTest (still green)
- cd relay && cargo test && cargo clippy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:06:07 -04:00
..
auth-pages Regenerate auth page gallery with correct icon 2026-04-08 08:53:44 -04:00
design Fix #79: Remove stale NotificationModel references from docs 2026-04-12 13:02:21 -04:00
notifications Fix #79: Remove stale NotificationModel references from docs 2026-04-12 13:02:21 -04:00
screenshots Regenerate screenshots after design language refactor 2026-04-07 12:25:12 -04:00
device-test-report.md Add device integration test report and screenshots 2026-04-07 09:03:32 -04:00
e2e-status.md Document e2e status: mTLS connection works, passthrough routing is the current blocker 2026-04-06 14:10:36 -04:00
overnight-plan-2.md Add connection hardening, integration test gaps to backlog and plan 2026-04-06 17:11:39 -04:00
screenshot_audit_tab.png Add device integration test report and screenshots 2026-04-07 09:03:32 -04:00
screenshot_connected.png Add device integration test report and screenshots 2026-04-07 09:03:32 -04:00
screenshot_dashboard.png Add device integration test report and screenshots 2026-04-07 09:03:32 -04:00
screenshot_settings_tab.png Add device integration test report and screenshots 2026-04-07 09:03:32 -04:00
security-audit-2026-04-07.md Add security audit report: 23 findings across 4 severity levels 2026-04-07 08:49:14 -04:00
security-decisions.md Add security decisions log for evaluated-and-accepted risks 2026-04-07 09:07:31 -04:00
security.md Add comprehensive security overview document 2026-04-10 09:39:55 -04:00
self-hosting.md Fix #70: Parameterize base domain for self-hosting 2026-04-12 13:06:07 -04:00
test-coverage-audit.md Fix #79: Remove stale NotificationModel references from docs 2026-04-12 13:02:21 -04:00
workflow.md Add T-11 security monitoring task, renumber subsequent tasks 2026-04-04 19:48:46 -04:00