aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-04-27ci(packages): final pre-release yeet bump (#384)HEADmainXe Iaso2-2/+2
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-27refactor(lib): Split up anubis.go into some smaller files. (#379)Jason Cameron6-274/+308
* refactor(logging): centralize logger creation in GetLogger function Signed-off-by: Jason Cameron <git@jasoncameron.dev> * refactor(logging): rename GetLogger to GetRequestLogger for clarity Signed-off-by: Jason Cameron <git@jasoncameron.dev> * refactor: streamline error handling and response methods Signed-off-by: Jason Cameron <git@jasoncameron.dev> * refactor(lib): Split anubis.go up into some smaller specialized methods Signed-off-by: Jason Cameron <git@jasoncameron.dev> * refactor(http): simplify error response handling by using respondWithStatus Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore(lib): run goimports 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-27README: Fix broken link to policy definition docs. (#380)Kistaro Windrider1-1/+1
2025-04-27test(config): add Xesite's old policy file to known good test cases (#382)Xe Iaso1-0/+79
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-27docs(known-instances): add Codeberg. (#381)p00088741-2/+2
Signed-off-by: p0008874 <75534590+p0008874@users.noreply.github.com>
2025-04-26chore: blank commit to unbreak gitv1.17.0-beta4Xe Iaso0-0/+0
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-26fix(config): remove trailing newlines in regexes (#373)v1.17.0-beta31.17.0-beta2Xe Iaso8-9/+61
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-25fix(lib): make Anubis less paranoid (#365)v1.17.0-beta1Xe Iaso4-52/+3
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-25feat: add support for a base prefix (#294)Jason Cameron12-110/+490
* 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-25Add check endpoint which can be used with nginx' auth_request function (#266)Sandro20-51/+609
* 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-25docs(install): note that Anubis needs certain paths proxied (#363)Xe Iaso1-0/+6
Closes #310 Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-25fix(docs): fix typos in Traefik integration docs (#361)Maher1-29/+33
- Fix wording and typos in the`traefix.mdx` file - Add rendering fix for the NOTE due to syntax
2025-04-25feat: more elaborate XFF compute (#350)Aurelia8-22/+619
* feat: more elaborate XFF compute #328 followup now featuring configuration and defaults that shouldn't break most setups. fixes #344 * refactor: obvious condition eval order optimization * feat: add StripLLU implementation * chore: I'm sorry it's 7 AM * test: add test environment for unix socket serving Signed-off-by: Xe Iaso <me@xeiaso.net> * test(unix-socket-xff): comment out the shell script more Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(internal): fix logic bug in XFF computation, add tests Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(internal): prevent panic in local testing Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(internal): shuffle around return values to flow better 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-25docs(README): sponsor: DistrustXe Iaso1-3/+11
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-25sponsor: DistrustXe Iaso2-3/+13
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-25docs(README): enable dark mode for the star history view (#360)Xe Iaso2-3/+24
Closes #340 Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-25docs: Fix nginx.mdx indentation (#359)Diego E1-33/+33
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-24docs(known-instances): add NixOS Hydra (#358)Tristan Ross1-0/+1
2025-04-24Fix Traegik but funny typos. (#356)Remy Zandwijk1-2/+2
2025-04-24Fix: mojeekbot regex (#351)Igor Brai2-1/+2
* 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-24README: represent repology badge in 3 column format (#349)luzpaz1-1/+1
Signed-off-by: luzpaz <luzpaz@users.noreply.github.com>
2025-04-24fix(lib): use correct URL for path checker in PassChallenge (#347)compilade1-1/+11
Otherwise, `r.URL.Path` was always `/.within.website/x/cmd/anubis/api/pass-challenge` and this didn't match the path checker rules correctly, which caused a failure when the difficulty of these rules was non-default.
2025-04-24feat(docs): add documentation for default allow behavior (#346)Luciano Hillcoat - lucdev.net3-1/+94
2025-04-23feat(xess): move CSS color definitions to CSS variables (#339)Xe Iaso4-237/+288
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-23build(deps): bump estree-util-value-to-estree in /docs (#336)dependabot[bot]1-3/+3
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-23build(deps): bump http-proxy-middleware from 2.0.7 to 2.0.9 in /docs (#335)dependabot[bot]1-3/+3
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-23feat: enable loading config fragments (#321)Xe Iaso37-1305/+1210
* 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-23feat(cmd/anubis): compute full XFF header (#328)Aurelia3-0/+42
* 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-23fix(docs): make the docs respect light/dark mode (#334)Xe Iaso3-10/+53
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-22fix: improve error handling and create the json encoder once #331 (#332)Jason Cameron8-23/+48
* 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-22Update known-instances.md (#324)Xe Iaso1-0/+1
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-22chore(ci): migrate to TecharoHQ/yeet (#323)Xe Iaso2-2/+4
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-22data: disable generic-bot-catchall by default (#322)Xe Iaso4-18/+13
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-22feat(lib): use Checker type instead of ad-hoc logic (#318)Xe Iaso8-151/+453
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-21docs: update default difficulty to 4Xe Iaso3-3/+3
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-21docs(known-instances): add Arch wikiXe Iaso1-24/+25
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-20build(deps): bump astral-sh/setup-uv in the github-actions group (#312)dependabot[bot]1-1/+1
Bumps the github-actions group with 1 update: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv). Updates `astral-sh/setup-uv` from 5.4.1 to 5.4.2 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/0c5e2b8115b80b4c7c5ddf6ffdd634974642d182...d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: 5.4.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-20Update CHANGELOG.md (#313)Jason Cameron1-16/+16
Signed-off-by: Jason Cameron <git@jasoncameron.dev>
2025-04-21lib: move config to yaml (#307)Xe Iaso22-19/+854
* 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-20feat(docs): added info on how to configure traefik (#255)Snoweuph3-0/+213
* 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-20Update known-instances.md (#309)Xe Iaso1-0/+1
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-20added an another git.lupancham.net to known instances of use (#296)Thinkseal1-0/+1
* 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-20Add headers bot rule (#300)Neur0toxine9-21/+125
* Closes #291: add headers support to bot policy rules * Fix config validator
2025-04-20Add Haiku to known instances (#304)Asmodeus1-1/+2
Signed-off-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>
2025-04-20docs/admin/native-install: point people to the right places to get started ↵Xe Iaso1-0/+7
easier Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-20undo depot for now until I have the corp set upXe Iaso7-7/+7
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-20docs/admin/environments/docker-compose: fix heading levelXe Iaso1-1/+1
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-19Use outline shorthand (#293)Jason Cameron2-3/+2
* fix(xess): suppress Go inspection warning for boolean expressions Signed-off-by: Jason Cameron <git@jasoncameron.dev> * feat: use outline shorthand Signed-off-by: Jason Cameron <git@jasoncameron.dev> --------- Signed-off-by: Jason Cameron <git@jasoncameron.dev>
2025-04-19docs/admin: break per-environment details into their own pages (#292)Xe Iaso7-408/+490
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-04-19docs/admin/installation: Apache documentation (#290)Xe Iaso2-0/+143
* docs/admin/installation: Apache documentation Closes #277 This adds step by step documentation for setting up Anubis in Apache. * docs/admin/installation: add selinux troubleshooting Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>