1 | # Yukari's Gap
|
---|
2 |
|
---|
3 | Web content sanitizer proxy as a service, fork of [MortyProxy](https://github.com/asciimoo/morty) with some suggestions from the issue tracker applied, named after [the youkai you shouldn't ever come near](https://en.touhouwiki.net/wiki/Yukari_Yakumo)
|
---|
4 |
|
---|
5 | Yukari's Gap rewrites web pages to exclude malicious HTML tags and attributes. It also replaces external resource references to prevent third party information leaks.
|
---|
6 |
|
---|
7 | The main goal of this tool is to provide a result proxy for [searx](https://asciimoo.github.com/searx/), but it can be used as a standalone sanitizer service too.
|
---|
8 |
|
---|
9 | Features:
|
---|
10 |
|
---|
11 | * HTML sanitization
|
---|
12 | * Rewrites HTML/CSS external references to locals
|
---|
13 | * JavaScript blocking
|
---|
14 | * No Cookies forwarded
|
---|
15 | * No Referrers
|
---|
16 | * No Caching/Etag
|
---|
17 | * Supports GET/POST forms and IFrames
|
---|
18 | * Optional HMAC URL verifier key to prevent service abuse
|
---|
19 |
|
---|
20 |
|
---|
21 | ## Installation and setup
|
---|
22 | Requirement: Go version 1.16 or higher.
|
---|
23 |
|
---|
24 | ```
|
---|
25 | $ go install marisa.chaotic.ninja/yukari@latest
|
---|
26 | $ "$GOPATH/bin/yukari" --help
|
---|
27 | ```
|
---|
28 |
|
---|
29 | ### Usage
|
---|
30 |
|
---|
31 | ```
|
---|
32 | -debug
|
---|
33 | Debug mode (default true)
|
---|
34 | -followredirect
|
---|
35 | Follow HTTP GET redirect
|
---|
36 | -hashparam string
|
---|
37 | User-defined requesting string HASH parameter name (ie: '/?hash=...' or '/?h=...') (default "yukarihash")
|
---|
38 | -ipv6
|
---|
39 | Allow IPv6 HTTP requests (default true)
|
---|
40 | -key string
|
---|
41 | HMAC url validation key (base64 encoded) - leave blank to disable validation
|
---|
42 | -listen string
|
---|
43 | Listen address (default "127.0.0.1:3000")
|
---|
44 | -proxy string
|
---|
45 | Use the specified HTTP proxy (ie: '[user:pass@]hostname:port'). Overrides -socks5, -ipv6.
|
---|
46 | -proxyenv
|
---|
47 | Use a HTTP proxy as set in the environment (HTTP_PROXY, HTTPS_PROXY and NO_PROXY). Overrides -proxy, -socks5, -ipv6.
|
---|
48 | -socks5 string
|
---|
49 | Use a SOCKS5 proxy (ie: 'hostname:port'). Overrides -ipv6.
|
---|
50 | -timeout uint
|
---|
51 | Request timeout (default 5)
|
---|
52 | -urlparam string
|
---|
53 | User-defined requesting string URL parameter name (ie: '/?url=...' or '/?u=...') (default "yukariurl")
|
---|
54 | -version
|
---|
55 | Show version
|
---|
56 | ```
|
---|
57 |
|
---|
58 | ### Environment variables
|
---|
59 |
|
---|
60 | Yukari can additionally be configured using the following environment variables:
|
---|
61 | - `YUKARI_ADDRESS`: Listen address (default to `127.0.0.1:3000`)
|
---|
62 | - `YUKARI_KEY`: HMAC url validation key (base64 encoded) to prevent direct URL opening. Leave blank to disable validation. Use `openssl rand -base64 33` to generate.
|
---|
63 | - `YUKARI_URL_PARAM`: User-defined requesting string URL parameter name (ie: `/?url=...` or `/?u=...`) (default `yukariurl`)
|
---|
64 | - `YUKARI_HASH_PARAM`: User-defined requesting string HASH parameter name (ie: `/?hash=...` or `/?h=...`) (default `yukarihash`)
|
---|
65 | - `DEBUG`: Enable/disable proxy and redirection logs (default to `true`). Set to `false` to disable.
|
---|
66 |
|
---|
67 | ### Test
|
---|
68 |
|
---|
69 | ```
|
---|
70 | $ cd "$GOPATH/src/marisa.chaotic.ninja/yukari"
|
---|
71 | $ go test
|
---|
72 | ```
|
---|
73 |
|
---|
74 |
|
---|
75 | ### Benchmark
|
---|
76 |
|
---|
77 | ```
|
---|
78 | $ cd "$GOPATH/src/marisa.chaotic.ninja/yukari"
|
---|
79 | $ go test -benchmem -bench .
|
---|
80 | ```
|
---|
81 |
|
---|
82 |
|
---|
83 | ## Bugs
|
---|
84 | Bugs or suggestions? Visit the [issue tracker](https://git.chaotic.ninja/yakumo.izuru/yukari/issues).
|
---|