break apart services, fix startup

This commit is contained in:
Adam Outler
2025-10-15 18:18:30 -04:00
parent 5109a0881d
commit de92c9563e
10 changed files with 887 additions and 13 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/sh
# ramdisk-check.sh - Verify critical paths are backed by ramdisk and warn on fallback storage.
warn_if_not_ramdisk() {
path="$1"
if cat /proc/mounts| grep ${path} | grep -qE 'tmpfs|ramfs'; then
return 0
fi
cat >&2 <<EOF
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
ATTENTION: ${path} is not on a ramdisk.
Mount this folder inside the container as tmpfs or ramfs.
NetAlertX expects this location to live in memory for fast reads and writes.
Running it on disk will severely degrade performance for every user.
Fix: Please mount ${path} as tmpfs/ramfs.
eg. --mount type=tmpfs,destination=${path}
Restart the container after adding the ramdisk mount.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
EOF
exit 1
}
warn_if_not_ramdisk "${NETALERTX_API}"
warn_if_not_ramdisk "${NETALERTX_LOG}"
if [ ! -f "${SYSTEM_NGINIX_CONFIG}/conf.active" ]; then
echo "Note: Using default listen address ${LISTEN_ADDR}:${PORT} (no ${SYSTEM_NGINIX_CONFIG}/conf.active override)."
fi