mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-13 03:09:51 +03:00
testing/go-away: new aport
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>
This commit is contained in:
parent
5763083061
commit
b720d110c1
4 changed files with 99 additions and 0 deletions
43
testing/go-away/APKBUILD
Normal file
43
testing/go-away/APKBUILD
Normal file
|
@ -0,0 +1,43 @@
|
|||
# Contributor: Drew DeVault <drew@ddevault.org>
|
||||
# Contributor: Ferass El Hafidi <funderscore@postmarketos.org>
|
||||
# Maintainer: Ferass El Hafidi <funderscore@postmarketos.org>
|
||||
pkgname=go-away
|
||||
pkgver=0.7.0
|
||||
pkgrel=0
|
||||
pkgdesc="Self-hosted abuse detection and rule enforcement against low-effort mass AI scraping and bots"
|
||||
url="https://git.gammaspectra.live/git/go-away"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
makedepends="go>=1.24"
|
||||
subpackages="$pkgname-openrc"
|
||||
source="
|
||||
$pkgname-$pkgver.tar.gz::https://git.gammaspectra.live/git/go-away/archive/v$pkgver.tar.gz
|
||||
$pkgname.confd
|
||||
$pkgname.initd
|
||||
"
|
||||
options="net"
|
||||
builddir="$srcdir/$pkgname"
|
||||
|
||||
build() {
|
||||
go build $GOFLAGS -trimpath -o go-away ./cmd/go-away
|
||||
}
|
||||
|
||||
check() {
|
||||
go test ./...
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
|
||||
install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
|
||||
|
||||
install -Dm755 go-away "$pkgdir"/usr/bin/go-away
|
||||
|
||||
mkdir -p "$pkgdir"/etc/go-away/
|
||||
cp -R examples/* "$pkgdir"/etc/go-away/
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
96a4fe401e1491b4dbc9da2aebd35b41d7d5fd88d14bf6f73aab1367c0505e0164b4da1ff7909eeeb9be9227b697d18b539bcc519ae450b8f1de80b412fae370 go-away-0.7.0.tar.gz
|
||||
7c0e5a9a107a38a3ed1eacec7f332474e25662c2dfb713fc76f120766e499421e2710424e6550ccb5ee77bdbbeb2f810b21f42138f18e670f7ddbf4b33815e3c go-away.confd
|
||||
4704c568a9130479184edc86056467e0b132ae54b7e9734346c2f46dd1699a4c43061025e0e853135e60ee5e89b9c86c8cafe736392e8767939263b52fe45fc2 go-away.initd
|
||||
"
|
13
testing/go-away/go-away.confd
Normal file
13
testing/go-away/go-away.confd
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Configuration for /etc/init.d/go-away
|
||||
|
||||
# Run the daemon as this user:
|
||||
# GO_AWAY_USER=goaway
|
||||
|
||||
# Bind daemon to address:
|
||||
# GO_AWAY_BIND=:8080
|
||||
|
||||
# Policy file name
|
||||
# GO_AWAY_POLICY=/etc/go-away/generic.yml
|
||||
|
||||
# Additional arguments to provide to the daemon:
|
||||
# GO_AWAY_ARGS=
|
34
testing/go-away/go-away.initd
Normal file
34
testing/go-away/go-away.initd
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/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 $?
|
||||
}
|
9
testing/go-away/go-away.pre-install
Normal file
9
testing/go-away/go-away.pre-install
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
user=goaway
|
||||
group=goaway
|
||||
|
||||
addgroup -S $group 2>/dev/null
|
||||
adduser -S -D -H -s /sbin/nologin -G $group -g $user $user 2>/dev/null
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue