-
-
Notifications
You must be signed in to change notification settings - Fork 12
How should autoupgrade work?
Autoupgrade is a vital for keeping what Odysseus will have for extensions compatible with the network services they relay on. Sure this could be seen as a universal backdoor, but by keeping it declarative and non-programmable concerned surfers can still see any potential backdoors in it's code.
To implement this at it's most basic we can wrap a session with a cache with infinite storage. For more efficiency for larger files, GGit can be useful. This'll probably require a higher level wrapper that can fetch particular files from a Git repository.
To download a git file using GGit:
- Clone or CD into the repo
- Fetch the remote master (or other branch).
- Get it's "oid".
- Get the commit corresponding to that Oid.
- Get the commit's tree.
- Load the filepath within that tree.
- Lookup the blob
- Finally read the file's contents!
While that'll take some effort, it may be worth it to some services (like Better) to be able to send us just the changes since last time.
For more complex cases where we decode the data and hand it WebKit, we can drop down to the libsoup message level in order to capture the caching headers and queue up a redownload/reparse.
To make things easy early-on I'll fetch things over HTTP(S), and host any of my own stuff on GitHub Pages. That way I don't get the analytics, and the only incentive GitHub (though while it does provide caching headers, it would be a win to find a way to increase their values) has is to ask me stop putting this server-load on them. Not that it should be a large load yet anyways.
However what I'd really like to do is to host any of my stuff on IPFS so practically no one (that is essentially random peers) will get to know what extensions you've updated and when. And it'd be nice to federate userscripts, userstyles, content blockers, etc into my own extension center so I can encourage others to use IPFS as well. But to make the most of that I'd want to integrate IPFS, and as such when I start to implement this I'll open an issue for the integration of IPFS (besides IPFS will help me offer rare but useful browser features).