浏览代码

chore: publish trust_cert\core\rule

Signed-off-by: zu1k <[email protected]>
zu1k 3 年之前
父节点
当前提交
742427f4c7
共有 5 个文件被更改,包括 17 次插入16 次删除
  1. 2 3
      Cargo.lock
  2. 1 1
      crates/core/Cargo.toml
  3. 5 1
      crates/rule/Cargo.toml
  4. 5 2
      crates/trust_cert/Cargo.toml
  5. 4 9
      crates/trust_cert/src/lib.rs

+ 2 - 3
Cargo.lock

@@ -695,7 +695,7 @@ dependencies = [
 
 
 [[package]]
 [[package]]
 name = "good-mitm-core"
 name = "good-mitm-core"
-version = "0.1.2"
+version = "0.1.3"
 dependencies = [
 dependencies = [
  "async-trait",
  "async-trait",
  "bytes",
  "bytes",
@@ -1933,9 +1933,8 @@ checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db"
 
 
 [[package]]
 [[package]]
 name = "trust_cert"
 name = "trust_cert"
-version = "0.0.2"
+version = "0.0.3"
 dependencies = [
 dependencies = [
- "cfg-if",
  "nix",
  "nix",
  "rcgen",
  "rcgen",
  "windows",
  "windows",

+ 1 - 1
crates/core/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 [package]
 name = "good-mitm-core"
 name = "good-mitm-core"
-version = "0.1.2"
+version = "0.1.3"
 edition = "2021"
 edition = "2021"
 description = "Use MITM technology to provide features like rewrite, redirect."
 description = "Use MITM technology to provide features like rewrite, redirect."
 homepage = "https://github.com/zu1k/good-mitm"
 homepage = "https://github.com/zu1k/good-mitm"

+ 5 - 1
crates/rule/Cargo.toml

@@ -2,10 +2,14 @@
 name = "good-mitm-rule"
 name = "good-mitm-rule"
 version = "0.1.0"
 version = "0.1.0"
 edition = "2021"
 edition = "2021"
-
+description = "Use MITM technology to provide features like rewrite, redirect."
+homepage = "https://github.com/zu1k/good-mitm"
+repository = "https://github.com/zu1k/good-mitm"
+license = "MIT"
 
 
 [dependencies]
 [dependencies]
 mitm-core = { path = "../core", package = "good-mitm-core" }
 mitm-core = { path = "../core", package = "good-mitm-core" }
+# mitm-core = { version = "0.1.3", package = "good-mitm-core" }
 
 
 anyhow = "1.0"
 anyhow = "1.0"
 async-trait = "0.1"
 async-trait = "0.1"

+ 5 - 2
crates/trust_cert/Cargo.toml

@@ -1,10 +1,13 @@
 [package]
 [package]
 name = "trust_cert"
 name = "trust_cert"
-version = "0.0.2"
+version = "0.0.3"
 edition = "2021"
 edition = "2021"
+description = "Install certificate to your system trust zone."
+homepage = "https://github.com/zu1k/good-mitm"
+repository = "https://github.com/zu1k/good-mitm"
+license = "MIT"
 
 
 [dependencies]
 [dependencies]
-cfg-if = "1"
 rcgen = { version = "0.9", features = ["x509-parser"] }
 rcgen = { version = "0.9", features = ["x509-parser"] }
 
 
 [target.'cfg(unix)'.dependencies]
 [target.'cfg(unix)'.dependencies]

+ 4 - 9
crates/trust_cert/src/lib.rs

@@ -8,13 +8,8 @@ mod linux;
 
 
 #[allow(unused_variables)]
 #[allow(unused_variables)]
 pub fn trust_cert(cert: Certificate) {
 pub fn trust_cert(cert: Certificate) {
-    cfg_if::cfg_if! {
-        if #[cfg(windows)] {
-            windows::install_cert(cert);
-        } else  if #[cfg(target_os = "linux")]  {
-            linux::install_cert(cert);
-        } else {
-            panic!("not implemented on this target")
-        }
-    }
+    #[cfg(windows)]
+    return windows::install_cert(cert);
+    #[cfg(target_os = "linux")]
+    return linux::install_cert(cert);
 }
 }