Self-Hosting Git
peppe.rs
peppe.rs
All my git repos now live in a "git" folder I share amongst my fileserver and other machines with syncthing, hosting only the bare repos. If I need pull requests or issue tracking, it's got to be something that goes with the repository - as it always should've been, really.
The interesting write-up would be the one describing what the experience has been like 6-, 12-, 18-months down the road. It's easy to be optimistic and idealistic at the outset, much more difficult to remain so in the face of the day-to-day realities.
You get a shell (ok, no root/sudo because shared hosting) with 10GB space, databases and what not. A vibrant community providing installation resources for a massive amount of tooling: https://lab.uberspace.de/
I am in no way affiliated to them just a happy customer for 10+ years now.
btw: it is pay what you like, but min 1€ per month.
The hard part is remembering to update all of your software, and making sure you do it fast enough in case there is a zero-day.
The worst part is discovering that you installed a simple app and forgot about it; and now hackers got in, encrypted your files and database, and now want a ransom.
1. Run Gitea on your server, but make it only available on localhost.
2. Connect to your server via SSH, and use the -L flag to forward the port that Gitea is using e.g.
ssh -L 8888:localhost:8888 me@myserver.com
3. Access Gitea by opening http://localhost:8888 (or whatever port you’re using) in your browser.However, this doesn’t work if you’d like to collaborate with anyone who you don’t trust enough to give SSH access to your machine.
It would also be annoying or impossible to open the web interfaces on mobile devices.
Does this service allow me to deploy the apps on my own a VPS and/or dedicated server?
Does this service offer to host the apps I deploy?
Does this service allow me to specify a docker container?
There should be a full list of supported deployable apps.
Can I use forks of the available apps, or deploy from a git repo?
Do I get analytics (cpu, ram, visitors)?
[Assuming clear answers on earlier questions] So I can deploy a ghost blog from my phone? Maybe this could be elaborated.
Any plans to release a video example of the service's usage?
2 > Does this service offer to host the apps I deploy?
3 > Does this service allow me to specify a docker container?
4 > There should be a full list of supported deployable apps.
5 > Can I use forks of the available apps, or deploy from a git repo?
6 > Do I get analytics (cpu, ram, visitors)?
7 > [Assuming clear answers on earlier questions] So I can deploy a ghost blog from my phone? Maybe this could be elaborated.
8 > Any plans to release a video example of the service's usage?
ANSWERS
1. On the roadmap, you'll have the ability to automatically deploy your apps to several locations (VPS, AWS, home servers, etc.)
2. Absolutely. Nearly any web app can be wrapped with a definition file and added to your personal library and shared with others. I find wrapping an existing app takes less than an hour.
3. Yes. Apps are docker containers wrapped with a definition file.
4. For sure! Once the service launches there will be a free tier with a fully searchable index.
5. Eventually you'll be able to choose versions of apps and import from repos.
6. That's an interesting idea, cpu, ram, disk use and bandwidth are tracked, number of visits could be too. I could see this being available as a power user option.
7. Yes. Would look like opening the browser on your phone, logging into your account and clicking the Ghost graphic. Now you have a URL to your new public instance of Ghost.
8. There's an instant use free tier but we're considering also making a short 60 second "Intro to using Cloudblast" video to jumpstart new users.
I've been thinking about this a lot. often I hear (specially old-guard) hackers talking about easy and simplicity but they really mean it's familiar to them.
How so?
There's no push-button magic for it, presumably because SourceHut the company (ie. Drew) isn't interested in running it in containers, but nothing is stopping you from trying. It's different from most Python software in that you're expected to use your OS's package manager and standard service tooling.
> (ie. Drew) isn't interested in running it in containers, but nothing is stopping you from trying.
Yes, he is. I asked in SourceHut's Freenode channel and Drew's comments were literally, "we don't take kindly to your kind around here, don't ask again."
Sourcehut assumes you know your way around Linux and want to spend the time to understand how to host the services you need. The expectation will be that, if you run into issues, you're willing to debug and submit patches if necessary.
Alternatives like Gitea/Gogs are hostable as essentially single binaries and have clear guides on how to host on Docker. They're less feature rich, but more widely used in a self hosting context.
If you're looking for a middle ground, I've had good luck hosting Gitlab but it will consume more server resources than anything mentioned thus far and be a little more difficult to keep up to date
There are are several open-source software projects that have been doing the same thing but on a self-hosted solution. GitLab instance like (GNOME, GTK, etc) or cgit (wireguard, Linux, etc) and so on. ReactOS has a backup mirror of this in case GitHub goes down. [2]
We really need to get away from the idea of 'centralising everything'.
[0] https://news.ycombinator.com/item?id=26469749
The workflows git has been developed for in the first place has little to do with the non-git and mostly walled garden feature provided by hosted Saas, being Github or even Gitlab.com
Of course some projects find it convenient, but I'm not impressed by the embrace/extend approaches, esp when it shapes the technical practices because of workflow limitations existing for mere business needs: if a merge request is not possible from and to any host, that's really a big loss - and that's particularly important because of geostrategic restrictions (mainly in practice for now: the US "randomly" banning other countries, or the reverse: countries "randomly" banning various, mainly US, services)
If you’re looking for a more complete yet still lightweight alternative, give gogs a look.
Gogs
https://public-001.gitsense.com/insights/github/repos?r=gith...
Gitea
https://public-001.gitsense.com/insights/github/repos?r=gith...
Personally I'd rather use gitea though. It has a more healthy development community (as in more than one developer) and is gaining new functionality at decent pace.
Like, can I get domain/repo.git somehow with no user management at all?
I swear 90% of people who use git don't know you can just push/pull directly from another computer's git repos.
Edit: Was a response to edited-out "Do people not know you can self host git using ... git?"
Could one imagine a git repository stored as static files (e.g. in a cloud bucket), and the client then runs git the functionality.
Or, a "serverless" git, with cloud functions?
(I guess concurrent writing would be an issue.)
EDIT: I don't mean ssh'ing to a server with git installed on it. I was thinking of a git-based protocol but based on static files. But thanks for the tips.
You can set it as a remote.
A git server is not required. You can just run it locally or even use another folder as a remote.
Simple git server over SSH:
local> ssh example.com
example.com> git init --bare code
example.com> exit
local> git clone example.com:code
Nothing required on the remote side other than an SSH server. Works with multiple users, too - just use SSH auth.A long time ago when I was working in a company that still prescribed SVN, I used a backed up network drive location as the location for my git bare repos, I just used it to manage prototypes or feasibility work nothing serious but it was more familiar and productivity for me than the accepted SVN workflow.
[0] - https://drewdevault.com/2018/07/02/Email-driven-git.html
Is the main point being made that, corporations are using open source (ie github) as a platform to commercialize software?
While probably not really needed as Git repositories are self contained, i find it nice to have a "backup" on hand.
https://www.scm-manager.org/ gitolite
gitea, gogs
gitlabUnlike most Git forges, Pagure has features that support decentralized development. For example, Pagure supports submitting pull requests with Git repos on any server (regardless of whether it's running Pagure or not) with its remote pull requests feature. Issues and pull request metadata are all stored as git repos using JSON files as data, making it easy and portable to other Pagure instances and easy to convert for any other system.
There's development ongoing by one of the other contributors to build an extension for Pagure to support Forgefed[2], a protocol to federate and decentralize code project management. And unlike most Git forges, Pagure is really easy to deploy, update, and modify. Naturally, this means Pagure is packaged in virtually all major distributions[3][4][5][6], too. :)
[2]: https://forgefed.peers.community/
[3]: https://src.fedoraproject.org/rpms/pagure
[4]: https://build.opensuse.org/package/show/openSUSE:Factory/pag...
It appeals to me because I had gitlab for our 2 person team and it was just wrong sized for us. So many features went unused. Frequent upgrades meant an increasingly powerful server was required for doing basically nothing most of the time. CI/CD is not something we need.
git clone —-depth 1 …While investigation is still underway, we have decided that maintaining our own git infrastructure is an unnecessary security risk, and that we will discontinue the git.php.net server." - https://externals.io/message/113838
[1] - https://xkcd.com/908/