SQLite

Experiments Setting Up Alpine Linux
Login

Create the VPS instance

Lock down SSHD

Fix nano

bind ^F forward main
bind ^B back main

Create the "www" user and setup /home/www as a chroot jail

Install Fossil, both inside and outside the chroot jail

Set up files for the website:

#!/usr/bin/fossil
repository: /Fossils/sqlite.fossil
errorlog: /logs/errors.txt

Install and test althttpd

Make althttpd a service that starts automatically

#!/sbin/openrc-run
# docs: https://wiki.alpinelinux.org/wiki/Writing_Init_Scripts
# https://github.com/OpenRC/openrc/blob/master/service-script-guide.md
name=$RC_SVCNAME
description="the althttpd web server"
command=/usr/local/bin/althttpd
command_args="-root /home/www
              -port 80
              -tls-port 443
              -certdir /etc/letsencrypt/live/main
              -logfile /logs/http.log
              -ipshun /ipshun"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
  need net
}

Install certbot

certbot certonly --cert-name main --webroot $* \
   -w /home/www/a1_sqlite_org.website -d a1.sqlite.org \
   -w /home/www/a1_fossil_scm_org.website -d a1.fossil-scm.org
#!/bin/sh
certbot renew
rc-service althttpd restart

Install and activate OpenSMPTD

Testing OpenSMTPD

To: your-email@gmail.com
From: root@$DOMAIN
Subject: OpenSMTPD test

This is a test message from the new machine, $DOMAIN.

Install wapptclsh (optional)

Install TCL and the SQLite extension for TCL

Set up the script used to relay Fossil notification emails out of the jail

Configure email-sender.tcl to run automatically

#!/sbin/openrc-run
# docs: https://wiki.alpinelinux.org/wiki/Writing_Init_Scripts
# https://github.com/OpenRC/openrc/blob/master/service-script-guide.md
name=$RC_SVCNAME
description="script to export emails out of the chroot jail"
command=/usr/bin/tclsh
command_args="/home/www/sbin/email-sender.tcl"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"</pre>

Installing rspamd (for DKIM signing of outgoing email)

allow_username_mismatch = true;
domain {
   pikchr.org {
      path = "/etc/dkim-keys/mail.key";
      selector = "mail";
   }
   sqlite.org {
      path = "/etc/dkim-keys/mail.key";
      selector = "mail";
   }
   fossil-scm.org {
      path = "/etc/dkim-keys/mail.key";
      selector = "mail";
   }
}

Connecting rspamd up to OpenSMTPD


Maintenance Procedures

Adding a new domain

Updating the althttpd binary to a new version

Updating the fossil binary to a new version

Taking a website down for maintenance

<h1>Website Down For Maintenance<h1>
<p>Expect return to service on or before 2025-04-04 00:00Z</p>