Sourcehut


Installation

Upstream only officially supports Alpine Linux 3.15.

To enable the package repository, add the following line to /etc/apk/repositories. It must be the first repository checked.

https://mirror.sr.ht/alpine/v3.15/sr.ht

The community package repository must be enabled. See here for more details.

Install the packager's key and update the package index.

wget -q -O /etc/apk/keys/[email protected] https://mirror.sr.ht/alpine/[email protected]
apk update

Sourcehut is a modular ecosystem, with meta.sr.ht being the only mandatory package (as it handles authentication and authorization). For example, to run the git and mercurial services, use git.sr.ht and hg.sr.ht, respectively. Installation and configuration of these modular services is detailed in a corresponding section under Administration.

Install the meta.sr.ht package. Start and enable three services: meta.sr.ht, meta.sr.ht-api, and meta.sr.ht-webhooks. Finally enable the metasrht-daily cronjob and set it to run daily.

Community Packages

Eli Schwartz maintains a set of packages for Arch Linux.

Add the mirror to /etc/pacman.conf:

[sr.ht]
Server = https://mirror.sr.ht/archlinux/sr.ht

Then install the packagers' keys:

sudo pacman-key --recv-keys C0AAFC1676BD998617C94C42DC59670F1EB0A189
sudo pacman-key --lsign-key C0AAFC1676BD998617C94C42DC59670F1EB0A189

Development Setup

TODO: copy from https://emersion.fr/blog/2021/setting-up-sr.ht-for-local-development/


Configuration

Several Sourcehut services depend on additional local services.

SMTP

TODO: copy from https://drewdevault.com/2018/08/05/Local-mail-server.html

To test the configuration, add an SSH key to the admin user. An automatic notification email will be generated by that trigger.

Redis

PostgreSQL


Administration

Users

To create an admin user, try:

metasrht-manageuser -t admin -e <email> <username>

Git

Mercurial

Bug Tracker

Page Hosting

Mail Lists

Automated Builds

Anecdotally the build service is the most unreliable component of the Sourcehut ecosystem.

The master server runs the builds.sr.ht package and service. Each runner corresponds to a builds.sr.ht-worker service, which depends on the builds.sr.ht-worker and builds.sr.ht-images packages.

Upstream's production architecture thoroughly encapsulates the runners.


CategoryRicottone