--- title: "Installing Sourcehut" date: 2020-08-27 draft: true --- A few months back, at the beginning of quarantine, I installed a self-hosted version of [SourceHut](https://sourcehut.org) for my git repos. In the end, I only actually set up and used the following services: - meta.sr.ht - git.sr.ht - todo.sr.ht - man.sr.ht - paste.sr.ht - dispatch.sr.ht I did not end up setting up lists.sr.ht or builds.sr.ht, either because I wasn't confident enough to do so (lists) or I didn't have the resources or knowledge (builds). Now, I figured that I have learned more and want to give it another crack. This post will go over the methods I use to install Sourcehut on my local machine and any pitfalls I encounter. The laptop that I used for this is a Thinkpad T430 running Arch Linux. ## Packages Sourcehut upstream provides installable [packages](https://man.sr.ht/packages) for Alpine, Arch, and Debian. The Arch Linux mirror is at [https://mirror.sr.ht/archlinux/sr.ht](https://mirror.sr.ht/archlinux/sr.ht). To use the repository with Pacman, I had to add the following snippet to `/etc/pacman.conf`. ``` [sr.ht] Server = https://mirror.sr.ht/archlinux/sr.ht ``` I also had to import the signing key, which took a little while, because I had to configure Pacman to use a different keyserver since the MIT one wasn't responding. To receive the keys, I had to run the following commands ``` # Get the key sudo pacman-key --recv-keys C0AAFC1676BD998617C94C42DC59670F1EB0A189 # Sign the key sudo pacman-key --lsign-key C0AAFC1676BD998617C94C42DC59670F1EB0A189 ``` This made installing all the Sourcehut packages a lot easier than building from source, which I tried to do my first time around. ## meta.sr.ht Since I had the package repository set up properly, all I had to do was `yay -S meta.sr.ht`, and both meta.sr.ht and the dependencies were downloaded. One dependency, `python-psycopg2` is marked as an optional dependency, but is required. ### Configuration Each sr.ht service maintains a `config.example.ini` file in its' git repository. For meta.sr.ht, that file is [here](https://git.sr.ht/~sircmpwn/meta.sr.ht/tree/master/config.example.ini)