chore: add Docker build config, scripts, and private registry setup
CI build / Validate Gradle Wrapper (push) Successful in 2m30s
CI build / jlink (linux-x64, ubuntu-latest) (push) Failing after 1m12s
CI build / Build Jar (push) Failing after 2m18s
CI build / jlink (macOS-arm64, macos-15) (push) Has been cancelled
CI build / jlink (macOS-x64, macos-15-intel) (push) Has been cancelled
CI build / jlink (windows-x64, windows-latest) (push) Has been cancelled
CI build / Make linux-assets release (push) Has been cancelled
CI build / Make appimage release (push) Has been cancelled
CI build / Make debian-all release (push) Has been cancelled
CI build / Make linux-x64 release (push) Has been cancelled
CI build / Make macOS-arm64 release (push) Has been cancelled
CI build / Make macOS-x64 release (push) Has been cancelled
CI build / Make windows-x64 release (push) Has been cancelled
CI build / release (push) Has been cancelled
CI build / Validate Gradle Wrapper (push) Successful in 2m30s
CI build / jlink (linux-x64, ubuntu-latest) (push) Failing after 1m12s
CI build / Build Jar (push) Failing after 2m18s
CI build / jlink (macOS-arm64, macos-15) (push) Has been cancelled
CI build / jlink (macOS-x64, macos-15-intel) (push) Has been cancelled
CI build / jlink (windows-x64, windows-latest) (push) Has been cancelled
CI build / Make linux-assets release (push) Has been cancelled
CI build / Make appimage release (push) Has been cancelled
CI build / Make debian-all release (push) Has been cancelled
CI build / Make linux-x64 release (push) Has been cancelled
CI build / Make macOS-arm64 release (push) Has been cancelled
CI build / Make macOS-x64 release (push) Has been cancelled
CI build / Make windows-x64 release (push) Has been cancelled
CI build / release (push) Has been cancelled
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+105
@@ -0,0 +1,105 @@
|
||||
FROM eclipse-temurin:25.0.3_9-jdk-noble AS build
|
||||
|
||||
ARG TACHIDESK_ABORT_HANDLER_DOWNLOAD_URL
|
||||
|
||||
# build abort handler
|
||||
RUN if [ -n "$TACHIDESK_ABORT_HANDLER_DOWNLOAD_URL" ]; then \
|
||||
apt-get update && \
|
||||
apt-get -y install -y curl gcc && \
|
||||
cd /tmp && \
|
||||
curl "$TACHIDESK_ABORT_HANDLER_DOWNLOAD_URL" -O && \
|
||||
gcc -fPIC -I$JAVA_HOME/include -I$JAVA_HOME/include/linux -shared catch_abort.c -lpthread -o /opt/catch_abort.so && \
|
||||
rm -f catch_abort.c && \
|
||||
apt-get -y purge gcc --auto-remove && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* || exit 1; \
|
||||
fi
|
||||
|
||||
# Build the server jar from source
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN GRADLE_OPTS="-Xmx4g" ./gradlew :server:shadowJar --no-daemon -x test
|
||||
|
||||
FROM eclipse-temurin:25.0.3_9-jre-noble
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ARG TACHIDESK_KCEF=n # y or n, leave empty for auto-detection
|
||||
ARG TACHIDESK_KCEF_RELEASE_URL
|
||||
|
||||
# Install envsubst from GNU's gettext project
|
||||
# install unzip to unzip the server-reference.conf from the jar
|
||||
# Install tini for a tiny init system (handles orphan processes for graceful restart)
|
||||
RUN apt-get update && \
|
||||
apt-get -y install -y curl gettext-base unzip tini ca-certificates p11-kit && \
|
||||
/usr/bin/p11-kit extract --format=java-cacerts --filter=certificates --overwrite --purpose server-auth $JAVA_HOME/lib/security/cacerts && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY scripts/kcef_download.sh /root/kcef_download.sh
|
||||
RUN chmod +x /root/kcef_download.sh
|
||||
|
||||
# install CEF dependencies
|
||||
RUN if [ "$TACHIDESK_KCEF" = "y" ] || ([ "$TACHIDESK_KCEF" = "" ] && ([ "$TARGETPLATFORM" = "linux/amd64" ] || [ "$TARGETPLATFORM" = "linux/arm64" ])); then \
|
||||
apt-get update && \
|
||||
apt-get -y install --no-install-recommends -y libxss1 libxext6 libxrender1 libxcomposite1 libxdamage1 libxkbcommon0 libxtst6 \
|
||||
libjogl2-jni libgluegen2-jni libglib2.0-0t64 libnss3 libdbus-1-3 libpango-1.0-0 libcairo2 libasound2t64 \
|
||||
libatk-bridge2.0-0t64 libcups2t64 libdrm2 libgbm1 xvfb \
|
||||
curl jq gawk findutils && \
|
||||
/root/kcef_download.sh "$TACHIDESK_KCEF_RELEASE_URL" "$TARGETPLATFORM" && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* || exit 1; \
|
||||
fi
|
||||
|
||||
COPY --from=build /opt/*.so /opt/
|
||||
|
||||
# Create a user to run as
|
||||
# .X11-unix must be created by root
|
||||
# Ubuntu exposes libgluegen_rt.so as libgluegen2_rt.so for some reason, so rename it
|
||||
# JCEF (or Java?) also does not search /usr/lib/jni, so copy them over into one it will search
|
||||
RUN userdel -r ubuntu && \
|
||||
groupadd --gid 1000 suwayomi && \
|
||||
useradd --uid 1000 --gid suwayomi --no-log-init -G audio,video suwayomi && \
|
||||
mkdir -p /home/suwayomi/.local/share/Tachidesk && \
|
||||
if command -v Xvfb; then \
|
||||
mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix && \
|
||||
cp /usr/lib/jni/libgluegen2_rt.so /home/suwayomi/libgluegen_rt.so && \
|
||||
cp /usr/lib/jni/*.so /home/suwayomi/; \
|
||||
fi
|
||||
|
||||
COPY scripts/create_server_conf.sh /home/suwayomi/create_server_conf.sh
|
||||
COPY scripts/startup_script.sh /home/suwayomi/startup_script.sh
|
||||
RUN chmod +x /home/suwayomi/create_server_conf.sh /home/suwayomi/startup_script.sh
|
||||
|
||||
# Copy locally built jar; grant o+rwx so non-default UIDs can write server.conf
|
||||
RUN mkdir -p /home/suwayomi/startup
|
||||
COPY --from=build /app/server/build/*.jar /home/suwayomi/startup/tachidesk_latest.jar
|
||||
RUN chmod 777 -R /home/suwayomi && \
|
||||
chown -R suwayomi:suwayomi /home/suwayomi
|
||||
|
||||
ARG BUILD_DATE
|
||||
ARG TACHIDESK_RELEASE_TAG
|
||||
ARG TACHIDESK_FILENAME
|
||||
ARG TACHIDESK_DOCKER_GIT_COMMIT
|
||||
LABEL maintainer="suwayomi" \
|
||||
org.opencontainers.image.title="Suwayomi Docker" \
|
||||
org.opencontainers.image.authors="https://github.com/suwayomi" \
|
||||
org.opencontainers.image.url="https://github.com/suwayomi/docker-tachidesk/pkgs/container/tachidesk" \
|
||||
org.opencontainers.image.source="https://github.com/suwayomi/docker-tachidesk" \
|
||||
org.opencontainers.image.description="This image is used to start suwayomi server in a container" \
|
||||
org.opencontainers.image.vendor="suwayomi" \
|
||||
org.opencontainers.image.created=$BUILD_DATE \
|
||||
org.opencontainers.image.version=$TACHIDESK_RELEASE_TAG \
|
||||
tachidesk.docker_commit=$TACHIDESK_DOCKER_GIT_COMMIT \
|
||||
tachidesk.release_tag=$TACHIDESK_RELEASE_TAG \
|
||||
tachidesk.filename=$TACHIDESK_FILENAME \
|
||||
org.opencontainers.image.licenses="MPL-2.0"
|
||||
|
||||
ENV HOME=/home/suwayomi
|
||||
WORKDIR /home/suwayomi
|
||||
USER suwayomi
|
||||
EXPOSE 4567
|
||||
|
||||
ENTRYPOINT ["tini", "--"]
|
||||
CMD ["/home/suwayomi/startup_script.sh"]
|
||||
|
||||
# vim: set ft=dockerfile:
|
||||
@@ -0,0 +1,71 @@
|
||||
---
|
||||
services:
|
||||
suwayomi:
|
||||
build: .
|
||||
platform: linux/amd64
|
||||
image: registry.achmad.dev/suwayomi-server:latest
|
||||
# user: 1000:1000
|
||||
environment:
|
||||
- TZ=${TZ:-Etc/UTC} # Add a TZ variable to .env to change it
|
||||
- DATABASE_TYPE=POSTGRESQL
|
||||
- DATABASE_URL=postgresql://postgresql:5432/${POSTGRES_DB}
|
||||
- DATABASE_USERNAME=${POSTGRES_USER}
|
||||
- DATABASE_PASSWORD=${POSTGRES_PASSWORD}
|
||||
# - USE_HIKARI_CONNECTION_POOL=false # Hikari Connection Pool can cause issues with some installations, but it is much more performant.
|
||||
# Comment these out if you do not use the flaresolverr container at the bottom of this file
|
||||
- FLARESOLVERR_ENABLED=true
|
||||
- FLARESOLVERR_URL=http://flaresolverr:8191
|
||||
# #################################################################################################
|
||||
#
|
||||
# !!! IMPORTANT !!!
|
||||
# - server settings can be changed during runtime in the WebUI
|
||||
# - providing an environment variable will OVERWRITE the current setting value when starting the container
|
||||
#
|
||||
# #################################################################################################
|
||||
#
|
||||
# example for setting env vars:
|
||||
#
|
||||
# - BIND_IP=0.0.0.0
|
||||
# - BIND_PORT=4567
|
||||
# - SOCKS_PROXY_ENABLED=false
|
||||
# - DOWNLOAD_AS_CBZ=true
|
||||
# - AUTH_MODE=basic_auth
|
||||
# - AUTH_USERNAME=manga
|
||||
# - AUTH_PASSWORD=hello123
|
||||
# - EXTENSION_REPOS=["http://github.com/orginazation-name/repo-name", "http://github.com/orginazation-name-2/repo-name-2"]
|
||||
depends_on:
|
||||
postgresql:
|
||||
condition: service_healthy
|
||||
restart: true
|
||||
volumes:
|
||||
- ./data:/home/suwayomi/.local/share/Tachidesk
|
||||
ports:
|
||||
- "4567:4567"
|
||||
restart: on-failure:3
|
||||
|
||||
postgresql:
|
||||
image: postgres:18.3
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- PGDATA=/data/postgres
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- TZ=${TZ:-Etc/UTC}
|
||||
- PGTZ=${TZ:-Etc/UTC}
|
||||
volumes:
|
||||
- ./postgres:/data/postgres
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
flaresolverr:
|
||||
image: ghcr.io/thephaseless/byparr:latest
|
||||
container_name: flaresolverr
|
||||
init: true
|
||||
environment:
|
||||
- TZ=${TZ:-Etc/UTC}
|
||||
restart: unless-stopped
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
services:
|
||||
suwayomi:
|
||||
build: .
|
||||
platform: linux/amd64
|
||||
image: registry.achmad.dev/suwayomi-server:latest
|
||||
# user: 1000:1000
|
||||
environment:
|
||||
- TZ=Etc/UTC # Use TZ database name from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
# Comment these out if you do not use the flaresolverr container at the bottom of this file
|
||||
- FLARESOLVERR_ENABLED=true
|
||||
- FLARESOLVERR_URL=http://flaresolverr:8191
|
||||
# #################################################################################################
|
||||
#
|
||||
# !!! IMPORTANT !!!
|
||||
# - server settings can be changed during runtime in the WebUI
|
||||
# - providing an environment variable will OVERWRITE the current setting value when starting the container
|
||||
#
|
||||
# #################################################################################################
|
||||
#
|
||||
# example for setting env vars:
|
||||
#
|
||||
# - BIND_IP=0.0.0.0
|
||||
# - BIND_PORT=4567
|
||||
# - SOCKS_PROXY_ENABLED=false
|
||||
# - DOWNLOAD_AS_CBZ=true
|
||||
# - AUTH_MODE=basic_auth
|
||||
# - AUTH_USERNAME=manga
|
||||
# - AUTH_PASSWORD=hello123
|
||||
# - EXTENSION_REPOS=["http://github.com/orginazation-name/repo-name", "http://github.com/orginazation-name-2/repo-name-2"]
|
||||
volumes:
|
||||
- ./data:/home/suwayomi/.local/share/Tachidesk
|
||||
ports:
|
||||
- "4567:4567"
|
||||
restart: on-failure:3
|
||||
|
||||
flaresolverr:
|
||||
image: ghcr.io/thephaseless/byparr:latest
|
||||
container_name: flaresolverr
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Etc/UTC # Use TZ database name from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
restart: unless-stopped
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# exit early in case the file already exists
|
||||
if [ -f /home/suwayomi/.local/share/Tachidesk/server.conf ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p /home/suwayomi/.local/share/Tachidesk
|
||||
|
||||
# extract the server reference config from the jar
|
||||
unzip -q -j /home/suwayomi/startup/tachidesk_latest.jar "server-reference.conf" -d /home/suwayomi/startup
|
||||
|
||||
# move and rename the reference config
|
||||
mv /home/suwayomi/startup/server-reference.conf /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
@@ -0,0 +1,83 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
url="$1"
|
||||
arch="$2"
|
||||
installdir="${3:-/opt/kcef/jcef}"
|
||||
|
||||
echo "Will try to download matching KCEF to $installdir, arch=$arch, api url=$url"
|
||||
|
||||
if [ -d "$installdir" ] && [ -f "$installdir/install.lock" ]; then
|
||||
echo "JCEF already downloaded to $installdir, nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$url" ]; then
|
||||
echo "Not downloading KCEF since no URL specified"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
arpath=/tmp/kcef/jcef.tar.gz
|
||||
expath=/tmp/kcef/jcef
|
||||
mkdir -p "$expath"
|
||||
|
||||
if [ ! -f "$arpath" ]; then
|
||||
body="`curl -# -H 'accept: application/vnd.github+json' "$url" | jq -r '.body'`"
|
||||
archive="`echo "$body" | gawk -F'|' '
|
||||
function compare_sdk(i1, v1, i2, v2) {
|
||||
# sort sdks last (https://github.com/DatL4g/KCEF/blob/0665269b7d6a91b0ee187f4432bb5be5ca41a112/kcef/src/main/kotlin/dev/datlag/kcef/KCEFBuilder.kt#L743-L755)
|
||||
if (v1 ~ /sdk/ && v2 ~ /sdk/) return 0;
|
||||
if (v1 ~ /sdk/) return 1;
|
||||
if (v2 ~ /sdk/) return -1;
|
||||
return 0;
|
||||
}
|
||||
BEGIN {
|
||||
# ensure urls is an array
|
||||
delete urls[0];
|
||||
# parse os/arch tuple
|
||||
match("'"$arch"'", /(.*)\/(.*)/, a);
|
||||
os=a[1];
|
||||
arch=a[2];
|
||||
if (arch == "amd64") arch="x64";
|
||||
if (arch == "arm64") arch="aarch64";
|
||||
}
|
||||
# for each line, check that the third table column contains a url and if so, extract it
|
||||
# also need to check that it contains JCEF and matches the os/arch tuple
|
||||
match($4, /(https?:\/\/|www.)[-a-zA-Z0-9+&@#\/%?=~_|!:.;]*[-a-zA-Z0-9+&@#/%=~_|]/, m) {
|
||||
# if so, push to the urls array; there is no push function, so do this cursed construction
|
||||
# arrays by convention start at 1, so do that
|
||||
if (m[0] ~ /jcef/ && m[0] ~ os && m[0] ~ arch && m[0] ~ /\.tar\.gz$/) urls[length(urls)+1] = m[0];
|
||||
}
|
||||
END {
|
||||
# now make sure sdk is sorted last, since we dont actually need the full sdk
|
||||
asort(urls, sorted, "compare_sdk");
|
||||
for (x in sorted) print sorted[x];
|
||||
}
|
||||
' | head -n1`"
|
||||
|
||||
if [ -z "$archive" ]; then
|
||||
echo "No suitable archive found on release page, so not downloading"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found suitable JCEF release: $archive"
|
||||
curl -# -L -H 'accept: application/x-tar' -o "$arpath" "$archive"
|
||||
fi
|
||||
|
||||
set -xe
|
||||
tar -C "$expath" -xf "$arpath"
|
||||
libfolder="`find "$expath" -type d -name lib`"
|
||||
|
||||
if [ -z "$libfolder" ]; then
|
||||
echo "lib folder not found in extracted archive, aborting"
|
||||
rm -rf /tmp/kcef
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "$installdir"
|
||||
rmdir "$installdir" # we abuse -p to make sure all parent directories are created, then delete the actual target, since mv would move the libfolder inside otherwise
|
||||
mv "$libfolder" "$installdir"
|
||||
chmod -R a+x "$installdir"
|
||||
touch "$installdir/install.lock"
|
||||
rm -rf /tmp/kcef
|
||||
@@ -0,0 +1,178 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Immediately bail out if any command fails:
|
||||
set -e
|
||||
|
||||
echo "Suwayomi data location inside the container: /home/suwayomi/.local/share/Tachidesk"
|
||||
|
||||
# make sure the server.conf file exists
|
||||
/home/suwayomi/create_server_conf.sh
|
||||
|
||||
# set default values for environment variables:
|
||||
export TZ="${TZ:-Etc/UTC}"
|
||||
|
||||
# Getting passwords from files
|
||||
if [ -f "${SOCKS_PROXY_PASSWORD_FILE}" ]; then
|
||||
export SOCKS_PROXY_PASSWORD=$(cat "${SOCKS_PROXY_PASSWORD_FILE}")
|
||||
fi
|
||||
if [ -f "${AUTH_PASSWORD_FILE}" ]; then
|
||||
export AUTH_PASSWORD=$(cat "${AUTH_PASSWORD_FILE}")
|
||||
fi
|
||||
if [ -f "${BASIC_AUTH_PASSWORD_FILE}" ]; then
|
||||
export BASIC_AUTH_PASSWORD=$(cat "${BASIC_AUTH_PASSWORD_FILE}")
|
||||
fi
|
||||
if [ -f "${DATABASE_PASSWORD_FILE}" ]; then
|
||||
export DATABASE_PASSWORD=$(cat "${DATABSE_PASSWORD_FILE}")
|
||||
fi
|
||||
|
||||
|
||||
# Set default values for settings
|
||||
sed -i -r "s/server.initialOpenInBrowserEnabled = ([0-9]+|[a-zA-Z]+)( #)?/server.initialOpenInBrowserEnabled = false #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.systemTrayEnabled = ([0-9]+|[a-zA-Z]+)( #)?/server.systemTrayEnabled = false #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# !!! IMPORTANT: make sure to add new env variables to the container.yml workflow step testing the container with providing environment variables
|
||||
|
||||
# Overwrite configuration values with environment variables
|
||||
# the "( #)?" at the end of the regex prevents the settings comment from getting removed
|
||||
# some settings might not have a comment, however, "sed" does not support non matching groups in a regex, thus, an empty
|
||||
# comment will just be created for these settings
|
||||
|
||||
# Server ip and port bindings
|
||||
sed -i -r "s/server.ip = \"(.*?)\"( #)?/server.ip = \"${BIND_IP:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.port = ([0-9]+|[a-zA-Z]+)( #)?/server.port = ${BIND_PORT:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# Socks5 proxy
|
||||
sed -i -r "s/server.socksProxyEnabled = ([0-9]+|[a-zA-Z]+)( #)?/server.socksProxyEnabled = ${SOCKS_PROXY_ENABLED:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.socksProxyVersion = ([0-9]+|[a-zA-Z]+)( #)?/server.socksProxyVersion = ${SOCKS_PROXY_VERSION:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.socksProxyHost = \"(.*?)\"( #)?/server.socksProxyHost = \"${SOCKS_PROXY_HOST:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.socksProxyPort = \"(.*?)\"( #)?/server.socksProxyPort = \"${SOCKS_PROXY_PORT:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.socksProxyUsername = \"(.*?)\"( #)?/server.socksProxyUsername = \"${SOCKS_PROXY_USERNAME:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.socksProxyPassword = \"(.*?)\"( #)?/server.socksProxyPassword = \"${SOCKS_PROXY_PASSWORD:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# webUI
|
||||
sed -i -r "s/server.webUIEnabled = ([0-9]+|[a-zA-Z]+)( #)?/server.webUIEnabled = ${WEB_UI_ENABLED:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.webUIFlavor = \"*([a-zA-Z0-9_]+)\"*( #)?/server.webUIFlavor = ${WEB_UI_FLAVOR:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.webUIChannel = \"*([a-zA-Z0-9_]+)\"*( #)?/server.webUIChannel = ${WEB_UI_CHANNEL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.webUIUpdateCheckInterval = ([0-9]+|[a-zA-Z]+)( #)?/server.webUIUpdateCheckInterval = ${WEB_UI_UPDATE_INTERVAL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# downloader
|
||||
sed -i -r "s/server.downloadAsCbz = ([0-9]+|[a-zA-Z]+)( #)?/server.downloadAsCbz = ${DOWNLOAD_AS_CBZ:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoDownloadNewChapters = ([0-9]+|[a-zA-Z]+)( #)?/server.autoDownloadNewChapters = ${AUTO_DOWNLOAD_CHAPTERS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.excludeEntryWithUnreadChapters = ([0-9]+|[a-zA-Z]+)( #)?/server.excludeEntryWithUnreadChapters = ${AUTO_DOWNLOAD_EXCLUDE_UNREAD:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoDownloadNewChaptersLimit = ([0-9]+|[a-zA-Z]+)( #)?/server.autoDownloadNewChaptersLimit = ${AUTO_DOWNLOAD_NEW_CHAPTERS_LIMIT:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoDownloadIgnoreReUploads = ([0-9]+|[a-zA-Z]+)( #)?/server.autoDownloadIgnoreReUploads = ${AUTO_DOWNLOAD_IGNORE_REUPLOADS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
if [ -n "$DOWNLOAD_CONVERSIONS" ]; then
|
||||
perl -0777 -i -pe 's/server\.downloadConversions = ({[^#]*?}}?)/server.downloadConversions = $ENV{DOWNLOAD_CONVERSIONS}/gs' /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
fi
|
||||
if [ -n "$SERVE_CONVERSIONS" ]; then
|
||||
perl -0777 -i -pe 's/server\.serveConversions = ({[^#]*?}}?)/server.serveConversions = $ENV{SERVE_CONVERSIONS}/gs' /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
fi
|
||||
|
||||
# extension repos
|
||||
if [ -n "$EXTENSION_REPOS" ]; then
|
||||
perl -0777 -i -pe 's/server\.extensionRepos = (\[.*?\])/server.extensionRepos = $ENV{EXTENSION_REPOS}/gs' /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
fi
|
||||
|
||||
# requests
|
||||
sed -i -r "s/server.maxSourcesInParallel = ([0-9]+|[a-zA-Z]+)( #)?/server.maxSourcesInParallel = ${MAX_SOURCES_IN_PARALLEL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# updater
|
||||
sed -i -r "s/server.excludeUnreadChapters = ([0-9]+|[a-zA-Z]+)( #)?/server.excludeUnreadChapters = ${UPDATE_EXCLUDE_UNREAD:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.excludeNotStarted = ([0-9]+|[a-zA-Z]+)( #)?/server.excludeNotStarted = ${UPDATE_EXCLUDE_STARTED:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.excludeCompleted = ([0-9]+|[a-zA-Z]+)( #)?/server.excludeCompleted = ${UPDATE_EXCLUDE_COMPLETED:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.globalUpdateInterval = ([0-9\.]+|[a-zA-Z]+)( #)?/server.globalUpdateInterval = ${UPDATE_INTERVAL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.updateMangas = ([0-9]+|[a-zA-Z]+)( #)?/server.updateMangas = ${UPDATE_MANGA_INFO:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# Authentication
|
||||
AUTH_MODE_VAL="${AUTH_MODE:-$( [ "$BASIC_AUTH_ENABLED" = "true" ] && echo 'basic_auth' || echo "" )}"
|
||||
AUTH_USERNAME_VAL="${AUTH_USERNAME:-$BASIC_AUTH_USERNAME}"
|
||||
AUTH_PASSWORD_VAL="${AUTH_PASSWORD:-$BASIC_AUTH_PASSWORD}"
|
||||
sed -i -r "s/server.authMode = \"*([a-zA-Z0-9_]+)\"*( #)?/server.authMode = ${AUTH_MODE_VAL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.authUsername = \"(.*?)\"( #)?/server.authUsername = \"${AUTH_USERNAME_VAL:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.authPassword = \"(.*?)\"( #)?/server.authPassword = \"${AUTH_PASSWORD_VAL:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.jwtAudience = \"(.*?)\"( #)?/server.jwtAudience = \"${JWT_AUDIENCE:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.jwtTokenExpiry = \"(.*?)\"( #)?/server.jwtTokenExpiry = \"${JWT_TOKEN_EXPIRY:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.jwtRefreshExpiry = \"(.*?)\"( #)?/server.jwtRefreshExpiry = \"${JWT_REFRESH_EXPIRY:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
sed -i -r "s/server.basicAuthEnabled = ([0-9]+|[a-zA-Z]+)( #)?/server.basicAuthEnabled = ${BASIC_AUTH_ENABLED:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.basicAuthUsername = \"(.*?)\"( #)?/server.basicAuthUsername = \"${BASIC_AUTH_USERNAME:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.basicAuthPassword = \"(.*?)\"( #)?/server.basicAuthPassword = \"${BASIC_AUTH_PASSWORD:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# misc
|
||||
sed -i -r "s/server.debugLogsEnabled = ([0-9]+|[a-zA-Z]+)( #)?/server.debugLogsEnabled = ${DEBUG:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.maxLogFiles = ([0-9]+|[a-zA-Z]+)( #)?/server.maxLogFiles = ${MAX_LOG_FILES:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.maxLogFileSize = \"(.*?)\"( #)?/server.maxLogFileSize = \"${MAX_LOG_FILE_SIZE:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.maxLogFolderSize = \"(.*?)\"( #)?/server.maxLogFolderSize = \"${MAX_LOG_FOLDER_SIZE:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# backup
|
||||
sed -i -r "s/server.backupTime = \"(.*?)\"( #)?/server.backupTime = \"${BACKUP_TIME:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.backupInterval = ([0-9]+|[a-zA-Z]+)( #)?/server.backupInterval = ${BACKUP_INTERVAL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.backupTTL = ([0-9]+|[a-zA-Z]+)( #)?/server.backupTTL = ${BACKUP_TTL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoBackupIncludeManga = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeManga = ${AUTO_BACKUP_INCLUDE_MANGA:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoBackupIncludeCategories = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeCategories = ${AUTO_BACKUP_INCLUDE_CATEGORIES:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoBackupIncludeChapters = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeChapters = ${AUTO_BACKUP_INCLUDE_CHAPTERS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoBackupIncludeTracking = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeTracking = ${AUTO_BACKUP_INCLUDE_TRACKING:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoBackupIncludeHistory = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeHistory = ${AUTO_BACKUP_INCLUDE_HISTORY:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoBackupIncludeClientData = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeClientData = ${AUTO_BACKUP_INCLUDE_CLIENT_DATA:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.autoBackupIncludeServerSettings = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeServerSettings = ${AUTO_BACKUP_INCLUDE_SERVER_SETTINGS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
|
||||
# cloudflare bypass
|
||||
sed -i -r "s/server.flareSolverrEnabled = ([0-9]+|[a-zA-Z]+)( #)?/server.flareSolverrEnabled = ${FLARESOLVERR_ENABLED:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s|server.flareSolverrUrl = \"(.*?)\"( #)?|server.flareSolverrUrl = \"${FLARESOLVERR_URL:-\1}\" #|" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.flareSolverrTimeout = ([0-9]+|[a-zA-Z]+)( #)?/server.flareSolverrTimeout = ${FLARESOLVERR_TIMEOUT:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.flareSolverrSessionName = \"(.*?)\"( #)?/server.flareSolverrSessionName = \"${FLARESOLVERR_SESSION_NAME:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.flareSolverrSessionTtl = ([0-9]+|[a-zA-Z]+)( #)?/server.flareSolverrSessionTtl = ${FLARESOLVERR_SESSION_TTL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.flareSolverrAsResponseFallback = ([0-9]+|[a-zA-Z]+)( #)?/server.flareSolverrAsResponseFallback = ${FLARESOLVERR_RESPONSE_AS_FALLBACK:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# opds
|
||||
sed -i -r "s/server.opdsUseBinaryFileSizes = ([0-9]+|[a-zA-Z]+)( #)?/server.opdsUseBinaryFileSizes = ${OPDS_USE_BINARY_FILE_SIZES:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.opdsItemsPerPage = ([0-9]+|[a-zA-Z]+)( #)?/server.opdsItemsPerPage = ${OPDS_ITEMS_PER_PAGE:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.opdsEnablePageReadProgress = ([0-9]+|[a-zA-Z]+)( #)?/server.opdsEnablePageReadProgress = ${OPDS_ENABLE_PAGE_READ_PROGRESS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.opdsMarkAsReadOnDownload = ([0-9]+|[a-zA-Z]+)( #)?/server.opdsMarkAsReadOnDownload = ${OPDS_MARK_AS_READ_ON_DOWNLOAD:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.opdsShowOnlyUnreadChapters = ([0-9]+|[a-zA-Z]+)( #)?/server.opdsShowOnlyUnreadChapters = ${OPDS_SHOW_ONLY_UNREAD_CHAPTERS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.opdsShowOnlyDownloadedChapters = ([0-9]+|[a-zA-Z]+)( #)?/server.opdsShowOnlyDownloadedChapters = ${OPDS_SHOW_ONLY_DOWNLOADED_CHAPTERS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.opdsChapterSortOrder = \"*([a-zA-Z0-9_]+)\"*( #)?/server.opdsChapterSortOrder = ${OPDS_CHAPTER_SORT_ORDER:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.opdsCbzMimetype = \"*([a-zA-Z0-9_]+)\"*( #)?/server.opdsCbzMimetype = ${OPDS_CBZ_MIME_TYPE:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# koreader
|
||||
sed -i -r "s/server.koreaderSyncChecksumMethod = \"*([a-zA-Z0-9_]+)\"*( #)?/server.koreaderSyncChecksumMethod = ${KOREADER_SYNC_CHECKSUM_METHOD:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.koreaderSyncPercentageTolerance = ([-0-9\.Ee]+)?( #)/server.koreaderSyncPercentageTolerance = ${KOREADER_SYNC_PERCENTAGE_TOLERANCE:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.koreaderSyncStrategyForward = \"*([a-zA-Z0-9_]+)\"*( #)?/server.koreaderSyncStrategyForward = ${KOREADER_SYNC_STRATEGY_FORWARD:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.koreaderSyncStrategyBackward = \"*([a-zA-Z0-9_]+)\"*( #)?/server.koreaderSyncStrategyBackward = ${KOREADER_SYNC_STRATEGY_BACKWARD:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
# database
|
||||
sed -i -r "s/server.databaseType = \"*([a-zA-Z0-9_]+)\"*( #)?/server.databaseType = ${DATABASE_TYPE:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s|server.databaseUrl = \"(.*?)\"( #)?|server.databaseUrl = \"${DATABASE_URL:-\1}\" #|" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.databaseUsername = \"(.*?)\"( #)?/server.databaseUsername = \"${DATABASE_USERNAME:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.databasePassword = \"(.*?)\"( #)?/server.databasePassword = \"${DATABASE_PASSWORD:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
sed -i -r "s/server.useHikariConnectionPool = ([0-9]+|[a-zA-Z]+)( #)?/server.useHikariConnectionPool = ${USE_HIKARI_CONNECTION_POOL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
|
||||
|
||||
rm -rf /home/suwayomi/.local/share/Tachidesk/cache/kcef/Singleton*
|
||||
|
||||
if command -v Xvfb >/dev/null; then
|
||||
command="xvfb-run --auto-servernum java"
|
||||
if [ -d /opt/kcef/jcef ]; then
|
||||
# if we have KCEF downloaded in the container, attempt to link it into the data directory where Suwayomi expects it
|
||||
if [ ! -d /home/suwayomi/.local/share/Tachidesk/bin ]; then
|
||||
mkdir -p /home/suwayomi/.local/share/Tachidesk/bin
|
||||
fi
|
||||
if [ ! -d /home/suwayomi/.local/share/Tachidesk/bin/kcef ] && [ ! -L /home/suwayomi/.local/share/Tachidesk/bin/kcef ]; then
|
||||
ln -s /opt/kcef/jcef /home/suwayomi/.local/share/Tachidesk/bin/kcef
|
||||
fi
|
||||
fi
|
||||
if [ -d /home/suwayomi/.local/share/Tachidesk/bin/kcef ] || [ -L /home/suwayomi/.local/share/Tachidesk/bin/kcef ]; then
|
||||
# make sure all files are always executable. KCEF (and our downloader) ensure this on creation, but if the flag is lost
|
||||
# at some point, CEF will die
|
||||
chmod -R a+x /home/suwayomi/.local/share/Tachidesk/bin/kcef 2>/dev/null || true
|
||||
fi
|
||||
export LD_PRELOAD=/home/suwayomi/.local/share/Tachidesk/bin/kcef/libcef.so
|
||||
else
|
||||
command="java"
|
||||
echo "Suwayomi built without KCEF support, not starting Xvfb"
|
||||
fi
|
||||
if [ -f /opt/catch_abort.so ]; then
|
||||
export LD_PRELOAD="/opt/catch_abort.so $LD_PRELOAD"
|
||||
fi
|
||||
echo "LD_PRELOAD=$LD_PRELOAD"
|
||||
exec $command -Duser.home=/home/suwayomi -jar "/home/suwayomi/startup/tachidesk_latest.jar";
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"stable": "v2.2.2100"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Rootless quadlet files are placed in $HOME/.config/containers/systemd
|
||||
|
||||
[Container]
|
||||
Environment=TZ=Etc/UTC # Use TZ database name from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
Image=ghcr.io/suwayomi/suwayomi-server:preview
|
||||
PublishPort=4567:4567
|
||||
|
||||
UserNS=keep-id
|
||||
# Without UserNS=keep-id, the container's UID 1000 would map to a diffferent host UID which probably doesn't own the bind-mounted directory below
|
||||
|
||||
Volume=/path/to/downloads:/home/suwayomi/.local/share/Tachidesk/downloads:Z
|
||||
# Podman will not create the directory automatically so make sure to create it beforehand
|
||||
# On systems with SELinux, add the :Z flag otherwise SELinux will block the container from accessing the directory
|
||||
|
||||
Volume=suwayomi-data.volume:/home/suwayomi/.local/share/Tachidesk
|
||||
# Named volumes should be defined in a .volume quadlet otherwise Podman will assign the root of the volume to container UID 0
|
||||
# $ cat $HOME/.config/containers/systemd/suwayomi-data.volume
|
||||
# [Volume]
|
||||
# VolumeName=suwayomi-data
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
# Sets Suwayomi to start on boot
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
Reference in New Issue
Block a user