Page MenuHomeFreeBSD

D49563.1775373374.diff
No OneTemporary

Size
4 KB
Referenced Files
None
Subscribers
None

D49563.1775373374.diff

diff --git a/www/Makefile b/www/Makefile
--- 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
--- /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 <bsd.port.mk>
diff --git a/www/go-anubis/distinfo b/www/go-anubis/distinfo
new file mode 100644
--- /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
--- /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
--- /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
--- /dev/null
+++ b/www/go-anubis/pkg-message
@@ -0,0 +1,18 @@
+[
+{
+ type: install
+ message: <<EOM
+Anubis has been installed! Typically anubis is run behind a proxy, such as
+nginx, caddy, haproxy, or similar, that passes the `x-real-ip` header to
+anubis, which runs by default on port 8923. You will need to supply the
+target url that you are protecting.
+
+Amend rc.conf as required. For example:
+
+anubis_enable=YES
+anubis_args="-target http://localhost:4000/myapp -bind :8923"
+
+For more information, see https://anubis.techaro.lol/
+EOM
+}
+]

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 5, 7:16 AM (14 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28265179
Default Alt Text
D49563.1775373374.diff (4 KB)

Event Timeline