-
Notifications
You must be signed in to change notification settings - Fork 2
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
[🚢 SHIPPED] SXG republisher service, web extension, remote and local proxy #3
Comments
If I could get this working by next week, there are a number of people at csv,conf in Portland (which I'm attending) that might be interested: |
I made a quick little proof-of-concept chrome extension to see if I could load an SXG file that way - just generate a redirect when accessing *.ipfs.v6z.me ... seems to work great! Really simple: |
Exciting! cc @ipfs/wg-web-browsers
|
I think it would be a cool progressive enhancement to have a fallback option ... where the static version of all the files are available for loading via http/https if somebody doesn't have the web extension installed - pretty much the same thing that Cloudflare already provides for IPFS. Previously, I did try the Service Worker approach, and got that working as well. For some reason, back in the fall, I couldn't load the Service Worker from an SXG file directly, so I had to host it on the underlying website. That wasn't too difficult, but wouldn't work for first load in an offline situation. It may be that it is now possible to load a Service Worker from an SXG now ... they do mention that as a use case for WebPackage (but we're only using Signed HTTP exchanges so far). For now, I think it makes sense to just prototype the Web Extension + SXG without the fallback. That keeps it a bit simpler, and would be extremely cheap to host on the server side. The most expensive part will be the periodic batch job to convert an IPFS cid or IPNS link to a set of SXG files ... but it's probably not that bad since it only needs to run once a week (max timeout on SXG is currently 7 days), and it's pretty fast. With the wildcard domain, I could use GitHub authentication, and hand out domains such as A more advanced service might offer a 'bring your own domain name' option, which would include the special SSL certs needed. Right now, only Digicert is selling the certs, but they are somewhat pricey and the approval process is strict, compared to something like Let's Encrypt. I imagine Cloudflare is generating their own certs for their AMP service. If people have their own DNS and certs, the service could look for dnslink txt records on DNS instead of having a web admin interface. The service would probably want to have a tie-in to ipfs-cluster to pin the generated SXG files. It would be a no brainer for the service to also act as an extra pinner for the original source as well. |
Another thought I had for an enhancement would be to automatically map |
I made a little video to show what I've managed to get working so far... https://ipfs.io/ipfs/Qmdn8biDeT1sWdyLCPs7nqfssPfzqLeWRHHpp9WKbH42aM/http-signed.mp4 |
I'll need to host some batch processes somewhere to periodically republish the SXG files. I tried out https://cloud.google.com/run/ and it seems like it might be a nice fit. It's serverless, but you can use a Docker image. |
I started working on a bit of a "worker" for publishing the SXG files. So far, it just updates some dnslink DNS records using AWS Route53. https://github.com/jimpick/sxg-republisher-worker/blob/master/index.js This lets us lookup IPFS CIDs via DNS and the public http gateway, eg.
I can do that from within the web extension to quickly resolve where to get the SXG and asset files from via IPFS. |
Lookup via SXG subdomain is a cool solution to the "opening in browser without SXG support" problem, feels like it could be matching existing subdomain conventions:
|
Tweeted the video from above. |
I added a tiny bit of a README to the extension: https://github.com/jimpick/sxg-republisher-extension I made an icon and tried submitting it to the Google Web Store but it was flagged for manual review, which takes several business days. |
I gave a demo during Kinuko's 5 minute lightning talk at IPFS Camp where I showed the publishing demo. I thought it would be nice to publish the extension so a few more people could try it out without having to manually install the extension as a developer. A number of Protocol Labs employees tried it out, but it is unreasonable to expect any community adoption with such a high friction installation procedure. My first attempt at submitting the extension was rejected as it "did not comply with our program policies", listed here: https://developer.chrome.com/webstore/program_policies The rejection email didn't mention which policy was violated. Quite likely the reviewer didn't understand the purpose of the extension. I think I would need to escalate via the forums or some other backchannel to figure out how to get the extension published. In order to keep the demo alive, I'd need to:
Also, the extension uses the webRequest and webRequestBlocking extension APIs which Chrome is deprecating: https://blog.chromium.org/2019/06/web-request-and-declarative-net-request.html It's quite likely that signed exchanges will undergo changes in the future as well. With all that, I think the best move for now is to let the certificates expire, and close this experiment. I'm encouraged that there will be a path for good IPFS support in mainstream browsers in the future. |
This idea came to me based on experimentation here and here:
I posted it to the #ipfs-in-web-browsers IRC channel on Freenode:
The text was updated successfully, but these errors were encountered: