2
0
Fork 0

sh.zio.znc.update-cert: add script and services

main
Astra 2023-10-09 19:41:47 +00:00
parent 4113e0a446
commit c952be0c12
4 changed files with 29 additions and 0 deletions

3
.gitignore vendored
View File

@ -31,6 +31,8 @@
!/etc/systemd/system/sh.zio.backup.timer !/etc/systemd/system/sh.zio.backup.timer
!/etc/systemd/system/zio-backup.service !/etc/systemd/system/zio-backup.service
!/etc/systemd/system/zio-backup.timer !/etc/systemd/system/zio-backup.timer
!/etc/systemd/system/sh.zio.znc.update-cert.service
!/etc/systemd/system/sh.zio.znc.update-cert.timer
# /usr/ # /usr/
!/usr/ !/usr/
@ -48,6 +50,7 @@
!/usr/local/bin/sh.zio.pod-exec !/usr/local/bin/sh.zio.pod-exec
!/usr/local/bin/sh.zio.pod-systemd !/usr/local/bin/sh.zio.pod-systemd
!/usr/local/bin/sh.zio.update-rootfs !/usr/local/bin/sh.zio.update-rootfs
!/usr/local/bin/sh.zio.znc.update-cert
!/usr/local/bin/zio-backup !/usr/local/bin/zio-backup
!/usr/local/bin/zio-libvirt-port-forward !/usr/local/bin/zio-libvirt-port-forward
!/usr/local/bin/zio-update-caddy !/usr/local/bin/zio-update-caddy

View File

@ -0,0 +1,6 @@
[Unit]
Description=Updates the ZNC certificate weekly
[Service]
ExecStart=/usr/local/bin/sh.zio.znc.update-cert
Type=oneshot

View File

@ -0,0 +1,11 @@
[Unit]
Description=Updates the ZNC certificate weekly
[Timer]
OnCalendar=weekly
Unit=sh.zio.znc.update-cert.service
AccuracySec=1h
Persistent=true
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,9 @@
#!/bin/bash
ZNC_CONFIG_LOCATION="/var/lib/containers/storage/volumes/znc/_data"
SSL_PATH="/var/lib/containers/storage/volumes/caddy_data/_data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/znc.zio.sh"
SSL_PATH="/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.zio.sh"
ZNCPEMBAK="$ZNC_CONFIG_LOCATION/configs/znc.pem.bak"
ZNCPEM="$ZNC_CONFIG_LOCATION/configs/znc.pem"
cp $ZNCPEM $ZNCPEMBAK
cat $SSL_PATH/wildcard_.zio.sh.key $SSL_PATH/wildcard_.zio.sh.crt > $ZNCPEM
echo "ZNC cert updated"