Skip to content

Commit 1bd0247

Browse files
committed
Merge remote-tracking branch 'upstream/main' into koreader-sync
2 parents 70e2b51 + 2756bde commit 1bd0247

32 files changed

+1105
-562
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Enforce LF for all shell scripts and related files
2+
*.sh text eol=lf
3+
*.bash text eol=lf
4+
*.env text eol=lf
5+
*.conf text eol=lf
6+
Dockerfile text eol=lf
7+
*.yml text eol=lf
8+
**/run text eol=lf

.github/workflows/dockerhub-build-push-on-push.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,61 @@
11
name: Build & Push - Dev
2-
# Automatically builds and pushes a multi-platform dev image based on commits involving key files
2+
# Automatically builds and pushes a multi-platform dev image based on commits involving key files in any branch
33

44
on:
55
push:
6+
branches:
7+
- '**' # Runs on pushes to any branch
68
paths:
79
- 'empty_library/**'
810
- 'root/**'
911
- 'scripts/**'
1012
- '**/Dockerfile'
13+
create:
14+
branches:
15+
- '**' # Runs when a new branch is created
1116

1217
jobs:
1318
build:
1419
runs-on: ubuntu-latest
20+
if: github.event.ref_type == 'branch' || github.event_name == 'push' # Ensures it runs for branch creation & push events
1521

1622
steps:
17-
- uses: actions/checkout@v4
23+
- name: Checkout correct branch
24+
uses: actions/checkout@v4
25+
with:
26+
ref: ${{ github.ref }}
27+
28+
- name: Determine Docker Image Tag
29+
id: tag
30+
run: |
31+
if [[ "${{ github.ref_name }}" == "main" ]]; then
32+
echo "IMAGE_TAG=dev" >> $GITHUB_ENV
33+
else
34+
echo "IMAGE_TAG=dev-${{ github.ref_name }}" >> $GITHUB_ENV
35+
fi
1836
1937
- name: DockerHub Login
2038
uses: docker/login-action@v3
2139
with:
2240
username: ${{ secrets.DOCKERHUB_USERNAME }}
2341
password: ${{ secrets.DOCKERHUB_PA_TOKEN }}
2442

43+
- name: Install QEMU
44+
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
45+
2546
- name: Set up Docker Buildx
2647
uses: docker/setup-buildx-action@v3
2748

2849
- name: Build and push Docker image
2950
uses: docker/build-push-action@v6
3051
with:
52+
provenance: false # Disable provenance metadata to fix BuildKit issues
3153
context: .
3254
file: ./Dockerfile
3355
push: true
3456
build-args: |
3557
BUILD_DATE=${{ github.event.repository.updated_at }}
36-
VERSION=${{ vars.CURRENT_DEV_VERSION }}-DEV_BUILD-${{ vars.CURRENT_DEV_BUILD_NUM }}
58+
VERSION=${{ vars.CURRENT_DEV_VERSION }}-DEV_BUILD-${{ env.IMAGE_TAG }}-${{ vars.CURRENT_DEV_BUILD_NUM }}
3759
tags: |
3860
${{ secrets.DOCKERHUB_USERNAME }}/calibre-web-automated:dev
3961

