فهرست منبع

chore: Add docs

zu1k 4 سال پیش
والد
کامیت
7bd68139d9
14فایلهای تغییر یافته به همراه98 افزوده شده و 29 حذف شده
  1. 2 12
      README.md
  2. 0 0
      docs/.nojekyll
  3. 19 0
      docs/README.md
  4. 6 0
      docs/_sidebar.md
  5. 17 0
      docs/guide/0_cert.md
  6. 1 0
      docs/guide/1_rule.md
  7. 5 0
      docs/guide/2_proxy.md
  8. 3 0
      docs/guide/README.md
  9. 24 0
      docs/index.html
  10. 3 0
      docs/rule/README.md
  11. 3 0
      docs/rule/action.md
  12. 3 0
      docs/rule/filter.md
  13. 7 8
      rules/demo.yaml
  14. 5 9
      rules/youtube.yaml

+ 2 - 12
README.md

@@ -5,8 +5,9 @@
 [![GitHub issues](https://img.shields.io/github/issues/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/issues)
 [![Build](https://github.com/zu1k/good-mitm/actions/workflows/build.yml/badge.svg)](https://github.com/zu1k/good-mitm/actions/workflows/build.yml)
 [![GitHub license](https://img.shields.io/github/license/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/blob/master/LICENSE)
+[![Docs](https://img.shields.io/badge/docs-read-blue.svg?style=flat)](https://good-mitm.lgf.im)
 
-Use MITM technology to provide features like `rewrite`, `redirect`.
+Use MITM technology to provide features like `rewrite`, `redirect`, `reject`.
 
 ## Usage
 
@@ -30,17 +31,6 @@ You need to trust the root certificate just generated, either by adding trust in
 
 Adding `http` and `https` proxies to the browser, `http://127.0.0.1:34567` if not modified.
 
-### Test Demo Rules
-
-Now I add two demo websites, removing ADs using good-MITM `rewrite` feature.
-
-You should use the demo rule file, `good-mitm.exe -k private.key -c cert.crt -r ads.yaml`
-
-See the effect by comparing the content(ads) with and without using `good-MITM`.
-
-- [低端影视](https://ddrk.me/)
-- [奈菲影视](https://www.nfmovies.com/)
-
 ## Thanks
 
 - [**hudsucker**](https://github.com/omjadas/hudsucker): a Rust crate providing MITM features

+ 0 - 0
docs/.nojekyll


+ 19 - 0
docs/README.md

@@ -0,0 +1,19 @@
+# Good Man in the Middle
+
+[![GitHub stars](https://img.shields.io/github/stars/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/stargazers)
+[![GitHub forks](https://img.shields.io/github/forks/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/network)
+[![GitHub issues](https://img.shields.io/github/issues/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/issues)
+[![Build](https://github.com/zu1k/good-mitm/actions/workflows/build.yml/badge.svg)](https://github.com/zu1k/good-mitm/actions/workflows/build.yml)
+[![GitHub license](https://img.shields.io/github/license/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/blob/master/LICENSE)
+
+Use MITM technology to provide features like `rewrite`, `redirect`, `reject`.
+
+## Thanks
+
+- [**hudsucker**](https://github.com/omjadas/hudsucker): a Rust crate providing MITM features
+
+## License
+
+MIT License
+
+Copyright (c) 2021 zu1k

+ 6 - 0
docs/_sidebar.md

@@ -0,0 +1,6 @@
+* [介绍](/)
+* [指南](guide/README.md)
+  * [证书准备](guide/0_cert.md)
+* [Rule 规则](rule/README.md)
+  * [Filter 筛选器](rule/filter.md)
+  * [Action 动作](rule/action.md)

+ 17 - 0
docs/guide/0_cert.md

@@ -0,0 +1,17 @@
+# 证书准备
+
+### Certificate Preparation
+
+For MITM functionality, it is required that you trust the self-signed root certificate.
+
+#### Generate your own root certificate
+
+For security reasons, you need to generate your own root certificate.
+
+```shell
+good-mitm.exe genca
+```
+
+#### Trust your root certificate
+
+You need to trust the root certificate just generated, either by adding trust in your browser or in your operating system's root certificate list, as you wish.

+ 1 - 0
docs/guide/1_rule.md

@@ -0,0 +1 @@
+# 配置规则

+ 5 - 0
docs/guide/2_proxy.md

@@ -0,0 +1,5 @@
+# 设置代理
+
+### Use the proxy provided by `good-MITM`
+
+Adding `http` and `https` proxies to the browser, `http://127.0.0.1:34567` if not modified.

+ 3 - 0
docs/guide/README.md

@@ -0,0 +1,3 @@
+# 指南
+
+这是指南,不是指北

+ 24 - 0
docs/index.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+  <meta charset="UTF-8">
+  <title>Good-MITM 文档</title>
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+  <meta name="description" content="Description">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
+  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
+</head>
+<body>
+  <div id="app"></div>
+  <script>
+    window.$docsify = {
+      name: 'Good-MITM 文档',
+      repo: 'https://github.com/zu1k/good-mitm',
+      loadSidebar: true,
+      subMaxLevel: 2
+    }
+  </script>
+  <!-- Docsify v4 -->
+  <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
+</body>
+</html>

+ 3 - 0
docs/rule/README.md

@@ -0,0 +1,3 @@
+# Rule 规则
+
+Rule用来操控Good-MITM

+ 3 - 0
docs/rule/action.md

@@ -0,0 +1,3 @@
+# Action 动作
+
+`Action` 用来对请求或者返回进行操作

+ 3 - 0
docs/rule/filter.md

@@ -0,0 +1,3 @@
+# Filter 筛选器
+
+`Filter`用来筛选需要处理的请求和返回

+ 7 - 8
rules/demo.yaml

@@ -2,25 +2,24 @@
   filter:
     domain: 'none.lgf.im'
   action:
-    - redirect: "https://lgf.im/"
+    redirect: "https://lgf.im/"
 
 - name: "redirect regex"
   filter:
     url-regex: 'https://r.lgf.im(.*)'
   action:
-    - redirect: "https://lgf.im/$1"
+    redirect: "https://lgf.im/$1"
 
 - name: "reject CSDN"
   filter:
     domain-keyword: 'csdn'
-  action:
-    - reject
+  action: reject
 
 - name: "modify response header"
   filter:
     domain-suffix: 'lgf.im'
   action:
-    - modify-response:
-        header:
-          origin: "2021"
-          new: "2022"
+    modify-response:
+      header:
+        origin: "2021"
+        new: "2022"

+ 5 - 9
rules/youtube.yaml

@@ -3,28 +3,24 @@
   filter:
     url-regex: '(^https?:\/\/(?!redirector)[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+)(ctier=L)(&.+)'
   action:
-    - redirect: "$1$4"
+    redirect: "$1$4"
 
 - name: "youtube-2"
   filter:
     url-regex: '^https?:\/\/[\w-]+\.googlevideo\.com\/(?!(dclk_video_ads|videoplayback\?)).+(&oad|ctier)'
-  action:
-    - reject
+  action: reject
 
 - name: "youtube-3"
   filter:
     url-regex: '^https?:\/\/(www|s)\.youtube\.com\/api\/stats\/ads'
-  action:
-    - reject
+  action: reject
 
 - name: "youtube-4"
   filter:
     url-regex: '^https?:\/\/(www|s)\.youtube\.com\/(pagead|ptracking)'
-  action:
-    - reject
+  action: reject
 
 - name: "youtube-5"
   filter:
     url-regex: '^https?:\/\/\s.youtube.com/api/stats/qoe?.*adformat='
-  action:
-    - reject
+  action: reject