Commit Graph

144 Commits

Author SHA1 Message Date
Henri Vasserman
f879e0d307 fix(cmd/anubis): print "Rule error IDs" in JSON (#408)
* fix(cmd/anubis): print "Rule error IDs" in JSON

amend: add new gpg key

* chore: changelog
2025-05-02 18:05:41 +00:00
Xe Iaso
6e82373718 feat(config): allow multi-level imports (#402)
* feat(config): allow multi-level imports

Signed-off-by: Xe Iaso <me@xeiaso.net>

* chore(data): fix spelling of Marginalia

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-05-02 13:57:20 -04:00
Xe Iaso
f8e1000ab0 fix(yeetfile): copy all docs, data files, and botPolicies.yaml (#419)
* fix(yeetfile): copy all docs, data files, and botPolicies.yaml

Closes #415

Signed-off-by: Xe Iaso <me@xeiaso.net>

* ci: bump yeet

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-05-02 08:43:19 -04:00
Thomas Schuster
fa362c8ec9 docs(known-instances): Add FreeCAD Wiki to known instances (#414)
Update to #407 in accordance with https://blog.freecad.org/2025/04/30/forum-and-wiki-performance-anubis-deployed/

Signed-off-by: Thomas Schuster <twihno@gmail.com>
2025-05-02 08:39:01 -04:00
Lothar Serra Mari
5d9cc40e34 docs(known-instances): add ScummVM (#411)
Signed-off-by: Lothar Serra Mari <mail@serra.me>
2025-05-01 18:12:45 +00:00
Xe Iaso
63b8411220 Version 1.17.1: Asahi sas Brutus: Echo 1
- Added customization of authorization cookie expiration time with `--cookie-expiration-time` flag or envvar
- Updated the `OG_PASSTHROUGH` to be true by default, thereby allowing OpenGraph tags to be passed through by default
- Added the ability to [customize Anubis' HTTP status codes](./admin/configuration/custom-status-codes.mdx) ([#355](https://github.com/TecharoHQ/anubis/issues/355))

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-05-01 13:24:37 -04:00
Thomas Schuster
803aa35d66 Update known-instances.md (#407)
The FreeCAD forum is also using anubis

Signed-off-by: Thomas Schuster <twihno@gmail.com>
2025-05-01 14:27:27 +00:00
polcak
cb523333a1 Update information on workarounds for JShelter (#399)
* Update information on workarounds for JShelter

The previous version unnecessarily lowered the protection that JShelter brings to their users. This commits provides three alternatives that users can apply and the recommended one is easier than the original one and less invasive.

Signed-off-by: polcak <ipolcak@fit.vutbr.cz>

* docs(broken-extensions): amend wording, use an admonition, formatting

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: polcak <ipolcak@fit.vutbr.cz>
Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-05-01 13:20:39 +00:00
Jareth Gomes
91275c489f feat: make authorization cookie default expiration time customizable (#389) 2025-05-01 10:05:33 +00:00
Xe Iaso
feb3dd2bcb docs(known-instances): Comic Fanfiction Authors Archive
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-29 16:16:11 -04:00
Jason Cameron
06a762959f feat: enable Open Graph tag passthrough by default (#348)
* feat: enable Open Graph tag passthrough by default

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* docs(changelog): move opengraph passthrough on by default to unreleased

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Jason Cameron <git@jasoncameron.dev>
Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-04-29 19:19:46 +00:00
Xe Iaso
74d330cec5 feat(config): add ability to customize HTTP status codes Anubis returns (#393)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-29 15:13:44 -04:00
Xe Iaso
2935bd4aa7 docs(known-instances): add more Sourceware endpoints
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-29 15:08:37 -04:00
Xe Iaso
7d52e9ff5e docs(known-instances): add Sourceware
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-29 15:06:13 -04:00
Jason Cameron
4184b42282 feat(og): Foward host header (#370)
* feat(ogtags): enhance target URL handling for OGTagCache, support Unix sockets

Closes: #323 #319
Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* docs: update CHANGELOG.md to include Opengraph passthrough support for Unix sockets

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* docs: update CHANGELOG.md to include Opengraph passthrough support for Unix sockets

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* feat(ogtags): add option to consider host in Open Graph tag cache key

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* feat(ogtags): add option to consider host in OG tag cache key

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* test(ogtags): enhance tests for OGTagCache with host consideration scenarios

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* refactor(ogtags): extract constants for HTTP timeout and max content length

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* refactor(ogtags): restore fetchHTMLDocument method for cache key generation

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* refactor(ogtags): replace maxContentLength field with constant and ensure HTTP scheme is set correctly

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* fix(fetch): add proxy headers

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

---------

Signed-off-by: Jason Cameron <git@jasoncameron.dev>
2025-04-29 08:20:04 -04:00
Xe Iaso
7a20a46b0d docs(traefik): change title to Traefik
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-28 23:51:09 -04:00
Xe Iaso
b0f0913ea2 v1.17.0: Asahi sas Brutus
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-27 15:16:25 -04:00
p0008874
b08580ca33 docs(known-instances): add Codeberg. (#381)
Signed-off-by: p0008874 <75534590+p0008874@users.noreply.github.com>
2025-04-27 12:17:27 +00:00
Xe Iaso
ef52550e70 fix(config): remove trailing newlines in regexes (#373)
Closes #372

Fun YAML fact of the day:

What is the difference between how these two expressions are parsed?

```yaml
foo: >
  bar
```

```yaml
foo: >-
  bar
```

They are invisible in yaml, but when you evaluate them to JSON the
difference is obvious:

```json
{
  "foo": "bar\n"
}
```

```json
{
  "foo": "bar"
}
```

User-Agent strings, URL path values, and HTTP headers _do_ end in
newlines in HTTP/1.1 wire form, but that newline is usually stripped
before the server actually handles it. Also HTTP/2 is a thing and does
not terminate header values with newlines.

This change makes Anubis more aggressively detect mistaken uses of the
yaml `>` operator and nudges the user into using the yaml `>-` operator
which does not append the trailing newline.

I had honestly forgotten about this YAML behavior because it wasn't
relevant for so long. Oops! Glad I released a beta.

Whenever you get into this state, Anubis will throw a config parsing
error and then give you a message hinting at the folly of your ways.

```
config.Bot: regular expression ends with newline (try >- instead of > in yaml)
```

Big thanks to https://yaml-multiline.info, this helped me realize my
folly instantly.

@aiverson, this is official permission to say "told you so".

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-26 14:01:15 +00:00
Xe Iaso
c669b47b57 fix(lib): make Anubis less paranoid (#365)
Previously Anubis would aggressively make sure that the client cookie
matched exactly what it should. This has turned out to be too paranoid
in practice and has caused problems with Happy Eyeballs et. al.

This is a potential fix to #303 and #289.
2025-04-25 15:02:55 -04:00
Jason Cameron
24f8ba729b feat: add support for a base prefix (#294)
* fix: rename variable for preventing collision in ED25519 private key handling

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* fix: remove unused import and debug print in xess.go

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* feat: introduce base path configuration for Anubis endpoints

Closes: #231
Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* hack(internal/test): skip these tests for now

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(yeet): unbreak package builds

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Jason Cameron <git@jasoncameron.dev>
Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-04-25 14:39:38 -04:00
Sandro
6858f66a62 Add check endpoint which can be used with nginx' auth_request function (#266)
* Add check endpoint which can be used with nginx' auth_request function

* feat(cmd): allow configuring redirect domains

* test: add test environment for the nginx_auth PR

This is a full local setup of the nginx_auth PR including HTTPS so that
it's easier to validate in isolation.

This requires an install of k3s (https://k3s.io) with traefik set to
listen on localhost. This will be amended in the future but for now this
works enough to ship it.

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(cmd|lib): allow empty redirect domains variable

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(test): add space to target variable in anubis container

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs(admin): rewrite subrequest auth docs, make generic

* docs(install): document REDIRECT_DOMAINS flag

Signed-off-by: Xe Iaso <me@xeiaso.net>

* feat(lib): clamp redirects to the same HTTP host

Only if REDIRECT_DOMAINS is not set.

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-04-25 17:38:02 +00:00
Xe Iaso
a5d796c679 docs(install): note that Anubis needs certain paths proxied (#363)
Closes #310

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-25 17:32:29 +00:00
Maher
4d3353fdc5 fix(docs): fix typos in Traefik integration docs (#361)
- Fix wording and typos in the`traefix.mdx` file
- Add rendering fix for the NOTE due to syntax
2025-04-25 08:47:48 -04:00
Xe Iaso
bac942d2e8 sponsor: Distrust
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-25 00:25:03 -04:00
Xe Iaso
9fab74eb8a docs(README): enable dark mode for the star history view (#360)
Closes #340

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-25 03:26:35 +00:00
Diego E
e6a1c5309f docs: Fix nginx.mdx indentation (#359)
It would seem the file was originally edited for 2-space indentation but accidentally used tabs instead of actual spaces.

Signed-off-by: Diego E <diegoe@gnome.org>
2025-04-25 00:26:59 +00:00
Tristan Ross
5c29a66fcc docs(known-instances): add NixOS Hydra (#358) 2025-04-24 23:35:29 +00:00
Remy Zandwijk
b4f9269ae4 Fix Traegik but funny typos. (#356) 2025-04-24 18:54:53 +00:00
Igor Brai
54cd99c750 Fix: mojeekbot regex (#351)
* update mojeekbot UA regex

* add fix into changelog

* hack: empty commit to unbreak CI

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-04-24 14:24:41 +00:00
Luciano Hillcoat - lucdev.net
2320ef4014 feat(docs): add documentation for default allow behavior (#346) 2025-04-24 01:13:21 +00:00
Xe Iaso
cfbe16f2d0 feat(xess): move CSS color definitions to CSS variables (#339)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-23 12:07:53 +00:00
dependabot[bot]
1b206175f8 build(deps): bump estree-util-value-to-estree in /docs (#336)
Bumps [estree-util-value-to-estree](https://github.com/remcohaszing/estree-util-value-to-estree) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/remcohaszing/estree-util-value-to-estree/releases)
- [Commits](https://github.com/remcohaszing/estree-util-value-to-estree/compare/v3.3.2...v3.3.3)

---
updated-dependencies:
- dependency-name: estree-util-value-to-estree
  dependency-version: 3.3.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-23 07:09:01 -04:00
dependabot[bot]
3135abd0ec build(deps): bump http-proxy-middleware from 2.0.7 to 2.0.9 in /docs (#335)
Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.7 to 2.0.9.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.9/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.7...v2.0.9)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-version: 2.0.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-23 07:08:53 -04:00
Xe Iaso
74e11505c6 feat: enable loading config fragments (#321)
* feat(config): support importing bot policy snippets

This changes the grammar of the Anubis bot policy config to allow
importing from internal shared rules or external rules on the
filesystem.

This lets you create a file at `/data/policies/block-evilbot.yaml` and
then import it with:

```yaml
bots:
- import: /data/policies/block-evilbot.yaml
```

This also explodes the default policy file into a bunch of composable
snippets.

Thank you @Aibrew for your example gitea Atom / RSS feed rules!

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(data): update botPolicies.json to use imports

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(cmd/anubis): extract bot policies with --extract-resources

This allows a user that doesn't have anything but the Anubis binary to
figure out what the default configuration does.

* docs(data/botPolices.yaml): document import syntax in-line

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(lib/policy): better test importing from JSON snippets

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs(admin): Add import syntax documentation

This documents the import syntax and is based on the block comment at
the top of the default bot policy file.

* docs(changelog): add note about importing snippets

Signed-off-by: Xe Iaso <me@xeiaso.net>

* style(lib/policy/config): use an error value instead of an inline error

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-23 07:01:28 -04:00
Aurelia
4e2c9de708 feat(cmd/anubis): compute full XFF header (#328)
* feat(cmd/anubis): compute full XFF header

this one is pretty important to not pass
through blindly, as many applications and
frameworks will trust them

* feat(cmd/anubis): skip XFF compute if remote address is loopback

* docs: update CHANGELOG
2025-04-23 04:06:47 +00:00
Xe Iaso
bec7199ab6 fix(docs): make the docs respect light/dark mode (#334)
Closes #333

I'm very bad at design so I just picked colors that looked reasonable
enough to me. Hopefully this will be enough to get us to the next stage!

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-23 04:01:02 +00:00
Jason Cameron
78bb67fbf7 fix: improve error handling and create the json encoder once #331 (#332)
* fix: improve error handling for resource closing and JSON encoding in MakeChallenge

* chore: update CHANGELOG with recent changes and improvements

* refactor: simplify RenderIndex function and improve error handling

---------

Signed-off-by: Jason Cameron <git@jasoncameron.dev>
2025-04-22 20:31:19 -04:00
Xe Iaso
2db4105479 Update known-instances.md (#324)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-22 13:25:05 +00:00
Xe Iaso
3f1ce2d7ac data: disable generic-bot-catchall by default (#322)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-22 08:11:45 -04:00
Xe Iaso
84b28760b3 feat(lib): use Checker type instead of ad-hoc logic (#318)
This makes each check into its own type that has encapsulated check
logic, meaning that it's easier to add new checker implementations in
the future.

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-22 07:49:41 -04:00
Xe Iaso
9b7bf8ee06 docs: update default difficulty to 4
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-21 17:41:22 -04:00
Xe Iaso
1dae43f468 docs(known-instances): add Arch wiki
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-21 16:58:01 -04:00
Jason Cameron
2ecb15adac Update CHANGELOG.md (#313)
Signed-off-by: Jason Cameron <git@jasoncameron.dev>
2025-04-20 21:16:21 -04:00
Xe Iaso
d40b5cfdab lib: move config to yaml (#307)
* lib: move config to yaml

Signed-off-by: Xe Iaso <me@xeiaso.net>

* web: run go generate

Signed-off-by: Xe Iaso <me@xeiaso.net>

* Add Haiku to known instances (#304)

Signed-off-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>

* Add headers bot rule (#300)

* Closes #291: add headers support to bot policy rules

* Fix config validator

* update docs for JSON -> YAML

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs: document http header based actions

Signed-off-by: Xe Iaso <me@xeiaso.net>

* lib: add missing test

Signed-off-by: Xe Iaso <me@xeiaso.net>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>
Co-authored-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>
Co-authored-by: Neur0toxine <pashok9825@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-21 00:09:27 +00:00
Snoweuph
022eb59ff3 feat(docs): added info on how to configure traefik (#255)
* feat(docs): added info on how to configure traefik

* docs/admin/config/traefik: typo fixes

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-04-20 23:44:43 +00:00
Xe Iaso
65b533a014 Update known-instances.md (#309)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-20 22:31:45 +00:00
Thinkseal
2e3de07719 added an another git.lupancham.net to known instances of use (#296)
* Update CHANGELOG.md

Signed-off-by: Thinkseal <132022649+Thinkseal@users.noreply.github.com>

* Update known-instances.md to add git.lupancham.net

Signed-off-by: Thinkseal <132022649+Thinkseal@users.noreply.github.com>

---------

Signed-off-by: Thinkseal <132022649+Thinkseal@users.noreply.github.com>
Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-04-20 22:25:41 +00:00
Neur0toxine
7dc545cfa9 Add headers bot rule (#300)
* Closes #291: add headers support to bot policy rules

* Fix config validator
2025-04-20 22:18:21 +00:00
Asmodeus
1add24b907 Add Haiku to known instances (#304)
Signed-off-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>
2025-04-20 22:02:03 +00:00