fix: relay_server port configuration
This commit is contained in:
parent
9c13630c7d
commit
a59d9f61e2
2 changed files with 7 additions and 2 deletions
|
|
@ -202,6 +202,7 @@ in
|
|||
DATABASE_URL = "postgresql://${cfg.user}@127.0.0.1/${cfg.user}";
|
||||
APP_URL = "${cfg.protocol}://${cfg.hostname}";
|
||||
PAGES_DIR = cfg.pages_dir;
|
||||
RELAY_PORT = toString cfg.apiPort;
|
||||
SMTP_HOST = cfg.smtp.host;
|
||||
SMTP_PORT = toString (if cfg.smtp.port != null then cfg.smtp.port
|
||||
else if cfg.smtp.tls then 465 else 1025);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
|||
|
||||
#[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
|
||||
/// 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() {
|
||||
tracing_subscriber::registry()
|
||||
.with(
|
||||
|
|
@ -104,7 +104,11 @@ async fn main() {
|
|||
.layer(auth_layer)
|
||||
.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
|
||||
.unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue