Enable autobackup

This commit is contained in:
Daniel Berteaud 2023-09-03 23:18:56 +02:00
parent e3d367619b
commit 2b17bc729f
4 changed files with 6 additions and 5 deletions

View File

@ -1,3 +1,3 @@
Kind = "service-defaults"
Name = "unifi[[ .env.suffix ]]"
Name = "[[ .unifi.job_name ]][[ .env.suffix ]]"
Protocol = "http"

View File

@ -1,5 +1,5 @@
Kind = "service-intentions"
Name = "unifi[[ .env.suffix ]]"
Name = "[[ .unifi.job_name ]][[ .env.suffix ]]"
Sources = [
{
Name = "[[ .traefik.instance ]]"

View File

@ -9,15 +9,16 @@ db.mongo.local=false
[[- $mongo_stats := urlParse .unifi.controller.mongo.stats_address ]]
db.mongo.uri=[[ $mongo.Scheme ]]://
[[- if has .unifi.controller.mongo "user" ]]
[[- .unifi.controller.mongo.user ]]:{{ with secret "[[ .env.suffix ]]kv/service/unifi" }}{{ urlquery .Data.data.mongo_pwd }}{{ end }}@
[[- .unifi.controller.mongo.user ]]:{{ with secret "[[ .env.suffix ]]kv/service/[[ .unifi.job_name ]]" }}{{ urlquery .Data.data.mongo_pwd }}{{ end }}@
[[- end ]]
[[- $mongo.Host ]][[ $mongo.Path ]]?[[ $mongo.RawQuery ]]
statdb.mongo.uri=[[ $mongo_stats.Scheme ]]://
[[- if has .unifi.controller.mongo "user" ]]
[[- .unifi.controller.mongo.user ]]:{{ with secret "[[ .env.suffix ]]kv/service/unifi" }}{{ urlquery .Data.data.mongo_pwd }}{{ end }}@
[[- .unifi.controller.mongo.user ]]:{{ with secret "[[ .env.suffix ]]kv/service/[[ .unifi.job_name ]]" }}{{ urlquery .Data.data.mongo_pwd }}{{ end }}@
[[- end ]]
[[- $mongo_stats.Host ]][[ $mongo_stats.Path ]]?[[ $mongo_stats.RawQuery ]]
debug.device=info
debug.mgmt=info
debug.system=info
debug.sdn=warn
autobackup.dir=/data/backup

View File

@ -1,3 +1,3 @@
path "[[ .vault.prefix ]]kv/data/service/unifi" {
path "[[ .vault.prefix ]]kv/data/service/[[ .unifi.job_name ]]" {
capabilities = ["read"]
}