These instructions assume you have the following setup:
- reverse proxy with an assigned hostname and certificate forwarding to your Raspberry Pi
- micro usb to ethernet adapter
- address reservation on your router
- software tools for writing image (7zip & rufus, or equivalent)
- reasonably large micro sd card (~16 GB)
Download the DietPi OS and select the ARMv6 32-bit image:
https://dietpi.com/downloads/images/DietPi_RPi-ARMv6-Bullseye.7z
Extract the img file with 7-zip
Write the img file to the sd card with Rufus
Insert the sd card in the pi and turn it on
SSH into the pi with root:dietpi
Watch it update and reboot
Select the minimal image
apt-get -y install curl
apt-get -y install net-tools
apt-get -y install jq
apt-get -y install netcat
apt-get -y install unzip
apt-get -y install wget
apt-get -y install git
apt-get -y install vim
apt-get -y install fail2ban
apt-get -y install imagemagick-6.q16
apt-get -y install build-essential
apt-get -y install sqlite3
apt-get -y install openssh-client
Download the armv6l version:
https://go.dev/dl/go1.19.linux-armv6l.tar.gz
Extract it to /usr/local:
tar -C /usr/local -xzf go1.19.linux-armv6l.tar.gz
mkdir /app
cd /app
git clone https://github.com/balzack/databag.git
cd /app/databag/net/server
/usr/local/go/bin/go build databag
mkdir -p /var/lib/databag
sqlite3 /var/lib/databag/databag.db "VACUUM;"
sqlite3 /var/lib/databag/databag.db "CREATE TABLE IF NOT EXISTS 'configs' ('id' integer NOT NULL UNIQUE,'config_id' text NOT NULL,'str_value' text,'num_value' integer,'bool_value' numeric,'bin_value' blob,PRIMARY KEY ('id'));"
sqlite3 /var/lib/databag/databag.db "CREATE UNIQUE INDEX IF NOT EXISTS 'idx_configs_config_id' ON 'configs'('config_id');"
// because the react toolchain isn't available for the pi zero, the webapp is built in a github action
Download webapp.tar.gz from the most recent release:
https://github.com/balzack/databag/releases/download/v1.1.1019/webapp.tar.gz
SCP webapp.tar.gz into the pi
Extract it into the web/build directory
mkdir /app/databag/net/web/build
tar xf webapp.tar.gz -C /app/databag/net/web/build/
cd /app/databag/net/server
nohup nice -n -5 /usr/local/go/bin/go run databag -p 443 -s /var/lib/databag -w /app/databag/net/web/build &
Open your brower to the pi hostname
Click the 'cog' in the upper right
Set an admin password
Select the 'cog' to bring up the settings modal
- set your hostname
- set the key to RSA 2048
Still in the admin dashboard
Click the 'add-user' button
Open the link in a new tab
Set a username and password
Setup your profile
Connect with contacts on other federated instances
Back in the admin dashboard
Click the 'add-user' and send the link to anyone you want to host