From b4403d7c37b14a6dd5a4bb20f18d6857b7ff3b92 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Thu, 24 Nov 2022 23:11:37 +0000 Subject: [PATCH 1/2] Remove logrotate and symlink logs --- root/etc/cont-init.d/50-config | 37 +++++++++++++++------------------- root/etc/logrotate.d/heimdall | 9 --------- 2 files changed, 16 insertions(+), 30 deletions(-) delete mode 100644 root/etc/logrotate.d/heimdall diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index c30d046..2ebd554 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -1,8 +1,9 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash # make our folders mkdir -p \ - /config/www/{backgrounds,icons,avatars,SupportedApps} \ + /config/www/{avatars,backgrounds,icons,logs,SupportedApps} \ /app/www \ /config/log/heimdall @@ -20,31 +21,25 @@ if [[ -f /heimdall/heimdall.tar.gz ]]; then fi # create symlinks -symlinks=( \ -/app/www/storage/app/public/avatars \ -/app/www/storage/app/public/backgrounds \ -/app/www/storage/app/public/icons \ -/app/www/app/SupportedApps \ -/app/www/database/app.sqlite \ -/app/www/.env ) +symlinks=( + /app/www/storage/app/public/avatars + /app/www/storage/app/public/backgrounds + /app/www/storage/app/public/icons + /app/www/storage/logs + /app/www/app/SupportedApps + /app/www/database/app.sqlite + /app/www/.env +) -for i in "${symlinks[@]}" -do - if [[ -e "$i" && ! -L "$i" ]]; then - rm -rf "$i" +for i in "${symlinks[@]}"; do + if [[ -e "${i}" && ! -L "${i}" ]]; then + rm -rf "${i}" fi - if [[ ! -L "$i" ]]; then - ln -s /config/www/"$(basename "$i")" "$i" + if [[ ! -L "${i}" ]]; then + ln -s /config/www/"$(basename "${i}")" "${i}" fi done -if [[ -e "/app/www/storage/logs/laravel.log" && ! -L "/app/www/storage/logs/laravel.log" ]]; then - rm -rf "/app/www/storage/logs/laravel.log" -fi -if [[ ! -L "/app/www/storage/logs/laravel.log" ]]; then - ln -s "/config/log/heimdall/laravel.log" "/app/www/storage/logs/laravel.log" -fi - # copy .env if not exists if [[ ! -f /config/www/.env ]]; then cp /app/www/.env.example /config/www/.env diff --git a/root/etc/logrotate.d/heimdall b/root/etc/logrotate.d/heimdall deleted file mode 100644 index f777e6b..0000000 --- a/root/etc/logrotate.d/heimdall +++ /dev/null @@ -1,9 +0,0 @@ -/config/log/heimdall/laravel.log { - size 5M - rotate 5 - compress - nodateext - notifempty - missingok - su abc abc -} \ No newline at end of file From 40f301e5f97c9be62d4ac3088dbdcda6f17b08b4 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Fri, 25 Nov 2022 01:04:24 +0000 Subject: [PATCH 2/2] Spacing --- root/etc/cont-init.d/50-config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 2ebd554..743be7b 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -19,8 +19,8 @@ if [[ -f /heimdall/heimdall.tar.gz ]]; then cp /app/www/storage/app/searchproviders.yaml /app/www/storage/app/searchproviders.yaml.orig chown -R abc:abc /app/www fi -# create symlinks +# create symlinks symlinks=( /app/www/storage/app/public/avatars /app/www/storage/app/public/backgrounds @@ -30,7 +30,6 @@ symlinks=( /app/www/database/app.sqlite /app/www/.env ) - for i in "${symlinks[@]}"; do if [[ -e "${i}" && ! -L "${i}" ]]; then rm -rf "${i}" @@ -46,12 +45,14 @@ if [[ ! -f /config/www/.env ]]; then echo "Creating app key. This may take a while on slower systems" php /app/www/artisan key:generate fi + # copy searchproviders if not exists and symlink if [[ ! -f /config/www/searchproviders.yaml ]]; then cp /app/www/storage/app/searchproviders.yaml.orig /config/www/searchproviders.yaml fi rm -rf /app/www/storage/app/searchproviders.yaml ln -s /config/www/searchproviders.yaml /app/www/storage/app/searchproviders.yaml + # set queue driver to database sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env