mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 07:45:41 -04:00
Revert "build: clean up s6 overlay structure"
This reverts commit 90420823b0.
This commit is contained in:
14
root/etc/logrotate.d/nginx
Normal file
14
root/etc/logrotate.d/nginx
Normal file
@@ -0,0 +1,14 @@
|
||||
/config/log/nginx/*.log {
|
||||
weekly
|
||||
rotate 14
|
||||
compress
|
||||
delaycompress
|
||||
nodateext
|
||||
notifempty
|
||||
missingok
|
||||
sharedscripts
|
||||
postrotate
|
||||
s6-svc -1 /run/service/svc-nginx
|
||||
endscript
|
||||
su dockerx dockerx
|
||||
}
|
||||
14
root/etc/logrotate.d/php-fpm
Normal file
14
root/etc/logrotate.d/php-fpm
Normal file
@@ -0,0 +1,14 @@
|
||||
/config/log/php/*.log {
|
||||
rotate 7
|
||||
weekly
|
||||
missingok
|
||||
notifempty
|
||||
delaycompress
|
||||
compress
|
||||
nodateext
|
||||
sharedscripts
|
||||
postrotate
|
||||
s6-svc -t /run/service/svc-php-fpm
|
||||
endscript
|
||||
su dockerx dockerx
|
||||
}
|
||||
1
root/etc/nginx/nginx.conf
Normal file
1
root/etc/nginx/nginx.conf
Normal file
@@ -0,0 +1 @@
|
||||
include /config/nginx/nginx.conf;
|
||||
@@ -4,4 +4,8 @@
|
||||
# make folders
|
||||
mkdir -p \
|
||||
/config/{keys,php,www} \
|
||||
/run
|
||||
/config/log/{nginx,php} \
|
||||
/config/nginx/site-confs \
|
||||
/run \
|
||||
/var/lib/nginx/tmp/client_body \
|
||||
/var/tmp/nginx
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
# this file allows you to load an nginx webserver
|
||||
# /etc/s6-overlay/s6-rc.d/init-nginx/run
|
||||
/etc/s6-overlay/s6-rc.d/init-nginx/run
|
||||
|
||||
@@ -2,13 +2,22 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# permissions
|
||||
aetherxown -R dockerx:dockerx \
|
||||
/var/lib/nginx \
|
||||
/var/tmp/nginx
|
||||
|
||||
aetherxown -R dockerx:dockerx \
|
||||
/config/keys \
|
||||
/config/log \
|
||||
/config/nginx \
|
||||
/config/php
|
||||
|
||||
aetherxown dockerx:dockerx \
|
||||
/config/www
|
||||
|
||||
chmod -R g+w \
|
||||
/config/nginx
|
||||
|
||||
chmod -R 644 /etc/logrotate.d
|
||||
|
||||
if [[ -f "/config/log/logrotate.status" ]]; then
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# detect nginx configs with dates not matching the provided sample files
|
||||
# active_confs=$(find /config/nginx/ -name "*.conf" -type f 2>/dev/null)
|
||||
active_confs=$(find /config/nginx/ -name "*.conf" -type f 2>/dev/null)
|
||||
|
||||
# for i in ${active_confs}; do
|
||||
# if [ -f "${i}.sample" ]; then
|
||||
# if [ "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}")" != "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}.sample")" ]; then
|
||||
# active_confs_changed="│ $(printf '%10s' "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}" | tr / -)") │ $(printf '%10s' "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}.sample" | tr / -)") │ $(printf '%-70s' "${i}") │\n${active_confs_changed}"
|
||||
# fi
|
||||
# fi
|
||||
# done
|
||||
for i in ${active_confs}; do
|
||||
if [ -f "${i}.sample" ]; then
|
||||
if [ "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}")" != "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}.sample")" ]; then
|
||||
active_confs_changed="│ $(printf '%10s' "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}" | tr / -)") │ $(printf '%10s' "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' "${i}.sample" | tr / -)") │ $(printf '%-70s' "${i}") │\n${active_confs_changed}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# detect site-confs with wrong extension
|
||||
# site_confs_wrong_ext=$(find /config/nginx/site-confs/ -type f -not -name "*.conf" -not -name "*.conf.sample" 2>/dev/null)
|
||||
site_confs_wrong_ext=$(find /config/nginx/site-confs/ -type f -not -name "*.conf" -not -name "*.conf.sample" 2>/dev/null)
|
||||
|
||||
# if [ -n "${site_confs_wrong_ext}" ]; then
|
||||
# echo "**** The following site-confs have extensions other than .conf ****"
|
||||
# echo "**** This may be due to user customization. ****"
|
||||
# echo "**** You should review the files and rename them to use the .conf extension or remove them. ****"
|
||||
# echo "**** nginx.conf will only include site-confs with the .conf extension. ****"
|
||||
# echo -e "${site_confs_wrong_ext}"
|
||||
# fi
|
||||
if [ -n "${site_confs_wrong_ext}" ]; then
|
||||
echo "**** The following site-confs have extensions other than .conf ****"
|
||||
echo "**** This may be due to user customization. ****"
|
||||
echo "**** You should review the files and rename them to use the .conf extension or remove them. ****"
|
||||
echo "**** nginx.conf will only include site-confs with the .conf extension. ****"
|
||||
echo -e "${site_confs_wrong_ext}"
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
if pgrep -f "[n]ginx:" >/dev/null; then
|
||||
echo "Zombie nginx processes detected, sending SIGTERM"
|
||||
pkill -ef [n]ginx:
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if pgrep -f "[n]ginx:" >/dev/null; then
|
||||
echo "Zombie nginx processes still active, sending SIGKILL"
|
||||
pkill -9 -ef [n]ginx:
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# exec /usr/sbin/nginx
|
||||
|
||||
Reference in New Issue
Block a user