Put host in the relay stuct
Docker / build-and-push-image (push) Successful in 1m39s

This commit is contained in:
Jon Staab
2026-06-16 09:04:17 -07:00
parent 326fe9d2e1
commit 7750a5e552
2 changed files with 13 additions and 5 deletions
+1 -5
View File
@@ -281,11 +281,7 @@ async fn try_sync_relay(relay: &Relay) -> Result<()> {
.await?
.is_none();
let host = if relay.custom_domain_verified == 1 && !relay.custom_domain.is_empty() {
relay.custom_domain.clone()
} else {
format!("{}.{}", relay.subdomain, env::get().relay_domain)
};
let host = relay.host();
let mut body = serde_json::json!({
"host": host,
+12
View File
@@ -96,6 +96,18 @@ pub struct Relay {
pub created_at: i64,
}
impl Relay {
/// The relay's effective public host: its verified custom domain when set,
/// otherwise its canonical `<subdomain>.<relay_domain>`.
pub fn host(&self) -> String {
if self.custom_domain_verified == 1 && !self.custom_domain.is_empty() {
self.custom_domain.clone()
} else {
format!("{}.{}", self.subdomain, crate::env::get().relay_domain)
}
}
}
impl Default for Relay {
fn default() -> Self {
Self {