From 336c56204adccf0a68c273a7550ed27078c3684c Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Fri, 22 Mar 2024 23:42:31 -0600 Subject: [PATCH] Preserve environment config --- flake.nix | 2 +- src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index e8ea6bf..76f3679 100644 --- a/flake.nix +++ b/flake.nix @@ -75,7 +75,7 @@ DynamicUser = "yes"; PrivateTmp = "yes"; Environment = [ - "PORT=${toString cfg.port}" + "ROCKET_PORT=${toString cfg.port}" ]; }; }; diff --git a/src/main.rs b/src/main.rs index 92e12e9..1ca5a88 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ use config::Config; use governor::{clock::DefaultClock, state::keyed::DashMapStateStore, Quota, RateLimiter}; use mail_send::{SmtpClientBuilder, Credentials}; use rocket::data::{Limits, ToByteUnit}; +use rocket::config::Config as RConfig; mod config; mod endpoints; @@ -49,7 +50,7 @@ fn rocket() -> _ { let rocket_conf = rocket::config::Config { limits: Limits::default() .limit("json", 2.kibibytes()), - ..Default::default() + ..RConfig::from(RConfig::figment()) }; rocket::custom(rocket_conf)