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.
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.
I primarily chose lightweight libraries and tools wherever I could, and statically linked everything for a slight speed boost. You might notice that quite a few things came from BSD's; I guess BSD users have good taste when it comes to writing lightweight software.
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.)
- zlib (A compression library used by quite a few applications, including toybox, mandoc, sqlite, and my http server.)
- netbsd_curses (NetBSD's implementation of curses ported to linux. More lightweight than ncurses, which is what most linux systems use. Used by (c)fdisk, vim, less, and libedit.)
- libedit (NetBSD's replacement for readline. More lightweight than readline, which is what most linux systems use. Used by fdisk, sqlite, and lua.)
- 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.)
- xz (Used by squashfs-tools for a higher-ratio compression method.)
- lua (Lua is a lightweight scripting language, which is used by the http server for cgi scripts. I also have the lua interpreter installed so I can test things out as I write the cgi scripts.)
- sqlite (Sqlite is a database manager. I'm considering using it to store emails.)
- apm (Amethyst Package Mounter: My package manager replacement. It technically doesn't manage packages, but it mounts packages stored in files, which I manage the same way I manage files. Check it out if you're curious. The one project I actually wrote myself that's worth sharing.)
- 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.)
- sinit (This runs as the first userspace process, which just calls a script that sets everything up and then calls perp.)
- perp (Persistant process manager. This starts all the daemons.)
- toybox (This is a multitool that comes with a bunch of stuff most linux systems come with, but stripped down and fit into a single executable. I've actually made a few contributions to it myself, to fix a few issues I had using it.)
- oksh (Portable version of OpenBSD's ksh. My favorite interactive shell! More lightweight than bash, and faster too. Only downside is you can't use bash-completions with it... but I don't mind.)
- dash (Debian Almquist shell. Even more lightweight than ksh, but not a good interactive shell. But it runs shell scripts really fast.)
- shadow (Utilities for managing users. I use it instead of using toybox's because I wanted to make sure it could properly use yescrypt.)
- fdisk from util-linux (While I don't need most of util-linux's stuff since toybox replaces it, I wanted their fdisk so I could modify the partition table if I need to.)
- 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.)
- 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.)
- 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.)
- vim (My favorite text editor. If you don't already use it, just try it once. It's nice, though it takes a bit to get used to. But you can edit files really fast once you are used to it. Yes, there are more lightweight text editors; I used neatvi in the old version of the OS. But I missed vim's full syntax highlighting and copy-paste features.)
- mandoc (A manpage viewer. I use it when I forget how to do stuff.)
- 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.)
- dropbear (Dropbear is a lightweight alternative to openssh. It's used to remotely access the server with a command line shell.)
- sftp-server from openssh (The one downside to dropbear is that it doens't have an sftp-server, so you can't usually scp things directly to the server. But it can use openssh's sftp server, which is what I'm doing. I only installed the sftp server and nothing else; I use dropbear as the actual ssh server.)
- dnsmasq (Dnsmasq is a DNS server. I only use it on my private network, to give domain names to my local machines.)
- civetweb (Finally, the real question you probably have all been waiting for the answer to. This is the http/https 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.)
- acme.sh (This is a shell script that is used to automatically issue certificates for servers.)
- wget (Apparently toybox's wget isn't good enough for acme.sh, so I installed gnu's wget instead.)
- prompt (This is the shell prompt I wrote and use on a daily basis. It's best with oksh, but I made it compatible with mksh, bash, and dash too. You can use `setprompt (integer from 0 to 15)` to enable / disable parts of the prompt, or `setprompt` with no arguments to adjust the prompt according to the width of the console. There are also several pcol_* variables you can change to set the colors of parts of the prompt.)