keygen-sh / keygen-api

Keygen is a fair source software licensing and distribution API built with Ruby on Rails. For developers, by developers.
https://keygen.sh
Other
824 stars 53 forks source link

Support for S3-compatible storage providers #736

Open CharlieEriksen opened 1 year ago

CharlieEriksen commented 1 year ago

Hey,

It'd be nice to be able to use other storage providers than R2 and S3. I'm looking to use GCP Cloud Storage, which has an S3-compatible API.

It should be possible to enable that by allowing one to override the endpoint URL for the S3 configuration.

Thanks! Charlie

ezekg commented 1 year ago

I’d like to be explicit here, so instead of adding an S3_ENDPOINT environment variable, I’d like to have GCP_XXX environment variables like we have for R2.

This will allow a couple things:

  1. If you ever change storage providers, e.g. S3 to GCP, your old artifact uploads won’t break. If GCP was only configurable via an S3_ENDPOINT env var, setting it from S3 to GCP would break old artifacts still hosted on S3 (see release_artifacts.backend).
  2. In Keygen Cloud and other multiplayer instances of Keygen, we can add support for GCP as a storage provider at a per-account level. Some customers want their artifacts hosted with a specific provider for compliance reasons.

This currently isn’t on the immediate roadmap, since R2 is more cost-effective for us. But if somebody were to open a PR, I’ll review and merge.

Would you be open to making a PR?