mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 03:35:38 +03:00
go-away is a self-hosted abuse detection software against low-effort mass AI scraping and bots. This APKBUILD is based on the apkbuild from sourcehut: https://git.sr.ht/~sircmpwn/sr.ht-apkbuilds/tree/master/item/sr.ht/go-away See also: <https://git.gammaspectra.live/git/go-away> Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
34 lines
895 B
Bash
34 lines
895 B
Bash
#!/sbin/openrc-run
|
|
supervisor=supervise-daemon
|
|
|
|
name="go-away"
|
|
description="Self-hosted abuse detection and rule enforcement against low-effort mass AI scraping and bots"
|
|
|
|
GO_AWAY_USER=${GO_AWAY_USER:-goaway}
|
|
GO_AWAY_BIND=${GO_AWAY_BIND:-:8080}
|
|
GO_AWAY_POLICY=${GO_AWAY_POLICY:-/etc/go-away/generic.yml}
|
|
LOGS=/var/log/go-away.log
|
|
|
|
command=/usr/bin/go-away
|
|
command_user=goaway:goaway
|
|
command_user="$GO_AWAY_USER:$GO_AWAY_USER"
|
|
command_args="--bind $GO_AWAY_BIND --config /etc/go-away/config.yml --policy-snippets /etc/go-away/snippets/ --policy $GO_AWAY_POLICY $GO_AWAY_ARGS"
|
|
supervise_daemon_args="-1 $LOGS -2 $LOGS"
|
|
|
|
extra_started_commands="reload"
|
|
description_reload="Reload configurationf ile"
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath -f "$LOGS" -m 644 -o $command_user
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading configuration"
|
|
$supervisor $RC_SVCNAME --signal HUP
|
|
eend $?
|
|
}
|