Non-root launch

This commit is contained in:
Adam Outler
2025-09-25 14:10:06 -04:00
parent 8ed21a8c07
commit dfcc375fba
8 changed files with 61 additions and 34 deletions

View File

@@ -1,8 +1,4 @@
#!/bin/bash
echo "Initializing backend..."
# Future backend initialization steps can go here.
# For now, we'll just ensure permissions are correct.
chown -R nginx:www-data "${NETALERTX_APP}"
chmod 750 "${NETALERTX_APP}"/config "${NETALERTX_APP}"/log "${NETALERTX_APP}"/db
find "${NETALERTX_APP}"/config "${NETALERTX_APP}"/log "${NETALERTX_APP}"/db -type f -exec chmod 640 {} \;
echo "Backend initialized."

View File

@@ -1,7 +1,7 @@
#!/bin/bash
echo "Initializing crond..."
# Add crontab file
chmod 600 /etc/crontabs/root
chown root:root /etc/crontabs/root
rm /etc/crontabs/root
chmod 600 /etc/crontabs/netalertx
chown netalertx:netalertx /etc/crontabs/netalertx
echo "crond initialized."

View File

@@ -1,13 +1,13 @@
#!/bin/bash
echo "Initializing php-fpm..."
# Set up PHP-FPM directories and socket configuration
install -d -o nginx -g www-data /run/php/
install -d -o netalertx -g netalertx /run/php/
sed -i "/^;pid/c\pid = /run/php/php8.3-fpm.pid" /etc/php83/php-fpm.conf
sed -i "/^listen/c\listen = /run/php/php8.3-fpm.sock" /etc/php83/php-fpm.d/www.conf
sed -i "/^;listen.owner/c\listen.owner = nginx" /etc/php83/php-fpm.d/www.conf
sed -i "/^;listen.group/c\listen.group = www-data" /etc/php83/php-fpm.d/www.conf
sed -i "/^user/c\user = nginx" /etc/php83/php-fpm.d/www.conf
sed -i "/^group/c\group = www-data" /etc/php83/php-fpm.d/www.conf
sed -i "/^;listen.owner/c\listen.owner = netalertx" /etc/php83/php-fpm.d/www.conf
sed -i "/^;listen.group/c\listen.group = netalertx" /etc/php83/php-fpm.d/www.conf
sed -i "/^user/c\user = netalertx" /etc/php83/php-fpm.d/www.conf
sed -i "/^group/c\group = netalertx" /etc/php83/php-fpm.d/www.conf
# Increase max child process count
sed -i -e 's/pm.max_children = 5/pm.max_children = 10/' /etc/php83/php-fpm.d/www.conf