Setup instructions for this server:
Raspberry Pi Zero W
traffic proxied from CloudFlare using cloudflared
git
Cross-compile binaries for the Raspberry Pi.
$ git clone https://github.com/cloudflare/cloudflared/
$ cd cloudflared
$ GOARCH=arm CGO_ENABLED=0 go build -trimpath -ldflags "-s -w"
$ apt install git
On the raspberry pi, create the:
bare git repository
www directory for serving pages
Set the permissions to allow an unprivileged user to push updates. When changes are pushed, a git hook runs and checks out the files to the www root directory.
$ mkdir /opt/git /opt/www
$ chmod g+w /opt/git /opt/www
$ chgrp sudo /opt/git /opt/www
$ git init --bare --shared /opt/git/crashonly.com
$ chgrp -R sudo /opt/git/crashonly.com
$ mkdir /opt/www/crashonly.com
$ chmod 2775 /opt/www/crashonly.com
$ chgrp sudo /opt/www/crashonly.com
$ vi /opt/git/crashonly.com/hooks/post-receive
$ chmod +x /opt/git/crashonly.com/hooks/post-receive
#!/bin/sh
set -e
umask 0002
GIT_WORK_TREE=/opt/www/crashonly.com git checkout -f
(
cat <<'EOF'
---
title: About Server
---
# About Server
| Name | Value |
| ---- | ----- |
EOF
(cat /proc/cpuinfo; grep -E "^Mem" /proc/meminfo) |
awk -F: '{ if (NF < 2) next } {printf("| %s | %s |\n", $1, $2)}'
cat <<'EOF'
---
([markdown](/server-info.md))
EOF
) >/opt/www/crashonly.com/server-info.md
(markdown)