Compare commits

...

2 commits

Author SHA1 Message Date
d3acd365cc Added mitmproxy. Disabled mitmproxy.
Some checks failed
Trunk Check / Trunk Check Runner (push) Failing after 1s
2024-07-18 17:17:38 +02:00
35536c16d0 Nerf telegram/vigil code. 2024-07-18 17:17:26 +02:00
4 changed files with 51 additions and 3 deletions

44
mitmproxy.tf_ Normal file
View file

@ -0,0 +1,44 @@
data "docker_registry_image" "mitmproxy" {
name = "ghcr.io/benzine-framework/mitmproxy:10.1.1"
}
resource "docker_service" "mitmproxy" {
name = "mitmproxy"
task_spec {
container_spec {
image = "${data.docker_registry_image.mitmproxy.name}@${data.docker_registry_image.mitmproxy.sha256_digest}"
command = [
"mitmweb",
"--web-host", "0.0.0.0",
"--web-port", "8081",
#"--listen-host", "0.0.0.0",
#"--listen-port", "8080",
"--ssl-insecure",
]
#healthcheck {
# test = ["CMD-SHELL", " curl -I -x http://localhost:8080 -k http://172.17.0.1 || exit 1"]
# start_period = "10s"
# interval = "10s"
# timeout = "5s"
# retries = 5
#}
}
restart_policy {
condition = "any"
delay = "0s"
window = "0s"
}
}
endpoint_spec {
ports {
target_port = 8081
published_port = 8081
publish_mode = "ingress"
}
ports {
target_port = 8080
published_port = 8080
publish_mode = "ingress"
}
}
}

View file

@ -21,6 +21,7 @@ locals {
custom_html = var.custom_html custom_html = var.custom_html
services = local.services_toml services = local.services_toml
startup_notification = var.notify_on_startup startup_notification = var.notify_on_startup
telegram_enable = var.notify_telegram.token == "" ? "# " : "" // Disable telegram if token is not set
telegram_bot_token = var.notify_telegram.token telegram_bot_token = var.notify_telegram.token
telegram_chat_id = var.notify_telegram.channel telegram_chat_id = var.notify_telegram.channel
}) })

View file

@ -59,9 +59,9 @@ reminder_interval = 600
reminder_backoff_function = "linear" reminder_backoff_function = "linear"
reminder_backoff_limit = 3 reminder_backoff_limit = 3
[notify.telegram] ${telegram_enable}[notify.telegram]
bot_token = "${telegram_bot_token}" ${telegram_enable}bot_token = "${telegram_bot_token}"
chat_id = "${telegram_chat_id}" ${telegram_enable}chat_id = "${telegram_chat_id}"
[probe] [probe]

View file

@ -11,12 +11,15 @@ module "vigil_nginx_config" {
} }
variable "telegram_token" { variable "telegram_token" {
type = string type = string
default = ""
} }
variable "telegram_channel" { variable "telegram_channel" {
type = string type = string
default = ""
} }
variable "telegram_topic" { variable "telegram_topic" {
type = string type = string
default = ""
} }
module "vigil" { module "vigil" {
source = "./modules/vigil" source = "./modules/vigil"