(Broken) Work on new dynamic runtime config system

This commit is contained in:
Michael Mikovsky
2025-11-12 17:39:11 -07:00
parent 258599c9c7
commit 920a0f78e9
14 changed files with 319 additions and 93 deletions
+24 -6
View File
@@ -1,11 +1,28 @@
use unshell_lib::{
ModuleError,
config::{PayloadConfig, RuntimeConfig},
module::{Manager, Module},
};
use unshell_obfuscate::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(),
// };
fn main() {
#[cfg(not(feature = "obfuscate"))]
unshell_lib::logger::PrettyLogger::init();
@@ -15,12 +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)?)
}
Manager::run(modules);
// 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());
Ok(())
}() {