shell
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2025-05-05 14:56:02 +02:00
parent 3af7b892b2
commit f10c7df262
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
10 changed files with 276 additions and 326 deletions

View file

@ -40,6 +40,19 @@ pub struct JoinResponse {
pub mqtt: String,
}
#[derive(Deserialize, Serialize)]
pub struct ShellParam {
pub cmd: String,
pub cwd: String,
}
#[derive(Deserialize, Serialize, Debug)]
pub struct ShellResponse {
pub stdout: String,
pub stderr: String,
pub status: i32,
}
/// Setup a MQTT connection for `machine_id` on `mqtt`.
///
/// This will connect either over `ws://` or `wss://` depending on the scheme of `mqtt`. By default it will use `wss://`.
@ -175,6 +188,7 @@ impl ClientAction {
#[derive(Debug, Serialize, Deserialize)]
pub enum ClientActions {
OSQuery(String),
Shell(String, String),
}
#[derive(Debug, Serialize, Deserialize)]
@ -195,4 +209,5 @@ impl ServerResponse {
#[derive(Debug, Serialize, Deserialize)]
pub enum ServerResponses {
OSQuery(String),
Shell(ShellResponse),
}