fix: relay_server port configuration

This commit is contained in:
Henri Bourcereau 2026-07-28 13:21:39 +02:00
parent 9c13630c7d
commit a59d9f61e2
2 changed files with 7 additions and 2 deletions

View file

@ -202,6 +202,7 @@ in
DATABASE_URL = "postgresql://${cfg.user}@127.0.0.1/${cfg.user}"; DATABASE_URL = "postgresql://${cfg.user}@127.0.0.1/${cfg.user}";
APP_URL = "${cfg.protocol}://${cfg.hostname}"; APP_URL = "${cfg.protocol}://${cfg.hostname}";
PAGES_DIR = cfg.pages_dir; PAGES_DIR = cfg.pages_dir;
RELAY_PORT = toString cfg.apiPort;
SMTP_HOST = cfg.smtp.host; SMTP_HOST = cfg.smtp.host;
SMTP_PORT = toString (if cfg.smtp.port != null then cfg.smtp.port SMTP_PORT = toString (if cfg.smtp.port != null then cfg.smtp.port
else if cfg.smtp.tls then 465 else 1025); else if cfg.smtp.tls then 465 else 1025);

View file

@ -35,7 +35,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
#[tokio::main] #[tokio::main]
/// Activates error tracing, spawns a watch dog task to eliminate eventual dead rooms, then it sets up the roting system to serve the /// Activates error tracing, spawns a watch dog task to eliminate eventual dead rooms, then it sets up the roting system to serve the
/// web sockets and listen for the pages enlist and reload. The server listens on port 8080. /// web sockets and listen for the pages enlist and reload.
async fn main() { async fn main() {
tracing_subscriber::registry() tracing_subscriber::registry()
.with( .with(
@ -104,7 +104,11 @@ async fn main() {
.layer(auth_layer) .layer(auth_layer)
.layer(cors); .layer(cors);
let listener = tokio::net::TcpListener::bind("127.0.0.1:8080") let port: u16 = std::env::var("RELAY_PORT")
.ok()
.and_then(|p| p.parse().ok())
.unwrap_or(8080);
let listener = tokio::net::TcpListener::bind(("127.0.0.1", port))
.await .await
.unwrap(); .unwrap();