Closed Bug 876440 Opened 12 years ago Closed 12 years ago

Implement S3 redirects for /edit and /remix routes

Categories

(Webmaker Graveyard :: Thimble, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michiel, Assigned: michiel)

References

Details

(Whiteboard: s=2013w22)

Attachments

(1 file)

Published pages will be published "for real" as some database rowid, and can be remixed on that value. When we publish to a named XYZ.mywebmaker.org domain, we publish based on the page's title, so if I have a page with title "moderately caffeinated", I will publish to pomax.mywebmaker.org/moderately-caffeinated and while the "remix this" link will point to the correct thing, adding /edit at the end of that URL will not take us back to the thimble app. Can we tackle this with a routing table "somewhere" that autoresolves /edit links to the correct location, or do we need more drastic measures here?
Blocks: 876451, 876459
There is no global routing table anywhere, visiting "jbuck.mywebmaker.org/thimble/not-caffeinated" will proxy to "mywebmaker.s3.amazonaws.com/jbuck/thimble/not-caffeinated". If you want to have /edit links hanging off every make, then you'll need to publish an additional page to S3 that is makeURL + "/edit".
the problem here is that we don't want an extra page, we need the /edit link to load thimble as if it's calling thimble.wm.o/remix/[some number], so publishing a new page won't actually help us there, unless we can "publish" a redirect? i.e. rather than content publish a 300?
That is exactly what you can do! You can take a peek at the documentation ( http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html ) but the key idea is PUT a 0-byte object with the header "x-amz-website​-redirect-location" set to whatever URL you want to redirect to.
ooh, excellent.
Assignee: nobody → pomax
Status: NEW → ASSIGNED
Summary: Adding /edit to the end of a myname.mywebmaker.org/page-title link does not work → Implement S3 redirects for /edit and /remix routes
Whiteboard: s=2013w22
I tried putting in these two redirects, but they do not seem to be taking. I probably forgot something really obvious, how good are your eyes?
Attachment #754841 - Flags: feedback?(jon)
Comment on attachment 754841 [details] [review] https://github.com/mozilla/thimble.webmaker.org/pull/81 alright, fixed up to work, with a followup bug to make it work "nicer". But this definitely works.
Attachment #754841 - Flags: feedback?(jon) → review?(jon)
Attachment #754841 - Flags: review?(jon) → review+
landed
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Matt/Scott, make sure you're aware of this bug so we can do the same in Popcorn Maker. Do we already have a bug?
Unsure if it's something that's on the radar. I'll look over what it took here and check out what's being done in Scotts ticket for the Popcorn Maker implementation.
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: