permissions fix

This commit is contained in:
Jokob-sk
2023-01-07 23:43:08 +11:00
parent 4d0d62a00b
commit a29d0a6cf6
3 changed files with 13 additions and 13 deletions

View File

@@ -139,11 +139,9 @@ def checkPermissionsOK():
def fixPermissions():
# Try fixing access rights if needed
chmodCommands = []
if dbR_access == False or dbW_access == False:
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', dbPath])
if confR_access == False or confW_access == False:
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', confPath])
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', fullDbPath])
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', fullConfPath])
for com in chmodCommands:
# Execute command
@@ -193,9 +191,8 @@ if confR_access == False:
if dbR_access == False:
initialiseFile(fullDbPath, "/home/pi/pialert/back/pialert.db_bak")
if dbR_access == False or confR_access == False:
if checkPermissionsOK() == False: # second check
fixPermissions()
# last attempt
fixPermissions()
#===============================================================================
# Initialise user defined values
@@ -2182,8 +2179,8 @@ def send_notifications ():
# DEBUG - Write output emails for testing
#if True :
# write_file (logPath + '/report_output.txt', mail_text)
# write_file (logPath + '/report_output.html', mail_html)
write_file (logPath + '/report_output.txt', mail_text)
write_file (logPath + '/report_output.html', mail_html)
# Send Mail
if json_internet != [] or json_new_devices != [] or json_down_devices != [] or json_events != []:

View File

@@ -1,6 +1,7 @@
version: "3"
services:
pialert:
privileged: true
build: .
container_name: pialert
network_mode: "host"

View File

@@ -73,7 +73,8 @@ CommitDB();
// create settings groups
$isIn = ' in ';
foreach ($groups as $group) {
foreach ($groups as $group)
{
$html = $html.'<div class=" box panel panel-default">
<a data-toggle="collapse" data-parent="#accordion_gen" href="#'.$group.'">
<div class="panel-heading">
@@ -84,8 +85,9 @@ CommitDB();
<div class="panel-body">';
$isIn = ' '; // open the first panel only by default on page load
// populate settings for each group id="collapse100" class="panel-collapse collapse"
foreach ($settings as $set) {
// populate settings for each group
foreach ($settings as $set)
{
if($set["Group"] == $group)
{
$html = $html.