feat: event management and websocket for updates

This commit is contained in:
Andrew Rioux
2025-02-22 16:04:15 -05:00
parent 005048f1ce
commit faaa4d2d1a
48 changed files with 1409 additions and 204 deletions

View File

@@ -0,0 +1 @@
pub trait Action {}

View File

@@ -3,3 +3,6 @@
pub mod payload_types {
include!(concat!(std::env!("OUT_DIR"), "/bindings.rs"));
}
pub mod actions;
pub mod messages;

View File

@@ -0,0 +1,40 @@
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
#[derive(Clone, Serialize, Deserialize)]
pub struct RegisterBeacon {
pub beacon_id: String,
pub template_id: u16,
pub cwd: PathBuf,
pub operating_system: String,
pub userent: String,
pub hostname: String,
}
#[derive(Clone, Serialize, Deserialize)]
pub enum CronTimezone {
Utc,
Local,
}
#[derive(Clone, Serialize, Deserialize)]
pub enum RuntimeConfig {
Oneshot,
Random {
interval_min: u64,
interval_max: u64,
},
Regular {
interval: u64,
},
Cron {
schedule: String,
timezone: CronTimezone,
},
}
#[derive(Clone, Serialize, Deserialize)]
pub struct BeaconConfig {
pub runtime_config: RuntimeConfig,
}