Closes 12 template drift gaps between the Control Panel templates and production configs. New instances now provision with full monitoring (alerts fire properly), correct Gitea DB type (postgres not mysql), social sharing previews (OG meta bot routes), Excalidraw subdomain routing, docker-socket-proxy for Homepage, and complete Grafana/ Alertmanager/Prometheus config copying. Key changes: - Rewrite Prometheus template: add alerting, rule_files, 5 scrape jobs - Add cAdvisor, node-exporter, redis-exporter, gotify, docker-socket-proxy - Fix Gitea env from mysql to postgres to match docker-compose - Add OG bot detection + rewrite routes for campaigns/pages/gallery - Add Excalidraw nginx server block + Pangolin draw subdomain - Add embed port to discovery portConfig + emailTestMode to registration - Copy alerts.yml, alertmanager.yml, Grafana dashboards to templates - Add Listmonk proxy port and upgrade volume to API service Bunker Admin
113 lines
3.3 KiB
YAML
113 lines
3.3 KiB
YAML
global:
|
|
resolve_timeout: 5m
|
|
# SMTP configuration for email alerts
|
|
# Using MailHog for development - update for production:
|
|
# smtp_smarthost: 'smtp.example.com:587'
|
|
# smtp_auth_username: 'alerts@example.com'
|
|
# smtp_auth_password: 'your-password'
|
|
# smtp_require_tls: true
|
|
smtp_from: 'alerts@changemaker.local'
|
|
smtp_smarthost: 'mailhog-changemaker:1025'
|
|
smtp_auth_username: ''
|
|
smtp_auth_password: ''
|
|
smtp_require_tls: false
|
|
|
|
# Templates for notification content
|
|
templates:
|
|
- '/etc/alertmanager/*.tmpl'
|
|
|
|
# Route alerts to appropriate receivers based on severity
|
|
route:
|
|
group_by: ['alertname', 'cluster', 'service']
|
|
group_wait: 10s
|
|
group_interval: 10s
|
|
repeat_interval: 12h
|
|
receiver: 'default'
|
|
|
|
routes:
|
|
# Critical alerts go to both Gotify and email
|
|
- match:
|
|
severity: critical
|
|
receiver: 'critical-alerts'
|
|
group_wait: 0s
|
|
group_interval: 5m
|
|
repeat_interval: 4h
|
|
|
|
# Warning alerts go to Gotify + email
|
|
- match:
|
|
severity: warning
|
|
receiver: 'warning-alerts'
|
|
group_wait: 30s
|
|
repeat_interval: 12h
|
|
|
|
# Info alerts - Gotify with lower priority
|
|
- match:
|
|
severity: info
|
|
receiver: 'info-alerts'
|
|
repeat_interval: 24h
|
|
|
|
# Alert receivers
|
|
receivers:
|
|
# Default receiver (catches all unmatched)
|
|
- name: 'default'
|
|
email_configs:
|
|
- to: 'admin@changemaker.local'
|
|
headers:
|
|
Subject: '[Changemaker] {{ .GroupLabels.alertname }}'
|
|
|
|
# Critical alerts - email + Gotify push
|
|
- name: 'critical-alerts'
|
|
email_configs:
|
|
- to: 'admin@changemaker.local'
|
|
headers:
|
|
Subject: 'CRITICAL Alert: {{ .GroupLabels.alertname }}'
|
|
html: |
|
|
<h2 style="color: #d32f2f;">Critical Alert Triggered</h2>
|
|
{{ range .Alerts }}
|
|
<p><strong>Alert:</strong> {{ .Labels.alertname }}</p>
|
|
<p><strong>Severity:</strong> {{ .Labels.severity }}</p>
|
|
<p><strong>Summary:</strong> {{ .Annotations.summary }}</p>
|
|
<p><strong>Description:</strong> {{ .Annotations.description }}</p>
|
|
<p><strong>Started:</strong> {{ .StartsAt }}</p>
|
|
<hr>
|
|
{{ end }}
|
|
# Gotify push notifications (configure GOTIFY_APP_TOKEN in .env)
|
|
# Uncomment and set the token to enable:
|
|
# webhook_configs:
|
|
# - url: 'http://gotify-changemaker:80/message?token=YOUR_GOTIFY_APP_TOKEN'
|
|
# send_resolved: true
|
|
# http_config:
|
|
# follow_redirects: true
|
|
|
|
# Warning alerts - email + optional Gotify
|
|
- name: 'warning-alerts'
|
|
email_configs:
|
|
- to: 'admin@changemaker.local'
|
|
headers:
|
|
Subject: 'Warning: {{ .GroupLabels.alertname }}'
|
|
# webhook_configs:
|
|
# - url: 'http://gotify-changemaker:80/message?token=YOUR_GOTIFY_APP_TOKEN'
|
|
|
|
# Info alerts - email only
|
|
- name: 'info-alerts'
|
|
email_configs:
|
|
- to: 'admin@changemaker.local'
|
|
headers:
|
|
Subject: 'Info: {{ .GroupLabels.alertname }}'
|
|
|
|
# Inhibition rules (prevent spam)
|
|
inhibit_rules:
|
|
# If a critical alert is firing, suppress related warnings
|
|
- source_match:
|
|
severity: 'critical'
|
|
target_match:
|
|
severity: 'warning'
|
|
equal: ['alertname', 'instance']
|
|
|
|
# If disk is critical, suppress disk warning
|
|
- source_match:
|
|
alertname: 'DiskSpaceCritical'
|
|
target_match:
|
|
alertname: 'DiskSpaceLow'
|
|
equal: ['instance']
|