Self-hosted GitHub alternative?
Anafroj @ Anafroj @sh.itjust.works Posts 1Comments 107Joined 2 yr. ago
Obligatory check : are you sure you really need a forge? (that's the name we use to designate tools like Github/Gitlab/Gitea/etc). You can do a lot with git alone : you can host repositories on your server, clone them through ssh (or even http with git http-backend
, although it requires a bit of setup), push, pull, create branches, create notes, etc. And the best of it : you can even have CI/CD scripts as post-receive
hooks that will run your tests, deploy your app, or reject the changes if something is not right.
The only thing you have to do is to create the repos on your server with the --bare
flag, as in git init --bare
, this will create a repos that is basically only what you usually have in the .git
directory, and will avoid having errors because you pushed to a branch that is not the currently one checked. It will also keep the repos clean, without artifacts (provided you run your build tasks elsewhere, obviously), so it will make all your sources really easy to backup.
And to discuss issues and changes, there is always email. :) There is also this, a code review tool that just pop up on HN.
And it works with Github! :) Just add a git remote to Github, and you can push to it or fetch from it. You can even setup hooks to sync with it. I publish my FOSS projects both on Github and Gitlab, and the only thing I do to propagate changes is to push to my local bare repos that I use for easy backups, they each have a post-update hook which propagates the change everywhere it needs to be (on Github, Gitlab, various machines in my local network, which then have their own post-update hooks to deploy the app/lib). The final touch to that : having this ~/git/
directory that contains all my bare repos (which are only a few hundred MB so fit perfectly in my backups) allowed me to create a git_grep_all
script to do code search in all my repos at once (who needs elasticsearch anyway :D ) :
#!/usr/bin/env bash # grep recursively bare repos INITIAL_DIR=$(pwd) for dir in $(find . -name HEAD -exec dirname '{}' \;); do pushd $dir > /dev/null git grep "$*" HEAD > /dev/null if [[ "$?" = "0" ]]; then pwd git grep "$*" HEAD echo fi popd > /dev/null done
(note that it uses pushd
and popd
, which are bash builtins, other shells should use other ways to change directories)
The reason why you may still want a forge is if you have non tech people who should be able to work on issues/epics/documentation/etc.
Thanks, that's a good idea.
The reason why it only works on page reload is because Lemmy is a SPA : it makes it look like you're browsing several pages, but it's actually always the same, and it uses javascript to change the url and load new content. So the "load" event, triggered when the current page is done loading, is only triggered once because the page is only changed once. If you wonder why : SPA became commonplace in the 2010s because javascript applications started to get way bigger than previously, and it was helping with page load speed. For a time… because when you make page load faster, people just make it load more things until it's slow again. :)
My first reaction was that additionally to binding to the load
event, we probably just can bind to the popstate
event, which happens when the url is programmatically changed. But my first tests were not successful in doing that. I'll have a quick look at the source code of Lemmy later today to see if I can solve this.
Sadly, denigrating other people work is a good way to look smart without having to create anything ourselves. That's why I always measure a new software through the question "what new thing it allows me to do or what does it make simpler?" rather than "what are other people thinking about it?". In the case of the fediverse, the value proposition is quite clear : it allows to have a social life online without being at the mercy of BigTech, through interoperable softwares. And in the case of Lemmy, it allows to do that to replace Reddit. So yeah, some people don't like it, whatever. :)
You're welcome. I don't use mobile myself : do you use an app, or it's just about opening your Lemmy instance url in a browser? If it's the later, you can go in the settings and there is a "Show Scores" checkbox. Just uncheck it, hit the "save" button and you're done. :) This is also where you find the "Sort Type" select box which allows to define default sorting and put it to "New". It only works for posts on the homepage, though, you have to take the habit to manually click "new" after reading a post to sort its comments (I could have swear it was using the "Sort Type" option before, or maybe just remembering last sort, but it's not the case anymore).
😂 No worry, I would not have seen it anyway. :)
Keep in mind that not everyone is using the upvotes weighting, so it's not just about "those who allow downvotes and those who don't".
Personally, I find the whole upvoting/downvoting thing to be a very toxic feature that encourages hive mind and blaming divergence, so I hide scores and I sort posts and comments by chronological order. I would not use Lemmy if I was forced to be under the influence of social scoring, so defederating from instances which do not apply the same rules on downvoting would feel very detrimental to me.
Upvotes/downvotes were implemented by websites like Reddit as a scaling trick, so they can get millions of users without the need to hire hundreds of thousands of moderators. But it turned out that adding subreddits with volunteer moderators worked better anyway, and this is already what we have on Lemmy, with instance owners and community moderators, so there is really no need for some dystopian scoring of everything someone says.
Anyone heard of them being DDOS'd? This certainly sounds like ongoing DDOS and protections kicking in (assuming that by "verify my account" you mean "having to solve a captcha").
Oh wow, I realize from your description we did have an exact translation, actually! It was the word "attardé". I don't think I heard it used in this millennium, though. :) I guess the difference is that it didn't make it into an insult. Thanks for the detailed explanation!
Oh I see, thanks. The word looks like "arriéré" in French (which means, from wiktionary : "backwards (behind current trends)"), I thought they had the same meaning. It's worth mentioning what "retarded" means, when you ask someone not to use it, they may have similar assumptions.
I'm a non native English speaker, could you please explain the link between "retarded" and disabled people? I've always seen it used as an insult.
selfhosted ebook library
Is that what we call hard drives, now? :P
I have two android tablets, one 7" to read small books, and one 13" to read US Letter format books, I took the cheapest ones I found, disabled Google Play and installed F-Droid to install FOSS readers, and it just works perfectly. You really don't need anything specific to just read text, you just want to make sure that you can display an entire page on your screen in a size you're comfortable reading, otherwise PDFs becomes quickly insufferable.
Great job! Maybe it would be worth putting it on the Gentoo wiki?
Thanks for mentioning it, I didn't know about it. Protecting against CVEs sounds indeed awesome. I took a more brutal approach to fix the constant pentesting : I ban everyone who triggers a 404. :D Of course, this only work because it's a private server, only meant to be accessed by me and people with deep links. I've whitelisted IPs commonly used by my relatives, and I've made a log parser that warns me when those IPs trigger a 404, which let me know if there are legit ones, and is also a great way to find problems in my applications. But of course, this wouldn't fly on a public server. :)
Note for others reading this, the correct link is CrowdSec
Gladly, fail2ban exists. :) Note that it's not just smtp anyway. Anything on port 22 (ssh) or 80/443 (http/https) get constantly tested as well. I've actually set up fail2ban rules to ban anyone who is querying /
on my webserver, it catches of lot of those pests.
This. Also, anybody who can identify you as the owner of the host (be it through Whois or through hosting service records) can associate your name to everything posted on that instance, thus profiling you, your tastes and your opinions easily (it's insane the amount of personal information we can leak on social media, even when thinking we're not). Clearly not something to do in countries where you can be harassed or worse for your opinions, and probably best avoided everywhere, if privacy is a concern for you. There is some virtue in being immersed in the masses (that's actually a common anonymisation strategy, from merging streams comes plausible deniability).
Ahah, so that's what initrd are called on Pi. :P Good catch!
Funny enough, I don't have such file on mine, the only *.img
I have is the kernel, kernel8.img
. I guess it's OS specific.
The .bak
things sound like an interrupted update, or something. Like if the updater moved the current initrd as a backup file, then started building the new initrd and crashed or was rebooted before completion. That's what I really dislike about automatic updates, I prefer to be sure to know it's running, and see the output. :)
Congrats on sorting it out!
Oh I see. That sounds cool, thanks for mentioning it. 👍️
I feel you, been there. :) I now use Gentoo on my Pi and it is stable, but I can't recommend that to anyone who is not already used to Gentoo, it's challenging to install it by itself.
Regarding the SD card, I have no problem anymore since I stopped using the cheapest brands. I now use only Sandisk Ultra microSDXC, and the oldest ones have been working for four years without issue. It's still basically a NAND (same stuff than in SSD drives) soldered on pins, though, so it's very fragile. Care should be taken to neve bend them : they look flexible, but the NAND really isn't.
It's also a good idea to backup the whole card. As they usually weight way less than hard drives, it's easy to backup on your system and flash them back, mounting the sdcard on your desktop/laptop:
lsblk # find the device name, let's say it's mmcblk1 dd if=/dev/mmcblk1 of=./backup-file bs=1G # making a backup dd if=./backup-file of=/dev/mmcblk1 bs=1G # restoring the backup
if
means "input file", of
means "output file" and bs
is the buffer size (how many bytes are copied at once, the more the faster, but it will use that amount or RAM at each iteration). dd
is just copying input to output, bs
bytes by bs
bytes.
If you do that regularly, even using cheap sdcard that fail after a year will be less of a setback : you can just flash the last saved version of the system on a new card. It's probably better, though, to keep only the OS on the sdcard, and store important daily updated data on a usb drive or key.
It's coming to Gitlab too! (although, this will take quite some time)