diff --git a/services/main.tf b/services/main.tf index e071918..607f419 100644 --- a/services/main.tf +++ b/services/main.tf @@ -49,190 +49,34 @@ resource "consul_config_entry" "nzbget_intents" { }) } -# module "nzbget" { -# source "./levant" -# -# template_path = "service.nomad" -# variables = { -# name = "nzbget" -# image = "linuxserver/nzbget" -# service_port = 6789 -# ingress = true -# env = jsonencode({ -# PGID = 100 -# PUID = 1001 -# TZ = "America/Los_Angeles" -# }) -# host_volumes = jsonencode([ -# { -# name = "download" -# dest = "/srv/volumes/download" -# read_only = false -# }, -# ]) -# } -# } -# -# module "sonarr" { -# source = "./levant" -# -# template_path = "service.nomad" -# variables = { -# name = "sonarr" -# image = "linuxserver/sonarr" -# service_port = 8989 -# ingress = true -# env = jsonencode({ -# PGID = 100 -# PUID = 1001 -# TZ = "America/Los_Angeles" -# -# }) -# host_volumes = jsonencode([ -# { -# name = "sonarr-data" -# dest = "/config" -# read_only = false -# }, -# { -# name = "tv-sonarr" -# dest = "/srv/volumes/media-write/TV Shows" -# read_only = false -# }, -# { -# name = "download" -# dest = "/srv/volumes/download" -# read_only = false -# }, -# ]) -# } -# } +module "minitor" { + source = "./service" -# resource "nomad_job" "photoprism" { -# jobspec = templatefile("services_tf.nomad", { -# vars = { -# name = "photoprism" -# image = "photoprism/photoprism:latest" -# ingress = true -# service_port = 2342 -# sticky_disk = true -# healthcheck = "/library/login" -# env = { -# PHOTOPRISM_SITE_CAPTION = "AI-Powered Photos App" -# PHOTOPRISM_SITE_DESCRIPTION = "Fijolek home photos" -# PHOTOPRISM_SITE_TITLE = "PhotoPrism" -# PHOTOPRISM_SITE_URL = "https://photoprism.thefij.rocks:2342/" # server URL in the format "http(s)://domain.name(:port)/(path)" -# PHOTOPRISM_SPONSOR = "true" -# # Paths -# PHOTOPRISM_ORIGINALS_PATH = "/photoprism-media/Library" -# PHOTOPRISM_IMPORT_PATH = "/photoprism-media/Import" -# PHOTOPRISM_STORAGE_PATH = "$${NOMAD_TASK_DIR}/storage" # Storage PATH for generated files like cache and index -# # Unix permissions -# PHOTOPRISM_UID = 500 -# PHOTOPRISM_GID = 100 -# PHOTOPRISM_UMASK = 0000 -# } -# mysql = true -# vault = true -# resources = { -# cpu = 100 -# memory = 500 -# memory_max = 1000 -# } -# host_volumes = [ -# { -# name = "photoprism-media" -# dest = "/photoprism-media" -# read_only = false -# }, -# ] -# mysql_bootstrap = { -# vault_key = "kv/data/photoprism" -# } -# templates = [ -# { -# data = < + curl -sS -X POST + -F subject="ALERT! {{.MonitorName}} is Down" + -F from="Minitor " + -F to=ian@iamthefij.com + -F text=$'{{.MonitorName}} has failed {{.FailureCount}} checks. Alert count: {{.AlertCount}}. Last success was {{.LastSuccess}}.\n\n-Nomad Minitor' + https://api.mailgun.net/v3/mg.iamthefij.com/messages + -u "api:$MAILGUN_API_KEY" + + mailgun_up: + command: > + curl -sS -X POST + -F subject="RECOVERED! {{.MonitorName}} is back Up" + -F from="Minitor " + -F to=ian@iamthefij.com + -F text=$'{{.MonitorName}} has recovered.\n\n-Nomad Minitor' + https://api.mailgun.net/v3/mg.iamthefij.com/messages + -u "api:$MAILGUN_API_KEY"