Preserve environment config

main
Ashelyn Dawn 2 months ago
parent 0230e14e65
commit 336c56204a
No known key found for this signature in database
GPG Key ID: D1980B8C6F349BC1

@ -75,7 +75,7 @@
DynamicUser = "yes"; DynamicUser = "yes";
PrivateTmp = "yes"; PrivateTmp = "yes";
Environment = [ Environment = [
"PORT=${toString cfg.port}" "ROCKET_PORT=${toString cfg.port}"
]; ];
}; };
}; };

@ -5,6 +5,7 @@ use config::Config;
use governor::{clock::DefaultClock, state::keyed::DashMapStateStore, Quota, RateLimiter}; use governor::{clock::DefaultClock, state::keyed::DashMapStateStore, Quota, RateLimiter};
use mail_send::{SmtpClientBuilder, Credentials}; use mail_send::{SmtpClientBuilder, Credentials};
use rocket::data::{Limits, ToByteUnit}; use rocket::data::{Limits, ToByteUnit};
use rocket::config::Config as RConfig;
mod config; mod config;
mod endpoints; mod endpoints;
@ -49,7 +50,7 @@ fn rocket() -> _ {
let rocket_conf = rocket::config::Config { let rocket_conf = rocket::config::Config {
limits: Limits::default() limits: Limits::default()
.limit("json", 2.kibibytes()), .limit("json", 2.kibibytes()),
..Default::default() ..RConfig::from(RConfig::figment())
}; };
rocket::custom(rocket_conf) rocket::custom(rocket_conf)

Loading…
Cancel
Save