aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-01-24 18:35:51 +0100
committerLibravatar Rutger Broekhoff2024-01-24 18:35:51 +0100
commitc31705b0228cf3b7eea5a9fece27847a17680a4e (patch)
tree3a3dfdbfa37559d4016272e6f183ab15516d7a88
parentedf27e8ed7ccca8ee87fef6e65790bb58982c74a (diff)
downloadgitolfs3-c31705b0228cf3b7eea5a9fece27847a17680a4e.tar.gz
gitolfs3-c31705b0228cf3b7eea5a9fece27847a17680a4e.zip
Add S3_REGION env (because the SDK seems to need this so desperately)
-rw-r--r--rs/server/src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/rs/server/src/main.rs b/rs/server/src/main.rs
index b346bc6..d6c780f 100644
--- a/rs/server/src/main.rs
+++ b/rs/server/src/main.rs
@@ -107,6 +107,7 @@ struct Env {
107 s3_access_key_id: String, 107 s3_access_key_id: String,
108 s3_secret_access_key: String, 108 s3_secret_access_key: String,
109 s3_bucket: String, 109 s3_bucket: String,
110 s3_region: String,
110 s3_endpoint: String, 111 s3_endpoint: String,
111 base_url: String, 112 base_url: String,
112 key_path: String, 113 key_path: String,
@@ -125,6 +126,7 @@ impl Env {
125 Ok(Env { 126 Ok(Env {
126 s3_secret_access_key: require_env("GITOLFS3_S3_SECRET_ACCESS_KEY_FILE")?, 127 s3_secret_access_key: require_env("GITOLFS3_S3_SECRET_ACCESS_KEY_FILE")?,
127 s3_access_key_id: require_env("GITOLFS3_S3_ACCESS_KEY_ID_FILE")?, 128 s3_access_key_id: require_env("GITOLFS3_S3_ACCESS_KEY_ID_FILE")?,
129 s3_region: require_env("GITOLFS3_S3_REGION")?,
128 s3_endpoint: require_env("GITOLFS3_S3_ENDPOINT")?, 130 s3_endpoint: require_env("GITOLFS3_S3_ENDPOINT")?,
129 s3_bucket: require_env("GITOLFS3_S3_BUCKET")?, 131 s3_bucket: require_env("GITOLFS3_S3_BUCKET")?,
130 base_url: require_env("GITOLFS3_BASE_URL")?, 132 base_url: require_env("GITOLFS3_BASE_URL")?,
@@ -150,6 +152,7 @@ fn get_s3_client(env: &Env) -> Result<aws_sdk_s3::Client, std::io::Error> {
150 ); 152 );
151 let config = aws_config::SdkConfig::builder() 153 let config = aws_config::SdkConfig::builder()
152 .behavior_version(aws_config::BehaviorVersion::latest()) 154 .behavior_version(aws_config::BehaviorVersion::latest())
155 .region(aws_config::Region::new(env.s3_region.clone()))
153 .endpoint_url(&env.s3_endpoint) 156 .endpoint_url(&env.s3_endpoint)
154 .credentials_provider(aws_sdk_s3::config::SharedCredentialsProvider::new( 157 .credentials_provider(aws_sdk_s3::config::SharedCredentialsProvider::new(
155 credentials, 158 credentials,