From 74f0880b23f2f28d0dcd60f24348308dba0b3d18 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Sun, 2 Jul 2023 01:20:22 +0200 Subject: [PATCH] CT Nextcloud, z2mqtt and hass: Fixed bugs related to alpine release update CT Nextcloud: Updated HTTP headers in Nginx config CT hass: Fixed hacs installer and updated dependencies: replaced mariadb-connector-c-dev with mariadb-dev, and added ffmpeg-dev CT z2mqtt: replaced yarn with corepack --- CT-Build/Alpine.yaml | 3 ++- CT-Files/hass/Scripts/Init.sh | 7 ++++--- CT-Files/nextcloud/Configs/nginx.conf | 21 +++++++++++++++------ CT-Files/z2mqtt/Scripts/Init.sh | 4 ++-- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CT-Build/Alpine.yaml b/CT-Build/Alpine.yaml index a3188f9..9135375 100644 --- a/CT-Build/Alpine.yaml +++ b/CT-Build/Alpine.yaml @@ -519,8 +519,9 @@ packages: - jpeg-dev - zlib-dev - bash - - mariadb-connector-c-dev + - mariadb-dev - eudev-dev + - ffmpeg-dev action: install variants: - hass diff --git a/CT-Files/hass/Scripts/Init.sh b/CT-Files/hass/Scripts/Init.sh index 037cf63..680b197 100644 --- a/CT-Files/hass/Scripts/Init.sh +++ b/CT-Files/hass/Scripts/Init.sh @@ -1,7 +1,7 @@ #!/bin/ash #Install HomeAssistant mkdir -p /opt/HomeAssistant/srv -mkdir -p /opt/HomeAssistant/data +mkdir -p /opt/HomeAssistant/data/custom_components/hacs touch /opt/HomeAssistant/data/home-assistant.log addgroup hass adduser -h /opt/HomeAssistant/data -D -G hass -s /bin/sh hass @@ -10,14 +10,15 @@ sudo -u hass python3 -m venv /opt/HomeAssistant/srv sudo -u hass sh -c '. /opt/HomeAssistant/srv/bin/activate && pip install --upgrade pip && pip3 install wheel mysqlclient sqlalchemy fnvhash && pip3 install homeassistant' #Install Home Assistant Community Store -sudo -u hass sh -c 'cd /opt/HomeAssistant/data && wget -O - https://get.hacs.xyz | bash -' +wget https://github.com/hacs/integration/releases/latest/download/hacs.zip -O /tmp/hacs.zip +sudo -u hass unzip /tmp/hacs.zip -d /opt/HomeAssistant/data/custom_components/hacs #Update script mv /opt/Setup/Scripts/UpdateHASS.sh /opt/UpdateHASS.sh #CleanUp rm -rf /opt/HomeAssistant/data/.cache/* -rm -rf /build/TMP/usr/lib/python3.9/__pycache__/* +rm -rf /usr/lib/python3.11/__pycache__/* #Setup HomeAssistant service mv /opt/Setup/Configs/hass.service /etc/init.d/hass diff --git a/CT-Files/nextcloud/Configs/nginx.conf b/CT-Files/nextcloud/Configs/nginx.conf index ce1dfba..a1af002 100644 --- a/CT-Files/nextcloud/Configs/nginx.conf +++ b/CT-Files/nextcloud/Configs/nginx.conf @@ -37,12 +37,21 @@ http { add_header Content-Type text/html; return 200 'To setup this container edit and run the FirstRun script `/opt/Setup/Scripts/FirstRun.sh`'; #SetupBlockEnd - add_header Referrer-Policy "no-referrer" always; - add_header X-Download-Options "noopen" always; - add_header X-Permitted-Cross-Domain-Policies "none" always; - add_header X-Robots-Tag "noindex, nofollow" always; - fastcgi_send_timeout 300; - fastcgi_read_timeout 300; + + ##Reverse proxy IP resolve + #set_real_ip_from ; + #real_ip_header X-Forwarded-For; + + add_header Referrer-Policy "no-referrer" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Download-Options "noopen" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Permitted-Cross-Domain-Policies "none" always; + add_header X-Robots-Tag "noindex, nofollow" always; + add_header X-XSS-Protection "1; mode=block" always; + + fastcgi_send_timeout 36000; + fastcgi_read_timeout 36000; fastcgi_hide_header X-Powered-By; fastcgi_buffers 64 4K; gzip on; diff --git a/CT-Files/z2mqtt/Scripts/Init.sh b/CT-Files/z2mqtt/Scripts/Init.sh index 63a7999..03a4f03 100644 --- a/CT-Files/z2mqtt/Scripts/Init.sh +++ b/CT-Files/z2mqtt/Scripts/Init.sh @@ -1,6 +1,6 @@ #!/bin/ash -#Install Yarn Globaly for zwavejs2mqtt -npm install -g yarn +#Install corpack globaly for zwavejs2mqtt +npm install -g corepack #Run folowing commands as 'node' user sudo -u node ash << EOF