mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-11-29 11:13:05 +00:00
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>
|
||
|---|---|---|
| .. | ||
| auth-pages | ||
| design | ||
| notifications | ||
| screenshots | ||
| device-test-report.md | ||
| e2e-status.md | ||
| overnight-plan-2.md | ||
| screenshot_audit_tab.png | ||
| screenshot_connected.png | ||
| screenshot_dashboard.png | ||
| screenshot_settings_tab.png | ||
| security-audit-2026-04-07.md | ||
| security-decisions.md | ||
| security.md | ||
| self-hosting.md | ||
| test-coverage-audit.md | ||
| workflow.md | ||