Skip to content

Commit 78d685a

Browse files
committed
Symlink logs and backups outside of www
1 parent 7759d52 commit 78d685a

File tree

1 file changed

+17
-3
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-bookstack-config

1 file changed

+17
-3
lines changed

Diff for: root/etc/s6-overlay/s6-rc.d/init-bookstack-config/run

+17-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
# create directory structure
55
mkdir -p \
6-
/config/www/{uploads,files,images,themes,backups,logs}
6+
/config/www/{uploads,files,images,themes} \
7+
/config/backups \
8+
/config/log/bookstack
79

810
# check for .env and copy default if needed
911
if [[ ! -f "/config/www/.env" ]] || [[ ! -s "/config/www/.env" ]]; then
@@ -13,8 +15,6 @@ fi
1315
# create symlinks
1416
symlinks=(
1517
/app/www/themes
16-
/app/www/storage/backups
17-
/app/www/storage/logs
1818
/app/www/storage/uploads/files
1919
/app/www/storage/uploads/images
2020
/app/www/public/uploads
@@ -30,6 +30,20 @@ for i in "${symlinks[@]}"; do
3030
fi
3131
done
3232

33+
if [[ -e "/app/www/storage/backups" && ! -L "/app/www/storage/backups" ]]; then
34+
rm -rf "/app/www/storage/backups"
35+
fi
36+
if [[ ! -L "/app/www/storage/backups" ]]; then
37+
ln -s "/config/backups" "/app/www/storage/backups"
38+
fi
39+
40+
if [[ -e "/app/www/storage/logs" && ! -L "/app/www/storage/logs" ]]; then
41+
rm -rf "/app/www/storage/logs"
42+
fi
43+
if [[ ! -L "/app/www/storage/logs" ]]; then
44+
ln -s "/config/log/bookstack" "/app/www/storage/logs"
45+
fi
46+
3347
# Echo init finish for test runs
3448
if [ -n "${TEST_RUN}" ]; then
3549
echo '[ls.io-init] done.'

0 commit comments

Comments
 (0)