unifi: Deploy Unifi controller

The Unifi controller consists of three containerized processes:

* Unifi Network itself
* unifi_exporter for monitoring and metrics via Prometheus
* Caddy for HTTPS

_unifi_exporter_ is really the only component with any configuration.
Unfortunately, it mixes secret and non-secret data in a single YAML
file, which makes it impossible to use `yaml.Marshal` to render the
configuration directly from the CUE source.
This commit is contained in:
2024-05-25 12:55:51 -05:00
parent ad6f8723da
commit e75204be53
12 changed files with 229 additions and 0 deletions

29
env/prod/unifi.cue vendored Normal file
View File

@@ -0,0 +1,29 @@
package prod
unifi: caddy: {
server_name: "unifi.pyrocufflink.blue"
acme: email: "unifi@pyrocufflink.blue"
}
unifi: exporter: {
listen: {
address: ":9130"
metricspath: "/metrics"
}
unifi: {
address: "https://localhost:8443/"
insecure: true
password: """
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvRVBncFB6YnJsYmlQSnJN
YXVqclJVTGV4eTRkd3JWbFhZOXN4WWJYc1NVCnlXdElESWJNdVcxRnZodnVUTlF5
d2ovRjNNeE9jV25IOW01MERIM1ZKZnMKLS0tIEFneVBWdHVobzZBTlBvZjZaMHJp
T3A4WTRYaDd1RFduVVBnQ3hXSkE0WmcKEFBdNfdUTZSo7ebqcIcl9qckp/zc0Mf6
LV9pZz8v3n9NO9fnF/vzXJrGyaJlzv3H
-----END AGE ENCRYPTED FILE-----
"""
site: "Pyrocufflink"
timeout: "5s"
username: "prometheus"
}
}