-
Notifications
You must be signed in to change notification settings - Fork 198
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
refactor(s3): Don't hardcode endpoint and region #2159
base: master
Are you sure you want to change the base?
Conversation
@@ -1854,28 +1852,26 @@ def get_upload_link(file, parts=1): | |||
|
|||
@frappe.whitelist() | |||
def multipart_exit(file, id, action, parts=None): | |||
press_settings: "PressSettings" = frappe.get_single("Press Settings") # type: ignore | |||
bucket_name = "uploads.frappe.cloud" # TODO: Use press_settings.remote_uploads_bucket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Frappe team can confirm that the current config on Frappe Cloud is indeed
remote_uploads_bucket = "uploads.frappe.cloud"
Which I believe is the case:
bucket_name = "uploads.frappe.cloud" # TODO: Use press_settings.remote_uploads_bucket | |
bucket_name = press_settings.remote_uploads_bucket |
0d3cb6c
to
28a422e
Compare
A patch could be written to set the value back in Press Settings if migration needs to be automatic. |
|
88b64f3
to
aa12651
Compare
- offsite_backups_provider - data_40
aa12651
to
72b56a8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2159 +/- ##
==========================================
- Coverage 39.93% 39.90% -0.03%
==========================================
Files 372 372
Lines 28210 28232 +22
==========================================
+ Hits 11266 11267 +1
- Misses 16944 16965 +21 ☔ View full report in Codecov by Sentry. |
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