smugdev / smugboard

An IPFS-based imageboard
MIT License
24 stars 2 forks source link

Smugboard NEXT #4

Open smugdev opened 7 years ago

smugdev commented 7 years ago

A complete rewrite of smugboard (tentatively called 'smugboard NEXT') has begun, with the aims of improving the codebase, consolidating the server packages, opening the door for direct user-specified object manipulation and allowing for the use of server functionality within the browser. Ideally, a user will be able to run servers (e.g. a moderation console) within their local browser, cutting down further the attack surface of the federation as a whole. This will not be available immediately on release, but the underlying infrastructure for it should be in place (with the current server systems it would be essentially impossible, too many legacy ties to local disk operations).

The server side is mostly rewritten, the next step will be rewriting the user client. This should result in the client being far more stable and not so brittle, and also make it less of an unreadable mess. Efforts will also be made to decouple the page renderer, in order to make it easier to create a client version that doesn't have to run within the browser in the future.

Since the underlying server formats have changed so radically, backwards compatibility with the original release will be essentially impossible. It is intended that this will be the last federation-breaking release.

smugdev commented 6 years ago

Brief update: Rewrite is still coming along, if slowly. I am holding off on releasing it until it reaches feature parity with the old implementation, hence the delay.

smugdev commented 6 years ago

Well, I decided against waiting any longer. It's not at feature parity with the original yet, but it's pretty close for most core cases so I opted to go ahead and commit it. This is a complete rewrite, as can be seen in 1a309383ba6280d3fa44eecacbf4c862fd044d8f.

As noted, this rewrite merges the various servers into a single unified entity, and is entirely embeddable in the browser code (though the UI isn't implemented yet). The storage system has been totally redone and all content storage is now integrated into the network. In essence, the only data the server stores locally is now a simple set of bindings of [IPNS name] => [IPFS hash]. The first time the server receives a request to add something to a thread (for example), it dynamically gets the thread's current state from IPFS based on its hash, which may mean pulling in data from disk that the server had previously added to IPFS, or it may mean pulling in a thread object from the network itself. In short, thread/board/site/mod/whatever forking is now possible and implemented. UI for it isn't there yet though, so it involves editing server/wrappers.json until that's done. Note that it being done will come along with the client gaining server functionality (in that case the bindings will be stored in a cookie instead of on file - everything has been designed to work with both).

As mentioned, the server is now browser-compatible, though the UI isn't done yet. This is probably going to be the most tedious part since it's a big chunk of stuff that I want to get right, as it's pretty important. There's many as-yet unanswered considerations regarding this part, so I'll need to spend more time thinking about it before doing anything. Stay tuned.

The code itself has been vastly improved, to the point it's probably even readable in places. Still a lot to go though, and a few features are currently missing including; the catalog, the UI for creating boards, and the UI for moderation. Those will be coming back soon, I don't like having regressions in here, but I didn't want to sit on this update any further. The live site will stay on the old system until I get these done.

I've definitely forgotten a good many other upgrades/improvements, almost all of the old code was thrown away and rewritten from scratch. The system as a whole should be much more stable than it was, though it hasn't properly been put through its paces yet. Anyway, that's where we're at as of now.