I recently bought a Raspberry Pi 4 Model B for running programs 24/7 and for selfhosting some stuff, and it’s been a fun experience so far. I’ve intentionally went out of my comfort zone with several of the decisions I made, and everything seems to have turned out good. Maybe.

I’ve been interested in some sort of microcomputer for a while now, but I’ve never acted on that interest until I decided to start hacking on sourcehut. This, along with a growing distaste for every single cloud hosting solution, a raging desire to learn new stuff, and a spare Ethernet cable, made me bite the bullet and buy the Pi.

I planned to install Linux on it (obviously), but I wasn’t sure which distribution to go with. Arch seemed like the obvious choice: I daily-drive it, know how to use it and its wiki is top-notch — but I’m not familiar with its ARM variant, and regardless, I wanted to try something new. Raspberry Pi OS1 was another strong contender, but Debian isn’t known for being very fast, and using the OS that comes with the machine is some normie shit. No thanks. Alpine is very fast to boot, very lightweight, and its diskless install means I can always roll back if when I fuck up something. Let’s go with that.

When the Pi arrived at my desk I was surprised to find that it didn’t come with an adapter for its micro-HDMI ports, so I had to start from SSH. One Alpine Wiki search2 et voilà, I had a server I could SSH into from any machine in the house.

My terminal, connected to ingress via ssh

It was time to actually do stuff with this machine I bought.

Installing sourcehut

Sourcehut’s page on hacking is very short and assumes that you already know what you’re doing. Thankfully, Mehdi Sadeghi provided a lengthy and detailed step-by-step guide on how to install sourcehut for hacking. Thanks, Mehdi!

That’s not to say everything went smoothly. Far from it, infact. Provided below is a list of things I fucked up:

  • Forgot to install PostgreSQL
  • Created the PSQL databases with a different account, but didn’t point to it in config.ini
  • Didn’t include my fake domain in /etc/hosts
  • Tried to access the site over HTTPS
  • Didn’t set up OAuth keys, then set them up incorrectly twice
  • Configured nginx but didn’t route anything through it

And, of course, the worst offender:

  • Didn’t use the packages to see that everything works before building from source

Anyway, two days later, I’ve successfully managed to set up my local instance of sourcehut, save for builds and lists which I’m too scared to touch. An enormous thank you to the people who’ve tolerated me on IRC and on the mailing lists.

Image hosting

I’m uncomfortable with the idea of unencrypted cloud image hosting, for obvious reasons I won’t elaborate upon in this post. If I connected the Pi to the Internet, however, I could have total control over my files!

One problem: I don’t like any of the open-source hosting software. Why does everything have to have a “sleek” UI? A UI, in general? I don’t want to have to access a webpage to upload stuff, I don’t want paste support, I want to be able to type a command and have a URL generated.

Seeing that nothing exists which fits this criteria, I’ve made my own minimal hosting software. It’s called ihst, and it’s still in early development, but I’m planning to finish with it ASAP and prevent feature-creep. Sticking to the theme of stepping out of my comfort zone, I programmed ihst entirely in Python using Flask, instead of falling back to JavaScript, which I’m more familiar with.

Actually, scratch that because it turns out that my ISP’s proprietary router app (yes, mobile phone app) is broken and can’t do port forwarding right, so I guess I can’t connect my Pi to the Internet. Oh well.


  1. I still don’t understand the name change — Raspbian is so much better than this generic-ass name ↩︎

  2. and 4 hours of being an idiot ↩︎

Permanent link to this article:
https://solfisher.com/blog/2021/05/28/new-server/

Start a discussion about this post by sending an email to my public mailing list! [archives]