mirror of
https://github.com/linuxserver/docker-bookstack.git
synced 2026-02-20 02:30:30 +08:00
Merge pull request #196 from linuxserver/init-fix
Symlink all logs to avoid defer error on new install
This commit is contained in:
commit
586c3d8751
@ -3,7 +3,9 @@
|
||||
|
||||
# create directory structure
|
||||
mkdir -p \
|
||||
/config/www/{uploads,files,images,themes,backups}
|
||||
/config/www/{uploads,files,images,themes} \
|
||||
/config/backups \
|
||||
/config/log/bookstack
|
||||
|
||||
# check for .env and copy default if needed
|
||||
if [[ ! -f "/config/www/.env" ]] || [[ ! -s "/config/www/.env" ]]; then
|
||||
@ -13,12 +15,10 @@ fi
|
||||
# create symlinks
|
||||
symlinks=(
|
||||
/app/www/themes
|
||||
/app/www/storage/backups
|
||||
/app/www/storage/uploads/files
|
||||
/app/www/storage/uploads/images
|
||||
/app/www/public/uploads
|
||||
/app/www/.env
|
||||
/app/www/storage/logs/laravel.log
|
||||
)
|
||||
|
||||
for i in "${symlinks[@]}"; do
|
||||
@ -30,6 +30,20 @@ for i in "${symlinks[@]}"; do
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -e "/app/www/storage/backups" && ! -L "/app/www/storage/backups" ]]; then
|
||||
rm -rf "/app/www/storage/backups"
|
||||
fi
|
||||
if [[ ! -L "/app/www/storage/backups" ]]; then
|
||||
ln -s "/config/backups" "/app/www/storage/backups"
|
||||
fi
|
||||
|
||||
if [[ -e "/app/www/storage/logs" && ! -L "/app/www/storage/logs" ]]; then
|
||||
rm -rf "/app/www/storage/logs"
|
||||
fi
|
||||
if [[ ! -L "/app/www/storage/logs" ]]; then
|
||||
ln -s "/config/log/bookstack" "/app/www/storage/logs"
|
||||
fi
|
||||
|
||||
# Echo init finish for test runs
|
||||
if [ -n "${TEST_RUN}" ]; then
|
||||
echo '[ls.io-init] done.'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user