mirror of
https://git.verdigado.com/NB-Public/simple-wkd.git
synced 2024-10-30 01:05:53 +01:00
Add bind_host setting
This commit is contained in:
parent
192bd9675d
commit
d4f4a35a65
6 changed files with 8 additions and 2797 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1 +1,4 @@
|
|||
/target
|
||||
/data
|
||||
/logs
|
||||
config.toml
|
2770
backend/Cargo.lock
generated
2770
backend/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,24 +0,0 @@
|
|||
[package]
|
||||
name = "simple-wkd"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
actix-files = "0.6.2"
|
||||
actix-web = "4.3.1"
|
||||
chrono = "0.4.24"
|
||||
flexi_logger = "0.25.3"
|
||||
lettre = "0.10.4"
|
||||
log = "0.4.17"
|
||||
once_cell = "1.17.1"
|
||||
rand = "0.8.5"
|
||||
sequoia-net = "0.27.0"
|
||||
sequoia-openpgp = { version = "1.14.0", default-features = false, features = ["crypto-openssl"] }
|
||||
serde = { version = "1.0.160", features = ["derive"] }
|
||||
serde_json = "1.0.96"
|
||||
thiserror = "1.0.40"
|
||||
tokio = { version = "1.27.0", features = ["time"] }
|
||||
toml = "0.7.3"
|
||||
url = { version = "2.3.1", features = ["serde"] }
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ max_age = 900
|
|||
cleanup_interval = 21600
|
||||
allowed_domains = ["example.org", "example.com"]
|
||||
port = 8080
|
||||
bind_host = "0.0.0.0"
|
||||
external_url = "http://localhost:8080"
|
||||
|
||||
[mail_settings]
|
||||
|
|
Loading…
Reference in a new issue