Add configuration templates
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Luke Murphy 2021-01-08 12:32:51 +01:00
parent f2638d6b88
commit 5caa04b472
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
4 changed files with 130 additions and 0 deletions

25
alerta.conf.tmpl Normal file
View File

@ -0,0 +1,25 @@
[DEFAULT]
debug = {{ env "DEBUG" }}
endpoint = http://localhost:8080/api
key = {{ secret "alerta_cli_api_key" }}
output = json
sslverify = False
timezone = Europe/London
[alerta-mailer]
amqp_topic = notify
amqp_url = {{ env "MONGODB_TYPE" }}://{{ env "MONGODB_USER" }}:{{ secret "db_root_password" }}@{{ env "MONGODB_ADDR" }}/alerta
config_file = /app/alerta.conf
dashboard_url = https://{{ env "DOMAIN" }}
debug = {{ env "DEBUG" }}
email_type = text
endpoint = http://localhost:8080/api
key = {{ secret "alerta_mailer_api_key" }}
mail_from = {{ env "MAIL_FROM" }}
mail_template = /app/email.tmpl
mail_to = {{ env "MAIL_TO" }}
skip_mta = False
smtp_host = {{ env "SMTP_HOST" }}
smtp_password = {{ secret "smtp_passwd" }}
smtp_port = {{ env "SMTP_PORT" }}
smtp_starttls = {{ env "SMTP_STARTTLS" }}

71
alertad.conf.tmpl Normal file
View File

@ -0,0 +1,71 @@
SITE_LOGO_URL = "https://www.coops.tech/images/coops/autonomic"
DEBUG = {{ env "DEBUG" }}
SECRET = "{{ secret "alerta_secret_key" }}"
DASHBOARD_URL = "https://{{ env "DOMAIN" }}"
BASE_URL = "/api"
USE_PROXYFIX = True
AUTH_REQUIRED = True
AUTH_PROVIDER = "keycloak"
ADMIN_USERS = [{{ env "ADMIN_USERS" }}]
USER_DEFAULT_SCOPES = ["admin"]
SIGNUP_ENABLED = False
KEYCLOAK_URL = "{{ env "KEYCLOAK_URL" }}"
KEYCLOAK_REALM = "{{ env "KEYCLOAK_REALM" }}"
ALLOWED_KEYCLOAK_ROLES = ["{{ env "KEYCLOAK_ROLE" }}"]
OAUTH2_CLIENT_ID = "{{ env "OAUTH_CLIENT_ID" }}"
OAUTH2_CLIENT_SECRET = "{{ secret "oauth_client_secret" }}"
SEVERITY_MAP = {
"fatal": 0,
"critical": 1,
"major": 2,
"minor": 3,
"warning": 4,
"indeterminate": 5,
"cleared": 5,
"normal": 5,
"ok": 5,
"informational": 6,
"debug": 7,
"trace": 8,
"unknown": 9
}
DEFAULT_NORMAL_SEVERITY = "normal"
DEFAULT_PREVIOUS_SEVERITY = "indeterminate"
PLUGINS = [
"alerta-mailer",
"amqp",
"blackout",
"normalise",
"rocketchat",
]
AMQP_URL = "{{ env "MONGODB_TYPE" }}://{{ env "MONGODB_USER" }}:{{ secret "db_passwd" }}@{{ env "MONGODB_ADDR" }}/alerta
AMQP_TOPIC = "notify"
ROCKETCHAT_WEBHOOK_URL = "{{ secret "rocket_chat_webhook_url" }}"
ROCKETCHAT_CHANNEL = "{{ env "ROCKET_CHAT_CHANNEL" }}"
ALERTA_USERNAME = "{{ env "ROCKET_CHAT_ALERTA_USERNAME" }}"
ICON_EMOJI = "{{ env "ROCKET_CHAT_ICON_EMOJI" }}"
DATABASE_URL = "{{ env "MONGODB_TYPE" }}://{{ env "MONGODB_USER" }}:{{ secret "db_root_password" }}@{{ env "MONGODB_ADDR" }}/alerta
DATABASE_NAME = "{{ env "MONGODB_NAME" }}"
EMAIL_VERIFICATION = False
MAIL_FROM = "{{ env "MAIL_FROM" }}"
SMTP_HOST = "{{ env "SMTP_HOST" }}"
SMTP_PASSWORD = "{{ secret "smtp_passwd" }}"
SMTP_PORT = "{{ env "SMTP_PORT" }}"
SMTP_STARTTLS = {{ env "SMTP_STARTTLS" }}
SMTP_USERNAME = "{{ env "SMTP_USERNAME" }}"
CORS_ORIGINS = ["*"]

1
config.json.tmpl Normal file
View File

@ -0,0 +1 @@
{ "endpoint": "/api" }

33
email.tmpl Normal file
View File

@ -0,0 +1,33 @@
------------------------------------------------------------
[{{ alert.status|title }}] {{ alert.environment }}: {{ alert.severity|title }} {{ alert.event }} on {{ alert.service|join(', ') }} {{ alert.resource }}
------------------------------------------------------------
Alert ID: {{ alert.id }}
Create Time: {{ alert.create_time }}
Environment: {{ alert.environment }}
Services: {{ alert.service|join(', ') }}
Resource: {{ alert.resource }}
Event: {{ alert.event }}
Group: {{ alert.group }}
Value: {{ alert.value }}
Severity: {{ alert.previous_severity|title}} -> {{ alert.severity|title }}
Status: {{ alert.status|title }}
Text: {{ alert.text }}
Duplicate Count: {{ alert.duplicate_count }}
Origin: {{ alert.origin }}
Tags: {{ alert.tags|join(', ') }}
{% for key,value in alert.attributes.items() -%}
{{ key|title }}: {{ value }}
{% endfor -%}
{% if alert.raw_data %}
Raw Data
{{ alert.raw_data }}
{% endif %}
Dear Comrade, the infrastructure barricades require your attention. Plz send halp.
{{ dashboard_url }}/#/alert/{{ alert.id }}
Generated by {{ program }} on {{ hostname }} at {{ now }}