diff --git a/crates/ruci-cmd/src/main.rs b/crates/ruci-cmd/src/main.rs index 48df75f7..4e0656bd 100644 --- a/crates/ruci-cmd/src/main.rs +++ b/crates/ruci-cmd/src/main.rs @@ -25,9 +25,8 @@ enum Mode { /// Chain mode, which uses lua file #[default] C, - - /// Suit mode, which uses toml file - S, + // Suit mode, which uses toml file + // S, } /// ruci command line parameters: @@ -304,8 +303,7 @@ async fn start_engine( opts, ) .await?; - } - Mode::S => todo!(), + } //Mode::S => todo!(), } Ok(()) } diff --git a/resource/local.suit.toml b/dev_res/local.suit.toml similarity index 100% rename from resource/local.suit.toml rename to dev_res/local.suit.toml diff --git a/resource/remote.suit.toml b/dev_res/remote.suit.toml similarity index 100% rename from resource/remote.suit.toml rename to dev_res/remote.suit.toml diff --git a/doc/book/src/app/cmd.md b/doc/book/src/app/cmd.md index ab381328..1abf139d 100644 --- a/doc/book/src/app/cmd.md +++ b/doc/book/src/app/cmd.md @@ -11,6 +11,39 @@ ./ruci-cmd -c remote.lua +macOS 版本要在 系统App:Settings - Privacy & Security 里 allow 一下。 + +ruci-cmd 会在 下面文件夹中 找 指定的 配置文件 + + "./", + "ruci_config/", + "resource/", + +因此如果不想使用 默认打包的 resource 文件夹,可以将其改名为 resource_default, +然后 自己创建一个 ruci_config 文件夹,将自己的配置放在 ruci_config 中,这样 +就不会产生混淆 + +## log + +两种选择,使用命令行参数 或者使用 环境变量 + +-l, --log-level + +可为 ERROR, WARN, INFO , DEBUG, TRACE + +环境变量法比较高级: + +在命令的开头加上 + + RUST_LOG=none,ruci=debug + + powershell + $Env:RUST_LOG="none,ruci=debug"; + +这是在过滤 log, 对其它依赖包的 日志通通不要,只留 ruci 包自己的日志 + + + ## 高级用法 使用 infinite: diff --git a/doc/notes.md b/doc/notes.md index f12a368c..687b39ad 100644 --- a/doc/notes.md +++ b/doc/notes.md @@ -467,3 +467,7 @@ ip route add {v} dev {original_dev_name} metric 100 } ``` +## 日志 + +从0.0.6起,ruci 不再继续开发 suit 模式。所留代码仅作参考使用 + diff --git a/resource/README.md b/resource/README.md index 18001c95..165d6c8e 100644 --- a/resource/README.md +++ b/resource/README.md @@ -2,8 +2,6 @@ local*.lua, remote.lua 为 chain 模式的示例配置文件 -local.suit.toml, remote.suit.toml 为 suit 模式的示例配置文件 - test.crt, test.key 用于测试用于tls的自签名证书 test.crt 为 pem 格式的 x509 证书, test.key 为 pem 格式的 EC key diff --git a/rucimp/src/lib.rs b/rucimp/src/lib.rs index c6bfd59e..bafb5580 100644 --- a/rucimp/src/lib.rs +++ b/rucimp/src/lib.rs @@ -14,10 +14,11 @@ pub mod route; pub const VERSION: &str = env!("CARGO_PKG_VERSION"); -pub const COMMON_DIRS: [&str; 5] = [ +pub const COMMON_DIRS: [&str; 6] = [ "./", "ruci_config/", "resource/", + "dev_res/", "../resource/", "../../resource/", ]; diff --git a/rucimp/src/utils.rs b/rucimp/src/utils.rs index 865841c5..8108afe4 100644 --- a/rucimp/src/utils.rs +++ b/rucimp/src/utils.rs @@ -9,7 +9,7 @@ use tracing::{debug, info}; use crate::COMMON_DIRS; -/// try current folder and ruci_config, resource, ../resource folder +/// try folders in COMMON_DIRS /// /// try the default_file given or the first cmd argument ///