From 944f32b7765bff7622ae03afb14b75a29b47eb80 Mon Sep 17 00:00:00 2001 From: "Akarsh.sharma" Date: Sat, 18 Apr 2026 18:10:25 +0530 Subject: [PATCH 1/2] Fix config.yml.tmpl templating - Add missing MINIFLUX_* env vars referenced by config.yml.tmpl - Tell miniflux to actually load the config file via -c flag - Remove redundant env-var injection that shadowed config values - Fix invalid single-quoted Go template literal in postgres healthcheck --- .env.sample | 9 +++++++++ compose.postgres.yml | 2 +- compose.yml | 5 +---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.env.sample b/.env.sample index 60f81d5..5790730 100644 --- a/.env.sample +++ b/.env.sample @@ -5,6 +5,15 @@ DB_NAME=miniflux DB_USER=miniflux MINIFLUX_ADMIN_USERNAME=admin +# Miniflux config file values (consumed by config.yml.tmpl) +MINIFLUX_APP_NAME=miniflux +MINIFLUX_DB_TYPE=postgresql +MINIFLUX_DB_HOST=db +MINIFLUX_DB_NAME=miniflux +MINIFLUX_DB_USER=miniflux +MINIFLUX_DOMAIN=rss.example.com +MINIFLUX_PORT=8080 + # Secret Versions SECRET_DB_PASSWORD_VERSION=v1 SECRET_ADMIN_PASSWORD_VERSION=v1 diff --git a/compose.postgres.yml b/compose.postgres.yml index 88e3cc7..bea0132 100644 --- a/compose.postgres.yml +++ b/compose.postgres.yml @@ -11,7 +11,7 @@ services: volumes: - miniflux-db:/var/lib/postgresql/data healthcheck: - test: ["CMD", "pg_isready", "-U", "{{ env 'DB_USER' }}"] + test: ["CMD", "pg_isready", "-U", "{{ env \"DB_USER\" }}"] interval: 10s start_period: 30s networks: diff --git a/compose.yml b/compose.yml index 5fb17e8..14d33da 100644 --- a/compose.yml +++ b/compose.yml @@ -4,6 +4,7 @@ version: "3.8" services: app: image: "miniflux/miniflux:2.2.0" + command: ["-c", "/etc/miniflux/config.yml"] configs: - source: config_yml target: /etc/miniflux/config.yml @@ -12,11 +13,7 @@ services: - admin_password - secret_key environment: - - DATABASE_URL=postgres://{{ env "DB_USER" }}:{{ secret "db_password" }}@db/{{ env "DB_NAME" }}?sslmode=disable - RUN_MIGRATIONS=1 - - ADMIN_USERNAME={{ env "MINIFLUX_ADMIN_USERNAME" }} - - ADMIN_PASSWORD={{ secret "admin_password" }} - - BASE_URL=https://{{ env "DOMAIN" }} networks: - proxy - internal -- 2.49.0 From 1ca30782cae17eb969d8cbaac8dc784438503022 Mon Sep 17 00:00:00 2001 From: "Akarsh.sharma" Date: Sat, 18 Apr 2026 18:26:15 +0530 Subject: [PATCH 2/2] Align config.yml.tmpl with Miniflux's real config format - Rewrite template to flat KEY=VALUE (DATABASE_URL, LISTEN_ADDR, BASE_URL, etc.) -- the TOML-style sections Miniflux would ignore - Hardcode deploy-time infra constants (LISTEN_ADDR, sslmode, db host, RUN_MIGRATIONS, CREATE_ADMIN) directly in the template literal - Drop the 7 MINIFLUX_* defaults from .env.sample (they were hardcoded non-user-tunable values shoehorned into the env file) - Remove now-redundant RUN_MIGRATIONS env var from compose.yml --- .env.sample | 9 --------- compose.yml | 2 -- config.yml.tmpl | 32 ++++++++------------------------ 3 files changed, 8 insertions(+), 35 deletions(-) diff --git a/.env.sample b/.env.sample index 5790730..60f81d5 100644 --- a/.env.sample +++ b/.env.sample @@ -5,15 +5,6 @@ DB_NAME=miniflux DB_USER=miniflux MINIFLUX_ADMIN_USERNAME=admin -# Miniflux config file values (consumed by config.yml.tmpl) -MINIFLUX_APP_NAME=miniflux -MINIFLUX_DB_TYPE=postgresql -MINIFLUX_DB_HOST=db -MINIFLUX_DB_NAME=miniflux -MINIFLUX_DB_USER=miniflux -MINIFLUX_DOMAIN=rss.example.com -MINIFLUX_PORT=8080 - # Secret Versions SECRET_DB_PASSWORD_VERSION=v1 SECRET_ADMIN_PASSWORD_VERSION=v1 diff --git a/compose.yml b/compose.yml index 14d33da..022f43b 100644 --- a/compose.yml +++ b/compose.yml @@ -12,8 +12,6 @@ services: - db_password - admin_password - secret_key - environment: - - RUN_MIGRATIONS=1 networks: - proxy - internal diff --git a/config.yml.tmpl b/config.yml.tmpl index 9c1ae60..b33bc96 100644 --- a/config.yml.tmpl +++ b/config.yml.tmpl @@ -1,24 +1,8 @@ -# Application -APP_NAME = {{ env "MINIFLUX_APP_NAME" }} - -# Database configuration -[database] -DB_TYPE = {{ env "MINIFLUX_DB_TYPE" }} -HOST = {{ env "MINIFLUX_DB_HOST" }} -NAME = {{ env "MINIFLUX_DB_NAME" }} -USER = {{ env "MINIFLUX_DB_USER" }} -PASSWD = {{ secret "db_password" }} - -# Server Configuration -[server] -DOMAIN = {{ env "MINIFLUX_DOMAIN" }} -PORT = {{ env "MINIFLUX_PORT" }} - -# Security -[security] -SECRET_KEY = {{ secret "secret_key" }} - -# Admin User Configuration -[admin] -USERNAME = {{ env "MINIFLUX_ADMIN_USERNAME" }} -PASSWORD = {{ secret "admin_password" }} +# Miniflux configuration -- flat KEY=VALUE, loaded via `miniflux -c` +DATABASE_URL=postgres://{{ env "DB_USER" }}:{{ secret "db_password" }}@db/{{ env "DB_NAME" }}?sslmode=disable +LISTEN_ADDR=0.0.0.0:8080 +BASE_URL=https://{{ env "DOMAIN" }} +RUN_MIGRATIONS=1 +CREATE_ADMIN=1 +ADMIN_USERNAME={{ env "MINIFLUX_ADMIN_USERNAME" }} +ADMIN_PASSWORD={{ secret "admin_password" }} -- 2.49.0