Files
docker-heimdall/root/etc/cont-init.d/50-config
2019-07-15 12:22:06 -04:00

40 lines
1.3 KiB
Plaintext

#!/usr/bin/with-contenv bash
# make our folders
mkdir -p \
/config/www/{backgrounds,icons,avatars,SupportedApps} \
/config/log/heimdall
# create symlinks
symlinks=( \
/var/www/localhost/heimdall/storage/app/public/avatars \
/var/www/localhost/heimdall/storage/app/public/backgrounds \
/var/www/localhost/heimdall/storage/app/public/icons \
/var/www/localhost/heimdall/app/SupportedApps \
/var/www/localhost/heimdall/database/app.sqlite \
/var/www/localhost/heimdall/.env )
for i in "${symlinks[@]}"
do
[[ -e "$i" && ! -L "$i" ]] && rm -rf "$i"
[[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i"
done
[[ -e "/var/www/localhost/heimdall/storage/logs/laravel.log" && ! -L "/var/www/localhost/heimdall/storage/logs/laravel.log" ]] \
&& rm -rf "/var/www/localhost/heimdall/storage/logs/laravel.log"
[[ ! -L "/var/www/localhost/heimdall/storage/logs/laravel.log" ]] && \
ln -s "/config/log/heimdall/laravel.log" "/var/www/localhost/heimdall/storage/logs/laravel.log"
# copy .env if not exists
[[ ! -f /config/www/.env ]] && \
cp /var/www/localhost/heimdall/.env.example /config/www/.env && \
php /var/www/localhost/heimdall/artisan key:generate
# set queue driver to database
sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env
# permissions
chown -R abc:abc \
/config \
/var/www/localhost/heimdall