From 01102bdf06cfde6d795098fc3921d2c5858dd1f2 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 4 Oct 2026 21:53:29 +0700 Subject: [PATCH] refactor: comment out optional env vars in diun and code-server --- CLAUDE.md | 3 ++- code-server/.env.example | 3 +++ code-server/README.md | 1 + code-server/compose.yml | 2 +- diun/.env.example | 8 ++++---- diun/README.md | 3 +++ diun/compose.yml | 11 ++++------- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 6bc1bac..07b50bf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -126,7 +126,8 @@ of its most important member, even when a member on its own would rank lower. Within a group, the variable others configure comes first. Optional variables are listed but commented out, in the form -`# - KEY=${KEY:-default}`, so the service runs without them and enabling one +`# - KEY=${KEY:-default}` (`# KEY: ${KEY:-default}` in a map-style +`environment:`), so the service runs without them and enabling one means uncommenting its line. The matching `.env.example` entry is commented out the same way (`# KEY=default`). Must-have and should-have variables stay active. diff --git a/code-server/.env.example b/code-server/.env.example index 1a7f70e..d6988b2 100644 --- a/code-server/.env.example +++ b/code-server/.env.example @@ -15,3 +15,6 @@ GIT_EMAIL= # Container hostname, also passed in as HOST -- the name zsh's prompt shows. # Not named HOSTNAME: the deploying shell's own HOSTNAME would override it. SERVICE_HOSTNAME=code-server + +# Name of the installed web app. +# PWA_APPNAME=code-server diff --git a/code-server/README.md b/code-server/README.md index 13585e7..96f4341 100644 --- a/code-server/README.md +++ b/code-server/README.md @@ -35,6 +35,7 @@ separate rootless daemon. | `SERVICE_HOSTNAME` | Container hostname, and the name the shell prompt shows. | | `PASSWORD` | Web UI login, also the in-container sudo password. **A blank value disables authentication entirely.** | | `GIT_NAME` / `GIT_EMAIL` | Git author and committer identity | +| `PWA_APPNAME` | Optional. Name of the installed web app; defaults to `code-server`. | Generate a password with `openssl rand -base64 24`. diff --git a/code-server/compose.yml b/code-server/compose.yml index ba62a27..fe0c4e4 100644 --- a/code-server/compose.yml +++ b/code-server/compose.yml @@ -18,7 +18,7 @@ services: - GIT_COMMITTER_NAME=${GIT_NAME} - GIT_COMMITTER_EMAIL=${GIT_EMAIL} - HOST=${SERVICE_HOSTNAME} - - PWA_APPNAME=code-server + # - PWA_APPNAME=${PWA_APPNAME:-code-server} volumes: - 'code-server-config:/config' - 'code-server-workspace:/workspace' diff --git a/diun/.env.example b/diun/.env.example index b5f5e65..061afaa 100644 --- a/diun/.env.example +++ b/diun/.env.example @@ -2,8 +2,8 @@ DIUN_NOTIF_TELEGRAM_TOKEN= DIUN_NOTIF_TELEGRAM_CHATIDS= DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true DIUN_WATCH_SCHEDULE=0 0 * * * -DIUN_WATCH_WORKERS=10 -DIUN_WATCH_JITTER=30s +# DIUN_WATCH_WORKERS=10 +# DIUN_WATCH_JITTER=30s TZ=UTC -LOG_LEVEL=info -LOG_JSON=false +# LOG_LEVEL=info +# LOG_JSON=false diff --git a/diun/README.md b/diun/README.md index 11734f4..4ef6492 100644 --- a/diun/README.md +++ b/diun/README.md @@ -50,6 +50,9 @@ fail fast if unset. Everything else has a working default. | `TZ` | `UTC` | Timezone for the schedule and log timestamps | | `LOG_LEVEL` / `LOG_JSON` | `info` / `false` | Logging | +`DIUN_WATCH_WORKERS`, `DIUN_WATCH_JITTER`, `LOG_LEVEL` and `LOG_JSON` are +optional: their defaults are Diun’s own, so they are commented out. + State lives in the `diun-data` volume (`DIUN_DB_PATH=/data/diun.db`). Diun notifies on first sight of an image, so a fresh volume produces one round of notifications for everything currently running. diff --git a/diun/compose.yml b/diun/compose.yml index 6db9fb8..b1837a5 100644 --- a/diun/compose.yml +++ b/diun/compose.yml @@ -1,6 +1,3 @@ -# Required env vars (set in Coolify/Dokploy, or a sibling .env): -# DIUN_NOTIF_TELEGRAM_TOKEN, DIUN_NOTIF_TELEGRAM_CHATIDS - services: diun: image: crazymax/diun:4 @@ -14,11 +11,11 @@ services: DIUN_NOTIF_TELEGRAM_CHATIDS: ${DIUN_NOTIF_TELEGRAM_CHATIDS:?required} DIUN_DB_PATH: /data/diun.db DIUN_WATCH_SCHEDULE: "${DIUN_WATCH_SCHEDULE:-0 0 * * *}" - DIUN_WATCH_WORKERS: "${DIUN_WATCH_WORKERS:-10}" - DIUN_WATCH_JITTER: "${DIUN_WATCH_JITTER:-30s}" + # DIUN_WATCH_WORKERS: "${DIUN_WATCH_WORKERS:-10}" + # DIUN_WATCH_JITTER: "${DIUN_WATCH_JITTER:-30s}" TZ: "${TZ:-UTC}" - LOG_LEVEL: "${LOG_LEVEL:-info}" - LOG_JSON: "${LOG_JSON:-false}" + # LOG_LEVEL: "${LOG_LEVEL:-info}" + # LOG_JSON: "${LOG_JSON:-false}" volumes: - diun-data:/data depends_on: