From 9eb7601f9d6bbc7eb0ad739a84cf85a5ba61e4d5 Mon Sep 17 00:00:00 2001 From: fef Date: Sun, 25 Dec 2022 18:33:32 +0100 Subject: [PATCH] add LOCAL_DOMAIN config value --- .env.default | 3 +++ src/conf.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.env.default b/.env.default index b3dcece..3e72c8f 100644 --- a/.env.default +++ b/.env.default @@ -7,6 +7,9 @@ # Note: predefined environment variables override the values specified here. # +# Domain name of this instance (the domain.tld part in @username@domain.tld) +LOCAL_DOMAIN= + # IP address or hostname to bind to BIND_ADDR=localhost diff --git a/src/conf.rs b/src/conf.rs index 2a25f17..8329f23 100644 --- a/src/conf.rs +++ b/src/conf.rs @@ -6,6 +6,7 @@ pub struct Config { pub bind_port: u16, pub database_url: String, pub jwt_secret: Vec, + pub local_domain: String, } impl Config { @@ -23,6 +24,7 @@ impl Config { .expect("JWT_SECRET must be a 32-byte hex string") .as_str(), ), + local_domain: env::var("LOCAL_DOMAIN").expect("LOCAL_DOMAIN not specified"), } } }