1 | # Morty
|
---|
2 |
|
---|
3 | [](https://travis-ci.org/asciimoo/morty)
|
---|
4 | [](https://www.gnu.org/licenses/agpl-3.0)
|
---|
5 |
|
---|
6 | Web content sanitizer proxy as a service
|
---|
7 |
|
---|
8 | Morty rewrites web pages to exclude malicious HTML tags and attributes. It also replaces external resource references to prevent third party information leaks.
|
---|
9 |
|
---|
10 | The main goal of morty is to provide a result proxy for [searx](https://asciimoo.github.com/searx/), but it can be used as a standalone sanitizer service too.
|
---|
11 |
|
---|
12 | Features:
|
---|
13 |
|
---|
14 | - HTML sanitization
|
---|
15 | - Rewrites HTML/CSS external references to locals
|
---|
16 | - JavaScript blocking
|
---|
17 | - No Cookies forwarded
|
---|
18 | - No Referrers
|
---|
19 | - No Caching/Etag
|
---|
20 | - Supports GET/POST forms and IFrames
|
---|
21 | - Optional HMAC URL verifier key to prevent service abuse
|
---|
22 |
|
---|
23 |
|
---|
24 | ## Installation and setup
|
---|
25 | Requirement: Go version 1.10 or higher.
|
---|
26 |
|
---|
27 | ```
|
---|
28 | $ go get github.com/asciimoo/morty
|
---|
29 | $ "$GOPATH/bin/morty" --help
|
---|
30 | ```
|
---|
31 |
|
---|
32 | ### Environment variables
|
---|
33 |
|
---|
34 | Morty can be configured using the following environment variables:
|
---|
35 | - `MORTY_ADDRESS`: Listen address (default to `127.0.0.1:3000`)
|
---|
36 | - `MORTY_KEY`: HMAC url validation key (base64 encoded) to prevent direct URL opening. Leave blank to disable validation. Use `openssl rand -base64 33` to generate.
|
---|
37 | - `DEBUG`: Enable/disable proxy and redirection logs (default to `true`). Set to `false` to disable.
|
---|
38 |
|
---|
39 | ### Docker
|
---|
40 |
|
---|
41 | ```
|
---|
42 | docker run -e DEBUG=false -e MORTY_ADDRESS=0.0.0.0:3000 -v ./rules.json:/etc/filtron/rules.json:rw dalf/morty
|
---|
43 | ```
|
---|
44 |
|
---|
45 | ```
|
---|
46 | docker run -e DEBUG=false -v ./rules.json:/etc/filtron/rules.json:rw dalf/morty -listen 0.0.0.0:3000
|
---|
47 | ```
|
---|
48 |
|
---|
49 |
|
---|
50 | ### Test
|
---|
51 |
|
---|
52 | ```
|
---|
53 | $ cd "$GOPATH/src/github.com/asciimoo/morty"
|
---|
54 | $ go test
|
---|
55 | ```
|
---|
56 |
|
---|
57 |
|
---|
58 | ### Benchmark
|
---|
59 |
|
---|
60 | ```
|
---|
61 | $ cd "$GOPATH/src/github.com/asciimoo/morty"
|
---|
62 | $ go test -benchmem -bench .
|
---|
63 | ```
|
---|
64 |
|
---|
65 |
|
---|
66 | ## Bugs
|
---|
67 |
|
---|
68 | Bugs or suggestions? Visit the [issue tracker](https://github.com/asciimoo/morty/issues).
|
---|