aboutsummaryrefslogtreecommitdiff
path: root/src/garage/server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-02-03 15:27:39 +0100
committerAlex Auvolat <alex@adnab.me>2023-02-03 15:27:39 +0100
commit656b8d42de2fc945c988094418c90d29d000be32 (patch)
tree938aa46539d2c836cf8207d695ba70a9b686bcf6 /src/garage/server.rs
parent30f1636a00ffc60d1c9ac1d3781ccee21669e54d (diff)
downloadgarage-656b8d42de2fc945c988094418c90d29d000be32.tar.gz
garage-656b8d42de2fc945c988094418c90d29d000be32.zip
secrets can be passed directly in config, as file, or as env
Diffstat (limited to 'src/garage/server.rs')
-rw-r--r--src/garage/server.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/garage/server.rs b/src/garage/server.rs
index 16f1b625..958089c6 100644
--- a/src/garage/server.rs
+++ b/src/garage/server.rs
@@ -17,6 +17,7 @@ use garage_api::k2v::api_server::K2VApiServer;
use crate::admin::*;
#[cfg(feature = "telemetry-otlp")]
use crate::tracing_setup::*;
+use crate::{fill_secrets, Secrets};
async fn wait_from(mut chan: watch::Receiver<bool>) {
while !*chan.borrow() {
@@ -26,9 +27,9 @@ async fn wait_from(mut chan: watch::Receiver<bool>) {
}
}
-pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
+pub async fn run_server(config_file: PathBuf, secrets: Secrets) -> Result<(), Error> {
info!("Loading configuration...");
- let config = read_config(config_file)?;
+ let config = fill_secrets(read_config(config_file)?, secrets);
// ---- Initialize Garage internals ----