diff options
author | networkException <git@nwex.de> | 2023-09-29 18:38:30 +0200 |
---|---|---|
committer | networkException <git@nwex.de> | 2023-09-29 18:38:30 +0200 |
commit | 7353038a64cc53cc01c4ec7f21671d3443177707 (patch) | |
tree | 6be1c168360baa54c019c39930351e31fe5a7393 | |
parent | 10195f1567e82a630e808bc2700424bce28238c0 (diff) | |
download | garage-7353038a64cc53cc01c4ec7f21671d3443177707.tar.gz garage-7353038a64cc53cc01c4ec7f21671d3443177707.zip |
config: allow using paths for unix domain sockets in various places
this patch updates the config format to also allow paths in bind
addresses for unix domain sockets.
this has been added to all apis except rpc.
-rw-r--r-- | src/util/config.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/util/config.rs b/src/util/config.rs index 724f9404..ebcb5fbe 100644 --- a/src/util/config.rs +++ b/src/util/config.rs @@ -7,6 +7,7 @@ use std::path::PathBuf; use serde::{de, Deserialize}; use crate::error::Error; +use crate::socket_address::UnixOrTCPSocketAddress; /// Represent the whole configuration #[derive(Deserialize, Debug, Clone)] @@ -102,7 +103,7 @@ pub struct Config { #[derive(Deserialize, Debug, Clone)] pub struct S3ApiConfig { /// Address and port to bind for api serving - pub api_bind_addr: Option<SocketAddr>, + pub api_bind_addr: Option<UnixOrTCPSocketAddress>, /// S3 region to use pub s3_region: String, /// Suffix to remove from domain name to find bucket. If None, @@ -114,14 +115,14 @@ pub struct S3ApiConfig { #[derive(Deserialize, Debug, Clone)] pub struct K2VApiConfig { /// Address and port to bind for api serving - pub api_bind_addr: SocketAddr, + pub api_bind_addr: UnixOrTCPSocketAddress, } /// Configuration for serving files as normal web server #[derive(Deserialize, Debug, Clone)] pub struct WebConfig { /// Address and port to bind for web serving - pub bind_addr: SocketAddr, + pub bind_addr: UnixOrTCPSocketAddress, /// Suffix to remove from domain name to find bucket pub root_domain: String, } @@ -130,7 +131,7 @@ pub struct WebConfig { #[derive(Deserialize, Debug, Clone, Default)] pub struct AdminConfig { /// Address and port to bind for admin API serving - pub api_bind_addr: Option<SocketAddr>, + pub api_bind_addr: Option<UnixOrTCPSocketAddress>, /// Bearer token to use to scrape metrics pub metrics_token: Option<String>, |