WIP
This commit is contained in:
parent
cab771ab40
commit
14d8afa844
3 changed files with 5 additions and 2 deletions
|
@ -468,7 +468,7 @@ mod server {
|
||||||
let http = &server_config.http()?;
|
let http = &server_config.http()?;
|
||||||
let http_addr = http.ip();
|
let http_addr = http.ip();
|
||||||
let http_port = server_config.http()?.port();
|
let http_port = server_config.http()?.port();
|
||||||
let webhook_url = server_config.webhook().base_url();
|
let webhook_url = server_config.inbound_webhook().base_url();
|
||||||
let storage_path = server_config.storage().path();
|
let storage_path = server_config.storage().path();
|
||||||
let notification_webhook_url = server_config
|
let notification_webhook_url = server_config
|
||||||
.notification()
|
.notification()
|
||||||
|
|
|
@ -22,7 +22,7 @@ impl Handler<NotifyUser> for ServerActor {
|
||||||
let timestamp = timestamp.unix_timestamp();
|
let timestamp = timestamp.unix_timestamp();
|
||||||
let to_sign = format!("{message_id}.{timestamp}.{payload}");
|
let to_sign = format!("{message_id}.{timestamp}.{payload}");
|
||||||
tracing::info!(?to_sign, "");
|
tracing::info!(?to_sign, "");
|
||||||
let Some(webhook) = notification.webhook() else {
|
let Some(webhook) = self.webhook.as_ref() else {
|
||||||
tracing::warn!("Invalid notification configuration - can't sent notification");
|
tracing::warn!("Invalid notification configuration - can't sent notification");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,7 @@ use git_next_repo_actor::messages::NotifyUser;
|
||||||
use git_next_repo_actor::{messages::CloneRepo, RepoActor};
|
use git_next_repo_actor::{messages::CloneRepo, RepoActor};
|
||||||
use git_next_webhook_actor as webhook;
|
use git_next_webhook_actor as webhook;
|
||||||
use kxio::{fs::FileSystem, network::Network};
|
use kxio::{fs::FileSystem, network::Network};
|
||||||
|
use standardwebhooks::Webhook;
|
||||||
use std::{
|
use std::{
|
||||||
collections::BTreeMap,
|
collections::BTreeMap,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
|
@ -53,6 +54,7 @@ pub struct ServerActor {
|
||||||
repository_factory: Box<dyn RepositoryFactory>,
|
repository_factory: Box<dyn RepositoryFactory>,
|
||||||
sleep_duration: std::time::Duration,
|
sleep_duration: std::time::Duration,
|
||||||
repo_actors: BTreeMap<(ForgeAlias, RepoAlias), Addr<RepoActor>>,
|
repo_actors: BTreeMap<(ForgeAlias, RepoAlias), Addr<RepoActor>>,
|
||||||
|
webhook: Option<Webhook>,
|
||||||
|
|
||||||
// testing
|
// testing
|
||||||
message_log: Option<Arc<RwLock<Vec<String>>>>,
|
message_log: Option<Arc<RwLock<Vec<String>>>>,
|
||||||
|
@ -78,6 +80,7 @@ impl ServerActor {
|
||||||
repository_factory: repo,
|
repository_factory: repo,
|
||||||
sleep_duration,
|
sleep_duration,
|
||||||
repo_actors: BTreeMap::new(),
|
repo_actors: BTreeMap::new(),
|
||||||
|
webhook: None,
|
||||||
message_log: None,
|
message_log: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue