Table of Contents

DESCRIPTION

Setup instructions for this server:

BUILDING

Cross-compile binaries for the Raspberry Pi.

cloudflared

$ git clone https://github.com/cloudflare/cloudflared/
$ cd cloudflared
$ GOARCH=arm CGO_ENABLED=0 go build -trimpath -ldflags "-s -w"

INSTALLATION

Create Git Repository

Install Git

$ apt install git

Create Git Repository

On the raspberry pi, create the:

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

Create Git Hook

$ 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)