From 8ec6a53b35e5bb742640a77ff282f2474c63af54 Mon Sep 17 00:00:00 2001 From: networkException Date: Fri, 29 Sep 2023 18:41:00 +0200 Subject: everywhere: support unix sockets when binding in various places this patch implements binding to paths as a unix socket for generic server and web server. --- src/api/k2v/api_server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/api/k2v') diff --git a/src/api/k2v/api_server.rs b/src/api/k2v/api_server.rs index bb85b2e7..413fd61c 100644 --- a/src/api/k2v/api_server.rs +++ b/src/api/k2v/api_server.rs @@ -1,4 +1,3 @@ -use std::net::SocketAddr; use std::sync::Arc; use async_trait::async_trait; @@ -9,6 +8,7 @@ use hyper::{Body, Method, Request, Response}; use opentelemetry::{trace::SpanRef, KeyValue}; use garage_util::error::Error as GarageError; +use garage_util::socket_address::UnixOrTCPSocketAddress; use garage_model::garage::Garage; @@ -37,7 +37,7 @@ pub(crate) struct K2VApiEndpoint { impl K2VApiServer { pub async fn run( garage: Arc, - bind_addr: SocketAddr, + bind_addr: UnixOrTCPSocketAddress, s3_region: String, shutdown_signal: impl Future, ) -> Result<(), GarageError> { -- cgit v1.2.3 From 7907a09acc812f857f283d64c988c69d08acd041 Mon Sep 17 00:00:00 2001 From: networkException Date: Tue, 3 Oct 2023 17:31:40 +0200 Subject: api: allow custom unix bind mode and use 0o220 for admin server --- src/api/k2v/api_server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/api/k2v') diff --git a/src/api/k2v/api_server.rs b/src/api/k2v/api_server.rs index 413fd61c..3a032aba 100644 --- a/src/api/k2v/api_server.rs +++ b/src/api/k2v/api_server.rs @@ -42,7 +42,7 @@ impl K2VApiServer { shutdown_signal: impl Future, ) -> Result<(), GarageError> { ApiServer::new(s3_region, K2VApiServer { garage }) - .run_server(bind_addr, shutdown_signal) + .run_server(bind_addr, None, shutdown_signal) .await } } -- cgit v1.2.3