docker-calibre-web/root/etc/cont-init.d/30-config
chbmb 63a4fcaacc Change to release based tagging
Rebase on Ubuntu baseimage.
2019-06-02 15:42:37 +01:00

31 lines
981 B
Plaintext

#!/usr/bin/with-contenv bash
# create symlinks for database and log
[[ ! -f /config/app.db ]] && \
cp /defaults/app.db /config/app.db
[[ -f /app/calibre-web/app.db ]] && \
rm /app/calibre-web/app.db
[[ ! -L /app/calibre-web/app.db ]] && \
ln -s /config/app.db /app/calibre-web/app.db
# create symlinks for log
[[ ! -f /config/calibre-web.log ]] && \
touch /config/calibre-web.log
[[ -f /app/calibre-web/calibre-web.log ]] && \
rm /app/calibre-web/calibre-web.log
[[ ! -L /app/calibre-web/calibre-web.log ]] && \
ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log
# Google Drive Integration
[[ ! -f /config/client_secrets.json ]] && \
echo "{}" > /config/client_secrets.json
[[ -f /app/calibre-web/client_secrets.json ]] &&
rm /app/calibre-web/client_secrets.json
[[ ! -L /app/calibre-web/client_secrets.json ]] &&
ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json
# permissions
chown -R abc:abc \
/config \
/app/calibre-web