Move ntfy into monitoring feature
Some checks failed
Run Check Script / check (pull_request) Failing after 2m5s
Some checks failed
Run Check Script / check (pull_request) Failing after 2m5s
This commit is contained in:
@@ -44,12 +44,6 @@ async fn main() {
|
||||
};
|
||||
|
||||
let topology = K8sAnywhereTopology::from_env();
|
||||
|
||||
// topology
|
||||
// .provision_tenant(&tenant.config)
|
||||
// .await
|
||||
// .expect("couldn't provision tenant");
|
||||
|
||||
let mut maestro = Maestro::initialize(Inventory::autoload(), topology)
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -61,59 +55,16 @@ async fn main() {
|
||||
framework: Some(RustWebFramework::Leptos),
|
||||
});
|
||||
|
||||
let ntfy = NtfyScore {
|
||||
namespace: tenant.clone().config.name,
|
||||
};
|
||||
|
||||
let ntfy_default_auth_username = "harmony";
|
||||
let ntfy_default_auth_password = "harmony";
|
||||
let ntfy_default_auth_header = format!(
|
||||
"Basic {}",
|
||||
general_purpose::STANDARD.encode(format!(
|
||||
"{ntfy_default_auth_username}:{ntfy_default_auth_password}"
|
||||
))
|
||||
);
|
||||
|
||||
let ntfy_default_auth_param = general_purpose::STANDARD
|
||||
.encode(ntfy_default_auth_header)
|
||||
.rsplit("=")
|
||||
.collect::<Vec<&str>>()[0]
|
||||
.to_string();
|
||||
|
||||
let ntfy_receiver = WebhookReceiver {
|
||||
name: "ntfy-webhook".to_string(),
|
||||
url: Url::Url(
|
||||
url::Url::parse(
|
||||
format!(
|
||||
"http://ntfy.{}.svc.cluster.local/rust-web-app?auth={ntfy_default_auth_param}",
|
||||
tenant.clone().config.name
|
||||
)
|
||||
.as_str(),
|
||||
)
|
||||
.unwrap(),
|
||||
),
|
||||
};
|
||||
|
||||
let alerting_score = HelmPrometheusAlertingScore {
|
||||
receivers: vec![Box::new(ntfy_receiver)],
|
||||
rules: vec![],
|
||||
service_monitors: vec![],
|
||||
};
|
||||
|
||||
let app = ApplicationScore {
|
||||
features: vec![
|
||||
Box::new(ContinuousDelivery {
|
||||
application: application.clone(),
|
||||
}), // TODO add monitoring, backups, multisite ha, etc
|
||||
Box::new(Monitoring {}),
|
||||
],
|
||||
application,
|
||||
};
|
||||
|
||||
maestro.register_all(vec![
|
||||
Box::new(tenant),
|
||||
Box::new(ntfy),
|
||||
Box::new(alerting_score),
|
||||
Box::new(app),
|
||||
]);
|
||||
maestro.register_all(vec![Box::new(app)]);
|
||||
harmony_cli::init(maestro, None).await.unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user