Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: https://svn.yakumo.dev/yakumo.izuru/yukari/trunk@150 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
yakumo.izuru 2024-03-24 00:58:49 +00:00
parent bb7614c3dc
commit 415db42f42
5 changed files with 40 additions and 25 deletions

View File

@ -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:

View File

@ -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

11
examples/yukari.ini Normal file
View File

@ -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

View File

@ -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

View File

@ -1,3 +1,4 @@
.\" $TheSupernovaDuo$
.Dd $Mdocdate$
.Dt YUKARI.INI 5
.Os