fix docker auth
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m3s
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m3s
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -7,4 +7,5 @@ out/
|
|||||||
medialore.db
|
medialore.db
|
||||||
medialore.db-shm
|
medialore.db-shm
|
||||||
medialore.db-wal
|
medialore.db-wal
|
||||||
tsconfig.tsbuildinfo
|
tsconfig.tsbuildinfo
|
||||||
|
.session_secret
|
||||||
@@ -6,13 +6,18 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
|
# CONFIG_PATH points db.ts and secret.ts at the config volume so medialore.db
|
||||||
|
# and .session_secret are created as files inside an existing directory mount.
|
||||||
|
# Without this Docker will create ./medialore.db on the host as an empty directory,
|
||||||
|
# which causes better-sqlite3 to fail with SQLITE_CANTOPEN.
|
||||||
|
CONFIG_PATH: /config
|
||||||
|
# Set to "true" only when serving over HTTPS (e.g. behind a TLS reverse proxy).
|
||||||
|
# Keeping this "false" allows the session cookie to be sent over plain HTTP.
|
||||||
|
COOKIE_SECURE: "false"
|
||||||
volumes:
|
volumes:
|
||||||
# Runtime data — must map to /app/ since process.cwd() = /app in the container
|
|
||||||
- ./medialore.db:/app/medialore.db
|
|
||||||
- ./.thumbnails:/app/.thumbnails
|
- ./.thumbnails:/app/.thumbnails
|
||||||
# Library config — mounted as a directory so the atomic rename in the API works.
|
# Library config, database, and session secret — all in one directory volume.
|
||||||
# A single-file bind-mount causes EBUSY on rename() because .tmp and the target
|
# Initialize before first run:
|
||||||
# end up on different devices. Initialize before first run:
|
|
||||||
# mkdir -p config && echo '[]' > config/libraries.json
|
# mkdir -p config && echo '[]' > config/libraries.json
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export function getSessionOptions(): SessionOptions {
|
|||||||
cookieName: 'ml_session',
|
cookieName: 'ml_session',
|
||||||
ttl: 60 * 60 * 24 * 30, // 30 days
|
ttl: 60 * 60 * 24 * 30, // 30 days
|
||||||
cookieOptions: {
|
cookieOptions: {
|
||||||
secure: process.env.NODE_ENV === 'production',
|
secure: process.env.COOKIE_SECURE === 'true',
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
sameSite: 'lax',
|
sameSite: 'lax',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user