feat: refactor Docker configuration to utilize Docker Secrets for sensitive information management

This commit is contained in:
troyeguo
2025-06-13 17:36:04 +08:00
parent b2b8b14310
commit 4444abc4e9
8 changed files with 30 additions and 19 deletions

View File

@@ -48,20 +48,8 @@ RUN echo '#!/bin/sh' > /start.sh && \
ENV SERVER_USERNAME=admin
ENV SERVER_PASSWORD=securePass123
ENV SERVER_PASSWORD_FILE=my_secret
ENV PORT=8080
# Define volume for uploads directory
VOLUME ["/app/uploads"]
CMD ["/start.sh"]
# docker run -d \
# --name koodo-reader \
# -p 80:80 \
# -p 8080:8080 \
# -e ENABLE_HTTP_SERVER=false \
# -e SERVER_USERNAME=admin \
# -e SERVER_PASSWORD=securePass123 \
# -e SERVER_PASSWORD_FILE=my_secret \
# -v /path/to/host/uploads:/app/uploads \
# ghcr.io/koodo-reader/koodo-reader:master

23
docker-compose-secret.yml Normal file
View File

@@ -0,0 +1,23 @@
version: "3.8"
# This docker-compose file uses secrets to manage sensitive information like passwords.
services:
koodo-reader:
image: ghcr.io/koodo-reader/koodo-reader:master
container_name: koodo-reader
restart: unless-stopped
ports:
- "80:80"
- "8080:8080"
environment:
- SERVER_USERNAME=${SERVER_USERNAME:-admin}
- SERVER_PASSWORD=${SERVER_PASSWORD:-securePass123}
- SERVER_PASSWORD_FILE=${SERVER_PASSWORD_FILE:-my_secret}
- ENABLE_HTTP_SERVER=false
volumes:
# 使用主机目录(推荐)
- /opt/uploads:/app/uploads
secrets:
- my_secret
secrets:
my_secret:
file: ./my_secret.txt

View File

@@ -11,8 +11,6 @@ services:
environment:
- SERVER_USERNAME=${SERVER_USERNAME:-admin}
- SERVER_PASSWORD=${SERVER_PASSWORD:-securePass123}
- SERVER_PASSWORD_FILE=${SERVER_PASSWORD_FILE:-my_secret}
- PORT=8080
- ENABLE_HTTP_SERVER=false
volumes:
# 使用主机目录(推荐)

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -85,7 +85,7 @@ class Background extends React.Component<BackgroundProps, BackgroundState> {
ConfigService.getReaderConfig("isOSNight") === "yes")
? "rgba(44,47,49,1)"
: "rgba(255,255,255,1)",
filter: `brightnessbrightness(${
filter: `brightness(${
ConfigService.getReaderConfig("brightness") || 1
}) invert(${
ConfigService.getReaderConfig("isInvert") === "yes" ? 1 : 0

View File

@@ -174,7 +174,9 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
ConfigService.getReaderConfig("isSliding") === "yes" ? "sliding" : "",
ConfigService.getReaderConfig("convertChinese"),
"",
"no",
ConfigService.getReaderConfig("backgroundColor") === "rgba(44,47,49,1)"
? "yes"
: "no",
"no",
Kookit
);