WIP: Refactor upload, get url from modules #504
No reviewers
Labels
No Label
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#504
Loading…
Reference in New Issue
No description provided.
Delete Branch "ilja/akkoma:refactor_upload_get_url_from_modules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To get the url and base url, we had a function in upload.ex. This included a
case
to check on what module is used. This means that adding a new upload module implies changing code besides just adding a new module (I noticed this in a Pleroma PR https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3654).While trying to fix this, I decided to fix up some other parts of the upload flow. This doesn't add new functionality, but should make for a more consistent flow, and make it easier to add new uploaders in the future.
Because this touches several parts of the upload flow, and because there are several options, it's best to properly test this in production in different configurations. Some things I can think of:
Local
vsS3
./lib/pleroma/web/pleroma_api/views/backup_view.ex: Pleroma.Upload.base_url() <> "/backups/" <> file_name
There are some things I keep out-of-scope:
POST /api/v1/media
endpoint.GET /api/v1/media/:id
,PUT /api/v1/media/:id
, and the flow when fetching objects who contain media as eg attachements are all out of scope.