From 669f5b14475edd28c8b4e7422696a53358f951cf Mon Sep 17 00:00:00 2001 From: hvmzx Date: Sat, 10 Aug 2024 21:40:22 +0200 Subject: [PATCH] feat: now using MOD_VERSION check --- Dockerfile | 13 +++++++++---- README.md | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b945557..1414a0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,17 +3,22 @@ ## Buildstage ## FROM ghcr.io/linuxserver/baseimage-alpine:3.19 AS buildstage +ARG MOD_VERSION + RUN curl -L https://archive.org/download/kindlegen_linux_2_6_i386_v2_9/kindlegen_linux_2.6_i386_v2_9.tar.gz > kindlegen.tar.gz RUN tar -zxvf kindlegen.tar.gz kindlegen RUN chmod +rwx 'kindlegen' RUN rm kindlegen.tar.gz -RUN latest_tag=$(curl -s https://api.github.com/repos/ciromattia/kcc/releases/latest | jq -rc ".tag_name") && \ - curl -L https://github.com/ciromattia/kcc/archive/refs/tags/$latest_tag.tar.gz > kcc.tar.gz && \ +RUN \ + if [ -z ${MOD_VERSION+x} ]; then \ + MOD_VERSION=$(curl -s https://api.github.com/repos/ciromattia/kcc/releases/latest | jq -rc ".tag_name"); \ + fi; \ + curl -L https://github.com/ciromattia/kcc/archive/refs/tags/${MOD_VERSION}.tar.gz > kcc.tar.gz && \ tar -xzf kcc.tar.gz && \ - mv kcc-$(echo "$latest_tag" | sed 's/^.\(.*\)/\1/') kcc && \ + mv kcc-$(echo "${MOD_VERSION}" | sed 's/^.\(.*\)/\1/') kcc && \ touch kcc/KCC_VERSION && \ - echo $latest_tag > kcc/KCC_VERSION && \ + echo ${MOD_VERSION} > kcc/KCC_VERSION && \ mkdir -p /root-layer/usr/local/bin && \ mv kindlegen /root-layer/usr/local/bin/ && \ mv kcc /root-layer/usr/local/bin/ diff --git a/README.md b/README.md index 65cb3fd..f825649 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# kcc - Docker mod for Calibre Web +# KCC (Kindle Comic Converter) - Docker mod for Calibre Web -This mod adds kcc and its multitude of ebook processing (upscale, stretch, right to left for manga...) to Calibre Web, to be installed/updated during container start. +This mod adds KCC and its multitude of ebook processing (upscale, stretch, right to left for manga...) to Calibre Web, to be installed/updated during container start. In any container docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:calibre-web-kcc`