From 1a3cf49c0062b79ede1435b49379164f7b92ad63 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Wed, 18 Oct 2023 22:35:36 +1100 Subject: [PATCH] =?UTF-8?q?PERMISSIONS,=20MQTT,=20Maintenance=20work?= =?UTF-8?q?=E2=A4=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dockerfiles/start.sh | 8 ++- dockerfiles/user-mapping.sh | 5 ++ front/maintenance.php | 59 +++++------------------ front/php/server/util.php | 13 +++-- front/plugins/_publisher_mqtt/config.json | 2 +- 5 files changed, 34 insertions(+), 53 deletions(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index e13620a5..7da364f3 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -30,7 +30,12 @@ echo "[INSTALL] Run setup scripts" "$INSTALL_DIR/pialert/install/install_dependencies.sh" "$INSTALL_DIR/pialert/install/install_python.sh" -# Chaneg port number if set +# # executes a new shell session with the user specified in the USER variable. +# if [ -n "$USER" ]; then +# exec su - "${USER}" +# fi + +# Change port number if set if [ -n "${PORT}" ]; then sed -ie 's/listen 20211/listen '${PORT}'/g' /etc/nginx/sites-available/default fi @@ -77,6 +82,7 @@ chmod -R a+rwx $INSTALL_DIR chmod -R a+rwx /var/www/html chmod -R a+rw $INSTALL_DIR/pialert/front/log chmod -R a+rw $INSTALL_DIR/pialert/config +sudo chgrp -R www-data $INSTALL_DIR/pialert FILEDB=$INSTALL_DIR/pialert/db/pialert.db diff --git a/dockerfiles/user-mapping.sh b/dockerfiles/user-mapping.sh index 38abcda1..18c9024c 100755 --- a/dockerfiles/user-mapping.sh +++ b/dockerfiles/user-mapping.sh @@ -25,6 +25,11 @@ array=( ${LINE//:/ } ) # home is 5th element USER_HOME=${array[4]} +# print debug output +echo USER_ID: ${USER_ID}; +echo USER_GID: ${USER_GID}; +echo USER_HOME: ${USER_HOME}; + sed -i -e "s/^${USER}:\([^:]*\):[0-9]*:[0-9]*/${USER}:\1:${USER_ID}:${USER_GID}/" /etc/passwd sed -i -e "s/^${USER}:\([^:]*\):[0-9]*/${USER}:\1:${USER_GID}/" /etc/group diff --git a/front/maintenance.php b/front/maintenance.php index e717fa13..be9a6547 100755 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -420,17 +420,6 @@ $db->close(); - -
-
- -
-
-
-
nginx/error.log
-
-
@@ -463,44 +452,18 @@ $db->close();
- - -
- -
- -
-
-
-
pialert_pholus_lastrun.log
- -
-
- -
-
-
- -
-
- +
+
- -
-
-
-
IP_changes.log
- -
-
- -
-
-
- -
+ + +
+
+
nginx/error.log
+
+
+