Compare commits

..

No commits in common. "fb0568bee64d541acb3dc85f4a286dd27dfb4148" and "f3e9cb92df364a6a0f59762456a5dc5c74a47bea" have entirely different histories.

36 changed files with 26 additions and 188 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
/target
.idea
Dockerfile
Cargo.lock
settings.json
hagent_test.sock

View File

@ -1,12 +1,24 @@
[workspace]
resolver = "2"
members = [
"noxis-rs",
"noxis-cli",
]
[package]
name = "runner-rs"
version = "0.10.11"
edition = "2021"
[profile.dev]
debug = true
[profile.test]
debug = false
[dependencies]
anyhow = "1.0.93"
chrono = "0.4.38"
clap = { version = "4.5.21", features = ["derive"] }
env_logger = "0.11.3"
inotify = "0.10.2"
log = "0.4.22"
pcap = "2.2.0"
redis = "0.25.4"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.118"
sysinfo = "0.32.0"
tokio = { version = "1.38.0", features = ["full", "time"] }

View File

@ -1,16 +1,13 @@
# noxis-rs
![Logo](logo.png)
### In-container integrating util to handle processes runtime
( with amd64 and riscv64 support )
# runner-rs ( with amd64 and riscv64 support )
![Logo](https://blog.desdelinux.net/wp-content/uploads/2023/07/rust-logo.png)
in-container integrating util to handle processes runtime
## Depends on
- `rustup (>=1.27.1)`
- `gcc-riscv64-unknown-elf`
- `build-essential`
- `gcc-riscv64-linux-gnu`
- `binutils-riscv64-linux-gnu`
## Setting up
Download and execute rustup.sh
@ -32,7 +29,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cd runner-rs/ && rustup target add riscv64gc-unknown-linux-gnu && rustup target add x86_64-unknown-linux-gnu
~~~
> [!NOTE]
> Cargo is configured to build an app for amd64/linux defaultly. RISCV-based compilation is optional.
> Cargo is configured to build an app for amd64/linux defaultly. RISC-based compilation is optional.
3.1. Release build of app for amd64/linux

BIN
logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

View File

@ -1,7 +0,0 @@
[package]
name = "noxis-cli"
version = "0.1.5"
edition = "2021"
[dependencies]
clap = { version = "4.5.22", features = ["derive"] }

View File

@ -1,134 +0,0 @@
use clap::{Parser, Subcommand};
#[derive(Debug, Parser)]
pub struct Cli {
#[command(
subcommand,
help = "status|start|stop|restart|",
)]
command : Commands,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
#[command(
about = "To get info about current Noxis status",
)]
Status,
#[command(
about = "To start Noxis process",
)]
Start,
#[command(
about = "To stop Noxis process",
)]
Stop,
#[command(
about = "To restart Noxis process",
)]
Restart,
#[command(
about = "To get list of processes that are being monitoring",
)]
Processes,
// process command
#[command(
about = "To manage current process that is being monitoring",
)]
Process(ProcessCommand),
// config command =
#[command(
about = "To manage config settings",
)]
Config(ConfigCommand),
}
#[derive(Debug, Parser)]
pub struct ConfigCommand {
#[command(subcommand)]
action : ConfigAction,
}
#[derive(Debug, Subcommand)]
pub enum ConfigAction {
#[command(
about = "To change current Noxis configuration",
)]
Local(LocalConfig),
#[command(
about = "To change credentials of the remote config server",
)]
Remote,
#[command(
about = "To reset all config settings",
)]
Reset,
}
#[derive(Debug, Parser)]
pub struct LocalConfig {
// flag
#[arg(
long = "json",
action,
help = "to read following input as JSON",
)]
type_of_entry : bool,
// value
#[arg(
help = "path to config file or config String (with --json flag)",
)]
config : String,
}
#[derive(Debug, Parser)]
pub struct ProcessCommand {
#[arg(
help = "name of needed process",
)]
process : String,
#[command(
subcommand,
help = "To get current process's status",
)]
action : ProcessAction,
}
#[derive(Debug, Subcommand)]
enum ProcessAction {
#[command(
about = "To get info about current process status",
)]
Status,
#[command(
about = "To start current process",
)]
Start,
#[command(
about = "To stop current process",
)]
Stop,
#[command(
about = "To freeze (hybernaze) current process",
)]
Freeze,
#[command(
about = "To unfreeze (unhybernaze) current process",
)]
Unfreeze,
#[command(
about = "To restart current process",
)]
Restart,
#[command(
about = "To get info about current process's dependencies",
)]
Deps,
#[command(
about = "To get info about current process's files-dependencies",
)]
Files,
#[command(
about = "To get info about current process's services-dependencies",
)]
Services,
}

View File

@ -1,11 +0,0 @@
mod cli;
use clap::Parser;
use cli::Cli;
fn main() -> Result<(), std::io::Error>{
let cli = Cli::parse();
dbg!(&cli);
println!("{:?}", cli);
Ok(())
}

View File

@ -1,18 +0,0 @@
[package]
name = "noxis-rs"
version = "0.10.11"
edition = "2021"
[dependencies]
anyhow = "1.0.93"
chrono = "0.4.38"
clap = { version = "4.5.21", features = ["derive"] }
env_logger = "0.11.3"
inotify = "0.10.2"
log = "0.4.22"
pcap = "2.2.0"
redis = "0.25.4"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.118"
sysinfo = "0.32.0"
tokio = { version = "1.38.0", features = ["full", "time"] }

View File

@ -98,10 +98,7 @@ pub async fn file_handler(
// * watcher recreation after dealing with file recreation mechanism in text editors
let mutex = notify.borrow_mut();
// *mutex = create_watcher(&file.filename, &file.src).await.unwrap();
if let Ok(watcher) = create_watcher(&file.filename, &file.src).await {
*mutex = watcher;
}
*mutex = create_watcher(&file.filename, &file.src).await.unwrap();
}
match file.triggers.on_change.as_str() {
"stop" => {