paperless-ngx/templates/dbenv

22 lines
530 B
HCL

[[- /*
vim: syntax=hcl
*/]]
template {
data =<<_EOT
[[- if ne .postgres.pooler.engine "none" ]]
PAPERLESS_DBHOST=127.0.0.1
PAPERLESS_DBPORT=[[ .postgres.pooler.port ]]
PAPERLESS_DBUSER=[[ .instance ]]
PAPERLESS_DBPASS={{ env "NOMAD_ALLOC_ID" }}
[[- else ]]
PAPERLESS_DBHOST=[[ .postgres.host ]]
PAPERLESS_DBPORT=[[ .postgres.port ]]
PAPERLESS_DBUSER=[[ .postgres.user ]]
PAPERLESS_DBPASS=[[ .postgres.password ]]
[[- end ]]
_EOT
destination = "secrets/.db.env"
perms = 400
env = true
}