fix: pass the config for QA_LISTEN_ADDRESS

This commit is contained in:
Jet 2026-03-28 20:50:59 -07:00
parent 1174299e77
commit 60c598c17d
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View file

@ -25,6 +25,10 @@ pub async fn run() -> Result<(), Box<dyn std::error::Error>> {
let qa_reply_domain = let qa_reply_domain =
std::env::var("QA_REPLY_DOMAIN").unwrap_or_else(|_| mail_domain.clone()); std::env::var("QA_REPLY_DOMAIN").unwrap_or_else(|_| mail_domain.clone());
let webhook_secret = std::env::var("WEBHOOK_SECRET").expect("WEBHOOK_SECRET must be set"); let webhook_secret = std::env::var("WEBHOOK_SECRET").expect("WEBHOOK_SECRET must be set");
let listen_address =
std::env::var("QA_LISTEN_ADDRESS").unwrap_or_else(|_| "127.0.0.1".to_string());
let listen_port = std::env::var("QA_LISTEN_PORT").unwrap_or_else(|_| "3003".to_string());
let listen_target = format!("{listen_address}:{listen_port}");
let conn = Connection::open(&db_path)?; let conn = Connection::open(&db_path)?;
conn.execute_batch("PRAGMA journal_mode=WAL;")?; conn.execute_batch("PRAGMA journal_mode=WAL;")?;
@ -58,8 +62,8 @@ pub async fn run() -> Result<(), Box<dyn std::error::Error>> {
.layer(CorsLayer::permissive()) .layer(CorsLayer::permissive())
.with_state(state); .with_state(state);
let listener = tokio::net::TcpListener::bind("127.0.0.1:3003").await?; let listener = tokio::net::TcpListener::bind(&listen_target).await?;
println!("Listening on 127.0.0.1:3003"); println!("Listening on {listen_target}");
axum::serve(listener, app).await?; axum::serve(listener, app).await?;
Ok(()) Ok(())
} }

View file

@ -253,6 +253,8 @@ in
"QA_NOTIFY_EMAIL=${cfg.qaNotifyEmail}" "QA_NOTIFY_EMAIL=${cfg.qaNotifyEmail}"
"QA_MAIL_DOMAIN=${cfg.qaMailDomain}" "QA_MAIL_DOMAIN=${cfg.qaMailDomain}"
"QA_REPLY_DOMAIN=${cfg.qaReplyDomain}" "QA_REPLY_DOMAIN=${cfg.qaReplyDomain}"
"QA_LISTEN_ADDRESS=${cfg.apiListenAddress}"
"QA_LISTEN_PORT=${toString cfg.apiListenPort}"
]; ];
NoNewPrivileges = true; NoNewPrivileges = true;
PrivateTmp = true; PrivateTmp = true;