Compare commits
6 commits
3802ed126f
...
72e409f952
Author | SHA1 | Date | |
---|---|---|---|
72e409f952 | |||
ab2af2596e | |||
988da49567 | |||
03f4f6e000 | |||
4764aee800 | |||
3644ce33b3 |
1 changed files with 0 additions and 22 deletions
|
@ -1,7 +1,5 @@
|
||||||
use actix::prelude::*;
|
use actix::prelude::*;
|
||||||
use git_next_config::server::NotificationType;
|
|
||||||
use git_next_webhook_actor::{AddWebhookRecipient, ShutdownWebhook, WebhookActor, WebhookRouter};
|
use git_next_webhook_actor::{AddWebhookRecipient, ShutdownWebhook, WebhookActor, WebhookRouter};
|
||||||
use standardwebhooks::Webhook;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
messages::{ReceiveValidServerConfig, ValidServerConfig},
|
messages::{ReceiveValidServerConfig, ValidServerConfig},
|
||||||
|
@ -21,26 +19,6 @@ impl Handler<ReceiveValidServerConfig> for ServerActor {
|
||||||
if let Some(webhook_actor_addr) = self.webhook_actor_addr.take() {
|
if let Some(webhook_actor_addr) = self.webhook_actor_addr.take() {
|
||||||
webhook_actor_addr.do_send(ShutdownWebhook);
|
webhook_actor_addr.do_send(ShutdownWebhook);
|
||||||
}
|
}
|
||||||
match server_config.notification().r#type() {
|
|
||||||
NotificationType::None => { /* do nothing */ }
|
|
||||||
NotificationType::Webhook => {
|
|
||||||
// Create webhook signer
|
|
||||||
use secrecy::ExposeSecret;
|
|
||||||
let webhook = server_config
|
|
||||||
.notification()
|
|
||||||
.webhook_secret()
|
|
||||||
.map(|secret| Webhook::new(secret.expose_secret()))
|
|
||||||
.transpose()
|
|
||||||
.map_err(|e| {
|
|
||||||
tracing::error!(
|
|
||||||
"Invalid notification webhook secret (will not send notifications): {e}"
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.ok()
|
|
||||||
.flatten();
|
|
||||||
self.webhook = webhook;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
self.generation.inc();
|
self.generation.inc();
|
||||||
// Webhook Server
|
// Webhook Server
|
||||||
tracing::info!("Starting Webhook Server...");
|
tracing::info!("Starting Webhook Server...");
|
||||||
|
|
Loading…
Reference in a new issue