diff options
Diffstat (limited to 'gitolfs3-server/src')
| -rw-r--r-- | gitolfs3-server/src/config.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/gitolfs3-server/src/config.rs b/gitolfs3-server/src/config.rs index 7adc9f0..5167cca 100644 --- a/gitolfs3-server/src/config.rs +++ b/gitolfs3-server/src/config.rs | |||
| @@ -18,19 +18,11 @@ pub struct AuthorizationConfig { | |||
| 18 | 18 | ||
| 19 | impl Config { | 19 | impl Config { |
| 20 | pub fn load() -> Result<Self, String> { | 20 | pub fn load() -> Result<Self, String> { |
| 21 | let env = match Env::load() { | 21 | let env = Env::load().map_err(|e| format!("failed to load configuration: {e}"))?; |
| 22 | Ok(env) => env, | 22 | let s3_client = |
| 23 | Err(e) => return Err(format!("failed to load configuration: {e}")), | 23 | create_s3_client(&env).map_err(|e| format!("failed to create S3 client: {e}"))?; |
| 24 | }; | 24 | let key = |
| 25 | 25 | load_key(&env.key_path).map_err(|e| format!("failed to load Gitolfs3 key: {e}"))?; | |
| 26 | let s3_client = match create_s3_client(&env) { | ||
| 27 | Ok(s3_client) => s3_client, | ||
| 28 | Err(e) => return Err(format!("failed to create S3 client: {e}")), | ||
| 29 | }; | ||
| 30 | let key = match load_key(&env.key_path) { | ||
| 31 | Ok(key) => key, | ||
| 32 | Err(e) => return Err(format!("failed to load Gitolfs3 key: {e}")), | ||
| 33 | }; | ||
| 34 | 26 | ||
| 35 | let trusted_forwarded_hosts: HashSet<String> = env | 27 | let trusted_forwarded_hosts: HashSet<String> = env |
| 36 | .trusted_forwarded_hosts | 28 | .trusted_forwarded_hosts |