[posts]: Re-thinking my git hosting with sourcehut and forgejo
25 July 2024 | 10:00 pm

Introduction

TLDR; I’ve moved my project to sourcehut, see my projects there, while maintaining a private and local forgejo instance.

Last year, I realized that my projects were in too many repos. I’ve been using github like many others for a long time, but I also had an account on gitlab, codeberg and sourcehut. I also have a few account on selfhosted repos from specific projects, but I’m not going to talk about these cases in this post.

After years of pushing codes everywhere… I had projects everywhere: github, gitlab, codeberg and sourcehut… So it was time to do something about it!

Context

Early last year, after testing sourcehut for a while, I was convinced it was the best forge for me. The “for me” is important, because I don’t think sourcehut is for everyone… And while it isn’t perfect (in particular its UI and how to navigate between each sourcehut features), I find it the best for my needs.

But at that point my repositories were a mess: projects were either on 1, all or a subset of the mentioned forges… Clear primary forge was not indicated and no way to have a good vision of all my projects… Let’s just say that this was not ideal and even myself wasn’t sure what were where…

And then sourcehut (and codeberg to a lesser extent) suffered massive DDoS attacked that put them down, specially Sourcehut that was out for multiple days. That event made me realized 3 things:

  1. I wanted a go to forge as my main “public” forge
  2. I needed a selfhosted forge to still push code during downtime of my main public forge
  3. I had to do some cleaning and clearly archive / close unused / unmaintained repos

A good question would be: “then why not just using one selfhosted platform only?”. But hosting my own forge publicly comes with big drawbacks:

  • I’ve found that bot crawlers are taking a lot of resources to crawl all public repositories.
  • Git access via ssh (to push) would need opening port 22 to the internet and do a lot configuration in my network.
  • A “known” public forge is usually easier to contribute.

So I rolled up my sleeves and decided to go through the migration to what I hope is their final destinations…

The plan

Objectives and Constraints

The goals were simple:

  • Have one main public forges for all open source projects: For that, I choose sourcehut1.
  • Have a selfhosted forges in case I want to push code and sourcehut is down. Also to host projects that I don’t want on sourcehut, even as a private project.
  • Clear indications for users / contributors on where to find the up to date version of a code.

Exception

I made 2 small exceptions for the 2 gemini RFC proposals. Collaboration are already taken place there and I’m sure some people had to create account to participate there and may not want to move. Also, as it is an RFC, having a small UI to edit the text and create a merge request may be easy than the git email workflow. That is why the Gemini Tinylog RFC and the Gemini Mention RFC primary repositories are still on codeberg.

All my other repositories follow the new plan.

New state

Local Forgejo Instance

As said, I decided to use Forgejo for my local private instance. I won’t cover the installation details, their documentation covers it well already.

This instance is only used by me for:

  • Private repository that I don’t want on sourcehut (even in private) or any other public forges
  • Very old and unused code that I want to keep
  • Hosting the code of all projects I host elsewhere. I don’t use mirroring here, I actually have to push to multiple remotes (see this post where I explained how I do it via git remote --set-url)
  • Sometimes used to push things before I push them publicly to sourcehut (or other)
  • Serve also as a backup of all my code: the instance itself is a backup of project on 3rd party forges (or the other way around), but also, the container hosting forgejo is part of my backup process with proxmox and borgbackup, so all covered :).

As you understood, every single project managed by git is hosted on this private instance. It isn’t used for anything else (no CI/CD, no public pages, no collaboration).

Sourcehut

The new public home for all my projects. Took a bit of time to get used to its UI and workflow, but I really enjoy using it. I won’t detail right now how sourcehut works differently than other “traditional” forge (=aka github workflow), but I’ll talk about why sourcehut in a later post.

One important thing to have in mind: on sourcehut, you can create projects to group multiple repositories (themselves attached to mailing lists and todolists) together. It means that you can have one project with mutltiple repositories but still a common todolist for example. It also allows to have a git repository in multiple projects, which can be useful too (see below as I’m using it).

It takes some time to grasp the full concepts of sourcehut, but the flexibility is way higher than with other forges. I’m using sourcehut projects for grouping codebases together or for “larger” projects on which I’d be happy to see collaboration. Smaller code are not in projects and just standalone repos (with mailing list and todolist still possible).

Sourcehut allows projects and codebases to be visible, unlisted or private. A project can have repos with different visibility.

For example, I created a writting project that contains 4 repositories: one for this blog, one for my gemini capsule, one for the deployment scripts (unlisted) and one for my custom hugo theme. The hugo theme is both in this project and in a dedicated one in case people would like to contribute. Other example, I have a gemini55 project containing all my gemini related repositories (gtl, houston, ggm, discogem and a link to the 2 gemini RFCs). Some repositories are not tight to projects.

What about other forges

Except the 2 Gemini RFC exceptions mentioned above, I’ve cleaned a lot my other forges presence by archiving all projects (and that took some time to do on all projects :D). Both my github and codeberg profiles indicate:

Profile used to contribute to Github projects. My own projects are hosted on sourcehut: https://sr.ht/~bacardi55 https://git.sr.ht/~bacardi55

I haven’t deleted my account on those forges though, as they might still be useful to collaborate on project hosted there.

Conclusion

The move is now over, I have been using solely sourcehut for quite some time now. This blog is now built via sourcehut builds and while sourcehut UI definitely needs improvements, it has been a great decision and I’ve enjoyed a lot using sourcehut since my move. Hopefully, this is a state that shouldn’t move for a while.


  1. : Some people might argue that sourcehut is not the best choice for this because it doesn’t provide the “classic” fork / pull request workflow, but I do believe anyone could learn fairly quickly the email workflow linked to sourcehut. Plus my project don’t have contributors in reality :P. ↩︎


[posts]: Rambling on blogging motivations and energy
24 July 2024 | 10:00 pm

It might be obvious, but I really enjoy writing on my website. Why would I do it otherwise? I’m not looking for earning money with this website and I don’t care about becoming a “well known blogger”. As I’ve wrote before (4 years ago already!), I blog for myself (and I even recently thanked myself for doing it).

I know other people sometimes force themselves to make a habit of posting daily (or close to). And while I’m impressed by such devotion and motivation, this isn’t what I want for myself. I only write when I want to and don’t impose myself a schedule.

This is the main reason I don’t participate in any of the many blogging challenges. Truth be told, I really enjoy these challenges, such as WeBlogPoMo (in May), Junited (in June), JulyReply (July) or the next one in August: Blaugust. They are not all “monthly” challenge, like the 100DaysToOffload which has been running for multiple years now. Such challenges are great to really transform writing to a habit. And I’m sure there are others I’m not aware off. The point being I do like them because:

  • They show the blogosphere is still alive and vibrant;
  • It (re)motivates old bloggers to restart writing;
  • It motivates new people to create their blog/website;
  • It brings mutual inspirations and often start group discussions (my favorite one);
  • Raise chances of seeing new interesting content in my feed reader or via mastodon.

But I don’t participate in them… It may sounds paradoxical, but I do not want that pressure for myself. Blogging, for me, is a fun thing to do, same as managing my homelab or sometimes coding some stuff. But any of these activities takes time, energy and motivation. And my day job and other IRL activities also takes time, energy and motivation… And sometimes they take too much of these things to have enough remaining for blogging and nerd related activities.

Side note, it is also true (to some extent) about reading, but it depends on the complexity of the books I’m reading. That’s why I often have multiple books in parallel, always trying to have a simple one for those days. If I don’t, I often have some manga to read anyway as an easy read.

Others may disagree, but for me, blogging is time and energy consuming. Maybe it is because I can’t write short post and always end up writing longer pieces than I expected (again with this post), maybe it is because I don’t write in my native language, but for sure it does require some motivation and a even more energy. Motivation, most of the time, is not the problem. I always have many drafts (more or less advanced) or todo for new posts and I often think about stuff I want to write about during the day. Sometimes I even add some bullet points to the post I want to write about at the end of the day thinking it will then be “just” a matter of adding more words around these bullet points.

But the reality is, at the end of the day, if my day job was long and/or very intense, or if other activities took too much times, the energy remaining at night to open my editor and start adding words is too low. Even though I may want to, I don’t feel energized enough to actually do it.

And that’s fine! As I said, blogging mainly for myself without following any rules makes me very ok with nights I don’t want to do any writing, devops or coding. Even though I thought about it a lot during the day. I always managed to remove this fake pressure from myself and just write when and if I wanted to.

Of course, it means that this blog has a very chaotic schedule. There are months where I publish a post every 2 or 3 days, and months where nothing happens… So what? Most of the (extermely) limited number of readers of this blog (if not all) use RSS feeds to follow new content. So the only things happening really is just my blog will not appear in their reader for a while. And I can (very easily) live with that :D.

I do admit that I still want to write somewhat regularly, not like previous years where I could have 6 months without a post. But the minimum I want to do is 1 post a month, which is reasonable. This year started well, and as I do not count the break during April / May due to my data loss, which was really an good reason for the break and an exceptional (at least I hope so) event, I’m way more active than my “minimal plan”.

There are days though where I’m not completely toast but still tired. During those days, to evaluate my motivation and energy, I force myself for 5 minutes. After just 5 minutes, I’m allowed to just stop and do something else. One of two things can happen during those 5 minutes: either I didn’t write anything (or just a couple of sentences), and in that case just stop because it will go nowhere. Or I just didn’t notice the 5 minutes mark and kept going. In those later cases, I usually realize after 15 or 20 minutes that I have many words already written and that usually motivates me enough to keep going and try to finish the post.

That’s it. By doing this 5 minutes exercise, I most of the time keep going :). There are (many) days where I don’t even go through this 5 minutes challenge, specially when I really don’t feel it or if I feel energy-less. But as said, I’m very ok with it, because I know at least a couple of time during a given month it will work and I’ll be able to keep this site “alive”.

This post you are reading actually started like that, with me being motivated but tired after a long and intensive work day. Well, 45 minutes later, I’m writing this conclusion and will probably publish this post in the next 30 minutes or so. So I guess it worked this time!

My only advise (and that’s also for my future self reading this) is: don’t forget you do it for the pleasure of doing it, for yourself first and not for an audience or “fame”. Remove that pressure and don’t do it on those days you feel it is will be a chore for sure. But when hesitating, just try and throw some words and you might be surprise how quickly you may have changed your mindset.

I certainly didn’t plan to finish this post today when I entered the “5 minutes test period” and clearly didn’t expect to write such a long rambling post… But here I am :).

Take care!


[bookmarks]: Tutoriel : configurer Neovim comme IDE/éditeur de code à partir de zéro
15 July 2024 | 10:00 pm

Personal notes:

[French] A very complete guide to setup neovim



More News from this Feed See Full Web Site