From b885e206ce1265ccfbf112c0fd64f7e5ecb3f196 Mon Sep 17 00:00:00 2001 From: Ginger Date: Tue, 3 Mar 2026 14:51:51 -0500 Subject: [PATCH] fix: Use server name in index again --- src/web/pages/index.rs | 14 ++------------ src/web/pages/templates/_components/form.html.j2 | 2 +- src/web/pages/templates/index.html.j2 | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/web/pages/index.rs b/src/web/pages/index.rs index 376f6ca4..2935aa46 100644 --- a/src/web/pages/index.rs +++ b/src/web/pages/index.rs @@ -16,22 +16,12 @@ async fn index_handler( #[derive(Debug, Template)] #[template(path = "index.html.j2")] struct Index<'a> { - client_domain: &'a str, + server_name: &'a str, first_run: bool, } - let client_domain = services.config.get_client_domain(); - let host = client_domain - .host_str() - .expect("client domain should have a host"); - let client_domain = if let Some(port) = client_domain.port() { - &format!("{host}:{port}") - } else { - host - }; - let template = Index { - client_domain, + server_name: services.globals.server_name().as_str(), first_run: services.firstrun.is_first_run(), }; Ok(Html(template.render()?)) diff --git a/src/web/pages/templates/_components/form.html.j2 b/src/web/pages/templates/_components/form.html.j2 index 3d50d863..8aa82ba4 100644 --- a/src/web/pages/templates/_components/form.html.j2 +++ b/src/web/pages/templates/_components/form.html.j2 @@ -19,7 +19,7 @@ diff --git a/src/web/pages/templates/index.html.j2 b/src/web/pages/templates/index.html.j2 index 47393670..94d8cec4 100644 --- a/src/web/pages/templates/index.html.j2 +++ b/src/web/pages/templates/index.html.j2 @@ -14,7 +14,7 @@

To get started, check the server logs for instructions on how to create the first account.

For support, take a look at the documentation or join the Continuwuity Matrix room.

{%- else %} -

To get started, choose a client and connect to {{ client_domain }}.

+

To get started, choose a client and connect to {{ server_name }}.

{%- endif %}