{"article":{"slug":"migrating-from-github-to-codeberg","title":"Migrating from GitHub to Codeberg","subtitle":null,"summary":"Inko creator Yorick Peterse explains why he moved Inko and his personal projects from GitHub to Codeberg, and walks through migrating repositories, replacing GitHub Actions with self-hosted Forgejo Actions runners, building container images, hosting private projects, and Codeberg's reliability and storage quotas.","content_type":"blog_post","language":"en","canonical_url":"https://yorickpeterse.com/articles/migrating-from-github-to-codeberg/","author":{"name":"Yorick Peterse","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"Yorick Peterse","url":"https://yorickpeterse.com/","listing_slug":null,"listing":null},"topics":[{"name":"git","slug":"git","url":"https://listedarticles.com/topics/git"},{"name":"open-source","slug":"open-source","url":"https://listedarticles.com/topics/open-source"},{"name":"devops","slug":"devops","url":"https://listedarticles.com/topics/devops"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":4936,"reading_minutes":21,"published_at":"2026-11-13T00:00:00.000Z","added_at":"2026-11-16T07:50:32.266Z","updated_at":"2026-11-16T07:50:32.266Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/migrating-from-github-to-codeberg","markdown_url":"https://listedarticles.com/articles/migrating-from-github-to-codeberg.md","example":false,"citation":"Yorick Peterse, Yorick Peterse. \"Migrating from GitHub to Codeberg.\" 13 Nov 2026. https://yorickpeterse.com/articles/migrating-from-github-to-codeberg/ (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://yorickpeterse.com/articles/migrating-from-github-to-codeberg/"},"body_markdown":"# Migrating from GitHub to Codeberg\n\nBy Yorick Peterse · November 13, 2026\n\nI created my GitHub account back in May 2009, and like most developers much of\nmy work since then has taken place on GitHub; both private and public work. In\nAugust 2015 I joined GitLab, and in the years followed I primarily used GitLab\nfor my own work as well as for [Inko](https://inko-lang.org/). Part of this was\nbecause at the time GitHub was neglecting its product, and because I wanted to\neat my own dog food so to speak.\n\nIn 2023, [I migrated Inko along with my personal projects back to\nGitHub](https://inko-lang.org/news/inko-has-migrated-back-to-github/). One of\nthe goals was to make it easier to contribute to Inko and to increase awareness\nand popularity of it, as GitHub is where most people go to look for new\nprojects; especially as the quality of search engines has degraded over the\nyears. Another goal was that GitLab.com never took off as a popular alternative\nto GitHub in spite of it's promise, something that I'm still frustrated about,\nespecially considering the effort made towards this goal by myself and many of\nmy (former) GitLab colleagues from that time.\n\nWhile moving back to GitHub did somewhat increase the amount of contributors to\nInko, measuring the impact on visibility is a lot more difficult. Sure, the\nnumber of stars of the project has increased but that's ultimately a measurement\nof how many people use *GitHub* and not so much how many actually *like* the\nproject and want to use it. For example, I myself at times star projects as a\nway of just bookmarking them so I can look into them deeper into the future; not\nso much because I think to myself \"Damn, this is cool and I want to use this\".\n\nWhat *has* been clear though is the increase in low-quality/wasteful\ninteractions on GitHub. This has always been an issue on GitHub due to the\nrelative low barrier to entry, but at least some amount of work was still\nrequired. Thanks to the ~~ongoing digital opioid crisis~~ rise of \"AI\", this\nbarrier dropped through the floor half way to China, for now one can\n\"contribute\" by just prompting ~~a digital talking parrot high on cocaine~~\nClaude Code to submit pull requests containing thousands of lines of pure\nnonsense.\n\nWhile the slop \"contributions\" I've had to deal with personally have been small\nenough/simple enough to deal with so far, the writing is on the wall: GitHub is\nno longer the place where developers collaborate, but rather a place where\n\"agents\" projectile-vomit slop that serves no other purpose but to boost their\nowner's ego.\n\nIgnoring this, there are also issues with Microsoft/GitHub in general not\nrelated to AI, that made me want something that feels more in the spirit of free\nsoftware.\n\nWhich brings me to [Codeberg](https://codeberg.org/). Codeberg, for those living\nunder a rock, is a centralized (and probably the most popular) instance of\n[Forgejo](https://forgejo.org/), which is a fork of\n[Gitea](https://about.gitea.com/) which in turn is a fork of\n[Gogs](https://gogs.io/).\n\nWhat I like about Codeberg in particular is it's [stance on hosting non-free\nsoftware](https://docs.codeberg.org/getting-started/faq/#can-i-host-content-without-a-free-and-open-source-license%3F),\nits [\"no AI here\"](https://codeberg.org/Codeberg/org/src/branch/main/TermsOfUse.md#2-allowed-content-usage)\nstance, and it's organisational structure that should make enshittification\nless likely to happen. I'm not alone feeling drawn to Codeberg, with for example\n[Zig](https://ziglang.org/news/migrating-from-github-to-codeberg/) moving from\nGitHub to Codeberg for similar reasons about a year ago.\n\nAfter thinking about moving to Codeberg for a while, I started the process of\ndoing so a few weeks ago, starting with my personal repositories, followed by\nthe repositories used for Inko. In total this meant going through 70+\nrepositories, though I did not migrate all them. For example, projects for which\ndevelopment ended years ago were not migrated.\n\n\"But Yorick this article is boring so far, I want the juicy details!\" Yes yes, I\nknow! Let's get to it.\n\nNote that what follows below is a bit rough on the edges, as I have this\nrecurring problem of thinking \"I should write about this process as I do it\",\nthen proceed to *not* do that, and then have to recall everything from memory\nwhen I *do* write down my findings later.\n\n## Table of contents\n\n- [Migrating repositories](#migrating-repositories)\n- [Replacing GitHub Actions with Forgejo Actions](#replacing-github-actions-with-forgejo-actions)\n- [Self-hosting Forgejo Actions runners](#self-hosting-forgejo-actions-runners)\n- [Building container images](#building-container-images)\n- [Hosting private projects](#hosting-private-projects)\n- [Codeberg reliability and performance](#codeberg-reliability-and-performance)\n- [Storage quotas](#storage-quotas)\n- [Conclusion](#conclusion)\n\n## Migrating repositories\n\nThe first step was to determine *what* I wanted to migrate. If you only have a\nfew repositories then the process is pretty easy, but when migrating 70+\nrepositories the process becomes a bit more difficult. The approach I took was\npretty simple: actively maintained or otherwise interesting projects (e.g. from\na historical perspective or those worth showcasing) were migrated, others were\narchived on GitHub and left as-is.\n\nNext, I created [an issue on\nGitHub](https://github.com/inko-lang/inko/issues/1021) to track the progress and\nall the steps necessary (later moved to [a Codeberg\nissue](https://codeberg.org/inko-lang/inko/issues/1021)). Most notably, this\nissue contains a large list of TODOs to check off. TODOs are great, except for\nthe part where GitHub at times resets the state of one item marked as done when\nyou mark another item as done too quickly after the first one. Coding is\napparently solved thanks to AI, but reliably updating a checkbox as \"checked\" is\napparently still too difficult.\n\nTo migrate the repositories, I used Codeberg's (technically Forgejo's)\n[repository migration feature](https://codeberg.org/repo/migrate). While I\nlikely could've automated this process, I ended up doing this by hand as I\nfigured the time to properly automate it would likely exceed the time spent\ndoing the work by hand, though in hindsight I think automating it probably\nwould've been faster. The rest of the time is mainly spent waiting for the\nimporter to do its work, followed by adjusting the relevant settings of each\nproject (e.g. the available merge strategies for pull requests).\n\nOne minor nuisance is that when the GitHub importer hits a GitHub rate limit it\nwon't notify you about this in any way, instead it just retains the last status\n(e.g. \"Migrated 500 issues\") until the rate limit is reset at which point it\nwill continue its work. The first time this happened I thought the importer got\nstuck, until about an hour later it resumed work and managed to import all\nremaining data without any further issues.\n\nAnother minor nuisance is that the importer makes no attempt at linking GitHub\nusers to any existing Codeberg issues, instead it essentially uses fake users\n(albeit with the corresponding GitHub usernames). This means that for example\nissues assigned to users on GitHub need to be manually assigned to their\ncorresponding Codeberg users.\n\nOh, and one more thing: GitHub introduced the concept of \"issue types\" (\"Bug\",\n\"Feature\", etc) but Forgejo has no equivalent. If you make use of this, make\nsure to label these issues accordingly so you don't lose that information during\na migration.\n\n## Replacing GitHub Actions with Forgejo Actions\n\nCodeberg offers two systems for continuous integration:\n[Woodpecker](https://woodpecker-ci.org/) and [Forgejo\nActions](https://forgejo.org/docs/latest/user/actions/basic-concepts/). The\nlatter is essentially a bootleg version of GitHub Actions, complete with\neverything that makes GitHub Actions a pain to deal with (e.g. semi\nTuring complete YAML). I went with Forgejo Actions because of its better\nintegration with Forgejo and because at this stage I didn't feel like *also*\nrewriting all CI configuration for an entirely different platform.\n\nOn the surface migrating from GitHub Actions to Forgejo Actions seems\nstraightforward, but there are various subtle differences that can make this\nmore annoying than anticipated.\n\nFor example, Codeberg offers a [set of shared\nrunners](https://codeberg.org/actions/meta#available-runners) but these come\nwith strict constraints on job times and limited resources, such that they are\nonly suitable for the most basic of workloads. The runners are also limited to\nAMD64 Linux, so if you need to run tests on for example macOS you're out of\nluck.\n\nOne important detail that *isn't* documented (at least that I could find) is\nthat these shared runners *don't* pull container images if they already exist on\nthe runner, or at least not always. So if you have a job that uses the image\n`foo:latest` and you update the tag to point to a newer version, you may need to\nwait an unspecified amount of time before the shared runners use this new\nversion. In practise this makes it impossible to effectively use images/tags\nsuch as `alpine:latest` or `alpine:3`. Using digests instead of tags should work\njust fine, but doing so across many projects can quickly become annoying to\nmanage, and it isn't always practical (e.g. when you rely on nightly container\nbuilds).\n\nI ended up setting up my own Forgejo runners to work around these issues, using\na Mac Mini M1 for ARM64 builds and a small home server that I already had set up\nfor other purposes for AMD64 builds. I'll cover this in more detail below.\n\nUI wise Forgejo Actions is a bit bare-bones compared to GitHub, so don't expect\nany fancy graphs showing your jobs and those that depend on them and so on,\ninstead you just get a flat list of all jobs and their output.\n\nWhile Forgejo Actions is based on GitHub Actions, it's not fully compatible with\nit. For example, more recent versions of\n[actions/upload-artifact](https://github.com/actions/upload-artifact) and\n[actions/download-artifact](https://github.com/actions/download-artifact) don't\nwork with Forgejo. Similarly, when using GitHub Actions it's not necessary for\ncustom container images to include Node.js, while Forgejo Actions *does* require\nthis.\n\nGiven that Forgejo Actions is based on GitHub Actions it also suffers from the\nsame problems, such as YAML being frustrating to work with, and it being\ndifficult to effectively test CI config changes without pushing the changes to a\nbranch and hoping for the best. I did briefly look at Woodpecker but it doesn't\nseem to be *that* different, and due to it being less well integrated into\nForgejo I didn't bother looking into this further.\n\n## Self-hosting Forgejo Actions runners\n\nThe current runner setup that I have involves two computers:\n\n- An M1 Mac Mini I bought second-hand a few years ago for about €200 (an\n  absolute steal)\n- A Deskmini X300 with a Ryzen 5 5600G and 16 GiB of RAM, built a few years ago\n  with the main purpose being some home automation and streaming of Blu-ray\n  movies through [Jellyfin](https://jellyfin.org/). Had I known about the\n  RAMpocalypse at the time I would've built it with 32 GiB or maybe even 64 GiB\n  of RAM, but alas here we are\n\nBoth sit in a ~~professional rack unit~~ a utilities closet on the ground floor,\ncomplete with excellent cable management (Deskmini in the top left, Mac Mini on\nthe bottom right between the router and switch):\n\n![OVH would be proud of this setup](/images/migrating-from-github-to-codeberg/server_closet.avif)\n\nFor Inko I want to test on all platforms it supports, which is Linux, macOS and\nFreeBSD, and on the two supported architectures: AMD64 and ARM64. As I don't\nhave access to any Intel Mac hardware, testing against AMD64 macOS is no longer\npossible. This is unfortunate, but with Apple deprecating Intel hardware this\nwas bound to happen at some point.\n\nThe way the runners are managed/updated differs a bit per platform. The Linux\nhost on the Deskmini and the Linux ARM64 runner both use Fedora through\n[bootc](https://bootc.dev/) and are set to automatically pull and apply updates\nfrom my private Forgejo instance/container registry. The FreeBSD VMs are updated\nby building a new disk image, turning the VM off and then swapping the existing\ndisk image with the newly built one.\n\nThe workload is divided across the hardware as follows:\n\n- The Mac Mini runs macOS tests directly on the host, while FreeBSD ARM64 and\n  Linux ARM64 tests run in a virtual machine (using [UTM](https://getutm.app/)).\n  The FreeBSD VM is limited to 2 CPU cores and 4 GiB of memory, while the Linux\n  VM is limited to 4 CPU cores and 4 GiB of memory\n- The Deskmini runs Linux tests in containers, restricted to 4 CPU cores and 4\n  GiB of memory. FreeBSD AMD64 tests run in a VM with the same constraints as\n  the FreeBSD VM running on the Mac Mini\n- A runner that runs on my Netcup RS 1000 G12.5 root server, used to also serve\n  this website and a private Forgejo instance. This runner is limited to only 2\n  CPU cores and mainly used for small jobs such as running linters\n\nAll runners are limited to only running a single job at a time. The exact\ndivision of CPU cores per VM/container is something I'm still experimenting\nwith.\n\nThe goal of this setup is to prevent one job from trashing the CPU and thus\naffecting other jobs. For example, when I experimented with each job having\naccess to all CPU cores, various tests that rely on timeouts (e.g. because they\nexpect operation A to time out and operation B to succeed) would sporadically\nfail due to the heavy contention caused by the many threads and processes the\njobs would run.\n\nUsing the current setup, a single pipeline for Inko takes between 15 and 20\nminutes. This involves running various linters, testing across three platforms\nand two architectures, building and upload documentation, and building container\nimages for two architectures.\n\nWhile this isn't too bad, with slightly more powerful hardware I'm certain the\ntime could be cut in half. For ARM64 builds I can't do much as an M1 Mac Mini\njust isn't *that* powerful (or at least not powerful enough for this scenario).\nFor AMD64 builds I could relax the constraints and speed up build times\nsomewhat, but this comes at the cost of noise: the Noctua CPU fan of the\nDeskmini can get pretty loud at high load and this noise can be heard across the\nentire ground floor. As I *hate* fan noise (\"WWWWWRRRRRRRRRRRRRRRRRR\"), this is\nnot an option.\n\nI've been experimenting with using VPS' to take over the load, but the results\nso far are mixed. For example, I tested a Netcup 500 ARM G12.5 VPS (2 virtual\ncores and 4 GiB of RAM) but found it to be about 2 times slower compared to the\nFreeBSD VM running on the Mac Mini. I ran a similar test on Hetzner and found\ntheir servers to be about 2.5 times slower. Based on this and some other tests I\nran, it appears that to achieve performance similar to my local VMs I need to\ntake whatever CPU cores they have access to and double that, so a local VM with\n2 cores would translate to a VM with *at least* 4 \"cores\".\n\nNote the \"cores\" part because different providers take different approaches to\naccess to the CPU: in some cases a \"vCore\" translates to a thread or even part\nof a thread (e.g. a thread with additional usage limits), while in other\ninstances (e.g. Netcup's root server offering) it translates to a thread not\nconcurrently shared with other VMs and without any utilisation limit.\n\nThe bottleneck here is money: most reputable providers charge somewhere between\n€15 and €20 for 4 \"cores\" per server, with some offering budget options (e.g.\nNetcup) that cost less but likely come with (significant) resource constraints\n(e.g. more CPU steal time or poor disk performance). Assuming I want to move all\nrunners out of my home network, that means 6 virtual machines (`3 operating\nsystems * 2 architectures`), for a total of somewhere between €90 and €120 per\nmonth. This also assumes that I wouldn't need bigger servers, at which point you\nmay end up paying double this estimate.\n\nOne experiment I'm thinking of is to set up a Netcup 1000 ARM G12.5 VPS (4\nvirtual cores) for FreeBSD ARM64 builds, and a Netcup Lite 2 G12.5s VPS (4 cores\nfrom their lite/budget tier) for FreeBSD AMD64 builds. This way I can free up 2\ncores on both the Deskmini and the Mac Mini for other jobs, though I have to\ngive this some more thought based on the somewhat lackluster performance of the\n2-core ARM servers I tried so far.\n\n## Building container images\n\nAnother challenge with the shared runners, and one worth discussing in more\ndetail, is that the shared runners don't allow for nested Podman/Docker builds.\nThis means you can't use the various existing Docker actions (e.g.\n[docker/build-push-action](https://github.com/docker/build-push-action/)) for\nbuilding container images and instead you have to use\n[Buildah](https://buildah.io/).\n\nWhile annoying at first, I think the end result is actually *better* than using\nexisting actions as your CI pipeline ends up depending less on some pile of\nJavaScript and YAML that resides in some GitHub repository.\n\nFor building images I use Buildah, as it doesn't require the ability to run\nPodman/Docker inside itself. I found some existing articles that discuss this\ntopic and they suggested to use the `vfs` storage driver, but after testing this\nfor myself I found that this doesn't perform well once you start building\ncontainer images larger than 1 GiB or so. Instead, I settled on the following:\n\nLinux runners are configured such that jobs run in containers with at least the\nfollowing option Podman:\n\n```\n--device /dev/fuse\n```\n\nThis doesn't require privileged access and shouldn't pose any security risks\n(that I know of at least).\n\nNext, we need to make sure that `/var/lib/containers/storage` in the container\nis a volume that resides on the host. If this is instead a regular directory,\nbuilding the container may take considerably longer depending on the amount of\nlayers and images produced when building an image.\n\nThere are two ways of doing this. The first option is to use a specific\ndirectory that exists on the host and configure the Forgejo runner to allow jobs\nto mount this directory. For example:\n\n```\ncontainer:\n  options: \"--device /dev/fuse\"\n  valid_volumes:\n    - /var/lib/forgejo-runner/containers\n```\n\nThis allows jobs to then mount this directory as follows:\n\n```\njobs:\n  manifest:\n    name: OCI manifest\n    runs-on: home-linux-amd64\n    container:\n      volumes:\n        - /var/lib/forgejo-runner/containers:/var/lib/containers/storage:z\n    needs:\n      - build\n    steps:\n      ...\n```\n\nWhile this works and allows jobs to reuse existing data, it comes with two\ndownsides:\n\n1. Concurrent jobs may mess with this data in ways that could cause build\n   failures, such as when one job removes all data while another job makes use\n   of it\n2. The directory may grow in size quickly, depending on the images you're\n   building and how often you build them\n\nA second and better option is to instead use anonymous volumes like so:\n\n```\ncontainer:\n  options: \"--device /dev/fuse --volume /var/lib/containers/storage\"\n  valid_volumes: []\n```\n\nCI jobs then *don't* need any additional configuration, i.e. the following is\nall you need:\n\n```\njobs:\n  manifest:\n    name: OCI manifest\n    runs-on: home-linux-amd64\n    needs:\n      - build\n    steps:\n      ...\n```\n\nThe Forgejo runner runs Docker/Podman jobs using the `--rm` option, so when the\njob finishes the anonymous volume is removed automatically. The downside is that\ndepending on the amount of data stored in this directory, tearing down the\ncontainer may take a little longer.\n\nIf you have a lot of RAM available you can also use a tmpfs mount, but given the\ncontainers storage can accumulate a lot of data quickly I don't think this is a\ngood idea.\n\nWith the above setup in place, Buildah is then invoked as follows (where `NAME`\nis the name to use for the built image):\n\n```\nbuildah build --pull=newer --isolation=chroot --layers --tag NAME\n```\n\nThe `--pull=newer` option ensures that any images used in `FROM` entries in the\n`Dockerfile`/`Containerfile` are updated if necessary. `--isolation=chroot` is\nused to avoid the need for running Podman inside Podman, and `--layers` ensure\nthat layers are cached and reused where possible (which unlike when using Podman\nisn't the default behavior).\n\nThe result of this approach is that Buildah is able to use the \"overlay\" storage\ndriver (the default), storing the data on the host such that it can be reused\nbetween builds. I also found that if you *don't* store the containers data\noutside of the container, cleaning up the container at the end can take a long\ntime (in the order of several minutes).\n\nA downside is that jobs can mess with this shared volume, such that you *don't*\nwant to use this if your runners are meant to run untrusted workloads. This\nisn't relevant for my use case though and as such I'm fine with this caveat.\n\nTo keep the CI configuration simple, I don't include the above buildah commands\ndirectly in the various YAML files. Instead, I have a\n[just](https://just.systems/) file that defines a bunch of tasks for each\nproject (e.g. those for releasing a new version), including tasks to build and\npush images. The general structure is as follows:\n\n```\n# justfile\nmod release 'just/release.just'\nmod image 'just/image.just'\n```\n\nThen `just/image.just` is defined as follows (using\n[idoc](https://codeberg.org/inko-lang/idoc) as an example here):\n\n```\nset unstable\nset no-cd\n\n# The user to log in as to the registry.\nUSER := \"yorickpeterse\"\n\n# The host of the registry.\nHOST := \"codeberg.org\"\n\n# The namespace of the package.\nNAMESPACE := \"inko-lang\"\n\n# The name of the package.\nNAME := \"idoc\"\n\n# The Git commit we're building for.\nGIT_SHA := `git rev-parse HEAD`\n\n# Build the image\nbuild tag=\"latest\" inko_tag=\"latest\":\n    buildah build \\\n        --pull=newer \\\n        --isolation=chroot \\\n        --layers \\\n        --build-arg \"SHA={{ GIT_SHA }}\" \\\n        --build-arg \"VERSION={{ tag }}\" \\\n        --build-arg \"INKO_TAG={{ inko_tag }}\" \\\n        --tag \\\n        \"{{ fqn(tag) }}\"\n\n# Log in to the container registry\nlogin pass:\n    @buildah login {{ HOST }} --username \"{{ USER }}\" --password \"{{ pass }}\"\n\n# Push the image to the registry\npush tag:\n    buildah push \"{{ fqn(tag) }}\"\n\n# Tag an image as the latest image.\nlatest tag:\n    buildah tag \"{{ fqn(tag) }}\" \"{{ fqn('latest') }}\"\n\n# Create and push a manifest of multi-arch tags\nmanifest tag:\n    buildah manifest create \\\n        --all \"{{ fqn('manifest') }}\" \\\n        \"{{ fqn(f'{{ tag }}-amd64') }}\"\n    buildah manifest push \"{{ fqn('manifest') }}\" \"docker://{{ fqn(tag) }}\"\n    buildah manifest rm \"{{ fqn('manifest') }}\"\n\n# Prune all images\nclean:\n    buildah prune --all --force\n\nfqn(tag) := f\"{{ HOST }}/{{ NAMESPACE }}/{{ NAME }}:{{ replace_regex(tag, 'v(\\d+\\.\\d+\\.\\d+)', '$1') }}\"\n```\n\nThen to build and push an image, you run the following:\n\n```\njust image build latest\njust image push latest\n```\n\nThe above setup also allows for multi-arch images. You can use this [reusable\nworkflow](https://codeberg.org/inko-lang/idoc/src/commit/945361f5daa7fc9b6109d7bea8a10e90b6c855ec/.forgejo/workflows/image.yml)\nas an example, but it essentially comes down to the following:\n\n1. For each architecture, run a job that builds an image with a tag in the\n   format `NAME:TAG-amd64` (i.e. `idoc:latest-amd64`) and push it to the\n   registry\n2. Create a manifest named `NAME:TAG` that combines these architecture specific\n   tags and push it to the registry\n\nIn theory the architecture specific tags aren't necessary as you can use digests\ninstead. This requires that you somehow store these digests in a build artifact\nsuch that it can be reused by a \"create and push manifest\" job. I felt it was\neasier to use the above approach, hence I went with that.\n\n## Hosting private projects\n\nWhile Codeberg allows for private repositories, this is limited to specific\nscenarios such as a private repository that supports a free-software project\n(e.g. a private project used for reporting security vulnerabilities). I have a\nfew repositories used to build bootc server images/updates, and to track some\nprivate data (e.g. tasks to do around the house), none of which fall within the\nscope of what Codeberg allows.\n\nI ended up migrating these projects to a private Forgejo instance hosted on the\nsame server that hosts this website. The setup is a bit creative: I use\n[shost](https://codeberg.org/yorickpeterse/shost) for hosting a few websites,\nand has some logic related to TLS certificates that I want to dog-food, and as\nsuch I don't want to run a reverse proxy in front of it. This means port 443 is\nunavailable. While I could run Forgejo on a different port (e.g. 4430), this\nmakes it a bit more annoying to work with.\n\nFortunately, there's a workaround: Netcup gives you access to a /64 IPv6 block,\nand pretty much every network I use on a regular basis supports IPv6. The way I\nhave things set up is that the server has three IP addresses assigned:\n\n1. `152.53.115.141` and `2a0a:4cc0:80:47b9::1`, used for the various sites\n   served by shost\n2. `2a0a:4cc0:80:47b9::2` used for the Forgejo instance\n\nThen \"routing\" and binding of the services is done as follows:\n\n1. shost binds itself to address `::` and port 443 on the host, with `::`\n   meaning it binds to *all* IPv4 and IPv6 addresses available. This way it can\n   handle both IPv4 and IPv6 connections\n2. Forgejo binds itself to port 443 in a Podman network bridge. Because this is\n   its own network, it won't conflict with shost\n3. The firewall is configured so that HTTP(s) and SSH traffic to\n   `2a0a:4cc0:80:47b9::2` is redirected to the IPv6 address of the Forgejo\n   instance running in the Podman bridge\n\nThe firewall in this case is [firewalld](https://firewalld.org/) and the routing\nconfiguration is as follows (here `fd9d:b34d:66b6:ff2d::2` is the IPv6 address\nthe Forgejo instance uses for the bridge, not the IPv6 address used by the\nhost):\n\n```\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<zone>\n  <short>Public</short>\n  <description>The default zone</description>\n\n  <!-- ... other stuff here ... -->\n\n  <rule family=\"ipv6\">\n    <destination address=\"2a0a:4cc0:80:47b9::2\" />\n    <forward-port port=\"443\" protocol=\"tcp\" to-port=\"443\" to-addr=\"fd9d:b34d:66b6:ff2d::2\" />\n  </rule>\n\n  <rule family=\"ipv6\">\n    <destination address=\"2a0a:4cc0:80:47b9::2\" />\n    <forward-port port=\"80\" protocol=\"tcp\" to-port=\"80\" to-addr=\"fd9d:b34d:66b6:ff2d::2\" />\n  </rule>\n\n  <rule family=\"ipv6\">\n    <destination address=\"2a0a:4cc0:80:47b9::2\" />\n    <forward-port port=\"22\" protocol=\"tcp\" to-port=\"22\" to-addr=\"fd9d:b34d:66b6:ff2d::2\" />\n  </rule>\n\n  <forward/>\n</zone>\n```\n\nAnd the corresponding\n[quadlets](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html)\nfor the Forgejo instance:\n\n```\n# forgejo.container\n[Container]\nImage=codeberg.org/forgejo/forgejo@sha256:5ef02fbcf22beef56b8c844952ffad58cfe177b6f98e46e6abb5df90b88dc8d3\nPull=missing\nContainerName=forgejo\n...\nNetwork=containers.network\nIP=10.10.0.2\nIP6=fd9d:b34d:66b6:ff2d::2\n...\n\n# containers.network\n[Network]\nDriver=bridge\nInterfaceName=containers\nIPv6=true\nDNS=127.0.0.53\nSubnet=10.10.0.0/16\nGateway=10.10.0.1\nSubnet=fd9d:b34d:66b6:ff2d::/64\nGateway=fd9d:b34d:66b6:ff2d::1\nNetworkDeleteOnStop=true\n```\n\nThe result is that I don't need a reverse proxy, an extra server, or the use of\na non-standard port for Forgejo. The caveat is that you won't be able to access\nthe instance from IPv4-only networks.\n\nThe reason shost binds directly to the host instead of using dedicated Podman\nnetwork is because of [this Podman\nissue](https://github.com/podman-container-tools/podman/discussions/29423).\n\nOne question that may arise is why not host *all* my projects on my own Forgejo\ninstance and make it available to the public, instead of using Codeberg. This is\nindeed something I thought of, and there are three main reasons for this:\n\n1. Hosting projects on Codeberg (or any centralized forge for that matter) makes\n   it easier to interact with different projects as you can use the same\n   account, similar to what made GitHub popular in the first place\n2. Opening your Forgejo instance up to the public means also dealing with an\n   onslaught of spam, abusive bot traffic, and so on, and Forgejo in its current\n   form doesn't have good tools to deal with this from what I've gathered\n3. Hosting repositories along with all their forks may end up consuming a lot of\n   disk space. While Forgejo supports [an alternative\n   workflow](https://forgejo.org/docs/latest/user/git-cli/agit-support/) that\n   doesn't require forking, it's sufficiently clunky that I suspect 99% of\n   people can't be bothered; myself included\n\nOf course hosting on Codeberg doesn't fundamentally *solve* these problems, but\nrather it means they are not *my* problems.\n\n## Codeberg reliability and performance\n\nOne reason one might want to move away from GitHub is it's poor reliability in\nrecent years. Unfortunately, the Codeberg experience in this regard is a bit of\na hit and miss. While Codeberg performs reasonably well, it's *a lot* slower\ncompared to a self-hosted instance.\n\nOf course that makes sense given that a typical self-hosted instance has a\nfraction of the data and traffic, but it's still annoying. For example, a `git\npush` typically takes between 5 and 10 seconds to complete and various pages on\nCodeberg can easily take seconds to finish loading. There have also been several\noutages over the last few weeks, most of which (including at least one partial\noutage that lasted for around an hour) with exactly zero communication from\nCodeberg. In fact, in at least one instance the Mastodon instance used for\nstatus updates was itself unavailable during a Codeberg outage.\n\nNow to be fair, running a large publicly accessible code forge is no easy task,\nso I have to give Codeberg some slack here. I'm also optimistic that it *will*\nimprove because Codeberg's whole mission is to make Codeberg useful, rather than\nmaking a big fat profit at all costs.\n\n## Storage quotas\n\nCodeberg enforces somewhat strict storage quotas on user accounts and\norganisations. For my personal account the limit is \"only\" 200 GiB for assets\n(that includes container images), but I think that's because my account has been\naround for a while. For the Inko organisation the limit is 1.5 GiB, which isn't\nenough for the various container images we build and store. While I submitted a\n[request to increase the\nquota](https://codeberg.org/Codeberg-e.V./requests/issues/2652), this request\nhas yet to receive a reply at the time of writing. So until this quota is\nincreased, Inko is forced to continue using GitHub's container registry for some\nof its container images, which feels a little odd.\n\nIf you're in a similar scenario, my advice is to create the quota request as\nearly as possible as it may take several weeks for it to be processed.\n\n## Conclusion\n\nI think Codeberg is a promising alternative, in spite of some paper cuts you'll\nrun into when migrating to it. Having to set up your own CI runners is a bit\ntedious, but there may be [some solutions to that in the\nfuture](https://felinebuildservices.org/). I also keep toying with the idea of\nsetting up a small business that provides hosted Forgejo runner, though it's\ndifficult to determine at this stage what (if any) interest there would be in\nthis. Given Codeberg's mission I also feel it can only get better from here on,\nbut only time will tell.\n","body_html":"<h1 id=\"migrating-from-github-to-codeberg\">Migrating from GitHub to Codeberg</h1>\n<p>By Yorick Peterse · November 13, 2026</p>\n<p>I created my GitHub account back in May 2009, and like most developers much of\nmy work since then has taken place on GitHub; both private and public work. In\nAugust 2015 I joined GitLab, and in the years followed I primarily used GitLab\nfor my own work as well as for <a href=\"https://inko-lang.org/\" rel=\"nofollow ugc noopener\">Inko</a>. Part of this was\nbecause at the time GitHub was neglecting its product, and because I wanted to\neat my own dog food so to speak.</p>\n<p>In 2023, <a href=\"https://inko-lang.org/news/inko-has-migrated-back-to-github/\" rel=\"nofollow ugc noopener\">I migrated Inko along with my personal projects back to\nGitHub</a>. One of\nthe goals was to make it easier to contribute to Inko and to increase awareness\nand popularity of it, as GitHub is where most people go to look for new\nprojects; especially as the quality of search engines has degraded over the\nyears. Another goal was that GitLab.com never took off as a popular alternative\nto GitHub in spite of it&#39;s promise, something that I&#39;m still frustrated about,\nespecially considering the effort made towards this goal by myself and many of\nmy (former) GitLab colleagues from that time.</p>\n<p>While moving back to GitHub did somewhat increase the amount of contributors to\nInko, measuring the impact on visibility is a lot more difficult. Sure, the\nnumber of stars of the project has increased but that&#39;s ultimately a measurement\nof how many people use <em>GitHub</em> and not so much how many actually <em>like</em> the\nproject and want to use it. For example, I myself at times star projects as a\nway of just bookmarking them so I can look into them deeper into the future; not\nso much because I think to myself &quot;Damn, this is cool and I want to use this&quot;.</p>\n<p>What <em>has</em> been clear though is the increase in low-quality/wasteful\ninteractions on GitHub. This has always been an issue on GitHub due to the\nrelative low barrier to entry, but at least some amount of work was still\nrequired. Thanks to the <del>ongoing digital opioid crisis</del> rise of &quot;AI&quot;, this\nbarrier dropped through the floor half way to China, for now one can\n&quot;contribute&quot; by just prompting <del>a digital talking parrot high on cocaine</del>\nClaude Code to submit pull requests containing thousands of lines of pure\nnonsense.</p>\n<p>While the slop &quot;contributions&quot; I&#39;ve had to deal with personally have been small\nenough/simple enough to deal with so far, the writing is on the wall: GitHub is\nno longer the place where developers collaborate, but rather a place where\n&quot;agents&quot; projectile-vomit slop that serves no other purpose but to boost their\nowner&#39;s ego.</p>\n<p>Ignoring this, there are also issues with Microsoft/GitHub in general not\nrelated to AI, that made me want something that feels more in the spirit of free\nsoftware.</p>\n<p>Which brings me to <a href=\"https://codeberg.org/\" rel=\"nofollow ugc noopener\">Codeberg</a>. Codeberg, for those living\nunder a rock, is a centralized (and probably the most popular) instance of\n<a href=\"https://forgejo.org/\" rel=\"nofollow ugc noopener\">Forgejo</a>, which is a fork of\n<a href=\"https://about.gitea.com/\" rel=\"nofollow ugc noopener\">Gitea</a> which in turn is a fork of\n<a href=\"https://gogs.io/\" rel=\"nofollow ugc noopener\">Gogs</a>.</p>\n<p>What I like about Codeberg in particular is it&#39;s <a href=\"https://docs.codeberg.org/getting-started/faq/#can-i-host-content-without-a-free-and-open-source-license%3F\" rel=\"nofollow ugc noopener\">stance on hosting non-free\nsoftware</a>,\nits <a href=\"https://codeberg.org/Codeberg/org/src/branch/main/TermsOfUse.md#2-allowed-content-usage\" rel=\"nofollow ugc noopener\">&quot;no AI here&quot;</a>\nstance, and it&#39;s organisational structure that should make enshittification\nless likely to happen. I&#39;m not alone feeling drawn to Codeberg, with for example\n<a href=\"https://ziglang.org/news/migrating-from-github-to-codeberg/\" rel=\"nofollow ugc noopener\">Zig</a> moving from\nGitHub to Codeberg for similar reasons about a year ago.</p>\n<p>After thinking about moving to Codeberg for a while, I started the process of\ndoing so a few weeks ago, starting with my personal repositories, followed by\nthe repositories used for Inko. In total this meant going through 70+\nrepositories, though I did not migrate all them. For example, projects for which\ndevelopment ended years ago were not migrated.</p>\n<p>&quot;But Yorick this article is boring so far, I want the juicy details!&quot; Yes yes, I\nknow! Let&#39;s get to it.</p>\n<p>Note that what follows below is a bit rough on the edges, as I have this\nrecurring problem of thinking &quot;I should write about this process as I do it&quot;,\nthen proceed to <em>not</em> do that, and then have to recall everything from memory\nwhen I <em>do</em> write down my findings later.</p>\n<h2 id=\"table-of-contents\">Table of contents</h2>\n<ul><li><a href=\"#migrating-repositories\">Migrating repositories</a></li><li><a href=\"#replacing-github-actions-with-forgejo-actions\">Replacing GitHub Actions with Forgejo Actions</a></li><li><a href=\"#self-hosting-forgejo-actions-runners\">Self-hosting Forgejo Actions runners</a></li><li><a href=\"#building-container-images\">Building container images</a></li><li><a href=\"#hosting-private-projects\">Hosting private projects</a></li><li><a href=\"#codeberg-reliability-and-performance\">Codeberg reliability and performance</a></li><li><a href=\"#storage-quotas\">Storage quotas</a></li><li><a href=\"#conclusion\">Conclusion</a></li></ul>\n<h2 id=\"migrating-repositories\">Migrating repositories</h2>\n<p>The first step was to determine <em>what</em> I wanted to migrate. If you only have a\nfew repositories then the process is pretty easy, but when migrating 70+\nrepositories the process becomes a bit more difficult. The approach I took was\npretty simple: actively maintained or otherwise interesting projects (e.g. from\na historical perspective or those worth showcasing) were migrated, others were\narchived on GitHub and left as-is.</p>\n<p>Next, I created <a href=\"https://github.com/inko-lang/inko/issues/1021\" rel=\"nofollow ugc noopener\">an issue on\nGitHub</a> to track the progress and\nall the steps necessary (later moved to <a href=\"https://codeberg.org/inko-lang/inko/issues/1021\" rel=\"nofollow ugc noopener\">a Codeberg\nissue</a>). Most notably, this\nissue contains a large list of TODOs to check off. TODOs are great, except for\nthe part where GitHub at times resets the state of one item marked as done when\nyou mark another item as done too quickly after the first one. Coding is\napparently solved thanks to AI, but reliably updating a checkbox as &quot;checked&quot; is\napparently still too difficult.</p>\n<p>To migrate the repositories, I used Codeberg&#39;s (technically Forgejo&#39;s)\n<a href=\"https://codeberg.org/repo/migrate\" rel=\"nofollow ugc noopener\">repository migration feature</a>. While I\nlikely could&#39;ve automated this process, I ended up doing this by hand as I\nfigured the time to properly automate it would likely exceed the time spent\ndoing the work by hand, though in hindsight I think automating it probably\nwould&#39;ve been faster. The rest of the time is mainly spent waiting for the\nimporter to do its work, followed by adjusting the relevant settings of each\nproject (e.g. the available merge strategies for pull requests).</p>\n<p>One minor nuisance is that when the GitHub importer hits a GitHub rate limit it\nwon&#39;t notify you about this in any way, instead it just retains the last status\n(e.g. &quot;Migrated 500 issues&quot;) until the rate limit is reset at which point it\nwill continue its work. The first time this happened I thought the importer got\nstuck, until about an hour later it resumed work and managed to import all\nremaining data without any further issues.</p>\n<p>Another minor nuisance is that the importer makes no attempt at linking GitHub\nusers to any existing Codeberg issues, instead it essentially uses fake users\n(albeit with the corresponding GitHub usernames). This means that for example\nissues assigned to users on GitHub need to be manually assigned to their\ncorresponding Codeberg users.</p>\n<p>Oh, and one more thing: GitHub introduced the concept of &quot;issue types&quot; (&quot;Bug&quot;,\n&quot;Feature&quot;, etc) but Forgejo has no equivalent. If you make use of this, make\nsure to label these issues accordingly so you don&#39;t lose that information during\na migration.</p>\n<h2 id=\"replacing-github-actions-with-forgejo-actions\">Replacing GitHub Actions with Forgejo Actions</h2>\n<p>Codeberg offers two systems for continuous integration:\n<a href=\"https://woodpecker-ci.org/\" rel=\"nofollow ugc noopener\">Woodpecker</a> and <a href=\"https://forgejo.org/docs/latest/user/actions/basic-concepts/\" rel=\"nofollow ugc noopener\">Forgejo\nActions</a>. The\nlatter is essentially a bootleg version of GitHub Actions, complete with\neverything that makes GitHub Actions a pain to deal with (e.g. semi\nTuring complete YAML). I went with Forgejo Actions because of its better\nintegration with Forgejo and because at this stage I didn&#39;t feel like <em>also</em>\nrewriting all CI configuration for an entirely different platform.</p>\n<p>On the surface migrating from GitHub Actions to Forgejo Actions seems\nstraightforward, but there are various subtle differences that can make this\nmore annoying than anticipated.</p>\n<p>For example, Codeberg offers a <a href=\"https://codeberg.org/actions/meta#available-runners\" rel=\"nofollow ugc noopener\">set of shared\nrunners</a> but these come\nwith strict constraints on job times and limited resources, such that they are\nonly suitable for the most basic of workloads. The runners are also limited to\nAMD64 Linux, so if you need to run tests on for example macOS you&#39;re out of\nluck.</p>\n<p>One important detail that <em>isn&#39;t</em> documented (at least that I could find) is\nthat these shared runners <em>don&#39;t</em> pull container images if they already exist on\nthe runner, or at least not always. So if you have a job that uses the image\n<code>foo:latest</code> and you update the tag to point to a newer version, you may need to\nwait an unspecified amount of time before the shared runners use this new\nversion. In practise this makes it impossible to effectively use images/tags\nsuch as <code>alpine:latest</code> or <code>alpine:3</code>. Using digests instead of tags should work\njust fine, but doing so across many projects can quickly become annoying to\nmanage, and it isn&#39;t always practical (e.g. when you rely on nightly container\nbuilds).</p>\n<p>I ended up setting up my own Forgejo runners to work around these issues, using\na Mac Mini M1 for ARM64 builds and a small home server that I already had set up\nfor other purposes for AMD64 builds. I&#39;ll cover this in more detail below.</p>\n<p>UI wise Forgejo Actions is a bit bare-bones compared to GitHub, so don&#39;t expect\nany fancy graphs showing your jobs and those that depend on them and so on,\ninstead you just get a flat list of all jobs and their output.</p>\n<p>While Forgejo Actions is based on GitHub Actions, it&#39;s not fully compatible with\nit. For example, more recent versions of\n<a href=\"https://github.com/actions/upload-artifact\" rel=\"nofollow ugc noopener\">actions/upload-artifact</a> and\n<a href=\"https://github.com/actions/download-artifact\" rel=\"nofollow ugc noopener\">actions/download-artifact</a> don&#39;t\nwork with Forgejo. Similarly, when using GitHub Actions it&#39;s not necessary for\ncustom container images to include Node.js, while Forgejo Actions <em>does</em> require\nthis.</p>\n<p>Given that Forgejo Actions is based on GitHub Actions it also suffers from the\nsame problems, such as YAML being frustrating to work with, and it being\ndifficult to effectively test CI config changes without pushing the changes to a\nbranch and hoping for the best. I did briefly look at Woodpecker but it doesn&#39;t\nseem to be <em>that</em> different, and due to it being less well integrated into\nForgejo I didn&#39;t bother looking into this further.</p>\n<h2 id=\"self-hosting-forgejo-actions-runners\">Self-hosting Forgejo Actions runners</h2>\n<p>The current runner setup that I have involves two computers:</p>\n<ul><li><p>An M1 Mac Mini I bought second-hand a few years ago for about €200 (an</p><p>absolute steal)</p></li><li><p>A Deskmini X300 with a Ryzen 5 5600G and 16 GiB of RAM, built a few years ago</p><p>with the main purpose being some home automation and streaming of Blu-ray\nmovies through <a href=\"https://jellyfin.org/\" rel=\"nofollow ugc noopener\">Jellyfin</a>. Had I known about the\nRAMpocalypse at the time I would&#39;ve built it with 32 GiB or maybe even 64 GiB\nof RAM, but alas here we are</p></li></ul>\n<p>Both sit in a <del>professional rack unit</del> a utilities closet on the ground floor,\ncomplete with excellent cable management (Deskmini in the top left, Mac Mini on\nthe bottom right between the router and switch):</p>\n<p>OVH would be proud of this setup</p>\n<p>For Inko I want to test on all platforms it supports, which is Linux, macOS and\nFreeBSD, and on the two supported architectures: AMD64 and ARM64. As I don&#39;t\nhave access to any Intel Mac hardware, testing against AMD64 macOS is no longer\npossible. This is unfortunate, but with Apple deprecating Intel hardware this\nwas bound to happen at some point.</p>\n<p>The way the runners are managed/updated differs a bit per platform. The Linux\nhost on the Deskmini and the Linux ARM64 runner both use Fedora through\n<a href=\"https://bootc.dev/\" rel=\"nofollow ugc noopener\">bootc</a> and are set to automatically pull and apply updates\nfrom my private Forgejo instance/container registry. The FreeBSD VMs are updated\nby building a new disk image, turning the VM off and then swapping the existing\ndisk image with the newly built one.</p>\n<p>The workload is divided across the hardware as follows:</p>\n<ul><li><p>The Mac Mini runs macOS tests directly on the host, while FreeBSD ARM64 and</p><p>Linux ARM64 tests run in a virtual machine (using <a href=\"https://getutm.app/\" rel=\"nofollow ugc noopener\">UTM</a>).\nThe FreeBSD VM is limited to 2 CPU cores and 4 GiB of memory, while the Linux\nVM is limited to 4 CPU cores and 4 GiB of memory</p></li><li><p>The Deskmini runs Linux tests in containers, restricted to 4 CPU cores and 4</p><p>GiB of memory. FreeBSD AMD64 tests run in a VM with the same constraints as\nthe FreeBSD VM running on the Mac Mini</p></li><li><p>A runner that runs on my Netcup RS 1000 G12.5 root server, used to also serve</p><p>this website and a private Forgejo instance. This runner is limited to only 2\nCPU cores and mainly used for small jobs such as running linters</p></li></ul>\n<p>All runners are limited to only running a single job at a time. The exact\ndivision of CPU cores per VM/container is something I&#39;m still experimenting\nwith.</p>\n<p>The goal of this setup is to prevent one job from trashing the CPU and thus\naffecting other jobs. For example, when I experimented with each job having\naccess to all CPU cores, various tests that rely on timeouts (e.g. because they\nexpect operation A to time out and operation B to succeed) would sporadically\nfail due to the heavy contention caused by the many threads and processes the\njobs would run.</p>\n<p>Using the current setup, a single pipeline for Inko takes between 15 and 20\nminutes. This involves running various linters, testing across three platforms\nand two architectures, building and upload documentation, and building container\nimages for two architectures.</p>\n<p>While this isn&#39;t too bad, with slightly more powerful hardware I&#39;m certain the\ntime could be cut in half. For ARM64 builds I can&#39;t do much as an M1 Mac Mini\njust isn&#39;t <em>that</em> powerful (or at least not powerful enough for this scenario).\nFor AMD64 builds I could relax the constraints and speed up build times\nsomewhat, but this comes at the cost of noise: the Noctua CPU fan of the\nDeskmini can get pretty loud at high load and this noise can be heard across the\nentire ground floor. As I <em>hate</em> fan noise (&quot;WWWWWRRRRRRRRRRRRRRRRRR&quot;), this is\nnot an option.</p>\n<p>I&#39;ve been experimenting with using VPS&#39; to take over the load, but the results\nso far are mixed. For example, I tested a Netcup 500 ARM G12.5 VPS (2 virtual\ncores and 4 GiB of RAM) but found it to be about 2 times slower compared to the\nFreeBSD VM running on the Mac Mini. I ran a similar test on Hetzner and found\ntheir servers to be about 2.5 times slower. Based on this and some other tests I\nran, it appears that to achieve performance similar to my local VMs I need to\ntake whatever CPU cores they have access to and double that, so a local VM with\n2 cores would translate to a VM with <em>at least</em> 4 &quot;cores&quot;.</p>\n<p>Note the &quot;cores&quot; part because different providers take different approaches to\naccess to the CPU: in some cases a &quot;vCore&quot; translates to a thread or even part\nof a thread (e.g. a thread with additional usage limits), while in other\ninstances (e.g. Netcup&#39;s root server offering) it translates to a thread not\nconcurrently shared with other VMs and without any utilisation limit.</p>\n<p>The bottleneck here is money: most reputable providers charge somewhere between\n€15 and €20 for 4 &quot;cores&quot; per server, with some offering budget options (e.g.\nNetcup) that cost less but likely come with (significant) resource constraints\n(e.g. more CPU steal time or poor disk performance). Assuming I want to move all\nrunners out of my home network, that means 6 virtual machines (<code>3 operating\nsystems * 2 architectures</code>), for a total of somewhere between €90 and €120 per\nmonth. This also assumes that I wouldn&#39;t need bigger servers, at which point you\nmay end up paying double this estimate.</p>\n<p>One experiment I&#39;m thinking of is to set up a Netcup 1000 ARM G12.5 VPS (4\nvirtual cores) for FreeBSD ARM64 builds, and a Netcup Lite 2 G12.5s VPS (4 cores\nfrom their lite/budget tier) for FreeBSD AMD64 builds. This way I can free up 2\ncores on both the Deskmini and the Mac Mini for other jobs, though I have to\ngive this some more thought based on the somewhat lackluster performance of the\n2-core ARM servers I tried so far.</p>\n<h2 id=\"building-container-images\">Building container images</h2>\n<p>Another challenge with the shared runners, and one worth discussing in more\ndetail, is that the shared runners don&#39;t allow for nested Podman/Docker builds.\nThis means you can&#39;t use the various existing Docker actions (e.g.\n<a href=\"https://github.com/docker/build-push-action/\" rel=\"nofollow ugc noopener\">docker/build-push-action</a>) for\nbuilding container images and instead you have to use\n<a href=\"https://buildah.io/\" rel=\"nofollow ugc noopener\">Buildah</a>.</p>\n<p>While annoying at first, I think the end result is actually <em>better</em> than using\nexisting actions as your CI pipeline ends up depending less on some pile of\nJavaScript and YAML that resides in some GitHub repository.</p>\n<p>For building images I use Buildah, as it doesn&#39;t require the ability to run\nPodman/Docker inside itself. I found some existing articles that discuss this\ntopic and they suggested to use the <code>vfs</code> storage driver, but after testing this\nfor myself I found that this doesn&#39;t perform well once you start building\ncontainer images larger than 1 GiB or so. Instead, I settled on the following:</p>\n<p>Linux runners are configured such that jobs run in containers with at least the\nfollowing option Podman:</p>\n<pre><code>--device /dev/fuse</code></pre>\n<p>This doesn&#39;t require privileged access and shouldn&#39;t pose any security risks\n(that I know of at least).</p>\n<p>Next, we need to make sure that <code>/var/lib/containers/storage</code> in the container\nis a volume that resides on the host. If this is instead a regular directory,\nbuilding the container may take considerably longer depending on the amount of\nlayers and images produced when building an image.</p>\n<p>There are two ways of doing this. The first option is to use a specific\ndirectory that exists on the host and configure the Forgejo runner to allow jobs\nto mount this directory. For example:</p>\n<pre><code>container:\n  options: &quot;--device /dev/fuse&quot;\n  valid_volumes:\n    - /var/lib/forgejo-runner/containers</code></pre>\n<p>This allows jobs to then mount this directory as follows:</p>\n<pre><code>jobs:\n  manifest:\n    name: OCI manifest\n    runs-on: home-linux-amd64\n    container:\n      volumes:\n        - /var/lib/forgejo-runner/containers:/var/lib/containers/storage:z\n    needs:\n      - build\n    steps:\n      ...</code></pre>\n<p>While this works and allows jobs to reuse existing data, it comes with two\ndownsides:</p>\n<ol><li><p>Concurrent jobs may mess with this data in ways that could cause build</p><p> failures, such as when one job removes all data while another job makes use\n of it</p></li><li><p>The directory may grow in size quickly, depending on the images you&#39;re</p><p> building and how often you build them</p></li></ol>\n<p>A second and better option is to instead use anonymous volumes like so:</p>\n<pre><code>container:\n  options: &quot;--device /dev/fuse --volume /var/lib/containers/storage&quot;\n  valid_volumes: []</code></pre>\n<p>CI jobs then <em>don&#39;t</em> need any additional configuration, i.e. the following is\nall you need:</p>\n<pre><code>jobs:\n  manifest:\n    name: OCI manifest\n    runs-on: home-linux-amd64\n    needs:\n      - build\n    steps:\n      ...</code></pre>\n<p>The Forgejo runner runs Docker/Podman jobs using the <code>--rm</code> option, so when the\njob finishes the anonymous volume is removed automatically. The downside is that\ndepending on the amount of data stored in this directory, tearing down the\ncontainer may take a little longer.</p>\n<p>If you have a lot of RAM available you can also use a tmpfs mount, but given the\ncontainers storage can accumulate a lot of data quickly I don&#39;t think this is a\ngood idea.</p>\n<p>With the above setup in place, Buildah is then invoked as follows (where <code>NAME</code>\nis the name to use for the built image):</p>\n<pre><code>buildah build --pull=newer --isolation=chroot --layers --tag NAME</code></pre>\n<p>The <code>--pull=newer</code> option ensures that any images used in <code>FROM</code> entries in the\n<code>Dockerfile</code>/<code>Containerfile</code> are updated if necessary. <code>--isolation=chroot</code> is\nused to avoid the need for running Podman inside Podman, and <code>--layers</code> ensure\nthat layers are cached and reused where possible (which unlike when using Podman\nisn&#39;t the default behavior).</p>\n<p>The result of this approach is that Buildah is able to use the &quot;overlay&quot; storage\ndriver (the default), storing the data on the host such that it can be reused\nbetween builds. I also found that if you <em>don&#39;t</em> store the containers data\noutside of the container, cleaning up the container at the end can take a long\ntime (in the order of several minutes).</p>\n<p>A downside is that jobs can mess with this shared volume, such that you <em>don&#39;t</em>\nwant to use this if your runners are meant to run untrusted workloads. This\nisn&#39;t relevant for my use case though and as such I&#39;m fine with this caveat.</p>\n<p>To keep the CI configuration simple, I don&#39;t include the above buildah commands\ndirectly in the various YAML files. Instead, I have a\n<a href=\"https://just.systems/\" rel=\"nofollow ugc noopener\">just</a> file that defines a bunch of tasks for each\nproject (e.g. those for releasing a new version), including tasks to build and\npush images. The general structure is as follows:</p>\n<pre><code># justfile\nmod release &#39;just/release.just&#39;\nmod image &#39;just/image.just&#39;</code></pre>\n<p>Then <code>just/image.just</code> is defined as follows (using\n<a href=\"https://codeberg.org/inko-lang/idoc\" rel=\"nofollow ugc noopener\">idoc</a> as an example here):</p>\n<pre><code>set unstable\nset no-cd\n\n# The user to log in as to the registry.\nUSER := &quot;yorickpeterse&quot;\n\n# The host of the registry.\nHOST := &quot;codeberg.org&quot;\n\n# The namespace of the package.\nNAMESPACE := &quot;inko-lang&quot;\n\n# The name of the package.\nNAME := &quot;idoc&quot;\n\n# The Git commit we&#39;re building for.\nGIT_SHA := `git rev-parse HEAD`\n\n# Build the image\nbuild tag=&quot;latest&quot; inko_tag=&quot;latest&quot;:\n    buildah build \\\n        --pull=newer \\\n        --isolation=chroot \\\n        --layers \\\n        --build-arg &quot;SHA={{ GIT_SHA }}&quot; \\\n        --build-arg &quot;VERSION={{ tag }}&quot; \\\n        --build-arg &quot;INKO_TAG={{ inko_tag }}&quot; \\\n        --tag \\\n        &quot;{{ fqn(tag) }}&quot;\n\n# Log in to the container registry\nlogin pass:\n    @buildah login {{ HOST }} --username &quot;{{ USER }}&quot; --password &quot;{{ pass }}&quot;\n\n# Push the image to the registry\npush tag:\n    buildah push &quot;{{ fqn(tag) }}&quot;\n\n# Tag an image as the latest image.\nlatest tag:\n    buildah tag &quot;{{ fqn(tag) }}&quot; &quot;{{ fqn(&#39;latest&#39;) }}&quot;\n\n# Create and push a manifest of multi-arch tags\nmanifest tag:\n    buildah manifest create \\\n        --all &quot;{{ fqn(&#39;manifest&#39;) }}&quot; \\\n        &quot;{{ fqn(f&#39;{{ tag }}-amd64&#39;) }}&quot;\n    buildah manifest push &quot;{{ fqn(&#39;manifest&#39;) }}&quot; &quot;docker://{{ fqn(tag) }}&quot;\n    buildah manifest rm &quot;{{ fqn(&#39;manifest&#39;) }}&quot;\n\n# Prune all images\nclean:\n    buildah prune --all --force\n\nfqn(tag) := f&quot;{{ HOST }}/{{ NAMESPACE }}/{{ NAME }}:{{ replace_regex(tag, &#39;v(\\d+\\.\\d+\\.\\d+)&#39;, &#39;$1&#39;) }}&quot;</code></pre>\n<p>Then to build and push an image, you run the following:</p>\n<pre><code>just image build latest\njust image push latest</code></pre>\n<p>The above setup also allows for multi-arch images. You can use this <a href=\"https://codeberg.org/inko-lang/idoc/src/commit/945361f5daa7fc9b6109d7bea8a10e90b6c855ec/.forgejo/workflows/image.yml\" rel=\"nofollow ugc noopener\">reusable\nworkflow</a>\nas an example, but it essentially comes down to the following:</p>\n<ol><li><p>For each architecture, run a job that builds an image with a tag in the</p><p> format <code>NAME:TAG-amd64</code> (i.e. <code>idoc:latest-amd64</code>) and push it to the\n registry</p></li><li><p>Create a manifest named <code>NAME:TAG</code> that combines these architecture specific</p><p> tags and push it to the registry</p></li></ol>\n<p>In theory the architecture specific tags aren&#39;t necessary as you can use digests\ninstead. This requires that you somehow store these digests in a build artifact\nsuch that it can be reused by a &quot;create and push manifest&quot; job. I felt it was\neasier to use the above approach, hence I went with that.</p>\n<h2 id=\"hosting-private-projects\">Hosting private projects</h2>\n<p>While Codeberg allows for private repositories, this is limited to specific\nscenarios such as a private repository that supports a free-software project\n(e.g. a private project used for reporting security vulnerabilities). I have a\nfew repositories used to build bootc server images/updates, and to track some\nprivate data (e.g. tasks to do around the house), none of which fall within the\nscope of what Codeberg allows.</p>\n<p>I ended up migrating these projects to a private Forgejo instance hosted on the\nsame server that hosts this website. The setup is a bit creative: I use\n<a href=\"https://codeberg.org/yorickpeterse/shost\" rel=\"nofollow ugc noopener\">shost</a> for hosting a few websites,\nand has some logic related to TLS certificates that I want to dog-food, and as\nsuch I don&#39;t want to run a reverse proxy in front of it. This means port 443 is\nunavailable. While I could run Forgejo on a different port (e.g. 4430), this\nmakes it a bit more annoying to work with.</p>\n<p>Fortunately, there&#39;s a workaround: Netcup gives you access to a /64 IPv6 block,\nand pretty much every network I use on a regular basis supports IPv6. The way I\nhave things set up is that the server has three IP addresses assigned:</p>\n<ol><li><p><code>152.53.115.141</code> and <code>2a0a:4cc0:80:47b9::1</code>, used for the various sites</p><p> served by shost</p></li><li><code>2a0a:4cc0:80:47b9::2</code> used for the Forgejo instance</li></ol>\n<p>Then &quot;routing&quot; and binding of the services is done as follows:</p>\n<ol><li><p>shost binds itself to address <code>::</code> and port 443 on the host, with <code>::</code></p><p> meaning it binds to <em>all</em> IPv4 and IPv6 addresses available. This way it can\n handle both IPv4 and IPv6 connections</p></li><li><p>Forgejo binds itself to port 443 in a Podman network bridge. Because this is</p><p> its own network, it won&#39;t conflict with shost</p></li><li><p>The firewall is configured so that HTTP(s) and SSH traffic to</p><p> <code>2a0a:4cc0:80:47b9::2</code> is redirected to the IPv6 address of the Forgejo\n instance running in the Podman bridge</p></li></ol>\n<p>The firewall in this case is <a href=\"https://firewalld.org/\" rel=\"nofollow ugc noopener\">firewalld</a> and the routing\nconfiguration is as follows (here <code>fd9d:b34d:66b6:ff2d::2</code> is the IPv6 address\nthe Forgejo instance uses for the bridge, not the IPv6 address used by the\nhost):</p>\n<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n&lt;zone&gt;\n  &lt;short&gt;Public&lt;/short&gt;\n  &lt;description&gt;The default zone&lt;/description&gt;\n\n  &lt;!-- ... other stuff here ... --&gt;\n\n  &lt;rule family=&quot;ipv6&quot;&gt;\n    &lt;destination address=&quot;2a0a:4cc0:80:47b9::2&quot; /&gt;\n    &lt;forward-port port=&quot;443&quot; protocol=&quot;tcp&quot; to-port=&quot;443&quot; to-addr=&quot;fd9d:b34d:66b6:ff2d::2&quot; /&gt;\n  &lt;/rule&gt;\n\n  &lt;rule family=&quot;ipv6&quot;&gt;\n    &lt;destination address=&quot;2a0a:4cc0:80:47b9::2&quot; /&gt;\n    &lt;forward-port port=&quot;80&quot; protocol=&quot;tcp&quot; to-port=&quot;80&quot; to-addr=&quot;fd9d:b34d:66b6:ff2d::2&quot; /&gt;\n  &lt;/rule&gt;\n\n  &lt;rule family=&quot;ipv6&quot;&gt;\n    &lt;destination address=&quot;2a0a:4cc0:80:47b9::2&quot; /&gt;\n    &lt;forward-port port=&quot;22&quot; protocol=&quot;tcp&quot; to-port=&quot;22&quot; to-addr=&quot;fd9d:b34d:66b6:ff2d::2&quot; /&gt;\n  &lt;/rule&gt;\n\n  &lt;forward/&gt;\n&lt;/zone&gt;</code></pre>\n<p>And the corresponding\n<a href=\"https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html\" rel=\"nofollow ugc noopener\">quadlets</a>\nfor the Forgejo instance:</p>\n<pre><code># forgejo.container\n[Container]\nImage=codeberg.org/forgejo/forgejo@sha256:5ef02fbcf22beef56b8c844952ffad58cfe177b6f98e46e6abb5df90b88dc8d3\nPull=missing\nContainerName=forgejo\n...\nNetwork=containers.network\nIP=10.10.0.2\nIP6=fd9d:b34d:66b6:ff2d::2\n...\n\n# containers.network\n[Network]\nDriver=bridge\nInterfaceName=containers\nIPv6=true\nDNS=127.0.0.53\nSubnet=10.10.0.0/16\nGateway=10.10.0.1\nSubnet=fd9d:b34d:66b6:ff2d::/64\nGateway=fd9d:b34d:66b6:ff2d::1\nNetworkDeleteOnStop=true</code></pre>\n<p>The result is that I don&#39;t need a reverse proxy, an extra server, or the use of\na non-standard port for Forgejo. The caveat is that you won&#39;t be able to access\nthe instance from IPv4-only networks.</p>\n<p>The reason shost binds directly to the host instead of using dedicated Podman\nnetwork is because of <a href=\"https://github.com/podman-container-tools/podman/discussions/29423\" rel=\"nofollow ugc noopener\">this Podman\nissue</a>.</p>\n<p>One question that may arise is why not host <em>all</em> my projects on my own Forgejo\ninstance and make it available to the public, instead of using Codeberg. This is\nindeed something I thought of, and there are three main reasons for this:</p>\n<ol><li><p>Hosting projects on Codeberg (or any centralized forge for that matter) makes</p><p> it easier to interact with different projects as you can use the same\n account, similar to what made GitHub popular in the first place</p></li><li><p>Opening your Forgejo instance up to the public means also dealing with an</p><p> onslaught of spam, abusive bot traffic, and so on, and Forgejo in its current\n form doesn&#39;t have good tools to deal with this from what I&#39;ve gathered</p></li><li><p>Hosting repositories along with all their forks may end up consuming a lot of</p><p> disk space. While Forgejo supports <a href=\"https://forgejo.org/docs/latest/user/git-cli/agit-support/\" rel=\"nofollow ugc noopener\">an alternative\n workflow</a> that\n doesn&#39;t require forking, it&#39;s sufficiently clunky that I suspect 99% of\n people can&#39;t be bothered; myself included</p></li></ol>\n<p>Of course hosting on Codeberg doesn&#39;t fundamentally <em>solve</em> these problems, but\nrather it means they are not <em>my</em> problems.</p>\n<h2 id=\"codeberg-reliability-and-performance\">Codeberg reliability and performance</h2>\n<p>One reason one might want to move away from GitHub is it&#39;s poor reliability in\nrecent years. Unfortunately, the Codeberg experience in this regard is a bit of\na hit and miss. While Codeberg performs reasonably well, it&#39;s <em>a lot</em> slower\ncompared to a self-hosted instance.</p>\n<p>Of course that makes sense given that a typical self-hosted instance has a\nfraction of the data and traffic, but it&#39;s still annoying. For example, a <code>git\npush</code> typically takes between 5 and 10 seconds to complete and various pages on\nCodeberg can easily take seconds to finish loading. There have also been several\noutages over the last few weeks, most of which (including at least one partial\noutage that lasted for around an hour) with exactly zero communication from\nCodeberg. In fact, in at least one instance the Mastodon instance used for\nstatus updates was itself unavailable during a Codeberg outage.</p>\n<p>Now to be fair, running a large publicly accessible code forge is no easy task,\nso I have to give Codeberg some slack here. I&#39;m also optimistic that it <em>will</em>\nimprove because Codeberg&#39;s whole mission is to make Codeberg useful, rather than\nmaking a big fat profit at all costs.</p>\n<h2 id=\"storage-quotas\">Storage quotas</h2>\n<p>Codeberg enforces somewhat strict storage quotas on user accounts and\norganisations. For my personal account the limit is &quot;only&quot; 200 GiB for assets\n(that includes container images), but I think that&#39;s because my account has been\naround for a while. For the Inko organisation the limit is 1.5 GiB, which isn&#39;t\nenough for the various container images we build and store. While I submitted a\n<a href=\"https://codeberg.org/Codeberg-e.V./requests/issues/2652\" rel=\"nofollow ugc noopener\">request to increase the\nquota</a>, this request\nhas yet to receive a reply at the time of writing. So until this quota is\nincreased, Inko is forced to continue using GitHub&#39;s container registry for some\nof its container images, which feels a little odd.</p>\n<p>If you&#39;re in a similar scenario, my advice is to create the quota request as\nearly as possible as it may take several weeks for it to be processed.</p>\n<h2 id=\"conclusion\">Conclusion</h2>\n<p>I think Codeberg is a promising alternative, in spite of some paper cuts you&#39;ll\nrun into when migrating to it. Having to set up your own CI runners is a bit\ntedious, but there may be <a href=\"https://felinebuildservices.org/\" rel=\"nofollow ugc noopener\">some solutions to that in the\nfuture</a>. I also keep toying with the idea of\nsetting up a small business that provides hosted Forgejo runner, though it&#39;s\ndifficult to determine at this stage what (if any) interest there would be in\nthis. Given Codeberg&#39;s mission I also feel it can only get better from here on,\nbut only time will tell.</p>","headings":[{"level":1,"text":"Migrating from GitHub to Codeberg","id":"migrating-from-github-to-codeberg"},{"level":2,"text":"Table of contents","id":"table-of-contents"},{"level":2,"text":"Migrating repositories","id":"migrating-repositories"},{"level":2,"text":"Replacing GitHub Actions with Forgejo Actions","id":"replacing-github-actions-with-forgejo-actions"},{"level":2,"text":"Self-hosting Forgejo Actions runners","id":"self-hosting-forgejo-actions-runners"},{"level":2,"text":"Building container images","id":"building-container-images"},{"level":2,"text":"Hosting private projects","id":"hosting-private-projects"},{"level":2,"text":"Codeberg reliability and performance","id":"codeberg-reliability-and-performance"},{"level":2,"text":"Storage quotas","id":"storage-quotas"},{"level":2,"text":"Conclusion","id":"conclusion"}]}}