diff --git a/srcpkgs/anubis/files/anubis/run b/srcpkgs/anubis/files/anubis/run new file mode 100644 index 00000000000..8ddc45db63a --- /dev/null +++ b/srcpkgs/anubis/files/anubis/run @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +exec 2>&1 + +[ -r ./conf ] && . ./conf + +exec chpst -u _anubis:_anubis anubis diff --git a/srcpkgs/anubis/patches/npm-assets.diff b/srcpkgs/anubis/patches/npm-assets.diff new file mode 100644 index 00000000000..554d49e31b4 --- /dev/null +++ b/srcpkgs/anubis/patches/npm-assets.diff @@ -0,0 +1,13 @@ +diff --git a/package.json b/package.json +index 4041096..c672d64 100644 +--- a/package.json ++++ b/package.json +@@ -6,7 +6,7 @@ + "scripts": { + "test": "npm run assets && go test ./...", + "test:integration": "npm run assets && go test -v ./internal/test", +- "assets": "go generate ./... && ./web/build.sh && ./xess/build.sh", ++ "assets": "./web/build.sh && ./xess/build.sh", + "build": "npm run assets && go build -o ./var/anubis ./cmd/anubis", + "dev": "npm run assets && go run ./cmd/anubis --use-remote-address", + "container": "npm run assets && go run ./cmd/containerbuild", diff --git a/srcpkgs/anubis/template b/srcpkgs/anubis/template new file mode 100644 index 00000000000..4d9d99b991f --- /dev/null +++ b/srcpkgs/anubis/template @@ -0,0 +1,29 @@ +# Template file for 'anubis' +pkgname=anubis +version=1.18.0 +revision=1 +build_style=go +go_import_path="github.com/TecharoHQ/anubis" +go_ldflags="-X ${go_import_path}.Version=${version}" +go_package=./cmd/anubis +make_check_args="-skip=TestPlaywrightBrowser" +hostmakedepends="nodejs esbuild zstd" +short_desc="Weighs the soul of requests using proof-of-work to stop crawlers" +maintainer="Luca Matei Pintilie " +license="MIT" +homepage="https://anubis.techaro.lol/" +changelog="https://github.com/TecharoHQ/anubis/releases" +distfiles="https://github.com/TecharoHQ/anubis/archive/refs/tags/v${version}.tar.gz" +checksum=b543f3c4af32a71994f4290b901b5670ce3cc7756b9db2c86d2569286d6dd6ef + +system_accounts="_anubis" + +pre_build() { + npm install --ignore-scripts + npm run assets +} + +post_install() { + vsv anubis + vlicense LICENSE +}