Skip to content

Commit

Permalink
feat(better_uptime): allow disabling notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Jun 18, 2024
1 parent 01db31b commit 7518d38
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions infra/tf/better_uptime/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ resource "betteruptime_monitor" "monitor" {
value = "Bearer ${module.betteruptime_secrets.values["rivet/api_status/token"]}"
}
]
email = var.better_uptime_notify
push = var.better_uptime_notify
}

resource "betteruptime_status_page_resource" "status_page_resource" {
Expand Down
5 changes: 5 additions & 0 deletions infra/tf/better_uptime/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ variable "better_uptime" {
company_subdomain = string
})
}

variable "better_uptime_notify" {
type = bool
}

4 changes: 4 additions & 0 deletions lib/bolt/config/src/ns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@ pub struct BetterUptime {
/// It needs to be unique across all of Better Uptime. This is required
/// by Better Uptime.
pub company_subdomain: String,
/// If we should send push notifications.
///
/// SHould be disabled for staging environments.
pub notify: bool,
}

fn default_docker_repo() -> String {
Expand Down
2 changes: 2 additions & 0 deletions lib/bolt/core/src/dep/terraform/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ async fn vars(ctx: &ProjectContext) {
);

vars.insert("better_uptime".into(), json!(better_uptime.to_owned()));

vars.insert("better_uptime_notify".into(), json!(better_uptime.notify));
}

// Imagor
Expand Down

0 comments on commit 7518d38

Please sign in to comment.