Commit Graph
94 Commits
Author SHA1 Message Date
Xe Iaso b15017d097 docs/admin/native-install: point people to the right places to get started easier
Signed-off-by: Xe Iaso <[email protected]>
2025-04-20 13:51:45 -04:00
Xe Iaso 150523b9d3 docs/admin/environments/docker-compose: fix heading level
Signed-off-by: Xe Iaso <[email protected]>
2025-04-20 08:35:57 -04:00
Xe IasoandGitHub 75b97eb03d docs/admin: break per-environment details into their own pages (#292)
Signed-off-by: Xe Iaso <[email protected]>
2025-04-19 12:29:36 -04:00
Xe IasoandGitHub f5827721c3 docs/admin/installation: Apache documentation (#290)
* 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 <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-04-19 14:23:56 +00:00
a40c5e99fc Add more AI user agent in botPolicies.json (#249)
* Add more IA user agent in bot policies

* Update data/botPolicies.json

Signed-off-by: Xe Iaso <[email protected]>

* Fix trailling pipe that deny all requests

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-18 22:28:56 +00:00
af831f0d7f Add 'Opera' to 'generic-browser' bot policy rule (#220)
After deploying Anubis bot traffic is drastically reduced but I still
see a lot of requests from User-Agents that claim to be 'Opera' like so:

"Opera/9.90.(Windows NT 6.0; mt-MT) Presto/2.9.173 Version/10.00"
"Opera/8.46.(X11; Linux i686; fo-FO) Presto/2.9.161 Version/11.00"

Add 'Opera' to the generic-browser rule to also challenge them.

Signed-off-by: Michael Jeanson <[email protected]>
Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-18 17:57:02 +00:00
095e18d0c8 Allow ranges from the Internet Archive (AS7941) (#276)
* Allow ranges from the Internet Archive (AS7941)

* Updated changelog

* Update data/botPolicies.json

Signed-off-by: Xe Iaso <[email protected]>

* Removed overlapping CIDR for internet-archive in botPolicies.json

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-18 04:13:01 +00:00
Ryan CaoandGitHub f844dba3dc perf: embed challenge data in HTML (#279) 2025-04-18 00:06:37 -04:00
b20774d9a6 Docs: add nginx with Anubis in the middle configuration example (#282)
* Add documentation example for a NGINX configuration that demonstrates how to insert Anubis in the middle of a normal configuration.

Signed-off-by: Jeroen Massar <[email protected]>

* Add changelog entry

Signed-off-by: Jeroen Massar <[email protected]>

* docs/admin/installation: rephrasing and diagrams

Signed-off-by: Xe Iaso <[email protected]>

* docs/admin/installation: flatten down the nginx config

Signed-off-by: Xe Iaso <[email protected]>

* docs/admin/installation: other fixups and note the assumptions at play

Thanks @SuperSandro2000!

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Jeroen Massar <[email protected]>
Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-18 03:28:35 +00:00
Xe Iaso 2c94090fde README: add contributor images
Signed-off-by: Xe Iaso <[email protected]>
2025-04-16 12:40:56 -04:00
fossddandGitHub df3509ec99 docs/blog: remove (#273)
still leftovers from the docusaurus template
2025-04-15 23:23:26 -04:00
Paul WildeandGitHub 8689143214 Create Anubis FreeBSD rc.d script (#274)
* Create anubis.freebsd

add freebsd rc.d script so can be run as a freebsd daemon

Signed-off-by: Paul Wilde <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Paul Wilde <[email protected]>

---------

Signed-off-by: Paul Wilde <[email protected]>
2025-04-15 12:05:13 +00:00
B4uti4githubandGitHub ac273a8ad5 Update custom.css (#271) 2025-04-15 09:51:18 +00:00
Jason CameronandGitHub 9865e3ded8 fix(fetch): improve error handling for Content-Type parsing (#253)
* fix(fetch): improve error handling for Content-Type parsing

Signed-off-by: Jason Cameron <[email protected]>

* fix(fetch): rename OgHandledError to ErrOgHandled for statichcheck to like me

Signed-off-by: Jason Cameron <[email protected]>

---------

Signed-off-by: Jason Cameron <[email protected]>
2025-04-13 15:59:58 -04:00
hyperdefinedandGitHub f2cb6ae121 feat(docs): known users cleanup (#257) 2025-04-13 18:26:42 +00:00
rayerandGitHub 92dbc22db0 docs/docs/user/known-instances.md: remove duplicate scioly.org mention (#259)
Signed-off-by: rayer <[email protected]>
2025-04-13 05:00:12 +00:00
Jason CameronandGitHub 971e781965 feat(docs): expand known instances list with new entries and collapsible sections (#254)
Signed-off-by: Jason Cameron <[email protected]>
2025-04-12 19:47:25 +00:00
81307bcb5c feat: update botPolicies for DuckDuckGo web crawler (#250)
- updates botPolicies with ips from the website
- adds the updated information to the `CHANGELOG.md` file

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-12 02:13:38 +00:00
fossddandGitHub 40d7b2ec55 docs/user/known-instances: add page (#214)
I've been keeping a list in my head for a while, but I think a canonical
location with most known instances could help others, e.g. for deciding
wheather to use Anubis or not and to get in contact with Anubis operators.
2025-04-12 02:04:57 +00:00
Henri VassermanandGitHub 20f1d40b61 dev: Improvements to build scripts (#232)
* dev: make sure that stuff is building properly

* chore: changelog

* remove npx
2025-04-11 22:00:48 -04:00
Xe IasoandGitHub 51bd058f2d v1.16.0 (#244)
* v1.16.0

Signed-off-by: Xe Iaso <[email protected]>

* update packaging docs

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-04-10 00:07:14 +00:00
Patrick LinnaneandGitHub 1614504922 workflows: hash pin Actions (#203)
Signed-off-by: Patrick Linnane <[email protected]>
2025-04-08 00:45:06 -04:00
Xe IasoandGitHub 2eef15724b docs: fix edit me links and configuration subcategory (#238)
* docs: fix edit me links and configuration subcategory

Signed-off-by: Xe Iaso <[email protected]>

* remove this file that shouldn't exist

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-04-07 17:28:29 -04:00
acce3604a4 Add variable WEBMASTER_EMAIL and if present, display it on error page (#235)
* Add variable WEBMASTER_EMAIL and if present, display it on error page

    - Adresses issue https://github.com/TecharoHQ/anubis/issues/115

* web: regenerate templates

Signed-off-by: Xe Iaso <[email protected]>

* update docs

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-07 19:44:00 +00:00
77436207e6 feat: Add Open Graph tag support (#195)
* feat: Add Open Graph tag support (og-tags)

Signed-off-by: Jason Cameron <[email protected]>

* Fix: Prevent nil pointer dereference in test (og-tags)

Signed-off-by: Jason Cameron <[email protected]>

* feat!: Implement Open Graph tag caching and passthrough functionality (WIP)

I'm going to sleep. currently tags are passed to renderIndex.

see https://github.com/TecharoHQ/anubis/issues/131

Signed-off-by: Jason Cameron <[email protected]>

* feat: Add configuration for air tool with build and logger settings

Signed-off-by: Jason Cameron <[email protected]>

* feat: Move OG tags to base template (og-tags)

Moves the Open Graph (OG) tags from the index template to
the base template. This allows OG tags to be set on any
page, not just the index.  Also adds a
BaseWithOGTags function to the web package to allow
passing OG tags to the base template.  Removes the
ogTags parameter from the Index function and template.

Signed-off-by: Jason Cameron <[email protected]>

* Delete CHANGELOG.md

Signed-off-by: Jason Cameron <[email protected]>

* feat: Add language attribute to HTML tag in template

Signed-off-by: Jason Cameron <[email protected]>

* fix(tests):  Fix nil pointer ref

Signed-off-by: Jason Cameron <[email protected]>

* feat(og-tags): Add timeout to http client (og-tags)

Signed-off-by: Jason Cameron <[email protected]>

* style: fix line endings & indentation

Signed-off-by: Jason Cameron <[email protected]>

* style: add inspection comment for GoBoolExpressions in UnchangingCache

Signed-off-by: Jason Cameron <[email protected]>

* feat(og-tags): Implement Open Graph tag fetching and caching

Signed-off-by: Jason Cameron <[email protected]>

* fix(og-tags): Simplify Open Graph tag extraction logic

Signed-off-by: Jason Cameron <[email protected]>

* fix(og-tags): Add nil check in isOGMetaTag and enhance test cases

Signed-off-by: Jason Cameron <[email protected]>

* feat(og-tags): Add approved tags and prefixes for Open Graph extraction

Signed-off-by: Jason Cameron <[email protected]>

* test(og-tags): Update tests with approved tags and improve clarity

Signed-off-by: Jason Cameron <[email protected]>

* chore: Add changelog notes

Signed-off-by: Jason Cameron <[email protected]>

* fix: Improve stability of the target fetcher?

Signed-off-by: Jason Cameron <[email protected]>

* fix: Update template error handling and improve Open Graph tag integration

Signed-off-by: Jason Cameron <[email protected]>

* style: format files and remove deubg logs

Signed-off-by: Jason Cameron <[email protected]>

* feat: Credit CELPHASE for mascot design (og-tags)

Signed-off-by: Jason Cameron <[email protected]>

* feat: Credit CELPHASE for mascot design (og-tags)

Signed-off-by: Jason Cameron <[email protected]>

* feat: Allow twitter prefixed OG tags by default

Signed-off-by: Jason Cameron <[email protected]>

* chore: replace /tmp with /var

Signed-off-by: Jason Cameron <[email protected]>

* Update docs/docs/CHANGELOG.md

Co-authored-by: Xe Iaso <[email protected]>
Signed-off-by: Jason Cameron <[email protected]>

* Update docs/docs/admin/configuration/open-graph.mdx

Co-authored-by: Xe Iaso <[email protected]>
Signed-off-by: Jason Cameron <[email protected]>

* chore: add fediverse to default prefixes (#og-tags)

Signed-off-by: Jason Cameron <[email protected]>

* feat(og-tags): Remove og-query-distinct flag

This commit removes the `og-query-distinct` flag and
associated logic.  URLs with different query parameters
will now always be treated as the same cache key for Open
Graph tags.  This simplifies the caching logic and
improves performance.

Additionally, the http client used for fetching OG tags
is now a member of the OGTagCache struct, rather than a
global variable. This improves testability and allows
for more flexible configuration in the future.

Signed-off-by: Jason Cameron <[email protected]>

* Update docs/docs/admin/configuration/open-graph.mdx

Co-authored-by: Xe Iaso <[email protected]>
Signed-off-by: Jason Cameron <[email protected]>

* docs: remove og tags references

Signed-off-by: Jason Cameron <[email protected]>

* refactor: rename url > u to not overlap package name

Signed-off-by: Jason Cameron <[email protected]>

* Update internal/ogtags/cache.go

Co-authored-by: Xe Iaso <[email protected]>
Signed-off-by: Jason Cameron <[email protected]>

* Update internal/ogtags/cache.go

Co-authored-by: Xe Iaso <[email protected]>
Signed-off-by: Jason Cameron <[email protected]>

* fix(tests): Don't use network when network access is disabled

Signed-off-by: Jason Cameron <[email protected]>

* Fix: Handle nil URL in GetOGTags (og-tags)

Signed-off-by: Jason Cameron <[email protected]>

* chore: sort installation docs alphabetically

Signed-off-by: Jason Cameron <[email protected]>

* fix(tests): validate that no duplicate requests are made

Signed-off-by: Jason Cameron <[email protected]>

* style(tests): remove unused ok var

Signed-off-by: Jason Cameron <[email protected]>

* docs: convert to table fmt

Signed-off-by: Jason Cameron <[email protected]>

* feat(og-tags): Enhance OG tag fetching and caching

Adds additional approved OG tags (`keywords`, `author`), improves

Signed-off-by: Jason Cameron <[email protected]>

* chore: update generated templ's after format

Signed-off-by: Jason Cameron <[email protected]>

* fix(tests): update integration_test.go to reflect the new behavior of fetchHTMLDocument

Signed-off-by: Jason Cameron <[email protected]>

* Revert "data/botPolicies: allow iMessage scraper by default (#178)"

This reverts commit 21a9d777

Signed-off-by: Jason Cameron <[email protected]>

* Fix: Simplify ogTags access in cache test.

Didn't know this was possible! wow!

Signed-off-by: Jason Cameron <[email protected]>

* Fix: Handle request timeouts when fetching OG tags (#og-tags)

Cache a nil result for half the TTL to avoid repeatedly
requesting a timed-out URL.

Signed-off-by: Jason Cameron <[email protected]>

* Fix: make OG tags passthrough option function.

Signed-off-by: Jason Cameron <[email protected]>

* Fix: Handle timeouts and non-200 responses when fetching OG tags (og-tags)

- Cache empty results for timeouts and non-200 status codes
  to avoid spamming the server.
- Use a non-nil empty map to represent empty results in the
  cache, as nil would be a cache miss.

Signed-off-by: Jason Cameron <[email protected]>

* feat(og-tags): switch to http.MaxBytesReader

Signed-off-by: Jason Cameron <[email protected]>

* chore(og-tags): add noindex, nofollow meta tag and update error line numbers

Signed-off-by: Jason Cameron <[email protected]>

---------

Signed-off-by: Jason Cameron <[email protected]>
Signed-off-by: Jason Cameron <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-06 20:02:12 -04:00
Xe IasoandGitHub df27a96f1f make a half-baked tarball (#221)
* make a half-baked tarball

Closes #217

Signed-off-by: Xe Iaso <[email protected]>

* make two tarballs: one with just the vendor, and one with vendor and npm

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-04-06 12:44:52 +00:00
Xe IasoandGitHub 95416dfe82 Makefile: fix subtle logic bug (#228)
Closes #226

Makefile dependencies are backwards, apparently.

Also add staticcheck as a `go tool` dependency.
2025-04-06 00:28:08 -04:00
Xe IasoandGitHub e58abbe4de web: add noindex to base HTML template (#229)
Closes #227

Signed-off-by: Xe Iaso <[email protected]>
2025-04-06 04:21:13 +00:00
Xe IasoandGitHub 878b37178d implement packaging proof of concept with yeet (#194)
* implement packaging proof of concept with yeet

Signed-off-by: Xe Iaso <[email protected]>

* docs/developer: add local dev docs for yeet

Signed-off-by: Xe Iaso <[email protected]>

* apply review feedback

Signed-off-by: Xe Iaso <[email protected]>

* build package artifacts in CI

Signed-off-by: Xe Iaso <[email protected]>

* tell CI to fetch all git metadata

Signed-off-by: Xe Iaso <[email protected]>

* rename package builds job

Signed-off-by: Xe Iaso <[email protected]>

* upload each package individually

Signed-off-by: Xe Iaso <[email protected]>

* split package build CI jobs

Signed-off-by: Xe Iaso <[email protected]>

* fix code injection?

Signed-off-by: Xe Iaso <[email protected]>

* fix ci?

Signed-off-by: Xe Iaso <[email protected]>

* fix security alert

Signed-off-by: Xe Iaso <[email protected]>

* docs/local-dev: point people to yeet v1.13.3

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-04-04 08:15:04 -04:00
Xe IasoandGitHub a230a58a1d cmd/anubis: add --extract-resources flag to extract static assets to the filesystem (#216)
Signed-off-by: Xe Iaso <[email protected]>
2025-04-03 18:24:10 -04:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
0bcc0a2429 build(deps): bump image-size from 1.2.0 to 1.2.1 in /docs (#210)
Bumps [image-size](https://github.com/image-size/image-size) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/image-size/image-size/releases)
- [Commits](https://github.com/image-size/image-size/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: image-size
  dependency-version: 1.2.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 12:53:21 +00:00
Xe IasoandGitHub b14aa6a0c3 Add new Anubis mascot (#204)
* Add new Anubis mascot

Signed-off-by: Xe Iaso <[email protected]>

* web: add artist credit to footer

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-04-03 07:54:24 -04:00
Xe IasoandGitHub 21a9d77788 data/botPolicies: allow iMessage scraper by default (#178)
Signed-off-by: Xe Iaso <[email protected]>
2025-04-03 00:03:28 +00:00
Xe IasoandGitHub 266d8c0cc2 add a Makefile (#191)
* add a Makefile

Based on advice from IRC, a makefile helps downstream packagers
understand how to build the software.

Signed-off-by: Xe Iaso <[email protected]>

* Apply review suggestions

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-04-02 23:57:28 +00:00
01c2e45843 dependabot: enable (#189)
* dependabot: enable

Signed-off-by: Patrick Linnane <[email protected]>

* dependabot: group updates

Signed-off-by: Patrick Linnane <[email protected]>

---------

Signed-off-by: Patrick Linnane <[email protected]>
Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-04-02 00:09:46 -04:00
Patrick LinnaneandGitHub fc237a1690 workflows: fix zizmor findings (part 1) (#190)
Signed-off-by: Patrick Linnane <[email protected]>
2025-04-01 22:33:44 +00:00
Patrick LinnaneandGitHub 6af7c5891f ci: add zizmor (#188)
Signed-off-by: Patrick Linnane <[email protected]>
2025-04-01 17:56:27 -04:00
Patrick LinnaneandGitHub 661d72474b various: fix minor typos (#187)
Signed-off-by: Patrick Linnane <[email protected]>
2025-04-01 17:14:02 +00:00
Talya ConnorandGitHub 2b28439137 docs: document ED25519_PRIVATE_KEY_HEX_FILE (#186) 2025-03-31 22:35:51 -04:00
Talya ConnorandGitHub 08bb7f953c cmd/anubis: support ED25519_PRIVATE_KEY_HEX_FILE (#185) 2025-03-31 20:20:06 -04:00
b4a2e1a6a0 lib/anubis: actually check the result with the correct difficulty (#180)
* cmd/anubis actually check the result with the correct difficulty

* chore: changelog

* test(cmd/anubis): make test check for difficulty

* lib: add regression test for CVE-2025-24369

Signed-off-by: Xe Iaso <[email protected]>

* bump VERSION and CHANGELOG

Tracks #181

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-03-31 18:42:12 -04:00
28828a2e93 web/js: Added a wait with button continue + 30 second auto continue after 30s if you click "Why am I seeing this? (#166)
* web/js: update page to allow users to read the "Why am I seeing this?", complete with a button to send them through after challenge completed, and a 30s timeout that does the same.

* .gitignore: added .DS_store.

* docs/docs/CHANGELOG: added to the Unreleased section as requested in code quality guidelines

* web: pushing index_templ.go alongside this update.

* package.json: added postcss to dependencies list.

* package-lock: added postcss to dependencies

* Revert "package-lock: added postcss to dependencies"

This reverts commit bf02e7ba56.

* Revert "package.json: added postcss to dependencies list."

This reverts commit 1a38c63049.

* web/js: OG comments are important

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-03-31 02:29:55 +00:00
Jason CameronandGitHub feca1ddeea Fix: Correct typo in challenge page title (main) (#174)
- Fixed a typo in the challenge page title, removing
  an unnecessary backslash.
- Updated the index page title to "Making sure
  you're not a bot!".

Signed-off-by: Jason Cameron <[email protected]>
2025-03-30 22:24:47 -04:00
Jason CameronandGitHub eab62f7611 fix(tests): disable integration tests on Windows due to posix feature reliance (#169)
Signed-off-by: Jason Cameron <[email protected]>
2025-03-30 20:59:08 +00:00
Jason CameronandGitHub 5a07684f99 fix(logs): Correctly format listener address (#162)
* fix: Correctly format listener address (https://github.com/TecharoHQ/anubis/issues/93)

Handle addresses that include a hostname, not just ports.  If
the address starts with a colon, assume it's just a port and
prefix it with "http://localhost".  Otherwise, prefix the
entire address with "http://".  This ensures that the listener
URL is correctly formatted regardless of whether it includes
a hostname or just a port.

Signed-off-by: Jason Cameron <[email protected]>

* chore(docs): add changelog entry

Signed-off-by: Jason Cameron <[email protected]>

---------

Signed-off-by: Jason Cameron <[email protected]>
2025-03-29 23:51:13 -04:00
4bc00e5a65 web/js: Add LibreJS banner to Anubis JavaScript to allow LibreJS users to run the challenge (#161)
* web/js: add project license in the JavaScript used by Anubis

This will allow LibreJS users to pass the captcha without problems
without having to whitelist anubis manually.

* Update docs/docs/CHANGELOG.md

Co-authored-by: Xe Iaso <[email protected]>
Signed-off-by: Fijxu <[email protected]>

---------

Signed-off-by: Fijxu <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-03-29 23:48:12 -04:00
5237291072 Debug tool for benchmarking proof-of-work algorithms (#155)
* cmd/anubis: add a debug option for benchmarking hashrate

Having the ability to benchmark different proof-of-work implementations
is useful for extending Anubis. This adds a flag `--debug-benchmark-js`
(and its associated environment variable `DEBUG_BENCHMARK_JS`) for
serving a tool to do so.

Internally, a there is a new policy action, "DEBUG_BENCHMARK", which
serves the benchmarking tool instead of a challenge. The flag then
replaces all bot rules with a special rule matching every request
to that action. The benchmark page makes heavy use of inline styles,
because currently all global styles are shared across all pages. This
could be fixed, but I wanted to avoid major changes to the templates.

* web/js: add signal for aborting an active proof-of-work algorithm

Both proof-of-work algorithms now take an optional `AbortSignal`, which
immediately terminates all workers and returns `false` if aborted before
the challenge is complete.

* web/js: add algorithm comparison to the benchmark page

"Compare:" is added to the benchmark page for testing the relative
performance between two algorithms. Since benchmark runs generally have
high variance, it may take a while for the averages to converge on a
stable difference.

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-03-29 23:38:12 -04:00
Jason CameronandGitHub 0f41388bd7 Add periodic cleanup job for DecayMap (#8) (#158)
* Add periodic cleanup job for DecayMap

see https://github.com/TecharoHQ/anubis/issues/8

* Refactor: Improve DecayMap cleanup tests and add Len method

- Refactored DecayMap cleanup tests to use the new Len method
  for more precise assertions.
- Added a Len method to DecayMap to retrieve the number of
  entries.
- Simplified conditional checks in Get method.

* chore(changelog): add entry

* fix(tests): Use Impl.expire for decaymap cleanup

Signed-off-by: Jason Cameron <[email protected]>

---------

Signed-off-by: Jason Cameron <[email protected]>
2025-03-29 23:24:06 -04:00
FijxuandGitHub 052316ba25 cmd/containerbuild: use TrimSuffix instead of TrimRight (#157)
Using TrimRight will remove all characters from `*dockerRepo` from right
to left that match a character contained on `"/"+filepath.Base(*dockerRepo)`
(the cutset) until it doesn't matches anymore.

So for example, if `dockerRepo` is `example.com/fijxu/anubis`, and
`"/"+filepath.Base(*dockerRepo)` is `/anubis`, it will remove
`u/anubis` and not just `/anubis` from `dockerRepo` because `u` is a character inside the
cutoff.
2025-03-29 23:12:19 -04:00
Xe Iaso db5143ae7a docs/developer/building-anubis: fix syntax
Signed-off-by: Xe Iaso <[email protected]>
2025-03-29 22:18:45 -04:00