0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-06 14:52:41 +01:00

Add bind_host setting

This commit is contained in:
Delta1925 2023-04-16 19:08:46 +02:00
parent 192bd9675d
commit d4f4a35a65
No known key found for this signature in database
GPG key ID: 1C21ACE44193CB25
6 changed files with 8 additions and 2797 deletions

View file

@ -61,8 +61,8 @@ async fn main() -> std::io::Result<()> {
}
});
info!(
"Running server on http://localhost:{} (External URL: {})",
SETTINGS.port, SETTINGS.external_url
"Running server on http://{}:{} (External URL: {})",
SETTINGS.bind_host, SETTINGS.port, SETTINGS.external_url
);
HttpServer::new(|| {
App::new()
@ -75,7 +75,7 @@ async fn main() -> std::io::Result<()> {
)
.route("/{filename:.*}", web::get().to(index))
})
.bind(("127.0.0.1", SETTINGS.port))?
.bind((SETTINGS.bind_host.to_string(), SETTINGS.port))?
.run()
.await
}

View file

@ -14,6 +14,7 @@ pub struct Settings {
pub cleanup_interval: u64,
pub allowed_domains: Vec<String>,
pub port: u16,
pub bind_host: String,
pub external_url: Url,
pub mail_settings: MailSettings,
}