Merge pull request #111 from linuxserver/master-logs

Remove logrotate and symlink logs
This commit is contained in:
KodeStar
2022-11-25 15:10:38 +00:00
committed by GitHub
2 changed files with 19 additions and 32 deletions

View File

@@ -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
@@ -18,45 +19,40 @@ 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
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 )
for i in "${symlinks[@]}"
do
if [[ -e "$i" && ! -L "$i" ]]; then
rm -rf "$i"
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}"
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
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

View File

@@ -1,9 +0,0 @@
/config/log/heimdall/laravel.log {
size 5M
rotate 5
compress
nodateext
notifempty
missingok
su abc abc
}