Files
nixpkgs/pkgs/by-name/go/go-away/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

77 lines
1.8 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitea,
# asset compression
brotli,
zopfli,
# wasm compilation
clang,
tinygo,
}:
buildGoModule (finalAttrs: {
pname = "go-away";
version = "0.7.0";
src = fetchFromGitea {
domain = "git.gammaspectra.live";
owner = "git";
repo = "go-away";
tag = "v${finalAttrs.version}";
hash = "sha256-5rcuR3ke+BSgYJQbJhqQmDgjrtj6jt1Q18eLkRpp8wE=";
};
vendorHash = "sha256-DOAJrQlh+5gfxKIBbf5rEYt+hZ0luNkX4MxtwNoLiKo=";
nativeBuildInputs = [
# build-compress.sh
brotli
zopfli
# build-wasm.sh
clang
tinygo
];
postPatch = ''
patchShebangs *.sh
'';
preBuild = ''
./build-compress.sh
# build-wasm.sh
export HOME=$(mktemp -d)
go generate -v ./...
'';
subPackages = [
"cmd/go-away"
];
postInstall = ''
mkdir -p $out/lib/go-away
cp -rv examples/snippets $out/lib/go-away/
'';
meta = {
changelog = "https://git.gammaspectra.live/git/go-away/releases/tag/${finalAttrs.src.tag}";
description = "Self-hosted abuse detection and rule enforcement against low-effort mass AI scraping and bots";
longDescription = ''
go-away sits in between your site and the Internet / upstream proxy.
Incoming requests can be selected by rules to be actioned or challenged to filter suspicious requests.
The tool is designed highly flexible so the operator can minimize impact to legit users, while surgically targeting heavy endpoints or scrapers.
Challenges can be transparent (not shown to user, depends on backend or other logic), non-JavaScript (challenges common browser properties), or custom JavaScript (from Proof of Work to fingerprinting or Captcha is supported)
'';
homepage = "https://git.gammaspectra.live/git/go-away";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ hexa ];
};
})