refactor(s3): Don't hardcode endpoint and region #2159
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't hardcode endpoint and region for S3 buckets
There were many references to the
ap-south-1
region and a global implicit reference to AWS. This PR contains refactors of the S3 bucket systems for "offsite backups", "dashboard uploads" and "Backup Bucket doctype" buckets, to avoid vendor lock-in.I tried my best to make it backwards compatible with what I assume is the configuration on Frappe Cloud, but I can't check.
Details:
offsite_backups_endpoint
,remote_uploads_region
,remote_uploads_endpoint
offsite_backups_provider
(replaced by endpoint),data_40
(typo probably)cc: @gavindsouza 👋re: #19 #22
For the Frappe team
uploads.frappe.cloud
URL somewhere, I just kept it unchanged, but the refactor won't be truly finished until a migration path can be found for you.Typical configuration values for the fields
AWS S3 (Fallback/Legacy)
ap-south-1
https://s3.amazonaws.com
)AWS S3
ap-south-1
https://s3.ap-south-1.amazonaws.com
(possibly a custom DNS name such asuploads.example.com
)OVH
de
https://storage.de.cloud.ovh.net