diff --git a/README.md b/README.md index 3a1c544..25de58f 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ slightly different in the way they are using caddy: The caddy subdirectory showcases a typical caddy configuration. I do run caddy in its container with host networking instead of running it in the typical -bridged network environment the other containser run. This is necessary so that +bridged network environment the other containers run. This is necessary so that caddy can create the proper X-Forward-For headers and put correct client ip addresses in the log. Some services like nextcloud are also very picky and will not work properly if the trusted proxy configuration is not right. If you have a @@ -293,7 +293,7 @@ HTTP_PORT = 3000 HTTP_ADDR = /run/containers/gitea.sock ``` -The act_runner directory contains the docker compose setup for a gitea +The runner directory contains the docker compose setup for a gitea runner. I do run that on a few nodes, but not on the node that runs gitea itself. If the runner nodes need to update via watchtower, make sure they are running in your tailnet. Before you start, run the register.sh script @@ -372,28 +372,32 @@ export RESTIC_PASSWORD_FILE=$HOME/.restic-backup-hostXXX docker compose ls --format json|jq -r '.[]|.ConfigFiles' | while read yaml do dir=`dirname "$yaml"` + user=`stat --format '%U' $dir` if test -x "$dir/dumpdb.sh" then - sudo -u adminuser sh -c "cd $dir; ./dumpdb.sh" + sudo -u $user sh -c "cd $dir; ./dumpdb.sh" fi if test -x "$dir/dumpdbout.sh" then restic $VERBOSE backup \ + --tag db-backup \ --stdin-filename $dir/dumpdb.db \ --stdin-from-command -- \ - sudo -u adminuser sh -c "cd $dir; ./dumpdbout.sh" + sudo -u $user sh -c "cd $dir; ./dumpdbout.sh" fi done restic $VERBOSE backup --exclude-caches=true \ - /etc/docker /var/lib/docker \ + --tag dir-backup \ + /etc/docker /var/lib/docker \ /usr/local \ /home/adminuser /root restic $VERBOSE forget \ --keep-daily 7 --keep-weekly 5 --keep-monthly 12 \ --keep-yearly 100 --prune -chown -R adminuser:adminuser /home/adminuser/.cache/restic +ownergroup=`stat --format %U:%G $HOME` +chown -R $ownergroup $HOME/.cache/restic ``` This scripts assumes that the subdirectories for the docker containers diff --git a/act_runner/register.sh b/act_runner/register.sh deleted file mode 100755 index 6716286..0000000 --- a/act_runner/register.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -docker run --rm --entrypoint /usr/local/bin/act_runner \ - -v ./data:/data \ - -w /data -it gitea/act_runner:nightly register diff --git a/act_runner/data/.runner-redacted b/runner/data/.runner-redacted similarity index 100% rename from act_runner/data/.runner-redacted rename to runner/data/.runner-redacted diff --git a/act_runner/data/config.yaml b/runner/data/config.yaml similarity index 100% rename from act_runner/data/config.yaml rename to runner/data/config.yaml diff --git a/act_runner/docker-compose.yml b/runner/docker-compose.yml similarity index 58% rename from act_runner/docker-compose.yml rename to runner/docker-compose.yml index 055252c..15ca49d 100644 --- a/act_runner/docker-compose.yml +++ b/runner/docker-compose.yml @@ -1,10 +1,10 @@ -name: act_runner +name: runner services: - act_runner: - container_name: act_runner + runner: + container_name: runner restart: always network_mode: host - image: gitea/act_runner:nightly + image: gitea/runner:latest volumes: - ./data:/data - /var/run/docker.sock:/var/run/docker.sock diff --git a/runner/register.sh b/runner/register.sh new file mode 100755 index 0000000..3be550a --- /dev/null +++ b/runner/register.sh @@ -0,0 +1,4 @@ +#!/bin/sh +docker run --rm --entrypoint /usr/local/bin/runner \ + -v ./data:/data \ + -w /data -it gitea/runner:latest register