summaryrefslogtreecommitdiff
path: root/gnu/packages/web.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/web.scm')
-rw-r--r--gnu/packages/web.scm110
1 files changed, 110 insertions, 0 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 369c40606b7..0c2c5b335f9 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -142,6 +142,7 @@
142 #:use-module (gnu packages golang-build) 142 #:use-module (gnu packages golang-build)
143 #:use-module (gnu packages golang-check) 143 #:use-module (gnu packages golang-check)
144 #:use-module (gnu packages golang-compression) 144 #:use-module (gnu packages golang-compression)
145 #:use-module (gnu packages golang-crypto)
145 #:use-module (gnu packages golang-web) 146 #:use-module (gnu packages golang-web)
146 #:use-module (gnu packages golang-xyz) 147 #:use-module (gnu packages golang-xyz)
147 #:use-module (gnu packages gperf) 148 #:use-module (gnu packages gperf)
@@ -177,6 +178,7 @@
177 #:use-module (gnu packages nettle) 178 #:use-module (gnu packages nettle)
178 #:use-module (gnu packages networking) 179 #:use-module (gnu packages networking)
179 #:use-module (gnu packages node) 180 #:use-module (gnu packages node)
181 #:use-module (gnu packages node-xyz)
180 #:use-module (gnu packages nss) 182 #:use-module (gnu packages nss)
181 #:use-module (gnu packages nss) 183 #:use-module (gnu packages nss)
182 #:use-module (gnu packages openldap) 184 #:use-module (gnu packages openldap)
@@ -248,6 +250,114 @@
248 #:use-module (ice-9 match) 250 #:use-module (ice-9 match)
249 #:use-module ((srfi srfi-1) #:select (delete-duplicates))) 251 #:use-module ((srfi srfi-1) #:select (delete-duplicates)))
250 252
253(define-public anubis-ai-firewall
254 (package
255 ;; Name clashes with "anubis" in (gnu packages mail).
256 (name "anubis-ai-firewall")
257 (version "1.22.0")
258 (source
259 (origin
260 (method git-fetch)
261 (uri (git-reference
262 (url "https://github.com/TecharoHQ/anubis")
263 (commit (string-append "v" version))))
264 (file-name (git-file-name name version))
265 (patches
266 (search-patches "anubis-use-the-browser-native-web-crypto-api.patch"))
267 (sha256
268 (base32 "1vaj78727ndzsxydhdgwr9w0p9ykg73nkrbbiijh5l7lvabh3ric"))))
269 (build-system go-build-system)
270 (arguments
271 (list
272 ;; TODO: Enable some of them
273 #:tests? #f
274 ;; TODO: some JS work is required as app.js could not be found
275 #:install-source? #f
276 #:embed-files #~(list ".version"
277 ".*\\.tmpl"
278 ".*\\.js"
279 ".*\\.jsx"
280 ".*\\.mjs"
281 ".*\\.sh"
282 ".*\\.css"
283 "nodes"
284 "text"
285 "children")
286 #:import-path "github.com/TecharoHQ/anubis/cmd/anubis"
287 #:unpack-path "github.com/TecharoHQ/anubis"
288 #:phases
289 #~(modify-phases %standard-phases
290 (add-after 'unpack 'patch-usr-bin-env-shebangs
291 (lambda* (#:key unpack-path #:allow-other-keys)
292 (with-directory-excursion (string-append "src/" unpack-path)
293 (substitute* (find-files "." "\\.sh$")
294 (("#!/usr/bin/env bash")
295 (string-append "#!" (which "bash")))))))
296 (add-after 'patch-usr-bin-env-shebangs 'generate-code
297 (lambda* (#:key unpack-path #:allow-other-keys)
298 (with-directory-excursion (string-append "src/" unpack-path)
299 (for-each make-file-writable
300 (find-files "." "(_templ\\.go|_string\\.go)$"))
301 (invoke "templ" "generate")
302 (with-directory-excursion "internal/dnsbl"
303 (invoke "stringer" "-type=DroneBLResponse")))))
304 (add-after 'generate-code 'make-assets
305 (lambda* (#:key inputs unpack-path #:allow-other-keys)
306 (with-directory-excursion (string-append "src/" unpack-path)
307 (substitute* "xess/xess.go"
308 (("if anubis.Version != \"devel\" \\{")
309 "if false {"))
310 ;; Let esbuild resolve 'preact' and 'preact/hooks'.
311 (setenv "NODE_PATH"
312 (string-append (assoc-ref inputs "node-preact")
313 "/lib/node_modules"))
314 (invoke "./web/build.sh")
315 (invoke "./lib/challenge/preact/build.sh")))))))
316 (native-inputs
317 (list brotli
318 esbuild
319 go-github-com-a-h-templ
320 go-github-com-cespare-xxhash-v2
321 go-github-com-facebookgo-flagenv
322 go-github-com-gaissmai-bart
323 go-github-com-golang-jwt-jwt-v5
324 go-github-com-google-cel-go
325 go-github-com-google-uuid
326 go-github-com-grpc-ecosystem-go-grpc-middleware-providers-prometheus
327 go-github-com-grpc-ecosystem-go-grpc-middleware-v2
328 go-github-com-joho-godotenv
329 go-github-com-lum8rjack-go-ja4h
330 go-github-com-nicksnyder-go-i18n-v2
331 go-github-com-prometheus-client-golang
332 go-github-com-redis-go-redis-v9
333 go-github-com-sebest-xff
334 go-github-com-shirou-gopsutil-v4
335 go-github-com-techarohq-thoth-proto
336 go-go-etcd-io-bbolt
337 go-golang-org-x-net
338 go-golang-org-x-text
339 go-google-golang-org-grpc
340 go-gopkg-in-yaml-v3
341 go-k8s-io-apimachinery
342 go-sigs-k8s-io-yaml
343 go-tools
344 gzip
345 node-preact
346 templ
347 zstd))
348 (home-page "https://github.com/TecharoHQ/anubis")
349 (synopsis "Weighs the soul of incoming HTTP requests to stop AI crawlers")
350 (description
351 "Anubis is a Web AI Firewall Utility that weighs the soul of your
352connection using one or more challenges in order to protect upstream resources
353from scraper bots.
354
355This program is designed to help protect the small internet from the endless
356storm of requests that flood in from AI companies. Anubis is as lightweight as
357possible to ensure that everyone can afford to protect the communities closest
358to them.")
359 (license license:expat)))
360
251(define-public qhttp 361(define-public qhttp
252 (package 362 (package
253 (name "qhttp") 363 (name "qhttp")