From c18fbc1dbdc0272f778caf20983999f5c2b793d5 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 27 Oct 2021 22:33:30 +0000 Subject: [PATCH] Added CT mailbackupsys, Updated nginx own repo to Yaml for Alpine instead of inst.sh --- .gitignore | 6 ++++- CT-Build/Alpine.yaml | 37 +++++++++++++++++++++++++++++ CT-Files/mailbackup/Scripts/Init.sh | 8 +++++++ CT-Files/nextcloud/Scripts/Init.sh | 7 ------ CT-Files/nginx/Scripts/Init.sh | 7 ------ Readme.md | 21 ++++++++++++---- Scripts/GetExternalResources.sh | 13 +++++++--- 7 files changed, 76 insertions(+), 23 deletions(-) create mode 100644 CT-Files/mailbackup/Scripts/Init.sh diff --git a/.gitignore b/.gitignore index 2f1090e..e865b31 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.tar.xz *.tar.gz *.tar +*.zip /distrobuilder CT-Files/nginx/nginx_signing.rsa.pub CT-Files/transfersh/transfersh-linux-amd64 @@ -9,4 +10,7 @@ CT-Files/domoticz/domoticz.tgz CT-Files/omadaV3/omada.deb CT-Files/nextcloud/nginx_signing.rsa.pub CT-Files/nextcloud/nextcloud.tar.bz2 -CT-Files/aptcacherng/*_mirrors \ No newline at end of file +CT-Files/aptcacherng/*_mirrors +CT-Files/mailbackup/OfflineIMAP3-installed +CT-Files/mailbackup/rainloop-installed +CT-Files/mailbackup/MailBackup-sys \ No newline at end of file diff --git a/CT-Build/Alpine.yaml b/CT-Build/Alpine.yaml index 4d12eac..c9eead6 100644 --- a/CT-Build/Alpine.yaml +++ b/CT-Build/Alpine.yaml @@ -338,6 +338,13 @@ files: variants: - hass +#FileForMailBackup +- path: /opt/Setup + generator: copy + source: CT-Files/mailbackup + variants: + - mailbackup + packages: manager: apk update: true @@ -356,6 +363,7 @@ packages: variants: - nginx - nextcloud + - mailbackup #PKGS for Default - packages: @@ -489,6 +497,20 @@ packages: variants: - hass +#PKGS for MailBackup + - packages: + - dovecot + - php8-xml + - php8-fpm + - php8-curl + - php8-dom + - php8-iconv + - py3-pip + - sudo + action: install + variants: + - mailbackup + repositories: - name: /etc/apk/repositories url: |- @@ -544,6 +566,20 @@ actions: - nodered - nodejs +#Run init script for CT's with Nginx +- trigger: post-files + action: |- + #!/bin/sh + #Setup Nginx repo + echo "@nginx http://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories + curl -L https://nginx.org/keys/nginx_signing.rsa.pub -o /etc/apk/keys/nginx_signing.rsa.pub + #Install Nginx + apk add nginx@nginx + variants: + - nginx + - nextcloud + - mailbackup + #Run provided init script - trigger: post-files action: |- @@ -560,6 +596,7 @@ actions: - nextcloud - mqtt - hass + - mailbackup # Enable service for iscsi CT - trigger: post-files diff --git a/CT-Files/mailbackup/Scripts/Init.sh b/CT-Files/mailbackup/Scripts/Init.sh new file mode 100644 index 0000000..596a448 --- /dev/null +++ b/CT-Files/mailbackup/Scripts/Init.sh @@ -0,0 +1,8 @@ +#!/bin/ash +#Install and configure using git.bprieshof.nl MailBackup-sys +DistoBuilderINT=true ResourceFolder=/opt/Setup ash /opt/Setup/MailBackup-sys/install.sh + +#cleanup +rm -rf /opt/Setup/MailBackup-sys +rm -f /opt/Setup/olim3.tar.gz +rm -f /opt/Setup/rlcl.zip \ No newline at end of file diff --git a/CT-Files/nextcloud/Scripts/Init.sh b/CT-Files/nextcloud/Scripts/Init.sh index 2b31e05..af266cc 100644 --- a/CT-Files/nextcloud/Scripts/Init.sh +++ b/CT-Files/nextcloud/Scripts/Init.sh @@ -1,11 +1,4 @@ #!/bin/ash -#Setup Nginx repo -echo "@nginx http://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories -mv /opt/Setup/nginx_signing.rsa.pub /etc/apk/keys/nginx_signing.rsa.pub - -#Install Nginx -apk add nginx@nginx - #Configure Nginx rm -rf /etc/nginx/conf.d mv /opt/Setup/Configs/nginx.conf /etc/nginx/nginx.conf diff --git a/CT-Files/nginx/Scripts/Init.sh b/CT-Files/nginx/Scripts/Init.sh index c2dad53..7f7e936 100644 --- a/CT-Files/nginx/Scripts/Init.sh +++ b/CT-Files/nginx/Scripts/Init.sh @@ -1,11 +1,4 @@ #!/bin/ash -#Setup Nginx repo -echo "@nginx http://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories -mv /opt/Setup/nginx_signing.rsa.pub /etc/apk/keys/nginx_signing.rsa.pub - -#Install Nginx -apk add nginx@nginx - #Configure Nginx mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/ rm -rf /etc/nginx/conf.d/* diff --git a/Readme.md b/Readme.md index 0d58cba..ce56904 100644 --- a/Readme.md +++ b/Readme.md @@ -42,6 +42,7 @@ This can be done on a Minimal debian CT (make sure to enable nesting) on the new | nodejs | Alpine | Basic nodejs install with pm2 | | mqtt | Alpine | Mosquitto mqtt broker | | hass | Alpine | HomeAssistant instance with HACS and mysql support | +| mailbackupsys | Alpine | Contains mail achive suite (MailBackup-sys) | ## TODO **Begin original list** @@ -56,7 +57,7 @@ This can be done on a Minimal debian CT (make sure to enable nesting) on the new -AptCacherNG + ~Unifi~ Not supported in debian 11 @@ -64,7 +65,7 @@ AptCacherNG -MailBackup* + ~FileShelter~ Not supported in debian 11 /transfer.sh As alternative @@ -142,14 +143,24 @@ exit **Do not start this container after creation, follow these steps first** * Recommended to give CT 1-2GB of RAM (Required for updating) ### In Proxmox -* Add the following to `/etc/udev/rules.d/99-CustomHome.rules` +* Add the following to `/etc/udev/rules.d/99-CustomHome.rules` +#### Always add (to set the device permissions)** ``` KERNEL=="ttyUSB[0-9]*", MODE="0666" KERNEL=="ttyACM[0-9]*", MODE="0666" - +``` +#### Add for Sonoff Zigbee 3.0 USB (CC2652P + CP2102N) +``` +SUBSYSTEM=="tty", ACTION=="change", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="ttyACM-Zigbee" +SUBSYSTEM=="tty", ACTION=="add", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="ttyACM-Zigbee" +``` +#### Add for Zigbee CC2531 USB +``` SUBSYSTEM=="tty", ACTION=="change", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="ttyACM-Zigbee" SUBSYSTEM=="tty", ACTION=="add", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="ttyACM-Zigbee" - +``` +#### Add for Zwave Aeotec Z-Stick Gen5 +``` SUBSYSTEM=="tty", ACTION=="change", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyACM-Zwave" SUBSYSTEM=="tty", ACTION=="add", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyACM-Zwave" ``` diff --git a/Scripts/GetExternalResources.sh b/Scripts/GetExternalResources.sh index d1c551f..2d9e423 100644 --- a/Scripts/GetExternalResources.sh +++ b/Scripts/GetExternalResources.sh @@ -12,7 +12,7 @@ GetResource () { GetResource mysql phpmyadmin.tar.gz https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz -GetResource nginx nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub +#GetResource nginx nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub GetResource nginx acmesh.tar.gz https://codeload.github.com/acmesh-official/acme.sh/tar.gz/master GetResource domoticz domoticz.tgz https://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz @@ -22,7 +22,14 @@ GetResource transfersh transfersh-linux-amd64 https://github.com/dutchcoders/tra #ForFutureDarkTheme#GetResource transfersh CustomTheme.tar.gz https://git.bprieshof.nl/attachments/e014dc2e-8b43-48bb-a771-da34e4d6fdef GetResource omadaV3 omada.deb https://static.tp-link.com/2020/202012/20201225/Omada_v3.2.14_linux_x64.deb -GetResource nextcloud nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub +#GetResource nextcloud nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub GetResource nextcloud nextcloud.tar.bz2 https://download.nextcloud.com/server/releases/latest.tar.bz2 GetResource aptcacherng alpine_mirrors http://dl-4.alpinelinux.org/alpine/MIRRORS.txt -curl -L --retry 7 --retry-delay 5 https://www.centos.org/download/full-mirrorlist.csv | sed 's/^.*"http:/http:/' | sed 's/".*$//' | grep ^http > CT-Files/aptcacherng/centos_mirrors \ No newline at end of file +curl -L --retry 7 --retry-delay 5 https://www.centos.org/download/full-mirrorlist.csv | sed 's/^.*"http:/http:/' | sed 's/".*$//' | grep ^http > CT-Files/aptcacherng/centos_mirrors + +OfflineIMAPVer=$(curl -s https://api.github.com/repos/OfflineIMAP/offlineimap3/tags | grep 'name.*' |head -n 1 | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") +echo "$(curl -s https://api.github.com/repos/RainLoop/rainloop-webmail/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")" > CT-Files/MailBackup/rainloop-installed +echo "$OfflineIMAPVer" > CT-Files/MailBackup/OfflineIMAP3-installed +GetResource mailbackup rlcl.zip http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip +GetResource mailbackup olim3.tar.gz https://github.com/OfflineIMAP/offlineimap3/archive/refs/tags/$OfflineIMAPVer.tar.gz -o /tmp/ +git clone https://git.bprieshof.nl/Tools/MailBackup-sys.git CT-Files/MailBackup/MailBackup-sys \ No newline at end of file