Work on runtime system

This commit is contained in:
Michael Mikovsky
2025-11-13 11:52:01 -07:00
parent 920a0f78e9
commit cc2b2960e8
18 changed files with 200 additions and 190 deletions
+22 -22
View File
@@ -1,30 +1,30 @@
use std::collections::HashMap;
use lazy_static::lazy_static;
use unshell_lib::{
ModuleError,
config::{PayloadConfig, RuntimeConfig},
module::{Manager, Module},
};
use unshell_obfuscate::symbol;
use unshell_obfuscate::{obs, symbol};
#[macro_use]
extern crate unshell_lib;
static PAYLOAD_CONFIG: PayloadConfig = PayloadConfig {
id: symbol!("Test ID"),
components: unshell_lib::get_components(),
runtime_config: vec![
RuntimeConfig {
"client"
}
],
};
// static RUNTIME_CONFIG: PayloadConfig = PayloadConfig {
// id: symbol!("Test ID"),
// components: Vec::new(),
// };
lazy_static! {
static ref PAYLOAD_CONFIG: PayloadConfig = PayloadConfig {
id: symbol!("Test ID"),
components: unshell_lib::get_components(),
runtime_config: vec![RuntimeConfig {
parent_component: symbol!("client"),
name: symbol!("client runtime"),
config: HashMap::from([(symbol!("host"), obs!("localhost:1234"))]),
}],
};
}
fn main() {
#[cfg(not(feature = "obfuscate"))]
// #[cfg(not(feature = "obfuscate"))]
unshell_lib::logger::PrettyLogger::init();
debug!("Initialized");
@@ -32,13 +32,13 @@ fn main() {
match || -> Result<(), ModuleError> {
let args = std::env::args();
// let mut modules = Vec::new();
// for arg in args.skip(1) {
// debug!("Loading module: {}", arg);
// modules.push(Module::new(&arg)?)
// }
let mut modules = Vec::new();
for arg in args.skip(1) {
debug!("Loading module: {}", arg);
modules.push(Module::new(&arg)?)
}
Manager::run(&PAYLOAD_CONFIG, Vec::new());
Manager::run(&PAYLOAD_CONFIG, modules);
Ok(())
}() {