diff --git a/Dockerfile b/Dockerfile index 70f267c..ed6628c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ RUN \ apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ - git \ libldap2-dev \ libsasl2-dev \ python3-dev && \ @@ -51,14 +50,15 @@ RUN \ /app/calibre-web --strip-components=1 && \ cd /app/calibre-web && \ pip3 install --no-cache-dir -U \ - pip wheel && \ - pip install --no-cache-dir -U --ignore-installed --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \ + pip \ + wheel && \ + pip3 install --no-cache-dir -U --ignore-installed --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \ requirements.txt -r \ optional-requirements.txt && \ echo "***install kepubify" && \ if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /usr/bin/kepubify -L \ @@ -66,7 +66,6 @@ RUN \ echo "**** cleanup ****" && \ apt-get -y purge \ build-essential \ - git \ libldap2-dev \ libsasl2-dev \ python3-dev && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index e85aedf..da3f284 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -15,7 +15,6 @@ RUN \ apt-get install -y --no-install-recommends \ build-essential \ cmake \ - git \ libffi-dev \ libjpeg-dev \ libldap2-dev \ @@ -56,14 +55,15 @@ RUN \ /app/calibre-web --strip-components=1 && \ cd /app/calibre-web && \ pip3 install --no-cache-dir -U \ - pip wheel && \ - pip install --no-cache-dir -U --ignore-installed --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \ + pip \ + wheel && \ + pip3 install --no-cache-dir -U --ignore-installed --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \ requirements.txt -r \ optional-requirements.txt && \ echo "***install kepubify" && \ if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /usr/bin/kepubify -L \ @@ -72,7 +72,6 @@ RUN \ apt-get -y purge \ build-essential \ cmake \ - git \ libffi-dev \ libjpeg-dev \ libldap2-dev \ diff --git a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run index 2f7e18f..ade464b 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run @@ -1,47 +1,24 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash # create symlinks for imagemagick policy.xml rm -rf /etc/ImageMagick-6/policy.xml ln -s /defaults/policy.xml /etc/ImageMagick-6/policy.xml -# create symlinks for database and log -if [[ ! -f /config/app.db ]] && [[ -f /app/calibre-web/app.db ]]; then - cp /defaults/app.db /config/app.db -fi -rm -rf /app/calibre-web/app.db -ln -s /config/app.db /app/calibre-web/app.db - -# create symlinks for log -if [[ ! -f /config/calibre-web.log ]]; then - touch /config/calibre-web.log -fi -rm -rf /app/calibre-web/calibre-web.log -ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log - # create Google drive client_secrets.json file if [[ ! -f /config/client_secrets.json ]]; then echo "{}" > /config/client_secrets.json fi -rm -rf /app/calibre-web/client_secrets.json -ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json - -# create Google drive symlinks for database -if [[ ! -f /config/gdrive.db ]] && [[ -f /app/calibre-web/gdrive.db ]]; then - cp /app/calibre-web/gdrive.db /config/gdrive.db -fi -rm -rf /app/calibre-web/gdrive.db -ln -s /config/gdrive.db /app/calibre-web/gdrive.db # check if kepubify is present and if so make executable if [[ -f /usr/bin/kepubify ]] && [[ ! -x /usr/bin/kepubify ]]; then chmod +x /usr/bin/kepubify fi -# Symlink logfiles -if [[ ! -L "/app/calibre-web/calibre-web.log" ]]; then - ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log -fi +# Pre-stage some files & directories for permissions purposes +mkdir -p /app/calibre-web/cps/cache # permissions -chown -R abc:abc \ - /config +lsiown -R abc:abc \ + /config \ + /app/calibre-web/cps/cache diff --git a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/type b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/type index 3d92b15..bdd22a1 100644 --- a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/type +++ b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/type @@ -1 +1 @@ -oneshot \ No newline at end of file +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/up b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/up index 7a022ec..ceac1e2 100644 --- a/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/up +++ b/root/etc/s6-overlay/s6-rc.d/init-calibre-web-config/up @@ -1 +1 @@ -/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run \ No newline at end of file +/etc/s6-overlay/s6-rc.d/init-calibre-web-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/notification-fd index e440e5c..00750ed 100644 --- a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/notification-fd +++ b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/notification-fd @@ -1 +1 @@ -3 \ No newline at end of file +3 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/run b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/run index 3a24191..79f812f 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/run @@ -1,4 +1,7 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash + +export CALIBRE_DBPATH=/config exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8083" \ diff --git a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/type b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/type index 1780f9f..5883cff 100644 --- a/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/type +++ b/root/etc/s6-overlay/s6-rc.d/svc-calibre-web/type @@ -1 +1 @@ -longrun \ No newline at end of file +longrun