Soft-serve: A tasty, self-hostable Git server for the command line
github.com
github.com
I recommend using an invocation like this instead when testing things like this; I think it’s enough (but welcome correction):
ssh -o PubkeyAuthentication=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -a nobody@git.charm.shI can’t imagine why you’d ever turn on ForwardAgent by default.
in the ideal, yes. but it wasn’t long ago (start of covid really) that i kept my personal and work ssh keys under the same profile. both of those alone are “public”, but that they correspond to the same identity perhaps ought not to be.
yeah, there are better ways to manage separate identities (separate users, VMs, VPNs)… and reminding people that `ssh host-name` can reveal all your ssh keys is a good way to push people toward those better solutions! :)
I guess I just take issue with the fear mongering. People often make it sound like the end of the world to not be perfectly anonymous.
Host one
HostName one.of.the.server.sh
User hn
IdentityFile ~/.ssh/one.of.the.server.sh.keyIt's not always clear the inheritance priority of directives with wildcards in ssh_config or .ssh/config. I think it's the opposite of what one might assume is the default, if I recall correctly.
I guess you could misconfigure it, but it’s one of those things where I’d painstaking ensure I set it up correct because doing it wrong is not an option.
Maybe it’s because I almost always go direct?
You may reasonably not care, but it’s also reasonable to care.
It’s not about them being public, it’s about announcing them. For me, running `ssh git.charm.sh` would have SSH essentially say “hi, I’m chris-morgan on GitHub (and here’s cryptographic proof)” as part of connecting. That’s a huge privacy leak. It’s disclosing all your identities automatically, including perhaps that you work for ACME Corporation, and isn’t that a valuable tid-bit for social engineering attacks, when you take all these things together.
(I think it’s worth noting of your pithy line that the two words spelled “public” are homonyms, not at all the same. The first one I might call cryptographic-public, and the second socially-public. There’s no need to share a (cryptographic-)public key (socially-)publicly, and doing so can be actively undesirable.)
A public key (to me) is public in the same sense that a client secret is public. You don’t have to advertise it to everyone, but if anybody finds it they can’t do anything bad with it (except confirm you are the person that has the private key).
But it is an information disclosure vulnerability, because it didn’t need to disclose your identity, and the typical user will not expect it to disclose all their identities.
And the information that is disclosed opens heavy social vulnerabilities, because your activity can now be perfectly correlated with who you are, by an untrusted party.
This is information that businesses put huge amounts of effort into attempting to do on the web, because it can be quite valuable (sometimes absurdly so). And SSH defaults to just giving them exactly what they want so they don’t even have to work for it.
When in a browser you connect to https://github.com, it sends your session cookie so the server knows who you are. Well and good. What it doesn’t do is send any of that to any other server; if example.com wants to know (and prove) your GitHub username, you have to go through an OAuth flow where you explicitly grant permission for sharing these details.
By contrast, the OpenSSH remote login client (`ssh`) defaults to leaking this potentially-sensitive information. It shares all your keys, when you probably actually want to share zero or one of them.
git clone git@github.com:Chanzhaoyu/chatgpt-web.git
And it will use SSH, no web browser involved: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protoco...
Is that true though? When I connect to a server I generally want ssh to connect with _any_ of the keys that are currently in my agent. For that to happen the server needs to check if I’m allowed to connect with each of them, therefore I have to send that information to the server.
I guess SSH could default to asking me which key I want to connect with and then store that info afterwards?
If I wanted it to connect using only a specific key for that host (or pattern), I’d specify that in my ssh config.
Exactly. When you consider that it already does this sort of thing for host keys, it’s really a pretty obvious way to plug the information disclosure vulnerability.
I like the look of this and the other stuff from the folks behind it, but I'm curious if anyone is using it "for real." I would love to use this over others with web UIs, but at this point I am also in the market for Git+Actions-analog, which Gitea and Drone (and now just Gitea) fill on their own. Am I missing the mark on this tool's use case, or is it not just to the place where it can do such things yet.
I want to self-host, but I also don't want any infrastructure.
... why not just use the cloud at that point and skip having to roll your own everything?
Self-hosting, with emphasis on the self, to me is taking it into your own hands.
Using the cloud can be very liberating these days, you can do it in a vendor agnostic way where you own all your domains, your data and can move freely between any cloud provider.
Also more expensive of course.
To me self-hosting was always about freedom. The two arguments against self-hosting in the cloud are security and cost.
I mean, on one level, a plain directory is also a generic interface, but blob storage has semantics which naturally lend themselves to replication in ways that a regular filesystem doesn't.
I think I understand what you're saying, but to me, "self host" means you are running your own servers. I.e. managing your infrastructure.
Maybe there needs to be some other term for "using the cloud, but only as dumb storage." Like cloud _storage_ vs cloud _app_...
Self-hosting is broad enough to include wanting to get away from large centralized vendors and take hosting into your own hands. Owning your domains and being vendor agnostic with IaC.
So this guy wants to run the software themself (the "self-host") without the infrastructure (the VPS which they rent yearly and which they have had to install Debian or Unbuntu 22, along with git and all the other software) - AWS replaces the infrastructure, and while it is close being "the cloud" it is still different because setting it all is still up to the user. They are still in control of their own data (although I guess some rogue AWS employee could read the data).
But then on the other hand I'm on the "that's not self-hosting!" side when you shift from your own needs to selling a service: if you run and sell a gitsomething.com and it's all on AWS, that certainly isn't self-hosting. And again the similarity holds: when you operate a computer brand and it's all off the shelf parts you're not really a computer builder, even if the exact same configuration would nicely run under "I built this" when some by a consumer.
You won't get any server side CI/hooks or even multi user management, but if you just want a central place to push and pull your private code it's perfect.
in the past have used git-remote-gcrypt[1] with rclone.
currently using git-remote-aws[2].
both work great.
(Does anyone know alternatives to this for nodejs though?)
Products based on that technology were quite impressive back in the day: Turbo Pascal 7.0, Turbo C. The only thing that I really missed back then was drag and drop (in console) and it's still an unachievium nowadays, afaik.
- gitolite https://gitolite.com/gitolite/overview.html , and
- cgit for http front-end https://git.zx2c4.com/cgit/about/
which is what https://kernel.org/ uses (https://www.kernel.org/doc/projects/korg/gitolite/index.html)However that also meant that I needed an alternative. So let's break down what soft-serve do: 1. It's a ssh server/git server 2. It can list git repositories 3. It can browse git repositories
For: 1. you can use your current ssh server and for extra protection use the git-shell that comes with git. 2. Is easily solved with git-shell-commands (see man git-shell) 3. Is not something I need. If you want to browse you'll need to clone.
Although soft-serve is beautiful, it's a lot of added complexity for not very much functionality. If/when they add CI/CD, pull requests (perhaps a git-appraise based interface). It will be awesome and I'll give it a new try.
--> pacman -S ssh git
Voilà, you're self hosting a git server...
The point is that a git server isn't just ssh and git except in the most barebones simple use case.