[1] | 1 | # Morty
|
---|
| 2 |
|
---|
[86] | 3 | [](https://travis-ci.org/asciimoo/morty)
|
---|
[84] | 4 | [](https://www.gnu.org/licenses/agpl-3.0)
|
---|
[81] | 5 |
|
---|
[1] | 6 | Web content sanitizer proxy as a service
|
---|
| 7 |
|
---|
[19] | 8 | Morty rewrites web pages to exclude malicious HTML tags and attributes. It also replaces external resource references to prevent third party information leaks.
|
---|
[1] | 9 |
|
---|
[6] | 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.
|
---|
[1] | 11 |
|
---|
[6] | 12 | Features:
|
---|
[1] | 13 |
|
---|
[19] | 14 | - HTML sanitization
|
---|
| 15 | - Rewrites HTML/CSS external references to locals
|
---|
[6] | 16 | - JavaScript blocking
|
---|
[19] | 17 | - No Cookies forwarded
|
---|
| 18 | - No Referrers
|
---|
| 19 | - No Caching/Etag
|
---|
[6] | 20 | - Supports GET/POST forms and IFrames
|
---|
[1] | 21 | - Optional HMAC URL verifier key to prevent service abuse
|
---|
| 22 |
|
---|
| 23 |
|
---|
| 24 | ## Installation and setup
|
---|
[82] | 25 | Requirement: Go version 1.10 or higher.
|
---|
[1] | 26 |
|
---|
| 27 | ```
|
---|
| 28 | $ go get github.com/asciimoo/morty
|
---|
| 29 | $ "$GOPATH/bin/morty" --help
|
---|
| 30 | ```
|
---|
| 31 |
|
---|
[101] | 32 | ### Environment variables
|
---|
[1] | 33 |
|
---|
[101] | 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 |
|
---|
[48] | 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 |
|
---|
[1] | 66 | ## Bugs
|
---|
| 67 |
|
---|
[101] | 68 | Bugs or suggestions? Visit the [issue tracker](https://github.com/asciimoo/morty/issues).
|
---|