matrix apiUrl: default to https on the gateway vhost
hive-c0re logs in with the hive's matrix sender token and creates the Space and rooms over swarm.matrix.apiUrl. On a hive that does not run the homeserver that crosses the network, so the default is now https://<gatewayHost>. hive-c0re already verifies against the hive trust bundle (SSL_CERT_FILE: system CAs, swarm root and the store's services root), which covers the gateway's leaf for that name. Also drops the remaining loopback-default wording in hive-c0re's matrix module and the openFirewall description, and pins the https default on a hive host without the homeserver in module-eval-matrix-core.
This commit is contained in:
parent
bed4358e19
commit
55a67e38fa
7 changed files with 56 additions and 35 deletions
|
|
@ -21,8 +21,8 @@ use reqwest::StatusCode;
|
|||
/// fallback: `localhost:8008` is right only when the homeserver happens to
|
||||
/// share this daemon's netns, and an address baked into the binary is one
|
||||
/// that builds fine and then talks to the wrong machine. The nix module
|
||||
/// supplies the loopback address when it is itself the thing running
|
||||
/// tuwunel, where it is not a guess but a fact about what it just started.
|
||||
/// defaults it to `https://` on the homeserver's gateway vhost, on every
|
||||
/// hive whichever host runs tuwunel.
|
||||
///
|
||||
/// Also not an agent-facing address either way. An agent has its own netns;
|
||||
/// agents are handed the gateway vhost via `HIVE_MATRIX_URL`, and get
|
||||
|
|
@ -126,12 +126,9 @@ pub fn hive_chat_room_id_path() -> PathBuf {
|
|||
|
||||
/// Whether this hive has a homeserver to provision against.
|
||||
///
|
||||
/// **A configured API URL, not a local container.** It used to scan
|
||||
/// `nixos-container list` for `hive-matrix`, which answers a different
|
||||
/// question — "is the homeserver a container on this host" — and so made a
|
||||
/// remote homeserver silently no-op no matter how it was addressed. The
|
||||
/// nix module still supplies the loopback URL whenever it runs tuwunel
|
||||
/// itself, so a co-located hive behaves exactly as before.
|
||||
/// **A configured API URL, not a local container**: whether the homeserver
|
||||
/// runs on this host is a different question, and a remote homeserver is
|
||||
/// provisioned through the same URL.
|
||||
#[must_use]
|
||||
pub fn is_present() -> bool {
|
||||
matrix_http().is_some()
|
||||
|
|
|
|||
Loading…
Reference in a new issue