fix: pass the config for QA_LISTEN_ADDRESS
This commit is contained in:
parent
1174299e77
commit
60c598c17d
2 changed files with 8 additions and 2 deletions
|
|
@ -25,6 +25,10 @@ pub async fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let qa_reply_domain =
|
||||
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 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)?;
|
||||
conn.execute_batch("PRAGMA journal_mode=WAL;")?;
|
||||
|
|
@ -58,8 +62,8 @@ pub async fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
.layer(CorsLayer::permissive())
|
||||
.with_state(state);
|
||||
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:3003").await?;
|
||||
println!("Listening on 127.0.0.1:3003");
|
||||
let listener = tokio::net::TcpListener::bind(&listen_target).await?;
|
||||
println!("Listening on {listen_target}");
|
||||
axum::serve(listener, app).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue