From 7a0de87698b2d3e867216c8832e121e627ae792d Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 7 Sep 2022 01:02:50 +0200 Subject: [PATCH] Fixed CT's : elkarbackupALP,duplicati,OmadaV3,transfersh,hass,pihole Github updated api and now appends a semicolon to versions, added `tr -d :` to list for url filtering elkarbackupALP: * Github api Fix duplicati: * Github api fix * Enabled in jenkinsfile OmadaV3: * Added Stop command for omada after installation to avoid DB corruption * Moved automaticaly installed dependencies to package list transfersh: * Github api fix hass: * Added Missing python modules (sqlalchemy nvhash) mailbackup: * Github api fix * Moved downlading of resources to project pihole: *Added support for ProxmoxHelper App updater --- CT-Build/Alpine.yaml | 4 +++- CT-Build/Debian.Jenkinsfile | 2 +- CT-Build/Debian.yaml | 2 ++ CT-Files/duplicati/Scripts/Init.sh | 2 +- CT-Files/duplicati/Scripts/UpdateDuplicati.sh | 2 +- CT-Files/elkarbackupALP/Scripts/Init.sh | 3 ++- .../Scripts/updateElkarbackup.sh | 2 +- CT-Files/elkarbackupDEB/Scripts/FirstRun.sh | 2 +- CT-Files/elkarbackupDEB/Scripts/Init.sh | 4 +++- CT-Files/hass/Scripts/Init.sh | 2 +- CT-Files/mailbackup/Scripts/Init.sh | 8 +------- CT-Files/mailbackup/Scripts/PTKAppUpdate.sh | 4 ++++ CT-Files/mysql/Scripts/Init.sh | 2 +- CT-Files/mysql/Scripts/UpdatePhpMyadmin.sh | 2 +- CT-Files/omadaV3/Scripts/Init.sh | 3 +++ .../Scripts/{FirstSetup.sh => FirstRun.sh} | 0 ...{PTKPortainerUpdate.sh => PTKAppUpdate.sh} | 0 CT-Files/transfersh/Scripts/Init.sh | 2 +- CT-Files/transfersh/Scripts/update.sh | 2 +- Readme.md | 20 ++++++++++--------- 20 files changed, 39 insertions(+), 29 deletions(-) create mode 100644 CT-Files/mailbackup/Scripts/PTKAppUpdate.sh rename CT-Files/pihole/Scripts/{FirstSetup.sh => FirstRun.sh} (100%) rename CT-Files/pihole/Scripts/{PTKPortainerUpdate.sh => PTKAppUpdate.sh} (100%) diff --git a/CT-Build/Alpine.yaml b/CT-Build/Alpine.yaml index c0f4c10..554dcd3 100644 --- a/CT-Build/Alpine.yaml +++ b/CT-Build/Alpine.yaml @@ -532,7 +532,9 @@ packages: - php8-fpm - php8-curl - php8-dom - - php8-iconv + - php8-zip + - php8-mbstring + - php-openssl - py3-pip - sudo - git diff --git a/CT-Build/Debian.Jenkinsfile b/CT-Build/Debian.Jenkinsfile index 172cd9d..64f3dfd 100644 --- a/CT-Build/Debian.Jenkinsfile +++ b/CT-Build/Debian.Jenkinsfile @@ -7,7 +7,7 @@ pipeline { string defaultValue: '192.168.200.11', description: 'Proxy server for packages, when enabled', name: 'ProxyServer' booleanParam description: 'will disable use of proxy server', name: 'DisProxy' checkboxParameter(name: 'ImgVariantList', format: 'JSON', displayNodePath: "//Variants/Variant", valueNodePath: "//Variants/Variant", description: 'Select the variant(s) that should be build', - pipelineSubmitContent: '{"Variants": [{"Variant": "minimal"},{"Variant": "default"},{"Variant": "jenkinsbuilder"},{"Variant": "imgbuilder"},{"Variant": "jenkins"},{"Variant": "mysql"},{"Variant": "pihole"},{"Variant": "collabora"},{"Variant": "jellyfin"},{"Variant": "domoticz"},{"Variant": "omadaV3"},{"Variant": "docker"},{"Variant": "smb"},{"Variant": "tvheadend"},{"Variant": "x2go"},{"Variant": "aptcacherng"},{"Variant": "elkarbackupDEB"},{"Variant": "nfs"},{"Variant": "fileshelter"}]}') + pipelineSubmitContent: '{"Variants": [{"Variant": "minimal"},{"Variant": "default"},{"Variant": "jenkinsbuilder"},{"Variant": "imgbuilder"},{"Variant": "jenkins"},{"Variant": "mysql"},{"Variant": "pihole"},{"Variant": "collabora"},{"Variant": "jellyfin"},{"Variant": "domoticz"},{"Variant": "omadaV3"},{"Variant": "docker"},{"Variant": "smb"},{"Variant": "tvheadend"},{"Variant": "x2go"},{"Variant": "aptcacherng"},{"Variant": "elkarbackupDEB"},{"Variant": "nfs"},{"Variant": "duplicati"},{"Variant": "fileshelter"}]}') } options { skipDefaultCheckout() diff --git a/CT-Build/Debian.yaml b/CT-Build/Debian.yaml index 7a961f8..15e14b7 100644 --- a/CT-Build/Debian.yaml +++ b/CT-Build/Debian.yaml @@ -1198,6 +1198,8 @@ packages: #OmadaV3 pkgs - packages: - curl + - jsvc + - libcommons-daemon-java action: install variants: - omadaV3 diff --git a/CT-Files/duplicati/Scripts/Init.sh b/CT-Files/duplicati/Scripts/Init.sh index f2d4cfb..368ed9a 100644 --- a/CT-Files/duplicati/Scripts/Init.sh +++ b/CT-Files/duplicati/Scripts/Init.sh @@ -1,7 +1,7 @@ #!/bin/bash #Get Resources ##Duplicate get latest (Working with mono-devel ) -CurrentVersion=$(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) +CurrentVersion=$(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 " " |tr -d : |head -n 1) ##Duplicati get older version (Working with only the runtime installed) #CurrentVersion="v2.0.5.1-2.0.5.1_beta_2020-01-18" echo $CurrentVersion > /opt/Duplicati-installed diff --git a/CT-Files/duplicati/Scripts/UpdateDuplicati.sh b/CT-Files/duplicati/Scripts/UpdateDuplicati.sh index f5e2e92..ce66744 100644 --- a/CT-Files/duplicati/Scripts/UpdateDuplicati.sh +++ b/CT-Files/duplicati/Scripts/UpdateDuplicati.sh @@ -1,6 +1,6 @@ #!/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) +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 " " |tr -d : |head -n 1) #Compare versions to check for update if [ "$NewDuplicatiVer" = "$(cat /opt/Duplicati-installed)" ] ; then diff --git a/CT-Files/elkarbackupALP/Scripts/Init.sh b/CT-Files/elkarbackupALP/Scripts/Init.sh index 95c4fef..f2fe13d 100644 --- a/CT-Files/elkarbackupALP/Scripts/Init.sh +++ b/CT-Files/elkarbackupALP/Scripts/Init.sh @@ -1,6 +1,6 @@ #!/bin/ash #Get Resources -CurrentVersion=$(curl -s https://api.github.com/repos/elkarbackup/elkarbackup/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") +CurrentVersion=$(curl -s https://api.github.com/repos/elkarbackup/elkarbackup/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : ) echo $CurrentVersion > /opt/Elkarbackup-installed curl -L --retry 7 --retry-delay 5 https://github.com/elkarbackup/elkarbackup/archive/refs/tags/$CurrentVersion.tar.gz -o /opt/Setup/elkb.tar.gz || exit 1 @@ -43,6 +43,7 @@ mv /opt/Setup/Configs/crontab /etc/crontabs/nginx #Configure Sudo mv /opt/Setup/Configs/sudofile /etc/sudoers.d/elkarbackup +chown 0:0 /etc/sudoers.d/elkarbackup #Enable services on boot rc-update add nginx diff --git a/CT-Files/elkarbackupALP/Scripts/updateElkarbackup.sh b/CT-Files/elkarbackupALP/Scripts/updateElkarbackup.sh index a6991a4..6ce9418 100644 --- a/CT-Files/elkarbackupALP/Scripts/updateElkarbackup.sh +++ b/CT-Files/elkarbackupALP/Scripts/updateElkarbackup.sh @@ -1,6 +1,6 @@ #!/bin/ash -NewElkarbackupVersion=$(curl -s https://api.github.com/repos/elkarbackup/elkarbackup/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") +NewElkarbackupVersion=$(curl -s https://api.github.com/repos/elkarbackup/elkarbackup/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : ) if test "$NewElkarbackupVersion" = "$(cat /opt/Elkarbackup-installed)" ; then echo 'Elkarbackup up-to-date' diff --git a/CT-Files/elkarbackupDEB/Scripts/FirstRun.sh b/CT-Files/elkarbackupDEB/Scripts/FirstRun.sh index 21bdf18..3ce4120 100644 --- a/CT-Files/elkarbackupDEB/Scripts/FirstRun.sh +++ b/CT-Files/elkarbackupDEB/Scripts/FirstRun.sh @@ -12,5 +12,5 @@ if [ $ThisScriptConfigured = no ]; then exit fi -sed -i -e 's/DBServer/'$MysqlIP'/' -e 's/DBName/'$MysqlDatabase'/' -e 's/DBUser/'$MysqlUsername'/' -e 's/DBPass/'$MysqlPassword'/' -e 's/ElkarToken/'$(tr -dc 'A-Za-z0-9!#%()*+,-.:;<=>?@[]^_{|}~' 2>/dev/null ?@^_' 2>/dev/null /opt/Setup/rainloop-installed -curl -L --retry 7 --retry-delay 5 http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip -o /opt/Setup/rlcl.zip || exit 1 -echo "$OfflineIMAPVer" > /opt/Setup/OfflineIMAP3-installed -curl -L --retry 7 --retry-delay 5 https://github.com/OfflineIMAP/offlineimap3/archive/refs/tags/$OfflineIMAPVer.tar.gz -o /opt/Setup/olim3.tar.gz || exit 1 #Install and configure using git.bprieshof.nl MailBackup-sys -DistoBuilderINT=true ResourceFolder=/opt/Setup ash /opt/Setup/MailBackup-sys/install.sh +DistoBuilderINT=true ash /opt/Setup/MailBackup-sys/install.sh #cleanup rm -rf /opt/Setup/MailBackup-sys diff --git a/CT-Files/mailbackup/Scripts/PTKAppUpdate.sh b/CT-Files/mailbackup/Scripts/PTKAppUpdate.sh new file mode 100644 index 0000000..32a7660 --- /dev/null +++ b/CT-Files/mailbackup/Scripts/PTKAppUpdate.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit +ash /opt/UpdateOfflineImap3.sh +ash /opt/UpdateSnappyMail.sh \ No newline at end of file diff --git a/CT-Files/mysql/Scripts/Init.sh b/CT-Files/mysql/Scripts/Init.sh index c8e6d0c..650b062 100644 --- a/CT-Files/mysql/Scripts/Init.sh +++ b/CT-Files/mysql/Scripts/Init.sh @@ -1,6 +1,6 @@ #!/bin/bash #Get Resources -CurrentVersion=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") +CurrentVersion=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : ) echo $CurrentVersion > /opt/phpmyadmin-installed curl -L --retry 7 --retry-delay 5 https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz -o "/opt/Setup/phpmyadmin.tar.gz" || exit 1 diff --git a/CT-Files/mysql/Scripts/UpdatePhpMyadmin.sh b/CT-Files/mysql/Scripts/UpdatePhpMyadmin.sh index 20a94a3..2d75d9f 100644 --- a/CT-Files/mysql/Scripts/UpdatePhpMyadmin.sh +++ b/CT-Files/mysql/Scripts/UpdatePhpMyadmin.sh @@ -1,6 +1,6 @@ #!/bin/bash -NewPhpMyAdminVersion=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") +NewPhpMyAdminVersion=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : ) if test "$NewPhpMyAdminVersion" = "$(cat /opt/phpmyadmin-installed)" ; then echo 'PhpMyAdmin up-to-date' diff --git a/CT-Files/omadaV3/Scripts/Init.sh b/CT-Files/omadaV3/Scripts/Init.sh index ff9c444..5f98d5d 100644 --- a/CT-Files/omadaV3/Scripts/Init.sh +++ b/CT-Files/omadaV3/Scripts/Init.sh @@ -3,4 +3,7 @@ curl -L --retry 7 --retry-delay 5 https://static.tp-link.com/2020/202012/20201225/Omada_v3.2.14_linux_x64.deb -o /opt/Setup/omada.deb || exit 1 #Install Omada apt install /opt/Setup/omada.deb -y +#Stoping Omdada (to prevent corrupting the DB) +/usr/bin/tpeap stop +#clean up rm /opt/Setup/omada.deb \ No newline at end of file diff --git a/CT-Files/pihole/Scripts/FirstSetup.sh b/CT-Files/pihole/Scripts/FirstRun.sh similarity index 100% rename from CT-Files/pihole/Scripts/FirstSetup.sh rename to CT-Files/pihole/Scripts/FirstRun.sh diff --git a/CT-Files/pihole/Scripts/PTKPortainerUpdate.sh b/CT-Files/pihole/Scripts/PTKAppUpdate.sh similarity index 100% rename from CT-Files/pihole/Scripts/PTKPortainerUpdate.sh rename to CT-Files/pihole/Scripts/PTKAppUpdate.sh diff --git a/CT-Files/transfersh/Scripts/Init.sh b/CT-Files/transfersh/Scripts/Init.sh index 090a1ea..6a9da8a 100644 --- a/CT-Files/transfersh/Scripts/Init.sh +++ b/CT-Files/transfersh/Scripts/Init.sh @@ -4,7 +4,7 @@ addgroup transfersh adduser -S -s /bin/ash -h /home/transfersh -D -G transfersh transfersh mkdir -p /opt/transfer.sh/CustomTheme #Get Resources -CurrentVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") +CurrentVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : ) echo $CurrentVersion > /opt/transfer.sh/Version curl -L --retry 7 --retry-delay 5 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurrentVersion"/transfersh-"$CurrentVersion"-linux-amd64 -o /opt/transfer.sh/transfersh-linux-amd64 || exit 1 #Install transfer.sh custom theme diff --git a/CT-Files/transfersh/Scripts/update.sh b/CT-Files/transfersh/Scripts/update.sh index e5283f3..219b0a3 100644 --- a/CT-Files/transfersh/Scripts/update.sh +++ b/CT-Files/transfersh/Scripts/update.sh @@ -1,5 +1,5 @@ #!/bin/ash -CurtransfershVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") +CurtransfershVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : ) if test "$CurtransfershVersion" = "$(cat /opt/transfer.sh/Version)" ; then echo 'Transfer.sh up-to-date' diff --git a/Readme.md b/Readme.md index bfd85a9..95414a6 100644 --- a/Readme.md +++ b/Readme.md @@ -110,12 +110,13 @@ Then select the created credential and click save ## gitea 1. Edit the parameters in the FistRun script in the container `vi /opt/Setup/Scripts/FirstRun.sh` 2. Run the FistRun script in the container `ash /opt/Setup/Scripts/FirstRun.sh` +* Available on http://``:3000 ## nginx * Run the FistRun script in the container `ash /opt/Setup/Scripts/FirstRun.sh` ## pihole -* Run the FistRun script in the container `ash /opt/Setup/Scripts/FirstRun.sh` +* Run the FistRun script in the container `bash /opt/Setup/Scripts/FirstRun.sh` ## collabora * Update the configuration in /etc/coolwsd/coolwsd.xml and reload the service `systemctl restart coolwsd` @@ -133,7 +134,7 @@ Then select the created credential and click save * To set-up the system follow the initial set-up wizard on http://``:8088 ## docker -* Run the FistRun script in the container `ash /opt/Setup/Scripts/FirstRun.sh` +* Run the FistRun script in the container `bash /opt/Setup/Scripts/FirstRun.sh` This container can be set up in two ways 1. As controller with portainer 2. As remote with docker tcp on port 2375 @@ -218,6 +219,11 @@ lxc.mount.entry: /dev/ttyACM-Zwave dev/ttyACM-Zwave none bind,optional,create=fi * Default credentials: setup/setup * Follow the setup wizzard after login, otherwise authentication will be disabled +## x2go +* Add a user by typing `adduser ` +* Set key auth only `sed -i -e '/PasswordAuthentication/c\PasswordAuthentication no' -e '/ChallengeResponseAuthentication/c\ChallengeResponseAuthentication no' /etc/ssh/sshd_config` +* Set ssh port `sed -i -e '/Port 22/c\Port ' /etc/ssh/sshd_config` + ## hass * After first start of CT HomeAssistant will finish its installation this will take at least 10 minutes * HomeAssistant available on http://``:8123 @@ -239,16 +245,17 @@ lxc.mount.entry: /dev/ttyACM-Zwave dev/ttyACM-Zwave none bind,optional,create=fi * Add user/storage space by running `ash /opt/AddMailBox.sh` ## heimdall -* available on http://``:80 +* Available on http://``:80 ## vouchproxy * Default port 9090 * A script to setup another instance is located here: `/opt/AddVouchInstance.sh` ## elkarbackup +**Alpine version recommended** 1. Edit the parameters in the FistRun script in the container `vi /opt/Setup/Scripts/FirstRun.sh` 2. Run the FistRun script in the container `ash /opt/Setup/Scripts/FirstRun.sh` -3. Available on http://`` (Default username/password: root/root +3. Available on http://`` (Default username/password: root/root) 4. Click cogwheel/settings icon > Manage backup locations >New (make sure to create this directory and set ngix as the owner) 5. Add a retention policy under the `Policies` tab @@ -302,8 +309,3 @@ cd /iscsi//tpg1/luns create exit ``` - -## x2go -* Add a user by typing `adduser ` -* Set key auth only `sed -i -e '/PasswordAuthentication/c\PasswordAuthentication no' -e '/ChallengeResponseAuthentication/c\ChallengeResponseAuthentication no' /etc/ssh/sshd_config` -* Set ssh port `sed -i -e '/Port 22/c\Port ' /etc/ssh/sshd_config` \ No newline at end of file