Okay, hypothetically, if somebody was looking for a name for a Free Software project that focuses on Web censorship circumvention, using multiple configurable non-standard in-browser delivery mechanisms, what would a good name be?

Asking for a friend.

Basically the whole day of hacking on the little decentralization project today. Good progress. This thing is becoming surprisingly usable.

I will announce the new name (it's going to either be SideWays or Samizdat, most probably) early next week, and full code will follow shortly.

Haven't had a project I was that excited about for a long while. I missed that feeling a lot!

Show thread

Well that went fast! Rename complete, code a bit cleaned, stuff tested.

I give you Sa屑i蟹da褌:

Example deployment:

Go on, test in modern Firefox, Chromium, or Chrome.

There are g-glitches every now and then, but basically once the ServiceWorker kicks in you should see a "YES" there on the example page. When you do, you should also notice the favicon appearing. That means IPFS is working; there is no favicon on that server!

Show thread

#Samizdat is moving forward nicely. We now have some basic explanation on the landing page, a nicer display of methods used to fetch content, and (just implemented, hot from the CI/CD pipeline!) info on which resources were fetched using which method.

Check it out:

Pretty sweet, if I may be so bold to say so!

This is still Proof-of-Concept quality, and so many things can be done so much better. But it works already, in a way.

So, yay!

Show thread

For those new to the #Samizdat thing:
1. if you want to test it, load it, and then reload it -- or even close the tab and open a new one to load it again; this way the ServiceWorker will kick in and stuff will start happening;
2. it will not work without JS (sorry...), and it will not work in incognito/private mode.

To those who had already looked at it: I would be super interested if your service worker kicked in! You might not get the full functionality until the service worker reloads.

Show thread

TFW you need to refactor your code to use a completely new (to you) technique of dealing with some particular problem, using technology you don't really feel that comfortable with...

...and 2h later stuff actually works:

I am very okay with this.

Also, #Samizdat can now chain multiple delivery plugins. Which means I should now be able to implement caching using Caching API.

Show thread

Moar #Samizdat news: cache plugin implemented, but content not automagically pushed to local cache yet. You can test by:
1. going to cdn.test.occrp.org/projects/sa , reloading so that ServiceWorker kicks in
2. in JS console, run: await SamizdatPlugins[0].push(listLocalResources())
3. once the flurry of activity ends, block cdn.test.occrp.org in /etc/hosts
4. reload. should load immediately, and most resources should be marked as fetched from cache.

Show thread

Clearing cache is as easy as:
await caches.delete('v1')

Once you do that, while cdn.test.occrp.org is still blocked, you can reload the page and you should see #Samizdat load content (slowly...) from gun+ipfs.

So! Now we have two plugins. 馃槇

Show thread

New in #Samizdat: implemented auto-caching of successful requests, and UIs for clearing the cache and publishing to Gun+IPFS. Check it out: cdn.test.occrp.org/projects/sa

I will need to make caching a bit less aggressive, and/or Gun a bit more patient in waiting for the *latest* version of a given resource IPFS address, but all in all, works pretty ok.

Show thread

Also, some more UI niceness would be good -- displaying progress of pushing to Gun+IPFS, and informing user that cache has been successfully cleared, that sort of thing.

Show thread

Had a great long conversation with @tomasino about #Samizdat. Got some solid architectural advice. 馃憣馃従

Made fetch() into a plugin; we can now serve stuff from cache before a regular HTTP(S) fetch() goes out.

Next steps include:
- code cleanups
- reimplementing how we store/access data about which URL was retrieved how
- implementing a retrieve-from-cache-but-keep-fetching-in-background strategy so that a blocked site "loads" immediately, but the user still gets the fresh version eventually.

Show thread

Also added some project status info and how to contact us on the landing page and in the README:

My #Samizdat ToDo list still includes moving the project to a public Gitlab instance (0xacab.org probably, since it hosts a bunch of related projects including @sutty).

I really need to do this soon, but it requires setting up the CI/CD pipeline in a new location (probably on my own server). And that's a bit of work.

Show thread

Oooof, some serious code cleanups and rewrites in #Samizdat this weekend: git.occrp.org/libre/samizdat/c

The tl;dr is:
- regular fetch() is now also a plugin, which opens a number of possibilities;
- any plugin that can locally cache requests and responses is now treated specially: the first such plugin is called after a successful content retrieval automagically;
- if content is retrieved from cache, Samizdat continues trying to get it from a "live" source (fetch(), Gun+IPFS) in the background.

Show thread

This last bit was suggested by @tomasino and turned out to be simpler to implement than expected. So, yay!

To make #Samizdat a v1.0.0 that feels fully functional, we need to also:
- rewrite the SamizdatInfo (keeping the information on which resource was fetched and how) thing;
- add some fancy-shmancy UI displayed on any Samizdat-managed page;
- which will together allow us to inform the user "hey, we got this from cache, but there seems to be fresher version; reload please".

Show thread

@tomasino thanks! I hope it's at least a tiny bit more readable now.

There's a bug where fetch plugin is called twice, but I know what's going on and I think I know how to fix it.

I'll try to work on feature branches from now on, so as not to screw you over in case you want to work on something. ;)

My next step might be the Samizdat UI.

Sign in to participate in the conversation
Mastodon @ SDF

"I appreciate SDF but it's a general-purpose server and the name doesn't make it obvious that it's about art." - Eugen Rochko