From 151e7944bc0e7a97ac6c53dc0ef7b0010a92825d Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 28 Nov 2024 13:36:19 -0700 Subject: [PATCH] add upgrade feature --- homelab/atlas/run | 4 ++-- homelab/auth/run | 5 ++++- homelab/builder-betty/run | 6 ++++-- homelab/caddy/run | 5 ++++- homelab/coredns/run | 6 +++++- homelab/ddns/run | 6 +++++- homelab/geneweb/run | 6 +++++- homelab/gitea/run | 6 +++++- homelab/ircd/run | 5 ++++- homelab/lidarr/run | 6 +++++- homelab/nextcloud/down | 0 homelab/nextcloud/run | 19 +++++++++++++++++++ homelab/nzbget/run | 6 +++++- homelab/oscar/run | 5 ++++- homelab/photos/run.pigallery2 | 6 +++++- homelab/picoshare/run | 6 +++++- homelab/plex/run | 6 +++++- homelab/portal/run | 6 +++++- homelab/prowlarr/run | 6 +++++- homelab/radarr/run | 6 +++++- homelab/readarr/run | 6 +++++- homelab/samba/run | 6 +++++- homelab/simpleauth/run | 6 +++++- homelab/skeleton/run | 5 ++++- homelab/sonarr/run | 6 +++++- homelab/sucker/run | 6 +++++- homelab/transmission/run | 6 +++++- homelab/upgrade | 21 +++++++++++++++++++++ homelab/webfs/run | 6 +++++- 29 files changed, 161 insertions(+), 28 deletions(-) create mode 100644 homelab/nextcloud/down create mode 100755 homelab/nextcloud/run create mode 100755 homelab/upgrade diff --git a/homelab/atlas/run b/homelab/atlas/run index 4b0f173..d42fc9e 100755 --- a/homelab/atlas/run +++ b/homelab/atlas/run @@ -2,10 +2,10 @@ exec 2>&1 -me=$(basename $(pwd)) image=jamesits/ripe-atlas:latest +[ -f upgrade ] && podman pull $image && rm upgrade -#podman pull $image +me=$(basename $(pwd)) podman rm -f $me podman run \ --name $me \ diff --git a/homelab/auth/run b/homelab/auth/run index 9a58241..95871a7 100755 --- a/homelab/auth/run +++ b/homelab/auth/run @@ -2,6 +2,9 @@ exec 2>&1 +image=quay.io/oauth2-proxy/oauth2-proxy +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm -f $me podman run \ @@ -9,5 +12,5 @@ podman run \ --network homelab \ --name auth \ --volume /srv/secrets/oauth2-proxy.cfg:/etc/oauth2-proxy.cfg:ro \ - quay.io/oauth2-proxy/oauth2-proxy \ + $image \ --config=/etc/oauth2-proxy.cfg diff --git a/homelab/builder-betty/run b/homelab/builder-betty/run index 742a95d..797dc5a 100755 --- a/homelab/builder-betty/run +++ b/homelab/builder-betty/run @@ -3,12 +3,14 @@ exec 2>&1 image=git.woozle.org/neale/big-builder:1.1 -me=$(basename $(pwd)) +[ -f upgrade ] && podman pull $image && rm upgrade +me=$(basename $(pwd)) podman pull $image podman rm -f $me podman run \ --name $me \ --volume ./config.yaml:/app/config.yaml:ro \ --volume /srv/secrets/builder-betty/.runner:/app/.runner \ - $image -c config.yaml daemon + $image \ + -c config.yaml daemon diff --git a/homelab/caddy/run b/homelab/caddy/run index 9f4d42a..0e79020 100755 --- a/homelab/caddy/run +++ b/homelab/caddy/run @@ -2,6 +2,9 @@ exec 2>&1 +image=caddy:2-alpine +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm -f $me podman run \ @@ -13,4 +16,4 @@ podman run \ --volume /srv/sys/caddy:/data/caddy \ --volume ./Caddyfile:/etc/caddy/Caddyfile:ro \ --add-host host.lan:192.168.86.2 \ - caddy:2-alpine + $image diff --git a/homelab/coredns/run b/homelab/coredns/run index 242fcd9..2f73774 100755 --- a/homelab/coredns/run +++ b/homelab/coredns/run @@ -1,8 +1,12 @@ #! /bin/sh + +image=coredns/coredns +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ --name $me \ --network host \ --mount type=bind,src=$(pwd)/Corefile,dst=/home/nonroot/Corefile,readonly=true \ - coredns/coredns + $image diff --git a/homelab/ddns/run b/homelab/ddns/run index 5f12b3b..671dcd1 100755 --- a/homelab/ddns/run +++ b/homelab/ddns/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=qmcgaw/ddns-updater +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -6,4 +10,4 @@ podman run \ --network homelab \ --dns 1.1.1.1 \ --volume /srv/sys/ddns-updater:/updater/data \ - qmcgaw/ddns-updater + $image diff --git a/homelab/geneweb/run b/homelab/geneweb/run index 5a55dc3..5b7bb8c 100755 --- a/homelab/geneweb/run +++ b/homelab/geneweb/run @@ -1,8 +1,12 @@ #! /bin/sh + +image=ravermeister/geneweb +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ --name $me \ --network homelab \ --volume /srv/sys/geneweb:/usr/local/share/geneweb/share/data \ - ravermeister/geneweb + $image diff --git a/homelab/gitea/run b/homelab/gitea/run index d641a7b..064c7e2 100755 --- a/homelab/gitea/run +++ b/homelab/gitea/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=codeberg.org/forgejo/forgejo:1.21.3-0-rootless +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -9,4 +13,4 @@ podman run \ --volume /etc/localtime:/etc/localtime:ro \ --volume /srv/sys/gitea/app.ini:/etc/gitea/app.ini \ --volume /srv/sys/gitea:/data \ - codeberg.org/forgejo/forgejo:1.21.3-0-rootless + $image diff --git a/homelab/ircd/run b/homelab/ircd/run index af076d1..13572c1 100755 --- a/homelab/ircd/run +++ b/homelab/ircd/run @@ -2,6 +2,9 @@ exec 2>&1 +image=ghcr.io/ergochat/ergo +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm -f $me @@ -11,4 +14,4 @@ podman run \ --network homelab \ --volume /srv/sys/ircd:/ircd/ \ --volume /srv/sys/caddy/certificates/acme-v02.api.letsencrypt.org-directory/irc.woozle.org/:/ircd/certs:ro \ - ghcr.io/ergochat/ergo + $image diff --git a/homelab/lidarr/run b/homelab/lidarr/run index 7731088..2b40245 100755 --- a/homelab/lidarr/run +++ b/homelab/lidarr/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=lscr.io/linuxserver/lidarr +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -7,4 +11,4 @@ podman run \ --volume /srv/sys/lidarr:/config \ --volume /srv/media/music:/srv/media/music \ --volume /srv/incoming:/srv/incoming \ - lscr.io/linuxserver/lidarr + $image diff --git a/homelab/nextcloud/down b/homelab/nextcloud/down new file mode 100644 index 0000000..e69de29 diff --git a/homelab/nextcloud/run b/homelab/nextcloud/run new file mode 100755 index 0000000..5a92c43 --- /dev/null +++ b/homelab/nextcloud/run @@ -0,0 +1,19 @@ +#! /bin/sh + +exec 2>&1 + +image=nextcloud +[ -f upgrade ] && podman pull $image && rm upgrade + +me=$(basename $(pwd)) +podman rm -f $me +podman run \ + --name $me \ + --network homelab \ + --memory 2g \ + --volume /srv/sys/nextcloud:/var/www/html \ + --volume /srv/storage:/srv/storage \ + --volume /srv/media:/srv/media \ + --volume /srv/incoming:/srv/incoming \ + --volume /srv/sys/nextcloud/bin/ffmpeg:/usr/local/bin/ffmpeg:ro \ + $image diff --git a/homelab/nzbget/run b/homelab/nzbget/run index 0d31ac3..a6198d0 100755 --- a/homelab/nzbget/run +++ b/homelab/nzbget/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=lscr.io/linuxserver/nzbget +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -6,4 +10,4 @@ podman run \ --network homelab \ --volume /srv/sys/nzbget:/config \ --volume /srv/incoming:/srv/incoming \ - lscr.io/linuxserver/nzbget + $image diff --git a/homelab/oscar/run b/homelab/oscar/run index 641ecdd..2f5ae3e 100755 --- a/homelab/oscar/run +++ b/homelab/oscar/run @@ -1,6 +1,9 @@ #! /bin/sh -me=$(basename $(pwd)) + image=git.woozle.org/neale/toolbox +[ -f upgrade ] && podman pull $image && rm upgrade + +me=$(basename $(pwd)) podman pull $image podman rm $me diff --git a/homelab/photos/run.pigallery2 b/homelab/photos/run.pigallery2 index 06445b0..21d5943 100755 --- a/homelab/photos/run.pigallery2 +++ b/homelab/photos/run.pigallery2 @@ -1,4 +1,8 @@ #! /bin/sh + +image=bpatrik/pigallery2:latest +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm -f $me podman run \ @@ -9,4 +13,4 @@ podman run \ --volume /srv/sys/pigallery2/cache:/app/data/cache \ --volume /srv/storage/fam/Photos:/photos/fam:ro \ --volume /home/ginnie/Photos:/photos/ginnie:ro \ - bpatrik/pigallery2:latest + $image diff --git a/homelab/picoshare/run b/homelab/picoshare/run index 3faa90b..99e380b 100755 --- a/homelab/picoshare/run +++ b/homelab/picoshare/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=git.woozle.org/neale/picoshare +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -7,4 +11,4 @@ podman run \ --env PS_SHARED_SECRET_FILE=/run/secrets/picoshare \ --volume /srv/sys/picoshare:/data \ --volume /srv/secrets/picoshare:/run/secrets/picoshare \ - git.woozle.org/neale/picoshare + $image diff --git a/homelab/plex/run b/homelab/plex/run index c8fd1a3..563db38 100755 --- a/homelab/plex/run +++ b/homelab/plex/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=lscr.io/linuxserver/plex:latest +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -7,4 +11,4 @@ podman run \ --env VERSION=public \ --mount type=bind,src=/srv/sys/plex,dst=/config \ --mount type=bind,src=/srv/media,dst=/srv/media,readonly=true \ - lscr.io/linuxserver/plex:latest + $image diff --git a/homelab/portal/run b/homelab/portal/run index 5803787..2b3a55e 100755 --- a/homelab/portal/run +++ b/homelab/portal/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=git.woozle.org/neale/portal +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -6,4 +10,4 @@ podman run \ --network homelab \ --volume ./portal.json:/web/portal.json:ro \ --volume ./deergrove.png:/web/portal.png:ro \ - git.woozle.org/neale/portal + $image diff --git a/homelab/prowlarr/run b/homelab/prowlarr/run index f0e567a..f181f6b 100755 --- a/homelab/prowlarr/run +++ b/homelab/prowlarr/run @@ -1,8 +1,12 @@ #! /bin/sh + +image=lscr.io/linuxserver/prowlarr +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ --name $me \ --network homelab \ --volume /srv/sys/prowlarr:/config \ - lscr.io/linuxserver/prowlarr + $image diff --git a/homelab/radarr/run b/homelab/radarr/run index bb3cc72..800d2b6 100755 --- a/homelab/radarr/run +++ b/homelab/radarr/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=lscr.io/linuxserver/radarr +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -7,4 +11,4 @@ podman run \ --volume /srv/sys/radarr:/config \ --volume /srv/media/movies:/srv/media/movies \ --volume /srv/incoming:/srv/incoming \ - lscr.io/linuxserver/radarr + $image diff --git a/homelab/readarr/run b/homelab/readarr/run index 45a6d8d..08f3c8c 100755 --- a/homelab/readarr/run +++ b/homelab/readarr/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=lscr.io/linuxserver/readarr:develop +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -8,4 +12,4 @@ podman run \ --volume /srv/media/books:/srv/media/books \ --volume /srv/media/audiobooks:/srv/media/audiobooks \ --volume /srv/incoming:/srv/incoming \ - lscr.io/linuxserver/readarr:develop + $image diff --git a/homelab/samba/run b/homelab/samba/run index b4ffce2..8271db0 100755 --- a/homelab/samba/run +++ b/homelab/samba/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=dperson/samba +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me # You gotta use host networking to get discovery gubbins @@ -13,4 +17,4 @@ podman run \ --env SHARE2='media;/srv/media;yes;yes;yes' \ --env-file /srv/secrets/samba-users.env \ --volume /srv:/srv \ - dperson/samba + $image diff --git a/homelab/simpleauth/run b/homelab/simpleauth/run index 9b966f5..c91c8de 100755 --- a/homelab/simpleauth/run +++ b/homelab/simpleauth/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=git.woozle.org/neale/simpleauth +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -6,4 +10,4 @@ podman run \ --network homelab \ --volume /srv/secrets/passwd:/run/secrets/passwd:ro \ --volume /srv/secrets/simpleauth.key:/run/secrets/simpleauth.key:ro \ - git.woozle.org/neale/simpleauth + $image diff --git a/homelab/skeleton/run b/homelab/skeleton/run index e9f7e1e..316faa1 100755 --- a/homelab/skeleton/run +++ b/homelab/skeleton/run @@ -2,9 +2,12 @@ exec 2>&1 +image=caddy:2-alpine +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm -f $me podman run \ --name $me \ --network homelab \ - caddy:2-alpine + $image diff --git a/homelab/sonarr/run b/homelab/sonarr/run index dd794c6..2a72823 100755 --- a/homelab/sonarr/run +++ b/homelab/sonarr/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=lscr.io/linuxserver/sonarr +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -7,4 +11,4 @@ podman run \ --volume /srv/sys/sonarr:/config \ --volume /srv/media/tv:/srv/media/tv \ --volume /srv/incoming:/srv/incoming \ - lscr.io/linuxserver/sonarr + $image diff --git a/homelab/sucker/run b/homelab/sucker/run index 8484360..3657562 100755 --- a/homelab/sucker/run +++ b/homelab/sucker/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=git.woozle.org/neale/media-sucker +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -9,7 +13,7 @@ podman run \ -v /srv/incoming/sucker:/incoming/sucker \ --cpu-shares 256 \ --user 911:19 \ - git.woozle.org/neale/media-sucker \ + $image \ -incoming /incoming/sucker \ -drive /hdev/sr0 /hdev/sr1 /hdev/sr2 diff --git a/homelab/transmission/run b/homelab/transmission/run index 80c5065..daf399e 100755 --- a/homelab/transmission/run +++ b/homelab/transmission/run @@ -1,4 +1,8 @@ #! /bin/sh + +image=lscr.io/linuxserver/transmission:latest +[ -f upgrade ] && podman pull $image && rm upgrade + me=$(basename $(pwd)) podman rm $me podman run \ @@ -9,4 +13,4 @@ podman run \ --env PEERPORT=51413 \ --volume /srv/sys/transmission:/config \ --volume /srv/incoming:/srv/incoming \ - lscr.io/linuxserver/transmission:latest + $image diff --git a/homelab/upgrade b/homelab/upgrade new file mode 100755 index 0000000..8bb94b0 --- /dev/null +++ b/homelab/upgrade @@ -0,0 +1,21 @@ +#! /bin/sh + +set -e + +cd $(dirname $0) + +while read service; do + echo "=== $service" + touch ./$service/upgrade + sv -w 30 restart ./$service/ +done <