From 415db42f42a1fcb34e67cb106cec811bdd361878 Mon Sep 17 00:00:00 2001 From: "yakumo.izuru" Date: Sun, 24 Mar 2024 00:58:49 +0000 Subject: [PATCH] =?UTF-8?q?=E3=81=88=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Izuru Yakumo git-svn-id: https://svn.yakumo.dev/yakumo.izuru/yukari/trunk@150 f3bd38d9-da89-464d-a02a-eb04e43141b5 --- Makefile | 15 +++++++++------ README.md | 26 +++++++------------------- examples/yukari.ini | 11 +++++++++++ yukari.1 | 12 ++++++++++++ yukari.ini.5 | 1 + 5 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 examples/yukari.ini diff --git a/Makefile b/Makefile index a8e9ea1..5b17741 100644 --- a/Makefile +++ b/Makefile @@ -19,14 +19,17 @@ GOOS ?= linux all: yukari yukari: vendor - $(GO) build $(GOFLAGS) ./cmd/yukari + ${GO} build ${GOFLAGS} ./cmd/yukari clean: - $(RM) -f yukari + ${RM} -f yukari install: all - $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(BINDIR) - $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 - $(CP) -f yukari $(DESTDIR)$(PREFIX)/$(BINDIR) - $(CP) -f yukari.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 + ${MKDIR} -p ${DESTDIR}${PREFIX}/${BINDIR} + ${MKDIR} -p ${DESTDIR}${PREFIX}/${MANDIR}/man1 + ${MKDIR} -p ${DESTDIR}${PREFIX}/${MANDIR}/man5 + + ${CP} -f yukari ${DESTDIR}${PREFIX}/${BINDIR} + ${CP} -f yukari.1 ${DESTDIR}${PREFIX}/${MANDIR}/man1 + ${CP} -f yukari.ini.5 ${DESTDIR}${PREFIX}/${MANDIR}/man5 test: go test bench: diff --git a/README.md b/README.md index e1ec7d6..87d2f62 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Yukari's Gap - -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) +Web content sanitizer proxy as a service[^1], 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) 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. @@ -17,7 +16,6 @@ Features: * Supports GET/POST forms and IFrames * Optional HMAC URL verifier key to prevent service abuse - ## Installation and setup Requirement: Go version 1.16 or higher (thus making it incompatible with MortyProxy's own requirement, but also to use `go embed`) @@ -25,34 +23,24 @@ Requirement: Go version 1.16 or higher (thus making it incompatible with MortyPr $ go install marisa.chaotic.ninja/yukari/cmd/yukari@latest $ "$GOPATH/bin/yukari" --help ``` - ### Usage See `yukari(1)` -### Environment variables - -Yukari can additionally be configured using the following environment variables: -- `YUKARI_ADDRESS`: Listen address (default to `127.0.0.1:3000`) -- `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. -- `YUKARI_URL_PARAM`: User-defined requesting string URL parameter name (ie: `/?url=...` or `/?u=...`) (default `yukariurl`) -- `YUKARI_HASH_PARAM`: User-defined requesting string HASH parameter name (ie: `/?hash=...` or `/?h=...`) (default `yukarihash`) -- `DEBUG`: Enable/disable proxy and redirection logs (default to `true`). Set to `false` to disable. - ### Test ``` -$ cd "$GOPATH/src/marisa.chaotic.ninja/yukari" -$ go test +$ make test ``` - ### Benchmark ``` -$ cd "$GOPATH/src/marisa.chaotic.ninja/yukari" -$ go test -benchmem -bench . +$ make bench ``` - ## Bugs Bugs or suggestions? Mail [yukari-dev@chaotic.ninja](mailto:yukari-dev@chaotic.ninja) + +--- + +[^1]: or WCPaaS, mind you, also I didn't come up with that, it was already there when I arrived diff --git a/examples/yukari.ini b/examples/yukari.ini new file mode 100644 index 0000000..8ac94e4 --- /dev/null +++ b/examples/yukari.ini @@ -0,0 +1,11 @@ +[yukari] +debug=false +listen="127.0.0.1:3000" +key="" +ipv6=true +timeout=5 +followredirect=false +max_conns_per_host=5 +urlparam="yukariurl" +hashparam="yukarihash" +proxyenv=false diff --git a/yukari.1 b/yukari.1 index 7e4616f..4c6dfc7 100644 --- a/yukari.1 +++ b/yukari.1 @@ -1,3 +1,4 @@ +.\" $TheSupernovaDuo$ .Dd $Mdocdate$ .Dt YUKARI 1 .Os @@ -18,6 +19,17 @@ information leaks. .Pp The main goal of Yukari's Gap is to provide a result proxy for SearX, but it can be used as a standalone sanitizer service, too. +.Sh FEATURES +.Bl -tag -width Ds +.It HTML sanitization +.It Rewrites HTML/CSS external references to locals +.It JavaScript blocking +.It No Cookies forwarded +.It No Referrers +.It No Caching/ETag +.It Supports GET/POST forms and IFrames +.It Optional HMAC URL verifier key to prevent service abuse +.El .Sh OPTIONS .Bl -tag -width Ds .It Fl f Ar path diff --git a/yukari.ini.5 b/yukari.ini.5 index 5e3b2dc..e1213b4 100644 --- a/yukari.ini.5 +++ b/yukari.ini.5 @@ -1,3 +1,4 @@ +.\" $TheSupernovaDuo$ .Dd $Mdocdate$ .Dt YUKARI.INI 5 .Os