From nobody Fri Apr 04 12:15:16 2025 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZTcxc2gmSz5sBPP; Fri, 04 Apr 2025 12:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZTcxc1wMfz3ssx; Fri, 04 Apr 2025 12:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743768916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3UnCbZneyfY3lflcONAmwSVHubFF9OVHYKBCSkeYyE=; b=lAIpkZ/1TlWg4M1T9qN5lG9n2vAmZk2t285Z1HVtwnqOFV8k3aqCI47onnNAjBv3yoLGUF bjusrnkkimSyzTAJVoBtP0IEP9YKoyA3gUkhxXFoHQ8R/K6p4T49jbRYmLTd9Dof1byzXq v0K+sEccKIbucF0ReclOyM5gKKKrgKcJx0yb1PojRBVNACkeHhO93Ql9+/5u6LlJ250w/b RF6bj/45bjyr8cc9I/UP8CsaT8a9U7MvkiV3T2ztNI77YNsEz0astsD64MehMoZSbP1fks /eGZVYFwIVtu+0+UlrHs+q7iGIwsrXGjqJ4Z2Gwr3IApOeFg9ZxeUovyf42vJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1743768916; a=rsa-sha256; cv=none; b=T1MS98fk4iVcTmUwlhVaB++ykFzeeuoIH37I2GorYTDuGrsDXFxTIPHUb9GU6IYfMy7jNJ U0i1BdoJPnefeiJ3cQTYp2czT0OCnL0E7DiR9TNaGTkPo/10tKGQjo58lMB74JJhYJTK2+ 290fitF/4dosfWFu7wxQwHQzcZ1rPUPIxGbp8QcHNM/ECwONymmdUyq4YvPtW2XlzG5k8M QDkhmp6gM5snR/knfkP/0u2hcBTiVEyjjftoQFReGwIHg4DyB8Gp5p2dg964ushix1bW6z wAzgdIpCHHltuYe+lXTYlPISvDUkoEEgQAFrH1q4mBPKiaNHprMAehFtMEhklQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743768916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3UnCbZneyfY3lflcONAmwSVHubFF9OVHYKBCSkeYyE=; b=OWYKwlooNuudteKAy7EjhPRW/Q9219D32YgIeE4BFB998buy8fLXgAIGF1DwuFvoRIdcQz ZlbtHG+PhzERpNiNusi0xAOfnVTqR1YeyWhhcsEse2g0J9BqOBatO03r+aJAAUFmPuDo0Z z1LOeZUXpNKb2ke5cH5OM6Gt6pY3C32LZmYO24J+O0lE1a0Z+8PjaeZbe7MJIIzIhq9slm 0SZ3vkLq1tlmlH3UfgxveGbdUwfWWWC7dA1/5DjDVrQoW+jPK5iD0hQPnEqtr0qwtyS205 wQRTSqDRXHNXOUnEcy3oXhg5wnVrLbTndlvXXBeUMp+t8MSx/3npr/EsVVIcbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZTcxc1W65zlyV; Fri, 04 Apr 2025 12:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 534CFGVW008609; Fri, 4 Apr 2025 12:15:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 534CFGwG008606; Fri, 4 Apr 2025 12:15:16 GMT (envelope-from git) Date: Fri, 4 Apr 2025 12:15:16 GMT Message-Id: <202504041215.534CFGwG008606@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 3745ef7406f7 - main - www/go-anubis: NEW PORT anti-scraper browser-based proof-of-work proxy List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3745ef7406f7579cea610caaa755d676f4d7f7af Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/ports/commit/?id=3745ef7406f7579cea610caaa755d676f4d7f7af commit 3745ef7406f7579cea610caaa755d676f4d7f7af Author: Dave Cottlehuber AuthorDate: 2025-04-04 10:23:48 +0000 Commit: Dave Cottlehuber CommitDate: 2025-04-04 12:14:25 +0000 www/go-anubis: NEW PORT anti-scraper browser-based proof-of-work proxy Differential Revision: https://reviews.freebsd.org/D49563 Reviewed by: diizzy Sponsored by: SkunkWerks, GmbH Tested by: dbaio, philip --- www/Makefile | 1 + www/go-anubis/Makefile | 27 ++++++++++++++++++++ www/go-anubis/distinfo | 5 ++++ www/go-anubis/files/anubis.in | 58 +++++++++++++++++++++++++++++++++++++++++++ www/go-anubis/pkg-descr | 16 ++++++++++++ www/go-anubis/pkg-message | 18 ++++++++++++++ 6 files changed, 125 insertions(+) diff --git a/www/Makefile b/www/Makefile index 82011589d55f..91d7aba25b4c 100644 --- a/www/Makefile +++ b/www/Makefile @@ -223,6 +223,7 @@ SUBDIR += glassfish4 SUBDIR += glpi SUBDIR += gnome-user-share + SUBDIR += go-anubis SUBDIR += go-www SUBDIR += gobuffalo SUBDIR += gohugo diff --git a/www/go-anubis/Makefile b/www/go-anubis/Makefile new file mode 100644 index 000000000000..ee3227e436a3 --- /dev/null +++ b/www/go-anubis/Makefile @@ -0,0 +1,27 @@ +PORTNAME= anubis +DISTVERSIONPREFIX= v +DISTVERSION= 1.15.1 +CATEGORIES= www +PKGNAMEPREFIX= go- + +MAINTAINER= dch@FreeBSD.org +COMMENT= Anti-scraper web proxy using browser-based proof-of-work challenges +WWW= https://anubis.techaro.lol/ + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= go:modules,1.24 +USE_RC_SUBR= ${PORTNAME} + +GO_MODULE= github.com/techarohq/${PORTNAME} +GO_TARGET= ./cmd/${PORTNAME} +GO_BUILDFLAGS= -ldflags="-X github.com/TecharoHQ/anubis.Version=v${DISTVERSION}" + +PLIST_FILES= sbin/${PORTNAME} + +do-install: + ${INSTALL_PROGRAM} ${WRKDIR}/bin/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/sbin/${PORTNAME} + +.include diff --git a/www/go-anubis/distinfo b/www/go-anubis/distinfo new file mode 100644 index 000000000000..fa33409aa6c7 --- /dev/null +++ b/www/go-anubis/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1743692515 +SHA256 (go/www_go-anubis/anubis-v1.15.1/v1.15.1.mod) = c4060528e14abead94fa468734829fd9ce1c88b9bea06ae6fed02d94c804013b +SIZE (go/www_go-anubis/anubis-v1.15.1/v1.15.1.mod) = 2190 +SHA256 (go/www_go-anubis/anubis-v1.15.1/v1.15.1.zip) = 7ca38367229c5cace57929a2fb7ff8ccbdde911e00bcf3ed7ef01b84a0902cd4 +SIZE (go/www_go-anubis/anubis-v1.15.1/v1.15.1.zip) = 1207282 diff --git a/www/go-anubis/files/anubis.in b/www/go-anubis/files/anubis.in new file mode 100644 index 000000000000..9a20142a7bee --- /dev/null +++ b/www/go-anubis/files/anubis.in @@ -0,0 +1,58 @@ +#!/bin/sh +# +# PROVIDE: anubis +# REQUIRE: DAEMON NETWORKING +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable anubis: +# anubis_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable anubis. +# anubis_user (user): Set to "www" by default. +# User to run anubis as. +# anubis_group (group): Set to "www" by default. +# Group to run anubis as. +# anubis_args (str): Set to "" by default. +# Extra flags passed to anubis. + +. /etc/rc.subr + +name=anubis +rcvar=anubis_enable + +load_rc_config $name + +: ${anubis_enable:="NO"} +: ${anubis_user:="www"} +: ${anubis_group:="www"} +: ${anubis_args:=""} + +pidfile="/var/run/${name}.pid" +daemon_pidfile="/var/run/${name}-daemon.pid" +procname="%%PREFIX%%/sbin/anubis" +command="/usr/sbin/daemon" +command_args="-f -c -R 5 -r -T ${name} -p ${pidfile} -P ${daemon_pidfile} ${procname} ${anubis_args}" + +start_precmd=anubis_startprecmd +stop_postcmd=anubis_stoppostcmd + +anubis_startprecmd() +{ + if [ ! -e ${daemon_pidfile} ]; then + install -o ${anubis_user} -g ${anubis_group} /dev/null ${daemon_pidfile}; + fi + if [ ! -e ${pidfile} ]; then + install -o ${anubis_user} -g ${anubis_group} /dev/null ${pidfile}; + fi +} + + +anubis_stoppostcmd() +{ + if [ -f "${daemon_pidfile}" ]; then + pids=$( pgrep -F ${daemon_pidfile} 2>&1 ) + _err=$? + [ ${_err} -eq 0 ] && kill -9 ${pids} + fi +} + +run_rc_command "$1" diff --git a/www/go-anubis/pkg-descr b/www/go-anubis/pkg-descr new file mode 100644 index 000000000000..de3309496cee --- /dev/null +++ b/www/go-anubis/pkg-descr @@ -0,0 +1,16 @@ +Anubis is a web proxy that protects upstream resources from scraper bots +by using a short hash-based proof-of-work challenge. It "weighs the soul of +your connection" to determine if you're a legitimate user or an automated bot. + +Anubis serves as a protective layer for websites that are being aggressively +scraped by AI bots and other automated systems that don't respect robots.txt +standards. It provides an alternative to services like Cloudflare when those +options aren't available or desired. + +The proof-of-work system requires clients to solve a computational challenge +before accessing protected content, effectively deterring most automated +scrapers while allowing legitimate users through with minimal disruption. + +It should be noted that Anubis may cause problems for accessibility of +protected websites, potentially confusing screen readers for blind users, +or other problems for assisted interaction. Please consider carefully. diff --git a/www/go-anubis/pkg-message b/www/go-anubis/pkg-message new file mode 100644 index 000000000000..d4e9cfa3dc58 --- /dev/null +++ b/www/go-anubis/pkg-message @@ -0,0 +1,18 @@ +[ +{ + type: install + message: <