Corrections on testing and behaviors

This commit is contained in:
Adam Outler
2025-10-31 22:47:35 +00:00
parent 8edef9e852
commit a6bc96d2dd
6 changed files with 944 additions and 46 deletions

View File

@@ -152,16 +152,19 @@ def main():
results = []
has_issues = False
has_write_errors = False
for var_name, is_persistent in PATHS_TO_CHECK.items():
result = analyze_path(
var_name, is_persistent,
mounted_filesystems, NON_PERSISTENT_FSTYPES, READ_ONLY_VARS
)
if result.dataloss_risk or result.error or result.write_error:
if result.dataloss_risk or result.error or result.write_error or result.performance_issue:
has_issues = True
if result.write_error:
has_write_errors = True
results.append(result)
if has_issues:
if has_issues or True: # Always print table for diagnostic purposes
# --- Print Table ---
headers = ["Path", "Writeable", "Mount", "RAMDisk", "Performance", "DataLoss"]
@@ -238,10 +241,13 @@ def main():
))
# --- Print Warning ---
print("\n", file=sys.stderr)
print_warning_message()
# Continue instead of exiting for testing purposes
# sys.exit(1)
if has_issues:
print("\n", file=sys.stderr)
print_warning_message()
# Exit with error only if there are write permission issues
if has_write_errors and os.environ.get("NETALERTX_DEBUG") != "1":
sys.exit(1)
if __name__ == "__main__":
main()

View File

@@ -1,5 +1,10 @@
#!/bin/sh
# check-nginx-config.sh - verify nginx conf.active mount is writable when startup needs to render config.
# check-nginx-config.sh - verify nginx conf.active mount is writable when PORT != 20211.
# Only check nginx config writability if PORT is not the default 20211
if [ "${PORT:-20211}" = "20211" ]; then
exit 0
fi
CONF_ACTIVE_DIR="${SYSTEM_SERVICES_ACTIVE_CONFIG}"
TARGET_FILE="${CONF_ACTIVE_DIR}/netalertx.conf"

View File

@@ -46,8 +46,8 @@ fi
YELLOW=$(printf '\033[1;33m')
RESET=$(printf '\033[0m')
>&2 printf "%s" "${YELLOW}"
&>2 cat <<EOF
printf "%s" "${YELLOW}"
cat <<EOF
══════════════════════════════════════════════════════════════════════════════
⚠️ ATTENTION: NetAlertX is not running with --network=host.
@@ -62,5 +62,5 @@ RESET=$(printf '\033[0m')
https://github.com/jokob-sk/NetAlertX/blob/main/docs/docker-troubleshooting/network-mode.md
══════════════════════════════════════════════════════════════════════════════
EOF
&>2 printf "%s" "${RESET}"
printf "%s" "${RESET}"
exit 0