More flexible database url

This commit is contained in:
Daniel Berteaud 2023-11-02 09:16:37 +01:00
parent 28c714acf9
commit 9eec2dd12c
2 changed files with 2 additions and 18 deletions

View File

@ -86,17 +86,6 @@ job [[ .miniflux.instance | toJSON ]] {
[[ template "common/file_env.tpl" $c.env ]]
template {
data =<<_EOT
{{ with secret "[[ .vault.prefix ]]database/creds/[[ .miniflux.instance ]]" }}
DATABASE_URL="host=localhost port=5432 user={{ .Data.username }} password='{{ .Data.password }}' dbname=[[ .miniflux.db.name ]] sslmode=disable"
{{ end }}
_EOT
destination = "secrets/miniflux.env"
perms = 400
env = true
}
[[ template "common/resources.tpl" .miniflux.resources ]]
}
}

View File

@ -19,17 +19,12 @@ miniflux:
- service: postgres
# Additional env var to pass to the container
env: {}
env:
DATABASE_URL: postgresql://{{ with secret "[[ .vault.prefix ]]database/creds/[[ .miniflux.instance ]]" }}{{ .Data.username }}:{{ urlquery .Data.password }}{{ end }}@localhost:5432/[[ .miniflux.instance ]]?sslmode=disable
# Public URL of the service
public_url: https://flux.example.org
# Postgres database settings
db:
host: localhost
port: 5432
name: '[[ .miniflux.instance ]]'
# Prometheus configuration
prometheus:
metrics_url: http://localhost:8085/metrics