@@ -97,8 +97,8 @@ The default user is `admin` with the password `admin`.## BackupsAll data is stored in `/srv/data/blog/` and your repo is stored in`/srv/git/blog.git/`. You can backup both of these folders and you'll haveAll data is stored in `/srv/data/blog.bythewood.me/` and your repo is stored in`/srv/git/blog.bythewood.me.git/`. You can backup both of these folders and you'll havea 100% backup of everything except changes you may have made to the `Caddyfile`and the `.env` file which should be easy enough to recreate but you can backthose up too!
@@ -141,20 +141,20 @@ Server: ufw allow 22/tcp && ufw allow 80/tcp && ufw allow 443/tcp && ufw --force enable echo -e "#!/bin/sh\napk upgrade --update | sed \"s/^/[\`date\`] /\" >> /var/log/apk-autoupgrade.log" > /etc/periodic/daily/apk-autoupgrade && chmod 700 /etc/periodic/daily/apk-autoupgrade rc-update add docker boot && service docker start mkdir -p /srv/git/blog.git && cd /srv/git/blog.git && git init --bare mkdir -p /srv/git/blog.bythewood.me.git && cd /srv/git/blog.bythewood.me.git && git init --bareLocal: git clone git@github.com:overshard/blog.git && cd blog git remote remove origin && git remote add origin root@blog.bythewood.me:/srv/git/blog.git git clone git@github.com:overshard/blog.bythewood.me.git && cd blog.bythewood.me git remote remove origin && git remote add origin root@blog.bythewood.me:/srv/git/blog.bythewood.me.git git push --set-upstream origin masterServer: mkdir -p /srv/docker && cd /srv/docker && git clone /srv/git/blog.git blog && cd /srv/docker/blog mkdir -p /srv/docker && cd /srv/docker && git clone /srv/git/blog.bythewood.me.git blog.bythewood.me && cd /srv/docker/blog.bythewood.me cp samplefiles/Caddyfile.sample /etc/caddy/Caddyfile && sed -i 's/blog.example.com/blog.bythewood.me/g' /etc/caddy/Caddyfile cp samplefiles/env.sample .env && sed -i 's/blog.example.com/blog.bythewood.me/g' .env cp samplefiles/post-receive.sample /srv/git/blog.git/hooks/post-receive mkdir -p /srv/data/blog/db && chown -R 1000:1000 /srv/data/blog cp samplefiles/post-receive.sample /srv/git/blog.bythewood.me.git/hooks/post-receive mkdir -p /srv/data/blog.bythewood.me/db && chown -R 1000:1000 /srv/data/blog.bythewood.me docker-compose up --build --detach && docker-compose run web python3 manage.py migrate --noinput && docker-compose run web sqlite3 db.sqlite3 "PRAGMA journal_mode=WAL;" ".exit" rc-update add caddy boot && service caddy start
modified
docker-compose.yml
@@ -1,6 +1,6 @@services: web: container_name: blog container_name: blog.bythewood.me build: . env_file: .env ports:
@@ -1,5 +1,5 @@[project]name = "blog"name = "blog.bythewood.me"version = "0.1.0"requires-python = ">=3.13"dependencies = [
modified
samplefiles/Caddyfile.sample
@@ -38,7 +38,7 @@ blog.example.com { handle /media/* { uri strip_prefix /media file_server { root /srv/data/blog/media root /srv/data/blog.bythewood.me/media } }
modified
samplefiles/post-receive.sample
@@ -1,8 +1,8 @@#!/bin/sh## For easy server deploys you can create add this post-receive hook to your# server in a bare repo somewhere like /srv/git/blog/hooks/post-receive# and make a git clone in /srv/docker/blog. This script will then run on# server in a bare repo somewhere like /srv/git/blog.bythewood.me/hooks/post-receive# and make a git clone in /srv/docker/blog.bythewood.me. This script will then run on# pushing updates to the server to build and deploy new docker images.
@@ -10,7 +10,7 @@ while read oldrev newrev ref; do if [ "$ref" = "refs/heads/master" ]; then unset GIT_DIR # unset GIT_DIR so that git pull works correctly START_TIME=`date +%s` cd /srv/docker/blog cd /srv/docker/blog.bythewood.me git pull docker-compose up --build --detach docker-compose run web python3 manage.py migrate --noinput
modified
templates/base.html
@@ -130,7 +130,7 @@ <small>© {{ now.year }} Isaac Bythewood</small> </div> <div class="col-sm-6 d-flex justify-content-center justify-content-sm-end py-3 py-sm-0"> <a href="https://github.com/overshard/blog" target="_blank" class="footer-bar-link" aria-label="GitHub"> <a href="https://github.com/overshard/blog.bythewood.me" target="_blank" class="footer-bar-link" aria-label="GitHub"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"> <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/> </svg>