About Kana's Server
This server is hosted on a raspberry pi. Not 2, 3 or 4, but one of the first models that came out. It was just sitting around, so I had the idea to host servers on that instead of on my PC, so even when I turn it off, my stuff is still available.
I built the operating system that this server runs on myself. As in, I built it from (mostly) other people's source code. The reason why I did was partially because the OS raspberry pi offers is SUPER SLOW, at least on this pi. But it's also because I enjoy putting linux systems together from scratch. It's just really satisfying.
This is actually my third time building the OS for this server. It's still ongoing at the moment, but most of the way there at this point. You can see the list of packages that were on my second version of the os here. The main goals for the new server are to:
- Build all the packages using APB rather than by hand (so it'll be easy to upgrade to new versions when they come out)
- Use full packages instead of just busybox / toybox
- Use full disk encryption and LVM
- Make it easier to upgrade the kernel and initramfs (Before I built my kernel with a baked-in initramfs, and it was using the shell-script equivalent of APM that was very limited compared to my C version. So I would have to upgrade both the kernel and initramfs together, which would be annoying.)
I actually built another OS for this once before, but it was using an old shell-script implementation of apm that did not support most of the features that my current version of apm does, and it didn't have as many packages as I would like now. So this is sort of version two of the operating system, updated to have more features.
It took quite a bit of work, and I was always taught to cite my sources, so I want to list what I use on it for those curious. Plus it'll make it easier for me to check for updates.
- raspberry pi firmware (The things the Raspberry Pi requires to boot. It's closed source, so I can't replace it. I built my own kernel, though.)
- linux kernel (The Raspberry Pi fork of the linux kernel. I configured it to not use kernel modules, and stripped it down to just the features I needed.)
- musl (The C library, which anything written in C depends on. More lightweight than glibc, which is what most linux systems use.)
- libxcrypt (A replacement for the libc's password encryption. I installed it because I'd rather use yescrypt than sha functions.)
- libressl (OpenBSD's fork of OpenSSL, an ssl library which is used to securely communicate with the internet. I use LibreSSL because it's a bit smaller, and more convenient in my opinion.)
- ncurses (Used for terminal applications like vim, less, and links.)
- readline (Used for line-based applications like bash, lvm, and fdisk.)
- zlib (A compression library used by quite a few applications, including toybox, mandoc, sqlite, and my http server.)
- zstd (Used by squashfs-tools for a fast and decently-high compression method.)
- xz (Used by squashfs-tools for a high-ratio compression method.)
- lua (Technically I didn't build a lua package, but civetweb offers lua as an option for CGI scripts.)
- sqlite (Also built into civetweb. I don't know if I'll actually use it though.)
- anita (Amethyst's init system: An init program tailored for Amethyst linux. It makes sure etc, var, and other necesary filesystems are mounted, and then starts perp.)
- coreutils (A basic set of utilities expected to be available on most POSIX operating systems.)
- cronie (A cron implementation, which is used to periodically run programs.)
- grep (A utility for searching for text / regex expressions in a file file.)
- procps-ng (A set of utilites for listing and controlling processes.)
- perp (Persistant process manager. This starts all the daemons.)
- sed (A utility for editing text streams.)
- shadow (Utilities for managing users and groups, setting passwords, and logging in.)
- tzdb (In order to set the timezone properly, I need this package. In the past I used the TZ environment variable... but it's so annoying trying to get every one of my daemons to include it.)
- util-linux (This includes a lot of linux-specific utilites. I don't like how heavy it is... but I need it if I'm not using toybox or busybox)
- oksh (Portable version of OpenBSD's ksh. My favorite interactive shell! More lightweight than bash, and faster too.)
- dash (Debian Almquist shell. Even more lightweight than ksh, but not a good interactive shell. But it runs shell scripts faster.)
- bash (A fully-featured POSIX-compilant shell made by GNU, with quite a few extensions. I have it just in case I need to run a bash-specific shell script... I'm not sure I'll actually need / want to though.)
- apm (The Amethyst Package Mounter is the core utility I wrote to make Amethyst Linux possible. It mounts a collection of packages to be used as root filesystem. Technically I only NEED it in the initramfs... but it's also useful to have outside of it too so I can use apremount, and also so I can build the initramfs using it.)
- cryptsetup (This utility is used to create and open encrypted partitions. This is how I got full disk encryption.)
- dosfstools (The raspberry pi requires that a fat filesystem is used for the boot partition. This is so I can fsck it / recreate it in an emergency)
- e2fsprogs (I use ext4 for most of the filesystems. This is so I can fsck them and create new ones.)
- lvm (LVM is a set of utilties that manage logical volumes. It can do a lot of things involving mapping physical partitions into logical volumes. For this server, though, I'm just using it to break my single encrypted partition into multiple volumes so I can have multiple filesystems.)
- squashfs-tools (These can create and extract squashfs filesystem images, which I use as the format for package files. I installed it on the system to create / modify packages without copying them to and from my PC.)
- acme.sh (This is a shell script that helps automate the process of getting certificates issued for servers.)
- chrony (This is a lightweight NTP client. I use the client to synchronize my raspberry pi's clock with servers online, which is especially important since the raspberry pi doesn't have an RTC to track the time with when turned off. It can also act as a server, but I don't use that part.)
- civetweb (This is the base http(s) server I use. It's pretty lightweight and decently fast, despite the 100Mbps ethernet connection the pi comes with. It also supports lua for cgi scripts, rather than php.)
- chrony (This is a lightweight NTP client. I use the client to synchronize my raspberry pi's clock with servers online, which is especially important since the raspberry pi doesn't have an RTC to track the time with when turned off. It can also act as a server, but I don't use that part.)
- dhcpcd (This is a DHCP client, which is used to automatically assign an ip address / route and maintain the lease for the address.)
- dnsmasq (Dnsmasq is a DNS server. I only use it on my private network, to assign domain names to my local machines. In particular, I have a weird issue with my router where I can't connect to my public ip address from within my LAN. To work around that I use this to override my global domain names with ones pointing to the raspberry pi's local ip address.)
- dropbear (Dropbear is a lightweight ssh server / client. I no longer use it as the main ssh server for my raspberry pi, but I do use it so I can remotely enter the encryption password.)
- iproute2 (This is a set of utilities for managing network interfaces, ip addresses, routes, and other network-releated stuff.)
- libressl (In addition to the library, libressl (same as openssl) comes with a utility that can perform various encryption-related tasks.)
- nginx (This is another http(s) server which I'm using as a reverse proxy for civetweb. I'm not using it as the base server because I like civetweb better for CGI. But civetweb's support for serving multiple domains is experimental and kind of janky... so I'd rather use this instead.)
- openssh (This is a fully featured ssh server / client. This lets me remotely access my server, and easily copy files to and from it.)
- wget (This is a utility mainly used for downloading files from servers. It's also necessary for acme.sh to work.)
- bzip2 (An older format for compressed files. It compresses at a better ratio than gzip, but less than the other formats I list here.)
- cpio (An archival tool / format that's less popular than tar or zip, but used by the linux kernel for initramfs. Similar to tar, it's used to pack / unpack a collection of files into a single file, and doesn't deal with compressing them. I need it so I can build an initramfs, which only supports the cpio format.)
- gzip (One of the most common compression formats used for compressing arbitrary files. It's one of the fastest formats to compress and decompress, but isn't as high-ratio as other programs.)
- tar (An archival tool / format that's used mainly by users of linux and other unix-like OS's. It packs / unpacks a collection of files into a single file. It doesn't compress them directly, but can use external programs to (de)compress the archive automatically.)
- lzip (A rival to xz that also uses LZMA. It's not as popular as xz, but it can occasionally be found online. Its author claims that lzip is better than xz for long-term storage due to handling checksums better. From my experience its compression ratios and times are approximately the same as xz, sometimes a bit higher and sometimes a bit lower.)
- unzip (A tool for extracting zip files, a popular archival format. Unlike tar and cpio, compression is built into the zip format.)
- xz (One of the most popular compression formats for high-compression ratios based on the LZMA algorithm. Its only major rival is lzip, which also uses LZMA.)
- zstd (A pretty good compression format. It doesn't compress quite as much as xz does, but it's way faster than xz, and sometimes even faster than gzip. This is what I use to compress my initramfs.)
- bc (An interactive arbitrary-precision calculator, which can also be used in scripts.)
- diffutils (A few utilites for comparing differences between files. I put it in this category since I don't technically need it on the server itself, but I have it since I needed to build it anyways so I could build other packages, and it's potentially useful to have on the system.)
- file (A command that identifies what type of file things are, plus some filetype-specific details about the file. I use it all the time.)
- findutils (A few utilites for locating files. I put it in this category for similar reasons to diffutils, but I'm considering moving it to core since I'm using it in one of my scripts now.)
- htop (An interactive process viewer, like the top command from procps-ng, but more user friendly.)
- jq (A tool for parsing json on the command line or in scripts. I thought it was cool and could be useful, and it was pretty easy to package, so I did.)
- less (A pager commonly available on linux systems. I use it to quickly read files sometimes, and it's used by mandoc to display the manpages.)
- links (A html viewer and web browser for the terminal. Convenient for testing my http servers locally.)
- mawk (Same story as diffutils... except that I don't really know how to use awk or mawk yet.)
- mandoc (A manpage viewer. I use it to read the documentation of the programs I have installed.)
- nano (A simple, user-friendly text editor for the terminal. It's not as useful to me as vim is, but I installed it just in case my sibling wanted to use it. I don't know if they even will, though...)
- ncurses (In addition to a library, ncurses provides some command-line utilities such as clear and reset.)
- opendoas (A port of OpenBSD's doas command for linux. Sudo's too over the top for me... All I use it for is running commands as root.)
- texinfo (A texinfo documentation viewer. I sometimes use this for reading documentation that has that form of documentation. Honestly, though, I mostly just use man.)
- vim (My favorite text editor. If you don't already use it, just try it once. It takes time to get used to, but you can edit files really fast once you are used to it.)
- which (A utility for locating a program in your PATH. Same story as diffutils.)