Skip to content

Commit 69aab19

Browse files
authored
set kepubify path automatically
1 parent 41d74be commit 69aab19

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ RUN \
3030
libxi6 \
3131
libxslt1.1 \
3232
python3-venv \
33+
sqlite3 \
3334
xdg-utils && \
3435
echo "**** install calibre-web ****" && \
3536
if [ -z ${CALIBREWEB_COMMIT+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_COMMIT+x} ]; then \

readme-vars.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ app_setup_block: |
5858
This optional layer will be rebuilt automatically on our CI pipeline upon new Calibre releases so you can stay up to date.
5959
To use this option add the optional environmental variable as shown in the docker-mods section to pull an addition docker layer to enable ebook conversion and then in the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Calibre E-Book Converter** to `/usr/bin/ebook-convert` on versions 0.6.21 and lower. For 0.6.22 and higher, set the directory, `/usr/bin/` only.
6060
61-
This image contains the [kepubify](https://pgaskin.net/kepubify/) ebook conversion tool (MIT License) to convert epub to kepub. In the Calibre-Web admin page (Basic Configuration:External Binaries) set the **Path to Kepubify E-Book Converter** to `/usr/bin/kepubify`
61+
This image contains the [kepubify](https://pgaskin.net/kepubify/) ebook conversion tool (MIT License) to convert epub to kepub.
6262
# init diagram
6363
init_diagram: |
6464
"calibre-web:nightly": {
@@ -100,6 +100,7 @@ init_diagram: |
100100
"calibre-web:nightly" <- Base Images
101101
# changelog
102102
changelogs:
103+
- {date: "07.01.25:", desc: "Set kepubify path by default."}
103104
- {date: "05.12.24:", desc: "Rebase to noble."}
104105
- {date: "26.08.24:", desc: "Add new dep, xdg-utils."}
105106
- {date: "07.07.24:", desc: "Add new dep, libmagic1."}

root/defaults/app.db

-80 KB
Binary file not shown.

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,21 @@ mkdir -p /app/calibre-web/cps/cache
2222
lsiown -R abc:abc \
2323
/config \
2424
/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)