fix: resolve config.yml.tmpl templating #4
Reference in New Issue
Block a user
No description provided.
Delete Branch "jaeger123/miniflux:fix/config-templating"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
config.yml.tmplis now aligned with Miniflux's actual config format (flatKEY=VALUE, real Miniflux keys), all{{ env "..." }}/{{ secret "..." }}directives resolve, and the container actually loads the file via-c.Changes
config.yml.tmpl— rewritten from TOML-style (which Miniflux ignores) to flatKEY=VALUEwith real Miniflux keys:DATABASE_URL,LISTEN_ADDR,BASE_URL,RUN_MIGRATIONS,CREATE_ADMIN,ADMIN_USERNAME,ADMIN_PASSWORD. Infra constants (LISTEN_ADDR=0.0.0.0:8080,sslmode=disable,dbhostname,RUN_MIGRATIONS=1,CREATE_ADMIN=1) hardcoded in the template since they don't vary per deploy..env.sample— only user-tunable values (DOMAIN,DB_NAME,DB_USER,MINIFLUX_ADMIN_USERNAME) + version pins. No more pre-filled defaults for infra constants likeDB_HOST=dborPORT=8080.compose.yml— addcommand: ["-c", "/etc/miniflux/config.yml"]; remove 5 env entries that previously shadowed the config (DATABASE_URL,ADMIN_USERNAME,ADMIN_PASSWORD,BASE_URL,RUN_MIGRATIONS). Config file is now authoritative.compose.postgres.yml— healthcheck had{{ env 'DB_USER' }}(single quotes, rejected by Go templates). Fixed to escaped double quotes.Usage
How templating resolves: abra reads
.env→ Docker Swarm'stemplate_driver: golang(seecompose.ymlconfigs:block) rendersconfig.yml.tmpl, substituting{{ env "X" }}from the env file and{{ secret "X" }}from Swarm secrets → mounted read-only at/etc/miniflux/config.yml→ loaded by Miniflux via the-cflag.Verify:
Expected output:
No leftover
{{ ... }}directives.Version bumps: any change to
config.yml.tmplrequires bumpingCONFIG_VERSIONin.env(Swarm configs are immutable by name). Rotating a secret requires bumping itsSECRET_*_VERSION.Note
secret_keyis still declared incompose.ymlsecrets block but not referenced in the template — Miniflux has no matching config key. Left the mount in place rather than deleting the secret definition; can be cleaned up in a follow-up if confirmed unused.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.