Dockerfile

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ ARG BUILD_DATE
2727
ARG VERSION
2828
ARG CALIBREWEB_RELEASE=0.6.24
2929
ARG LSCW_RELEASE=0.6.24-ls304
30-
ARG UNIVERSAL_CALIBRE_RELEASE=7.16.0
30+
ARG CALIBRE_RELEASE=8.4.0
31+
ARG KEPUBIFY_RELEASE=v4.0.4
3132
LABEL build_version="Version:- ${VERSION}"
3233
LABEL build_date="${BUILD_DATE}"
3334
LABEL CW-Stock-version="${CALIBREWEB_RELEASE}"
@@ -88,15 +89,21 @@ RUN \
8889
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \
8990
requirements.txt -r \
9091
optional-requirements.txt && \
91-
# STEP 1.8 - Installs the latest release of kepubify
92-
echo "***install kepubify" && \
93-
if [ -z ${KEPUBIFY_RELEASE+x} ]; then \
92+
# STEP 1.8 - Installs kepubify
93+
echo "**** install kepubify ****" && \
94+
if [[ $KEPUBIFY_RELEASE == 'newest' ]]; then \
9495
KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \
9596
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
9697
fi && \
97-
curl -o \
98-
/usr/bin/kepubify -L \
99-
https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit && \
98+
if [ "$(uname -m)" == "x86_64" ]; then \
99+
curl -o \
100+
/usr/bin/kepubify -L \
101+
https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit; \
102+
elif [ "$(uname -m)" == "aarch64" ]; then \
103+
curl -o \
104+
/usr/bin/kepubify -L \
105+
https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-arm64; \
106+
fi && \
100107
# STEP 2 - Install Calibre-Web Automated
101108
echo "~~~~ CWA Install - installing additional required packages ~~~~" && \
102109
# STEP 2.1 - Install additional required packages
@@ -157,28 +164,31 @@ RUN \
157164
libxdamage1 \
158165
libgl1 \
159166
libglx-mesa0 \
160-
xz-utils && \
167+
xz-utils \
168+
binutils && \
161169
# STEP 3.2 - Make the /app/calibre directory for the installed files
162170
mkdir -p \
163171
/app/calibre && \
164-
# STEP 3.3 - Download the desired version of Calibre, determined by the UNIVERSAL_CALIBRE_RELEASE variable and the architecture of the build environment
172+
# STEP 3.3 - Download the desired version of Calibre, determined by the CALIBRE_RELEASE variable and the architecture of the build environment
165173
if [ "$(uname -m)" == "x86_64" ]; then \
166174
curl -o \
167175
/calibre.txz -L \
168-
"https://download.calibre-ebook.com/${UNIVERSAL_CALIBRE_RELEASE}/calibre-${UNIVERSAL_CALIBRE_RELEASE}-x86_64.txz"; \
176+
"https://download.calibre-ebook.com/${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE}-x86_64.txz"; \
169177
elif [ "$(uname -m)" == "aarch64" ]; then \
170178
curl -o \
171179
/calibre.txz -L \
172-
"https://download.calibre-ebook.com/${UNIVERSAL_CALIBRE_RELEASE}/calibre-${UNIVERSAL_CALIBRE_RELEASE}-arm64.txz"; \
180+
"https://download.calibre-ebook.com/${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE}-arm64.txz"; \
173181
fi && \
174182
# STEP 3.4 - Extract the downloaded file to /app/calibre
175183
tar xf \
176184
/calibre.txz -C \
177185
/app/calibre && \
186+
# STEP 3.4.1 - Remove the ABI tag from the extracted libQt6* files to allow them to be used on older kernels
187+
strip --remove-section=.note.ABI-tag /app/calibre/lib/libQt6* && \
178188
# STEP 3.5 - Delete the extracted calibre.txz to save space in final image
179189
rm /calibre.txz && \
180-
# STEP 3.6 - Store the UNIVERSAL_CALIBRE_RELEASE in the root of the image in CALIBRE_RELEASE
181-
echo $UNIVERSAL_CALIBRE_RELEASE > /CALIBRE_RELEASE
190+
# STEP 3.6 - Store the CALIBRE_RELEASE in the root of the image in CALIBRE_RELEASE
191+
echo $CALIBRE_RELEASE > /CALIBRE_RELEASE
182192

183193
# Removes packages that are no longer required, also emptying dirs used to build the image that are no longer needed
184194
RUN \
@@ -202,4 +212,4 @@ COPY --from=unrar /usr/bin/unrar-ubuntu /usr/bin/unrar
202212
EXPOSE 8083
203213
VOLUME /config
204214
VOLUME /cwa-book-ingest
205-
VOLUME /calibre-library
215+
VOLUME /calibre-library

Dockerfile_calibre_not_included

Lines changed: 0 additions & 166 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ And just like that, Calibre-Web Automated should be up and running! **HOWEVER**
277277

278278
## _Calibre-Web Quick Start Guide_
279279

280-
1. Open your browser and navigate to http://localhost:8084 or http://localhost:8084/opds for the OPDS catalog
280+
1. Open your browser and navigate to http://localhost:8083 or http://localhost:8083/opds for the OPDS catalog
281281
2. Log in with the default admin credentials (_below_)
282282
3. Configure your Calibre-Web Automated instance via the Admin Page
283283
- A guide to what all of the stock CW Settings do can be found [here](https://github.com/janeczku/calibre-web/wiki/Configuration#basic-configuration)
@@ -363,4 +363,4 @@ Check out [Post-Install Tasks Here](#post-install-tasks) when necessary.
363363

364364
- CWA is really lucky to have a very passionate and active community of people that really help shape CWA into what it is today
365365
- If you have any ideas or want to contribute to the project, you're more than welcome to! We accept anyone regardless of skill level of expertise!
366-
- If you've got a good idea or want to simply suggest improvements, simply get in touch with us on the Discord Server [here](https://discord.gg/EjgSeek94R)!
366+
- If you've got a good idea or want to simply suggest improvements, simply get in touch with us on the Discord Server [here](https://discord.gg/EjgSeek94R)!

root/app/calibre-web/cps/admin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ def reconnect():
190190

191191

192192
@admi.route("/ajax/updateThumbnails", methods=['POST'])
193-
@admin_required
194193
@user_login_required
194+
@admin_required
195195
def update_thumbnails():
196196
content = config.get_scheduled_task_settings()
197197
if content['schedule_generate_book_covers']:
@@ -1870,6 +1870,10 @@ def _configuration_update_helper():
18701870
services.goodreads_support.connect(config.config_goodreads_api_key,
18711871
config.config_use_goodreads)
18721872

1873+
# Hardcover configuration
1874+
_config_checkbox(to_save, "config_use_hardcover")
1875+
_config_string(to_save, "config_hardcover_token")
1876+
18731877
_config_int(to_save, "config_updatechannel")
18741878

18751879
# Reverse proxy login configuration

root/app/calibre-web/cps/config_sql.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class _Settings(_Base):
118118

119119
config_use_goodreads = Column(Boolean, default=False)
120120
config_goodreads_api_key = Column(String)
121+
config_hardcover_token = Column(String)
122+
121123
config_register_email = Column(Boolean, default=False)
122124
config_login_type = Column(Integer, default=0)
123125

0 commit comments

Comments
 (0)