55rm -rf /etc/ImageMagick-6/policy.xml
66ln -s /defaults/policy.xml /etc/ImageMagick-6/policy.xml
77
8- # handle app.db updates for kepubify and ext binary path
9- # borrowed from crocodilestick because it's a better solution than what i was doing
10- sqlite3 /config/app.db <<EOS
11- update settings set config_kepubifypath='/usr/bin/kepubify', config_binariesdir='/usr/bin';
12- EOS
13-
14- if [[ $? == 0 ]]
15- then
16- echo "Successfully set binary paths in '/config/app.db'!"
17- elif [[ $? > 0 ]]
18- then
19- echo "Could not set binary paths for '/config/app.db' (see errors above)."
20- fi
21-
228# create Google drive client_secrets.json file
239if [[ ! -f /config/client_secrets.json ]]; then
2410 echo "{}" > /config/client_secrets.json
@@ -36,3 +22,21 @@ mkdir -p /app/calibre-web/cps/cache
3622lsiown -R abc:abc \
3723 /config \
3824 /app/calibre-web/cps/cache
25+
26+ export CALIBRE_DBPATH=/config
27+
28+ if [[ ! -f /config/app.db ]]; then
29+ echo "First time run, creating app.db..."
30+ cd /app/calibre-web && s6-setuidgid abc python3 /app/calibre-web/cps.py -d > /dev/null 2>&1
31+ # handle app.db updates for kepubify and ext binary path
32+ # borrowed from crocodilestick because it's a better solution than what i was doing
33+ sqlite3 /config/app.db <<EOS
34+ update settings set config_kepubifypath='/usr/bin/kepubify' where config_kepubifypath is NULL or LENGTH(config_kepubifypath)=0;
35+ EOS
36+
37+ if [[ $? == 0 ]]; then
38+ echo "Successfully set kepubify paths in '/config/app.db'!"
39+ elif [[ $? > 0 ]]; then
40+ echo "Could not set binary paths for '/config/app.db' (see errors above)."
41+ fi
42+ fi
0 commit comments