Skip to content

Instantly share code, notes, and snippets.

@chrisdone-artificial
Last active May 8, 2025 21:03
Show Gist options
  • Save chrisdone-artificial/99966c3f520e1c794375b3bf6ad622eb to your computer and use it in GitHub Desktop.
Save chrisdone-artificial/99966c3f520e1c794375b3bf6ad622eb to your computer and use it in GitHub Desktop.
raspberry pi setup
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
www.chrisdone.com, chrisdone.com {
# Set this path to your site's directory.
root * /var/www/html
# Enable the static file server.
file_server
handle /hooks/update-website {
reverse_proxy localhost:9000
}
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
- id: "update-website"
execute-command: "/tmp/website/update-website.sh"
# include-command-output-in-response: true
trigger-rule:
and:
- match:
type: "payload-hmac-sha256"
secret: "..."
parameter:
source: "header"
name: "X-Hub-Signature-256"
#!/bin/sh
set -e
cd /tmp/website/
sudo -u chris git pull
hell website.hell
rsync --delete --recursive $(pwd)/webroot/ /var/www/html/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment