Telegrammy bits - Requires a patch to vigil itself.
Some checks failed
Trunk Check / Trunk Check Runner (push) Failing after 2s
Some checks failed
Trunk Check / Trunk Check Runner (push) Failing after 2s
This commit is contained in:
parent
4482dbb3c6
commit
793568095e
5 changed files with 51 additions and 21 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@
|
||||||
/terraform.tfstate*
|
/terraform.tfstate*
|
||||||
/.terraform.tfstate*
|
/.terraform.tfstate*
|
||||||
/.github/cache
|
/.github/cache
|
||||||
|
/terraform.tfvars
|
|
@ -7,19 +7,22 @@ locals {
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
vigil_toml = templatefile("${path.module}/vigil.toml.tpl", {
|
vigil_toml = templatefile("${path.module}/vigil.toml.tpl", {
|
||||||
manager_token = random_password.token["manager"].result
|
manager_token = random_password.token["manager"].result
|
||||||
reporter_token = random_password.token["worker"].result
|
reporter_token = random_password.token["worker"].result
|
||||||
page_title = var.page_title
|
page_title = var.page_title
|
||||||
page_url = var.page_url
|
page_url = var.page_url
|
||||||
company_name = var.company_name
|
company_name = var.company_name
|
||||||
icon_color = var.icon_color
|
icon_color = var.icon_color
|
||||||
icon_url = var.icon_url
|
icon_url = var.icon_url
|
||||||
logo_color = var.logo_color
|
logo_color = var.logo_color
|
||||||
logo_url = var.logo_url
|
logo_url = var.logo_url
|
||||||
website_url = var.website_url
|
website_url = var.website_url
|
||||||
support_url = var.support_url
|
support_url = var.support_url
|
||||||
custom_html = var.custom_html
|
custom_html = var.custom_html
|
||||||
services = local.services_toml
|
services = local.services_toml
|
||||||
|
startup_notification = var.notify_on_startup
|
||||||
|
telegram_bot_token = var.notify_telegram.token
|
||||||
|
telegram_chat_id = var.notify_telegram.channel
|
||||||
})
|
})
|
||||||
vigil_toml_checksum = md5(local.vigil_toml)
|
vigil_toml_checksum = md5(local.vigil_toml)
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,20 @@ variable "docker_networks" {
|
||||||
description = "Docker networks to connect the vigil service to"
|
description = "Docker networks to connect the vigil service to"
|
||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
variable "notify_on_startup" {
|
||||||
|
type = bool
|
||||||
|
description = "Whether to send a startup notifications"
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
variable "notify_telegram" {
|
||||||
|
type = object({
|
||||||
|
token = string
|
||||||
|
channel = string
|
||||||
|
topic = optional(string, null)
|
||||||
|
})
|
||||||
|
description = "Telegram configuration"
|
||||||
|
default = null
|
||||||
|
}
|
||||||
variable "monitored_services" {
|
variable "monitored_services" {
|
||||||
type = map(list(object({
|
type = map(list(object({
|
||||||
id = string
|
id = string
|
||||||
|
@ -26,7 +39,6 @@ variable "monitored_services" {
|
||||||
http_status_healthy_below = optional(number, 400)
|
http_status_healthy_below = optional(number, 400)
|
||||||
http_status_healthy_above = optional(number, 200)
|
http_status_healthy_above = optional(number, 200)
|
||||||
})))
|
})))
|
||||||
|
|
||||||
}
|
}
|
||||||
variable "page_title" {
|
variable "page_title" {
|
||||||
type = string
|
type = string
|
||||||
|
|
|
@ -54,14 +54,14 @@ queue_nack_dead_above = 5000
|
||||||
queue_loaded_retry_delay = 500
|
queue_loaded_retry_delay = 500
|
||||||
|
|
||||||
[notify]
|
[notify]
|
||||||
startup_notification = false
|
startup_notification = ${startup_notification}
|
||||||
reminder_interval = 600
|
reminder_interval = 600
|
||||||
reminder_backoff_function = "linear"
|
reminder_backoff_function = "linear"
|
||||||
reminder_backoff_limit = 3
|
reminder_backoff_limit = 3
|
||||||
|
|
||||||
#[notify.telegram]
|
[notify.telegram]
|
||||||
#bot_token = "xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
bot_token = "${telegram_bot_token}"
|
||||||
#chat_id = "xxxxxxxxx"
|
chat_id = "${telegram_chat_id}"
|
||||||
|
|
||||||
[probe]
|
[probe]
|
||||||
|
|
||||||
|
|
18
vigil.tf
18
vigil.tf
|
@ -9,7 +9,15 @@ module "vigil_nginx_config" {
|
||||||
allow_non_ssl = true
|
allow_non_ssl = true
|
||||||
allow_ssl = false
|
allow_ssl = false
|
||||||
}
|
}
|
||||||
|
variable "telegram_token" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
variable "telegram_channel" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
variable "telegram_topic" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
module "vigil" {
|
module "vigil" {
|
||||||
source = "./modules/vigil"
|
source = "./modules/vigil"
|
||||||
monitored_services = {
|
monitored_services = {
|
||||||
|
@ -53,7 +61,7 @@ module "vigil" {
|
||||||
id = "backup"
|
id = "backup"
|
||||||
label = "Backup Server"
|
label = "Backup Server"
|
||||||
endpoints = [
|
endpoints = [
|
||||||
"icmp://backup.ti",
|
#"icmp://backup.ti", # ??? Doesn't work?
|
||||||
"tcp://backup.ti:22",
|
"tcp://backup.ti:22",
|
||||||
"http://backup.ti",
|
"http://backup.ti",
|
||||||
]
|
]
|
||||||
|
@ -205,4 +213,10 @@ module "vigil" {
|
||||||
docker_networks = [
|
docker_networks = [
|
||||||
docker_network.loadbalancer
|
docker_network.loadbalancer
|
||||||
]
|
]
|
||||||
|
notify_on_startup = true
|
||||||
|
notify_telegram = {
|
||||||
|
token = var.telegram_token
|
||||||
|
channel = var.telegram_channel
|
||||||
|
topic = var.telegram_topic
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue