Added CT's Duplicati and Vouch-Proxy

This commit is contained in:
2022-04-21 02:05:12 +02:00
parent 22f9b68c32
commit 3b5dcf8811
13 changed files with 207 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
# Settings for duplicati initscript
# Additional options that are passed to the Daemon.
DAEMON_OPTS="--webservice-interface=any --accept-any-ssl-certificate"

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Duplicati web-server
After=network.target
[Service]
Nice=19
IOSchedulingClass=idle
EnvironmentFile=-/etc/default/duplicati
ExecStart=/usr/bin/mono /opt/duplicati/Duplicati.Server.exe $DAEMON_OPTS
Restart=always
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,17 @@
#!/bin/bash
#Extract duplicati
unzip /opt/Setup/duplicati.zip -d /opt/duplicati
#Remove Archive
rm /opt/Setup/duplicati.zip
#Install updates-cript
mv /opt/Setup/Scripts/UpdateDuplicati.sh /opt/UpdateDuplicati.sh
#Move configuration inplace
mv /opt/Setup/duplicati-installed /opt/Duplicati-installed
mv /opt/Setup/Configs/Duplicati-env /etc/default/duplicati
#Installing and enabling service
mv /opt/Setup/Configs/duplicati.service /lib/systemd/system/duplicati.service
chmod +x /lib/systemd/system/duplicati.service
ln -s /lib/systemd/system/duplicati.service /etc/systemd/system/multi-user.target.wants/duplicati.service
#Fix SSL sert
/usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
update-ca-certificates

View File

@@ -0,0 +1,20 @@
#!/bin/bash
#Get latest vesion
NewDuplicatiVer=$(curl -s https://api.github.com/repos/duplicati/duplicati/releases | grep 'tag_name.*' | grep 'beta' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |head -n 1)
#Compare versions to check for update
if [ "$NewDuplicatiVer" = "$(cat /opt/Duplicati-installed)" ] ; then
echo 'Duplicati up-to-date'
exit
else
echo "Updater Disabled, Newer versions not compatible"
exit 123
systemctl stop duplicati
rm -rf /opt/duplicati.bck
mv /opt/duplicati /opt/duplicati.bck
echo 'Updating Duplicati'
curl -L --retry 7 --retry-delay 5 $(curl -s https://api.github.com/repos/duplicati/duplicati/releases/tags/"$NewDuplicatiVer" | grep browser_download_url | grep .zip |grep -v signatures | sed -e s#^.*https#https# | tr -d \") -o /tmp/duplicati.zip
unzip /tmp/duplicati.zip -d /opt/duplicati
systemctl start duplicati
echo $NewDuplicatiVer > "/opt/Duplicati-installed"
fi