fix environment variable handling

This commit is contained in:
Nogweii
2023-05-20 19:01:09 -07:00
parent 146da91296
commit 016fdb57a1
4 changed files with 38 additions and 15 deletions

View File

@@ -25,11 +25,12 @@ There are a number of environment variables available to configure Suwayomi:
| Variable | Default | Description |
|:-:|:-:|:-:|
| **TZ** | `Etc/UTC` | What time zone the container thinks it is. |
| **BIND_IP** | `0.0.0.0` | The interface to listen on, inside the container. You almost never want to change this. |
| **BIND_PORT** | `4567` | Which port Suwayomi will listen on |
| **SOCKS_PROXY_ENABLED** | `true` | Whether Suwayomi will connect through a SOCKS5 proxy |
| **SOCKS_PROXY_HOST** | `0.0.0.0` | The TCP host of the SOCKS5 proxy |
| **SOCKS_PROXY_PORT** | `0.0.0.0` | The port of the SOCKS5 proxy |
| **SOCKS_PROXY_ENABLED** | `false` | Whether Suwayomi will connect through a SOCKS5 proxy |
| **SOCKS_PROXY_HOST** | `""` | The TCP host of the SOCKS5 proxy |
| **SOCKS_PROXY_PORT** | `""` | The port of the SOCKS5 proxy |
| **DOWNLOAD_AS_CBZ** | `false` | Whether Suwayomi should save the manga to disk in CBZ format |
| **MAX_PARALLEL_UPDATE** | `10` | How many sources can be updated at the same time? |
| **BASIC_AUTH_ENABLED** | `false` | Whether Suwayomi requires HTTP Basic Auth to get in. |

View File

@@ -1,10 +1,19 @@
---
version: '3.7'
services:
tachidesk-docker:
suwayomi:
image: tachidesk:new
environment:
- TZ=Etc/UTC # Use TZ database name from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- DEBUG=true
- BIND_IP=0.0.0.0
- BIND_PORT=4567
- SOCKS_PROXY_ENABLED=false
- DOWNLOAD_AS_CBZ=true
- MAX_PARALLEL_UPDATE=3
- BASIC_AUTH_ENABLED=true
- BASIC_AUTH_USERNAME=manga
- BASIC_AUTH_PASSWORD=hello123
volumes:
- ./data:/home/suwayomi/.local/share/Tachidesk
ports:

View File

@@ -1,9 +1,9 @@
# Server ip and port bindings
server.ip = "${BIND_IP:-0.0.0.0}"
server.port = ${BIND_PORT:-4567}
server.ip = "${BIND_IP}"
server.port = ${BIND_PORT}
# Socks5 proxy
server.socksProxy = ${SOCKS_PROXY_ENABLED:-false}
server.socksProxy = ${SOCKS_PROXY_ENABLED}
server.socksProxyHost = "${SOCKS_PROXY_HOST}"
server.socksProxyPort = "${SOCKS_PROXY_PORT}"
@@ -15,18 +15,18 @@ server.webUIInterface = "browser" # "browser" or "electron"
server.electronPath = ""
# downloader
server.downloadAsCbz = ${DOWNLOAD_AS_CBZ:-false}
server.downloadAsCbz = ${DOWNLOAD_AS_CBZ}
server.downloadsPath = ""
# updater
# sets how many sources can be updated in parallel. updates are grouped by source and all mangas of a source are updated synchronously
server.maxParallelUpdateRequests = ${MAX_PARALLEL_UPDATE:-10}
server.maxParallelUpdateRequests = ${MAX_PARALLEL_UPDATE}
# Authentication
server.basicAuthEnabled = ${BASIC_AUTH_ENABLED:-false}
server.basicAuthEnabled = ${BASIC_AUTH_ENABLED}
server.basicAuthUsername = "${BASIC_AUTH_USERNAME}"
server.basicAuthPassword = "${BASIC_AUTH_PASSWORD}"
# misc
server.debugLogsEnabled = ${DEBUG:-true}
server.debugLogsEnabled = ${DEBUG}
server.systemTrayEnabled = false # always disabled as we are in a headless container

View File

@@ -1,11 +1,24 @@
#!/bin/sh
set -euo 'pipefail'
# Immediately bail out if any command fails:
set -e
echo "Suwayomi data location inside the container: /home/suwayomi/.local/share/Tachidesk"
if [ ! -f /home/suwayomi/.local/share/Tachidesk/server.conf ]; then
envsubst < /home/suwayomi/server.conf.template > /home/suwayomi/.local/share/Tachidesk/server.conf
fi
# set default values for environment variables:
export TZ="${TZ:-Etc/UTC}"
export BIND_IP="${BIND_IP:-0.0.0.0}"
export BIND_PORT="${BIND_PORT:-4567}"
export SOCKS_PROXY_ENABLED="${SOCKS_PROXY_ENABLED:-false}"
export SOCKS_PROXY_HOST="${SOCKS_PROXY_HOST:-""}"
export SOCKS_PROXY_PORT="${SOCKS_PROXY_PORT:-""}"
export DOWNLOAD_AS_CBZ="${DOWNLOAD_AS_CBZ:-false}"
export MAX_PARALLEL_UPDATE="${MAX_PARALLEL_UPDATE:-10}"
export BASIC_AUTH_ENABLED="${BASIC_AUTH_ENABLED:-false}"
export BASIC_AUTH_USERNAME="${BASIC_AUTH_USERNAME:-""}"
export BASIC_AUTH_PASSWORD="${BASIC_AUTH_PASSWORD:-""}"
export DEBUG="${DEBUG:-true}"
envsubst < /home/suwayomi/server.conf.template > /home/suwayomi/.local/share/Tachidesk/server.conf
exec java -jar "/home/suwayomi/startup/tachidesk_latest.jar";