Skip to content
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

License notices show strangely after switching to R2 #67

Open
SyntaxBlitz opened this issue Dec 16, 2022 · 1 comment
Open

License notices show strangely after switching to R2 #67

SyntaxBlitz opened this issue Dec 16, 2022 · 1 comment

Comments

@SyntaxBlitz
Copy link
Contributor

Used to be, the "open source licenses" section was a webview that just showed the contents of https://downloads.languagetransfer.org/NOTICE.

It still is, but after switching to Cloudflare R2 (from Linode object storage), the MIME type is application/octet-stream instead of... well, looks like there was no Content-Type header being served by Linode.

Trouble is, on Android at least, this results in the button downloading the NOTICE file instead of displaying it inline. The webview was kind of the easiest hacky solution, but we can do better by actually fetching the contents and rendering them in some UI (maybe one that's smart about not rendering that massive blob of text in one big view -- needs to be efficient to render).

We could just rename the file to NOTICE.txt, but it'd still require an app update so it knows where to look. Hmm, maybe that's what we should do, just update the URL in the app to NOTICE.txt and start uploading to both endpoints instead.

Either way, requires an app update unless I can send a new content type.

I CAN send a new content type! this is why I run everything through a shim server instead of directly to the CDN. I can just special-case the NOTICE file on the server to either send it directly from the shim lambda or to redirect to a NOTICE.txt file from R2!

lol doesn't matter, i CAN set a new content type on R2.

aws s3api put-object --bucket language-transfer --key NOTICE --body NOTICE --content-type text/plain --acl public-read --endpoint-url https://f38435e2c9280c3bd46c1155cd39ba57.r2.cloudflarestorage.com

thanks for being my rubber duck, github text box

@SyntaxBlitz
Copy link
Contributor Author

whoops, never actually checked in the app that this works. looks like it doesn't. will have to investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant