Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings credentials in config instead of relying on environment #61

Open
bpolaszek opened this issue May 12, 2023 · 0 comments
Open

Settings credentials in config instead of relying on environment #61

bpolaszek opened this issue May 12, 2023 · 0 comments

Comments

@bpolaszek
Copy link

Hey there, thanks for this great plugin!

Would it be hard to allow credentials to be passed as options, i.e.

s3proxy [<matcher>] {
    bucket <bucket_name>
    endpoint <endpoint>
    access_key_id <access_key_id>
    secret_access_key <secret_access_key>
}

This would allow connecting to several S3 Providers (just had a use case with Scaleway & DigitalOcean) on a single host.

example1.org {
  @cdn path_regexp cdn /cdn/(.*)
  route @cdn {
    rewrite @cdn {re.cdn.1}
    s3proxy {
      bucket {$EXAMPLE1_S3_BUCKET}
      endpoint {$EXAMPLE1_S3_ENDPOINT}
      access_key_id {$EXAMPLE1_S3_ACCESS_KEY_ID}
      secret_access_key {$EXAMPLE1_S3_SECRET_ACCESS_KEY}
    }
  }
}


example2.org {
  @cdn path_regexp cdn /cdn/(.*)
  route @cdn {
    rewrite @cdn {re.cdn.1}
    s3proxy {
      bucket {$EXAMPLE2_S3_BUCKET}
      endpoint {$EXAMPLE2_S3_ENDPOINT}
      access_key_id {$EXAMPLE2_S3_ACCESS_KEY_ID}
      secret_access_key {$EXAMPLE2_S3_SECRET_ACCESS_KEY}
    }
  }
}

No providing them would fall back to AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY, ~/.aws/credentials etc.

Second benefit of this is that you know that they have to exist somewhere, instead of copy/pasting config from one server to another and wasting time figuring out where to write the credentials for the plugin to work 😅 things would just become more obvious.

Thanks!
Ben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant