Skip to content

Commit 524fe87

Browse files
authored
fixes after a bunch of local tests
1 parent cf9514a commit 524fe87

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ RUN \
2929
libxi6 \
3030
libxslt1.1 \
3131
python3-venv \
32+
sqlite3 \
3233
xdg-utils && \
3334
echo "**** install calibre-web ****" && \
3435
if [ -z ${CALIBREWEB_RELEASE+x} ]; then \

Dockerfile.aarch64

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ RUN \
3535
libxi6 \
3636
libxslt1.1 \
3737
python3-venv \
38+
sqlite3 \
3839
xdg-utils && \
3940
echo "**** install calibre-web ****" && \
4041
if [ -z ${CALIBREWEB_RELEASE+x} ]; then \

root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,6 @@
55
rm -rf /etc/ImageMagick-6/policy.xml
66
ln -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
239
if [[ ! -f /config/client_secrets.json ]]; then
2410
echo "{}" > /config/client_secrets.json
@@ -36,3 +22,21 @@ mkdir -p /app/calibre-web/cps/cache
3622
lsiown -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

Comments
 (0)