5 ms·
A ton of source code that is stored on Sourcehut and Codeberg is also likely replicated over dozens or hundreds of other machines. I wonder if something like t
by nine_k 3y ago
A ton of source code that is stored on Sourcehut and Codeberg is also likely replicated over dozens or hundreds of other machines.
I wonder if something like the BitTorrent protocol could be used to keep a repo accessible without directing all the traffic to one site. Take a magnet link to a particular repo and commit, receive the complete branch eventually. Now serve these commits to other peers. That would be rather harder to DDoS or censor.
(This, of course, ignores other aspects of forges: CI/CD, releases, packages, etc. Issues and even code reviews can be branches, too; such tools exist, and e.g. Fossil has them built in.)
- mcepl 3y agoOnly not having access to https://todo.sr.ht https://todo.sr.ht made me to recognize fully, that I don’t have any access to it. https://github.com/MichaelMure/git-bug https://github.com/MichaelMure/git-bug suddenly looks much more interesting.
- palata 3y agoThe problem I see with the torrent approach being that you need to reach a consensus eventually, right? If I push a commit on the main branch, share that state, and you do the same with a different commit, then we have a conflict that we need to solve...
- hackernudes 3y agoThere would have to be a canonical source of truth (with private key). Then one could be reasonably sure an update is blessed by the owner. Makes me think of nostr + git + torrent/ipfs.
- palata 3y agoOh right. Not everyone modifies the torrent, then, just the maintainer. So as a user I get the magnet link, download (clone) the repo over torrent, then I can send a patch to the maintainer over email, discuss it there (maybe on a mailing list), and when the maintainer merges it, they can update the torrent and propagate the new state of the history. Is that about right? It actually sounds cool :-). I guess the next issue I see is that torrents are not mutable (I think there are some specs maybe, but it's not common/implemented? Not sure).
- 20after4 3y agoYou could also use the git protocol and a simple load-balanced pool of replicas that each pull from the main repo constantly. All push traffic would be routed to the central repo and all fetches would be routed to a random replica. To do it in a decentralized fashion you could simply have a DNS pool with all of the known replicas and rely on round robin DNS (not great but better than a single point of failure) Phabricator implements an interesting multi-master replication scheme with git that essentially keeps track of which node has the newest commit for a given HEAD, then edge nodes can automatically proxy incoming requests to the node with the latest change, or a random node if they are all in sync already.
- bayindirh 3y agoI think a Nordic broadcaster used "cascaded git" as a CDN. They pushed the content to a central repo, and as a hook, it pushed to four other repos. The repos had the same hook and it just fanned out, unattended. Pretty neat, if you ask me.
- teddyh 3y ago> To do it in a decentralized fashion you could simply have a DNS pool with all of the known replicas and rely on round robin DNS Using the new HTTPS DNS record¹ you could simply list all the servers in the DNS. 1. RFC 9460; discussion here a few months ago: <https://news.ycombinator.com/item?id=38420555 https://news.ycombinator.com/item?id=38420555>
- packetlost 3y agoIt smells crypto-ey but there's Radicle (https://app.radicle.xyz/ https://app.radicle.xyz/)
- lagniappe 3y agoiirc keybase (pre-acquisition) had this
- miki123211 3y agoBitTorrent relies heavily on hashes, you can't really update a torrent in place. Distributing a static piece of content peer-to-peer is a (somewhat) solved problem by now. Achieving consensus on which hash best represents a given repo, what its latest version is and who can update it under what circumstances is much harder. It's relatively easy if you have a blockchain handy, but there's serious opposition to such solutions now.
- WhyNotHugo 3y agoGit commits also rely on hashes, so there isn't a huge mismatch. The main issue is that each commit would become a separate torrent, so you'd need some abstraction on top to clone a whole repository (you'd need to download all the torrent-commits). OTOH, when updating a repository you'd only pull new commits (just like other transports). I've toyed with the idea in the past, but it's a substantial amount of work.
- miki123211 3y agoFetching the commits isn't the problem, knowing which commits to fetch is. You need some way to assign a stable identifier to a repository and to query for the current tip of the master branch from that identifier. This can be done naively by using public-key cryptography and DHT nodes storing signed {timestamp, commit_hash} messages, but this is wildly insecure against key compromise, which (as Bitcoin and others have shown) is pretty much inevitable. You'd probably need m-of-n signatures and some way to do key rotation, and that's not easy to do if you can't just run arbitrary programs, like you can on the EVM for example.
- k8svet 3y agoAlso, I'm guessing by time you go down that road, you wind up re-implementing Radicle.
- miki123211 3y agoI don't think you need radicle TBH, there's nothing in this use case that requires a custom blockchain or even a token (if you're willing to accept UUIDs instead of human-friendly repo names). A simple smart contract running on EVM / Solidity with no financial incentives (except the gas fees of the underlying chain of course) would do nicely. That means you get nothing out of it as a developer, though, and there are very few people willing to do crypto stuff and not interested in $$$. You still have the problem of incentivizing hackers. In the Github world, hacking the author of a major project is bad but not disastrous, somebody is probably going to notice, ping the Github security team, and the changes will get reversed in a matter of hours. Hacking a major project on radicle or similar means that the project is now out of its authors hands, potentially forever, and there's nothing you can do, short of informing every single consumer and asking them to change the project ID they depend on. You can give a trusted team a way to override ownership in such cases, but then these people are also subject to being hacked or compelled by a court. Requiring multiple signatures and best practices around hardware wallets is probably the best you can do realistically, and that dramatically increases complexity and expense on the maintainers' side compared to traditional Git workflows.
- tkz1312 3y agohttps://radicle.xyz/ https://radicle.xyz/
- anacrolix 3y agohttps://github.com/anacrolix/btlink https://github.com/anacrolix/btlink