diff --git a/ansible/roles/gatus/defaults/main.yml b/ansible/roles/gatus/defaults/main.yml index e8bf22f..6f6ec09 100644 --- a/ansible/roles/gatus/defaults/main.yml +++ b/ansible/roles/gatus/defaults/main.yml @@ -47,8 +47,18 @@ gatus_port: 8080 # publish this on 0.0.0.0: the external-endpoint push API shares the dashboard's # listener, and Caddy is what should be in front of both. gatus_bind_address: "127.0.0.1" -gatus_ui_title: "Status" -gatus_ui_header: "Status" +# Pass-through, the same shape as gatus_alerting: whatever is set here is +# rendered verbatim under `ui:`, so every option upstream supports is reachable +# without adding a variable per key. See config/ui/ui.go for the full set - +# title, description, header, dashboard-heading/subheading, logo, link, favicon, +# buttons, custom-css, dark-mode, default-sort-by, default-filter-by. +gatus_ui: + title: "Status" + header: "Status" + # Group by default. The dashboard's own groupByGroup toggle starts OFF and + # remembers per browser in localStorage, so without this the ten groups render + # as one flat list for anyone who has not clicked it. + default-sort-by: group # ── Storage ────────────────────────────────────────────────────────────────── # sqlite, not memory: history has to survive a restart, or the dashboard lies diff --git a/ansible/roles/gatus/templates/config.yaml.j2 b/ansible/roles/gatus/templates/config.yaml.j2 index 6a2a72e..faf61fb 100644 --- a/ansible/roles/gatus/templates/config.yaml.j2 +++ b/ansible/roles/gatus/templates/config.yaml.j2 @@ -40,8 +40,7 @@ storage: maximum-number-of-events: {{ gatus_storage_max_events }} ui: - title: {{ gatus_ui_title }} - header: {{ gatus_ui_header }} +{{ gatus_ui | to_nice_yaml(indent=2) | indent(2, true) }} {% if gatus_alerting %} alerting: diff --git a/ansible/roles/gatus_endpoint/defaults/main.yml b/ansible/roles/gatus_endpoint/defaults/main.yml index 5c330cc..90a2c19 100644 --- a/ansible/roles/gatus_endpoint/defaults/main.yml +++ b/ansible/roles/gatus_endpoint/defaults/main.yml @@ -42,3 +42,17 @@ gatus_gid: 10001 # check's cadence and there is no single correct default. See the note in # infra/400_host_monitoring.yml. gatus_endpoint_default_alerts: [] + +# UI options applied to every PULLED endpoint that does not set its own. +# +# Only pulled endpoints can carry this - an external (push) endpoint has no `ui` +# field at all, because it has no conditions to display. +# +# Note that every hide-* option already defaults to false upstream, so there is +# nothing to un-hide. The one setting that genuinely shows MORE is +# resolve-successful-conditions: by default a failing check displays the real +# value - "[STATUS] (502) == 200" - while a passing one drops it and shows only +# "[STATUS] == 200". Turning it on resolves both, so a healthy DNS check shows +# the IP it actually resolved rather than just the assertion. +gatus_endpoint_default_ui: + resolve-successful-conditions: true diff --git a/ansible/roles/gatus_endpoint/templates/endpoints.yaml.j2 b/ansible/roles/gatus_endpoint/templates/endpoints.yaml.j2 index 54340cd..680691e 100644 --- a/ansible/roles/gatus_endpoint/templates/endpoints.yaml.j2 +++ b/ansible/roles/gatus_endpoint/templates/endpoints.yaml.j2 @@ -19,6 +19,7 @@ external-endpoints: alerts: {{ _alerts | to_nice_yaml(indent=2) | indent(6, true) }} {% endif %} +{# external endpoints have no `ui` field upstream - they carry no conditions #} {% endfor %} {% endif %} {% if gatus_endpoint_pulled %} @@ -50,5 +51,10 @@ endpoints: alerts: {{ _alerts | to_nice_yaml(indent=2) | indent(6, true) }} {% endif %} +{% set _ui = e.ui | default(gatus_endpoint_default_ui) %} +{% if _ui %} + ui: +{{ _ui | to_nice_yaml(indent=2) | indent(6, true) }} +{% endif %} {% endfor %} {% endif %}