Use firebase storage for EasyEyes Media Library - #105
Open
Yonathan-Wagaye wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Makes the Media page actually store files. Uploads previously lived only in the
browser session; they now go to the
easyeyes-mediaFirebase Storage bucket andare listed back from it.
media-libraryfunction:GETlists the bucket,POSTverifies thecaller's Pavlovia account against
MEDIA_ROLESand returns a short-livedresumable upload URL.
body at ~6 MB, which is less than any video.
from object metadata, so there is no second store to keep in step with it.
easyeyes.app/media/*rather than a raw Google URL,which is the only way to set the
Cross-Origin-Resource-Policyheader thatremote-calibrator and speaker-calibration need under
require-corp.refused, so a link that works today keeps working.
Setup
FIREBASE_MEDIA_SERVICE_ACCOUNT(base64 service account JSON) must be set inNetlify for all deploy contexts. Run
node scripts/setup-media-bucket.mjsonceto apply bucket CORS and public reads; pass a deploy preview URL as an argument
to allow uploads from it.