fix: Use server name in index again

This commit is contained in:
Ginger 2026-03-03 14:51:51 -05:00
parent 07a935f625
commit b885e206ce
No known key found for this signature in database
3 changed files with 4 additions and 14 deletions

View file

@ -16,22 +16,12 @@ async fn index_handler(
#[derive(Debug, Template)] #[derive(Debug, Template)]
#[template(path = "index.html.j2")] #[template(path = "index.html.j2")]
struct Index<'a> { struct Index<'a> {
client_domain: &'a str, server_name: &'a str,
first_run: bool, 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 { let template = Index {
client_domain, server_name: services.globals.server_name().as_str(),
first_run: services.firstrun.is_first_run(), first_run: services.firstrun.is_first_run(),
}; };
Ok(Html(template.render()?)) Ok(Html(template.render()?))

View file

@ -19,7 +19,7 @@
<input <input
type="{{ input.input_type }}" type="{{ input.input_type }}"
id="{{ input.id }}" id="{{ input.id }}"
autocomplete="{{ input.autocomplete }} autocomplete="{{ input.autocomplete }}"
{% if input.type_name.is_some() %}name="{{ input.id }}"{% endif %} {% if input.type_name.is_some() %}name="{{ input.id }}"{% endif %}
{% if input.required %}required{% endif %} {% if input.required %}required{% endif %}
> >

View file

@ -14,7 +14,7 @@
<p>To get started, <em>check the server logs</em> for instructions on how to create the first account.</p> <p>To get started, <em>check the server logs</em> for instructions on how to create the first account.</p>
<p>For support, take a look at the <a href="https://continuwuity.org/introduction">documentation</a> or join the <a href="https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org">Continuwuity Matrix room</a>.</p> <p>For support, take a look at the <a href="https://continuwuity.org/introduction">documentation</a> or join the <a href="https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org">Continuwuity Matrix room</a>.</p>
{%- else %} {%- else %}
<p>To get started, <a href="https://matrix.org/ecosystem/clients">choose a client</a> and connect to <code>{{ client_domain }}</code>.</p> <p>To get started, <a href="https://matrix.org/ecosystem/clients">choose a client</a> and connect to <code>{{ server_name }}</code>.</p>
{%- endif %} {%- endif %}
</div> </div>