Changeset 142 in code
- Timestamp:
- Aug 26, 2023, 11:57:19 AM (22 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.gitignore
r49 r142 1 morty 1 yukari -
trunk/CHANGELOG.md
r77 r142 1 # v0.2.1 - 2023.08.26 2 Applied some suggestions from the issue tracker, and 3 rebrand this fork. 4 1 5 # v0.2.0 - 2018.05.28 2 6 -
trunk/Makefile
r93 r142 1 APP_NAME=morty 1 all: build 2 2 3 bench: 4 go test -benchmem -bench . 3 5 build: 4 docker rmi -f $(APP_NAME):latest 5 docker build -t $(APP_NAME) . 6 7 run: 8 @echo "\n /!\ DO NOT use in production\n" 9 docker run --rm -t -i --net=host --name="$(APP_NAME)" $(APP_NAME) 6 go build -o yukari 7 clean: 8 rm -f yukari 9 test: 10 go test -
trunk/README.md
r140 r142 1 # Morty1 # Yukari 2 2 3 [](https://travis-ci.org/asciimoo/morty) 4 [](https://www.gnu.org/licenses/agpl-3.0) 5 [](https://hub.docker.com/r/dalf/morty) 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 [Yes, that Gap Youkai](https://en.touhouwiki.net/wiki/Yukari_Yakumo) 6 4 7 Web content sanitizer proxy as a service 5 Yukari rewrites web pages to exclude malicious HTML tags and attributes. It also replaces external resource references to prevent third party information leaks. 8 6 9 Morty rewrites web pages to exclude malicious HTML tags and attributes. It also replaces external resource references to prevent third party information leaks. 10 11 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. 7 The main goal of yukari is to provide a result proxy for [searx](https://asciimoo.github.com/searx/), but it can be used as a standalone sanitizer service too. 12 8 13 9 Features: … … 27 23 28 24 ``` 29 $ go install github.com/asciimoo/morty@latest30 $ "$GOPATH/bin/ morty" --help25 $ go install marisa.chaotic.ninja/yukari@latest 26 $ "$GOPATH/bin/yukari" --help 31 27 ``` 32 28 … … 39 35 Follow HTTP GET redirect 40 36 -hashparam string 41 User-defined requesting string HASH parameter name (ie: '/?hash=...' or '/?h=...') (default " mortyhash")37 User-defined requesting string HASH parameter name (ie: '/?hash=...' or '/?h=...') (default "yukarihash") 42 38 -ipv6 43 39 Allow IPv6 HTTP requests (default true) … … 55 51 Request timeout (default 5) 56 52 -urlparam string 57 User-defined requesting string URL parameter name (ie: '/?url=...' or '/?u=...') (default " mortyurl")53 User-defined requesting string URL parameter name (ie: '/?url=...' or '/?u=...') (default "yukariurl") 58 54 -version 59 55 Show version … … 62 58 ### Environment variables 63 59 64 Mortycan additionally be configured using the following environment variables:65 - ` MORTY_ADDRESS`: Listen address (default to `127.0.0.1:3000`)66 - ` 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.67 - ` MORTY_URL_PARAM`: User-defined requesting string URL parameter name (ie: `/?url=...` or `/?u=...`) (default `mortyurl`)68 - ` MORTY_HASH_PARAM`: User-defined requesting string HASH parameter name (ie: `/?hash=...` or `/?h=...`) (default `mortyhash`)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`) 69 65 - `DEBUG`: Enable/disable proxy and redirection logs (default to `true`). Set to `false` to disable. 70 71 ### Docker72 73 ```74 docker run -e DEBUG=false -e MORTY_ADDRESS=0.0.0.0:3000 dalf/morty75 ```76 77 ```78 docker run -e DEBUG=false dalf/morty -listen 0.0.0.0:300079 ```80 81 66 82 67 ### Test 83 68 84 69 ``` 85 $ cd "$GOPATH/src/ github.com/asciimoo/morty"70 $ cd "$GOPATH/src/marisa.chaotic.ninja/yukari" 86 71 $ go test 87 72 ``` … … 91 76 92 77 ``` 93 $ cd "$GOPATH/src/ github.com/asciimoo/morty"78 $ cd "$GOPATH/src/marisa.chaotic.ninja/yukari" 94 79 $ go test -benchmem -bench . 95 80 ``` … … 97 82 98 83 ## Bugs 99 100 Bugs or suggestions? Visit the [issue tracker](https://github.com/asciimoo/morty/issues). 84 Bugs or suggestions? Visit the [issue tracker](https://git.chaotic.ninja/yakumo.izuru/yukari/issues). -
trunk/config/config.go
r140 r142 20 20 21 21 func init() { 22 default_listen_addr := os.Getenv(" MORTY_ADDRESS")22 default_listen_addr := os.Getenv("YUKARI_ADDRESS") 23 23 if default_listen_addr == "" { 24 24 default_listen_addr = "127.0.0.1:3000" 25 25 } 26 default_url_parameter := os.Getenv(" MORTY_URL_PARAM")26 default_url_parameter := os.Getenv("YUKARI_URL_PARAM") 27 27 if default_url_parameter == "" { 28 default_url_parameter = " mortyurl"28 default_url_parameter = "yukariurl" 29 29 } 30 default_hash_parameter := os.Getenv(" MORTY_HASH_PARAM")30 default_hash_parameter := os.Getenv("YUKARI_HASH_PARAM") 31 31 if default_hash_parameter == "" { 32 default_hash_parameter = " mortyhash"32 default_hash_parameter = "yukarihash" 33 33 } 34 default_key := os.Getenv(" MORTY_KEY")34 default_key := os.Getenv("YUKARI_KEY") 35 35 DefaultConfig = &Config{ 36 36 Debug: os.Getenv("DEBUG") != "false", -
trunk/go.mod
r140 r142 1 module github.com/asciimoo/morty1 module marisa.chaotic.ninja/yukari 2 2 3 3 go 1.14
Note:
See TracChangeset
for help on using the changeset viewer.