mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
permissions fix
This commit is contained in:
@@ -139,11 +139,9 @@ def checkPermissionsOK():
|
|||||||
def fixPermissions():
|
def fixPermissions():
|
||||||
# Try fixing access rights if needed
|
# Try fixing access rights if needed
|
||||||
chmodCommands = []
|
chmodCommands = []
|
||||||
|
|
||||||
if dbR_access == False or dbW_access == False:
|
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', fullDbPath])
|
||||||
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', dbPath])
|
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', fullConfPath])
|
||||||
if confR_access == False or confW_access == False:
|
|
||||||
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', confPath])
|
|
||||||
|
|
||||||
for com in chmodCommands:
|
for com in chmodCommands:
|
||||||
# Execute command
|
# Execute command
|
||||||
@@ -193,9 +191,8 @@ if confR_access == False:
|
|||||||
if dbR_access == False:
|
if dbR_access == False:
|
||||||
initialiseFile(fullDbPath, "/home/pi/pialert/back/pialert.db_bak")
|
initialiseFile(fullDbPath, "/home/pi/pialert/back/pialert.db_bak")
|
||||||
|
|
||||||
if dbR_access == False or confR_access == False:
|
# last attempt
|
||||||
if checkPermissionsOK() == False: # second check
|
fixPermissions()
|
||||||
fixPermissions()
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Initialise user defined values
|
# Initialise user defined values
|
||||||
@@ -2182,8 +2179,8 @@ def send_notifications ():
|
|||||||
|
|
||||||
# DEBUG - Write output emails for testing
|
# DEBUG - Write output emails for testing
|
||||||
#if True :
|
#if True :
|
||||||
# write_file (logPath + '/report_output.txt', mail_text)
|
write_file (logPath + '/report_output.txt', mail_text)
|
||||||
# write_file (logPath + '/report_output.html', mail_html)
|
write_file (logPath + '/report_output.html', mail_html)
|
||||||
|
|
||||||
# Send Mail
|
# Send Mail
|
||||||
if json_internet != [] or json_new_devices != [] or json_down_devices != [] or json_events != []:
|
if json_internet != [] or json_new_devices != [] or json_down_devices != [] or json_events != []:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
pialert:
|
pialert:
|
||||||
|
privileged: true
|
||||||
build: .
|
build: .
|
||||||
container_name: pialert
|
container_name: pialert
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ CommitDB();
|
|||||||
|
|
||||||
// create settings groups
|
// create settings groups
|
||||||
$isIn = ' in ';
|
$isIn = ' in ';
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group)
|
||||||
|
{
|
||||||
$html = $html.'<div class=" box panel panel-default">
|
$html = $html.'<div class=" box panel panel-default">
|
||||||
<a data-toggle="collapse" data-parent="#accordion_gen" href="#'.$group.'">
|
<a data-toggle="collapse" data-parent="#accordion_gen" href="#'.$group.'">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
@@ -84,8 +85,9 @@ CommitDB();
|
|||||||
<div class="panel-body">';
|
<div class="panel-body">';
|
||||||
$isIn = ' '; // open the first panel only by default on page load
|
$isIn = ' '; // open the first panel only by default on page load
|
||||||
|
|
||||||
// populate settings for each group id="collapse100" class="panel-collapse collapse"
|
// populate settings for each group
|
||||||
foreach ($settings as $set) {
|
foreach ($settings as $set)
|
||||||
|
{
|
||||||
if($set["Group"] == $group)
|
if($set["Group"] == $group)
|
||||||
{
|
{
|
||||||
$html = $html.
|
$html = $html.
|
||||||
|
|||||||
Reference in New Issue
Block a user