mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-07 09:18:18 +00:00
Compare commits
4 Commits
Xe/toggle-
...
json/add-c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33ea6c714f | ||
|
|
8e9b641280 | ||
|
|
d21c67f902 | ||
|
|
19e82973af |
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,12 +1,12 @@
|
|||||||
<!--
|
<!--
|
||||||
delete me and describe your change here, give enough context for a maintainer to understand what and why
|
delete me and describe your change here, give enough context for a maintainer to understand what and why
|
||||||
|
|
||||||
See https://github.com/TecharoHQ/anubis/blob/main/CONTRIBUTING.md for more information
|
See https://anubis.techaro.lol/docs/developer/code-quality for more information
|
||||||
-->
|
-->
|
||||||
|
|
||||||
Checklist:
|
Checklist:
|
||||||
|
|
||||||
- [ ] Added a description of the changes to the `[Unreleased]` section of docs/docs/CHANGELOG.md
|
- [ ] Added a description of the changes to the `[Unreleased]` section of docs/docs/CHANGELOG.md
|
||||||
- [ ] Added test cases to [the relevant parts of the codebase](https://github.com/TecharoHQ/anubis/blob/main/CONTRIBUTING.md)
|
- [ ] Added test cases to [the relevant parts of the codebase](https://anubis.techaro.lol/docs/developer/code-quality)
|
||||||
- [ ] Ran integration tests `npm run test:integration` (unsupported on Windows, please use WSL)
|
- [ ] Ran integration tests `npm run test:integration` (unsupported on Windows, please use WSL)
|
||||||
- [ ] All of my commits have [verified signatures](https://anubis.techaro.lol/docs/developer/signed-commits)
|
- [ ] All of my commits have [verified signatures](https://anubis.techaro.lol/docs/developer/signed-commits)
|
||||||
|
|||||||
8
.github/actions/spelling/allow.txt
vendored
8
.github/actions/spelling/allow.txt
vendored
@@ -26,11 +26,3 @@ blocklists
|
|||||||
rififi
|
rififi
|
||||||
prolocation
|
prolocation
|
||||||
Prolocation
|
Prolocation
|
||||||
Necron
|
|
||||||
Stargate
|
|
||||||
FFXIV
|
|
||||||
uvensys
|
|
||||||
de
|
|
||||||
resourced
|
|
||||||
envoyproxy
|
|
||||||
unipromos
|
|
||||||
|
|||||||
5
.github/actions/spelling/expect.txt
vendored
5
.github/actions/spelling/expect.txt
vendored
@@ -119,7 +119,6 @@ FCr
|
|||||||
fcrdns
|
fcrdns
|
||||||
fediverse
|
fediverse
|
||||||
ffprobe
|
ffprobe
|
||||||
FFXIV
|
|
||||||
fhdr
|
fhdr
|
||||||
financials
|
financials
|
||||||
finfos
|
finfos
|
||||||
@@ -239,7 +238,6 @@ mymaster
|
|||||||
mypass
|
mypass
|
||||||
myuser
|
myuser
|
||||||
nbf
|
nbf
|
||||||
Necron
|
|
||||||
nepeat
|
nepeat
|
||||||
netsurf
|
netsurf
|
||||||
nginx
|
nginx
|
||||||
@@ -331,13 +329,12 @@ Spambot
|
|||||||
spammer
|
spammer
|
||||||
sparkline
|
sparkline
|
||||||
spyderbot
|
spyderbot
|
||||||
srcip
|
|
||||||
srv
|
srv
|
||||||
stackoverflow
|
stackoverflow
|
||||||
Stargate
|
|
||||||
startprecmd
|
startprecmd
|
||||||
stoppostcmd
|
stoppostcmd
|
||||||
storetest
|
storetest
|
||||||
|
srcip
|
||||||
strcmp
|
strcmp
|
||||||
subgrid
|
subgrid
|
||||||
subr
|
subr
|
||||||
|
|||||||
6
.github/workflows/asset-verification.yml
vendored
6
.github/workflows/asset-verification.yml
vendored
@@ -22,12 +22,12 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential
|
sudo apt-get install -y build-essential
|
||||||
|
|
||||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
with:
|
with:
|
||||||
node-version: "24.11.0"
|
node-version: "24.11.0"
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "1.25.7"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- name: install node deps
|
- name: install node deps
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
8
.github/workflows/docker-pr.yml
vendored
8
.github/workflows/docker-pr.yml
vendored
@@ -26,18 +26,18 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential
|
sudo apt-get install -y build-essential
|
||||||
|
|
||||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
with:
|
with:
|
||||||
node-version: "24.11.0"
|
node-version: "24.11.0"
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${{ github.repository }}
|
images: ghcr.io/${{ github.repository }}
|
||||||
|
|
||||||
|
|||||||
12
.github/workflows/docker.yml
vendored
12
.github/workflows/docker.yml
vendored
@@ -36,17 +36,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
with:
|
with:
|
||||||
node-version: "24.11.0"
|
node-version: "24.11.0"
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
||||||
|
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
|
||||||
with:
|
with:
|
||||||
images: ${{ env.IMAGE }}
|
images: ${{ env.IMAGE }}
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
SLOG_LEVEL: debug
|
SLOG_LEVEL: debug
|
||||||
|
|
||||||
- name: Generate artifact attestation
|
- name: Generate artifact attestation
|
||||||
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ env.IMAGE }}
|
subject-name: ${{ env.IMAGE }}
|
||||||
subject-digest: ${{ steps.build.outputs.digest }}
|
subject-digest: ${{ steps.build.outputs.digest }}
|
||||||
|
|||||||
12
.github/workflows/docs-deploy.yml
vendored
12
.github/workflows/docs-deploy.yml
vendored
@@ -22,10 +22,10 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||||
|
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: techarohq
|
username: techarohq
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/techarohq/anubis/docs
|
images: ghcr.io/techarohq/anubis/docs
|
||||||
tags: |
|
tags: |
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
||||||
with:
|
with:
|
||||||
context: ./docs
|
context: ./docs
|
||||||
cache-to: type=gha
|
cache-to: type=gha
|
||||||
@@ -53,14 +53,14 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
|
|
||||||
- name: Apply k8s manifests to limsa lominsa
|
- name: Apply k8s manifests to limsa lominsa
|
||||||
uses: actions-hub/kubectl@934aaa4354bbbc3d2176ae8d7cae92d515032dff # v1.35.3
|
uses: actions-hub/kubectl@3ece3793e7a9fe94effe257d03ac834c815ea87d # v1.35.1
|
||||||
env:
|
env:
|
||||||
KUBE_CONFIG: ${{ secrets.LIMSA_LOMINSA_KUBECONFIG }}
|
KUBE_CONFIG: ${{ secrets.LIMSA_LOMINSA_KUBECONFIG }}
|
||||||
with:
|
with:
|
||||||
args: apply -k docs/manifest
|
args: apply -k docs/manifest
|
||||||
|
|
||||||
- name: Apply k8s manifests to limsa lominsa
|
- name: Apply k8s manifests to limsa lominsa
|
||||||
uses: actions-hub/kubectl@934aaa4354bbbc3d2176ae8d7cae92d515032dff # v1.35.3
|
uses: actions-hub/kubectl@3ece3793e7a9fe94effe257d03ac834c815ea87d # v1.35.1
|
||||||
env:
|
env:
|
||||||
KUBE_CONFIG: ${{ secrets.LIMSA_LOMINSA_KUBECONFIG }}
|
KUBE_CONFIG: ${{ secrets.LIMSA_LOMINSA_KUBECONFIG }}
|
||||||
with:
|
with:
|
||||||
|
|||||||
6
.github/workflows/docs-test.yml
vendored
6
.github/workflows/docs-test.yml
vendored
@@ -18,11 +18,11 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/techarohq/anubis/docs
|
images: ghcr.io/techarohq/anubis/docs
|
||||||
tags: |
|
tags: |
|
||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
||||||
with:
|
with:
|
||||||
context: ./docs
|
context: ./docs
|
||||||
cache-to: type=gha
|
cache-to: type=gha
|
||||||
|
|||||||
4
.github/workflows/go-mod-tidy-check.yml
vendored
4
.github/workflows/go-mod-tidy-check.yml
vendored
@@ -17,9 +17,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- name: Check go.mod and go.sum in main directory
|
- name: Check go.mod and go.sum in main directory
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
10
.github/workflows/go.yml
vendored
10
.github/workflows/go.yml
vendored
@@ -24,12 +24,12 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential
|
sudo apt-get install -y build-essential
|
||||||
|
|
||||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
with:
|
with:
|
||||||
node-version: "24.11.0"
|
node-version: "24.11.0"
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- name: Cache playwright binaries
|
- name: Cache playwright binaries
|
||||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||||
@@ -55,10 +55,10 @@ jobs:
|
|||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
- name: Lint with staticcheck
|
- name: Lint with staticcheck
|
||||||
uses: dominikh/staticcheck-action@9716614d4101e79b4340dd97b10e54d68234e431 # v1.4.1
|
uses: dominikh/staticcheck-action@024238d2898c874f26d723e7d0ff4308c35589a2 # v1.4.0
|
||||||
with:
|
with:
|
||||||
version: "latest"
|
version: "latest"
|
||||||
|
|
||||||
- name: Govulncheck
|
- name: Govulncheck
|
||||||
run: |
|
run: |
|
||||||
go tool govulncheck ./... ||:
|
go tool govulncheck ./...
|
||||||
|
|||||||
6
.github/workflows/package-builds-stable.yml
vendored
6
.github/workflows/package-builds-stable.yml
vendored
@@ -25,12 +25,12 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential
|
sudo apt-get install -y build-essential
|
||||||
|
|
||||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
with:
|
with:
|
||||||
node-version: "24.11.0"
|
node-version: "24.11.0"
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- name: install node deps
|
- name: install node deps
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential
|
sudo apt-get install -y build-essential
|
||||||
|
|
||||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
with:
|
with:
|
||||||
node-version: "24.11.0"
|
node-version: "24.11.0"
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- name: install node deps
|
- name: install node deps
|
||||||
run: |
|
run: |
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
go tool yeet
|
go tool yeet
|
||||||
|
|
||||||
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: packages
|
name: packages
|
||||||
path: var/*
|
path: var/*
|
||||||
|
|||||||
8
.github/workflows/smoke-tests.yml
vendored
8
.github/workflows/smoke-tests.yml
vendored
@@ -34,12 +34,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
with:
|
with:
|
||||||
node-version: "24.11.0"
|
node-version: "24.11.0"
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
run: echo "ARTIFACT_NAME=${{ matrix.test }}" | sed 's|/|-|g' >> $GITHUB_ENV
|
run: echo "ARTIFACT_NAME=${{ matrix.test }}" | sed 's|/|-|g' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: ${{ env.ARTIFACT_NAME }}
|
name: ${{ env.ARTIFACT_NAME }}
|
||||||
|
|||||||
4
.github/workflows/ssh-ci-runner-cron.yml
vendored
4
.github/workflows/ssh-ci-runner-cron.yml
vendored
@@ -24,13 +24,13 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
cd ./test/ssh-ci
|
cd ./test/ssh-ci
|
||||||
|
|||||||
13
.github/workflows/ssh-ci.yml
vendored
13
.github/workflows/ssh-ci.yml
vendored
@@ -12,15 +12,14 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
ssh:
|
ssh:
|
||||||
if: github.repository == 'TecharoHQ/anubis'
|
if: github.repository == 'TecharoHQ/anubis'
|
||||||
#runs-on: alrest-techarohq
|
runs-on: alrest-techarohq
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
host:
|
host:
|
||||||
- riscv64
|
- riscv64
|
||||||
- ppc64le
|
- ppc64le
|
||||||
#- aarch64-4k
|
- aarch64-4k
|
||||||
#- aarch64-16k
|
- aarch64-16k
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
@@ -30,15 +29,15 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install CI target SSH key
|
- name: Install CI target SSH key
|
||||||
uses: shimataro/ssh-key-action@6b84f2e793b32fa0b03a379cadadec75cc539391 # v2.8.0
|
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 # v2.7.0
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.CI_SSH_KEY }}
|
key: ${{ secrets.CI_SSH_KEY }}
|
||||||
name: id_rsa
|
name: id_rsa
|
||||||
known_hosts: ${{ secrets.CI_SSH_KNOWN_HOSTS }}
|
known_hosts: ${{ secrets.CI_SSH_KNOWN_HOSTS }}
|
||||||
|
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "stable"
|
go-version: "1.25.4"
|
||||||
|
|
||||||
- name: Run CI
|
- name: Run CI
|
||||||
run: go run ./utils/cmd/backoff-retry bash test/ssh-ci/rigging.sh ${{ matrix.host }}
|
run: go run ./utils/cmd/backoff-retry bash test/ssh-ci/rigging.sh ${{ matrix.host }}
|
||||||
|
|||||||
3
Makefile
3
Makefile
@@ -24,7 +24,8 @@ build: assets
|
|||||||
lint: assets
|
lint: assets
|
||||||
$(GO) vet ./...
|
$(GO) vet ./...
|
||||||
$(GO) tool staticcheck ./...
|
$(GO) tool staticcheck ./...
|
||||||
|
$(GO) tool govulncheck ./...
|
||||||
|
|
||||||
prebaked-build:
|
prebaked-build:
|
||||||
$(GO) build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis
|
$(GO) build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis
|
||||||
$(GO) build -o ./var/robots2policy -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/robots2policy
|
$(GO) build -o ./var/robots2policy -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/robots2policy
|
||||||
|
|||||||
@@ -26,12 +26,6 @@ Anubis is brought to you by sponsors and donors like:
|
|||||||
|
|
||||||
### Gold Tier
|
### Gold Tier
|
||||||
|
|
||||||
<a href="https://www.unipromos.com/?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
|
||||||
<img src="./docs/static/img/sponsors/unipromos.webp" alt="Unipromos" height="64" />
|
|
||||||
</a>
|
|
||||||
<a href="https://uvensys.de/?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
|
||||||
<img src="./docs/static/img/sponsors/uvensys.webp" alt="Uvensys" height="64">
|
|
||||||
</a>
|
|
||||||
<a href="https://distrust.co?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
<a href="https://distrust.co?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||||
<img src="./docs/static/img/sponsors/distrust-logo.webp" alt="Distrust" height="64">
|
<img src="./docs/static/img/sponsors/distrust-logo.webp" alt="Distrust" height="64">
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/http/pprof"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@@ -276,7 +275,7 @@ func main() {
|
|||||||
|
|
||||||
internal.SetHealth("anubis", healthv1.HealthCheckResponse_NOT_SERVING)
|
internal.SetHealth("anubis", healthv1.HealthCheckResponse_NOT_SERVING)
|
||||||
|
|
||||||
lg := internal.InitSlog(*slogLevel, os.Stderr, false)
|
lg := internal.InitSlog(*slogLevel, os.Stderr)
|
||||||
lg.Info("starting up Anubis")
|
lg.Info("starting up Anubis")
|
||||||
|
|
||||||
if *healthcheck {
|
if *healthcheck {
|
||||||
@@ -419,8 +418,8 @@ func main() {
|
|||||||
|
|
||||||
var redirectDomainsList []string
|
var redirectDomainsList []string
|
||||||
if *redirectDomains != "" {
|
if *redirectDomains != "" {
|
||||||
domains := strings.SplitSeq(*redirectDomains, ",")
|
domains := strings.Split(*redirectDomains, ",")
|
||||||
for domain := range domains {
|
for _, domain := range domains {
|
||||||
_, err = url.Parse(domain)
|
_, err = url.Parse(domain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("cannot parse redirect-domain %q: %s", domain, err.Error())
|
log.Fatalf("cannot parse redirect-domain %q: %s", domain, err.Error())
|
||||||
@@ -428,7 +427,7 @@ func main() {
|
|||||||
redirectDomainsList = append(redirectDomainsList, strings.TrimSpace(domain))
|
redirectDomainsList = append(redirectDomainsList, strings.TrimSpace(domain))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lg.Warn("REDIRECT_DOMAINS is not set, Anubis will redirect to any domain, see https://anubis.techaro.lol/docs/admin/configuration/redirect-domains")
|
lg.Warn("REDIRECT_DOMAINS is not set, Anubis will only redirect to the same domain a request is coming from, see https://anubis.techaro.lol/docs/admin/configuration/redirect-domains")
|
||||||
}
|
}
|
||||||
|
|
||||||
anubis.CookieName = *cookiePrefix + "-auth"
|
anubis.CookieName = *cookiePrefix + "-auth"
|
||||||
@@ -523,11 +522,6 @@ func metricsServer(ctx context.Context, lg slog.Logger, done func()) {
|
|||||||
defer done()
|
defer done()
|
||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.HandleFunc("GET /debug/pprof/", pprof.Index)
|
|
||||||
mux.HandleFunc("GET /debug/pprof/cmdline", pprof.Cmdline)
|
|
||||||
mux.HandleFunc("GET /debug/pprof/profile", pprof.Profile)
|
|
||||||
mux.HandleFunc("GET /debug/pprof/symbol", pprof.Symbol)
|
|
||||||
mux.HandleFunc("GET /debug/pprof/trace", pprof.Trace)
|
|
||||||
mux.Handle("/metrics", promhttp.Handler())
|
mux.Handle("/metrics", promhttp.Handler())
|
||||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
||||||
st, ok := internal.GetHealth("anubis")
|
st, ok := internal.GetHealth("anubis")
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func main() {
|
|||||||
flagenv.Parse()
|
flagenv.Parse()
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
slog.SetDefault(internal.InitSlog(*slogLevel, os.Stderr, false))
|
slog.SetDefault(internal.InitSlog(*slogLevel, os.Stderr))
|
||||||
|
|
||||||
koDockerRepo := strings.TrimSuffix(*dockerRepo, "/"+filepath.Base(*dockerRepo))
|
koDockerRepo := strings.TrimSuffix(*dockerRepo, "/"+filepath.Base(*dockerRepo))
|
||||||
|
|
||||||
@@ -159,8 +159,8 @@ func run(command string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setOutput(key, val string) {
|
func setOutput(key, val string) {
|
||||||
github_output := os.Getenv("GITHUB_OUTPUT")
|
github_output := os.Getenv("GITHUB_OUTPUT")
|
||||||
f, _ := os.OpenFile(github_output, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
f, _ := os.OpenFile(github_output, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||||
fmt.Fprintf(f, "%s=%s\n", key, val)
|
fmt.Fprintf(f, "%s=%s\n", key, val)
|
||||||
f.Close()
|
f.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/TecharoHQ/anubis/lib/config"
|
"github.com/TecharoHQ/anubis/lib/config"
|
||||||
@@ -211,8 +210,11 @@ func parseRobotsTxt(input io.Reader) ([]RobotsRule, error) {
|
|||||||
|
|
||||||
// Mark blacklisted user agents (those with "Disallow: /")
|
// Mark blacklisted user agents (those with "Disallow: /")
|
||||||
for i := range rules {
|
for i := range rules {
|
||||||
if slices.Contains(rules[i].Disallows, "/") {
|
for _, disallow := range rules[i].Disallows {
|
||||||
rules[i].IsBlacklist = true
|
if disallow == "/" {
|
||||||
|
rules[i].IsBlacklist = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ func TestDataFileConversion(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if strings.ToLower(*outputFormat) == "yaml" {
|
if strings.ToLower(*outputFormat) == "yaml" {
|
||||||
var actualData []any
|
var actualData []interface{}
|
||||||
var expectedData []any
|
var expectedData []interface{}
|
||||||
|
|
||||||
err = yaml.Unmarshal(actualOutput, &actualData)
|
err = yaml.Unmarshal(actualOutput, &actualData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -178,8 +178,8 @@ func TestDataFileConversion(t *testing.T) {
|
|||||||
t.Errorf("Output mismatch for %s\nExpected:\n%s\n\nActual:\n%s", tc.name, expectedStr, actualStr)
|
t.Errorf("Output mismatch for %s\nExpected:\n%s\n\nActual:\n%s", tc.name, expectedStr, actualStr)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var actualData []any
|
var actualData []interface{}
|
||||||
var expectedData []any
|
var expectedData []interface{}
|
||||||
|
|
||||||
err = json.Unmarshal(actualOutput, &actualData)
|
err = json.Unmarshal(actualOutput, &actualData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -419,6 +419,6 @@ Disallow: /`
|
|||||||
|
|
||||||
// compareData performs a deep comparison of two data structures,
|
// compareData performs a deep comparison of two data structures,
|
||||||
// ignoring differences that are semantically equivalent in YAML/JSON
|
// ignoring differences that are semantically equivalent in YAML/JSON
|
||||||
func compareData(actual, expected any) bool {
|
func compareData(actual, expected interface{}) bool {
|
||||||
return reflect.DeepEqual(actual, expected)
|
return reflect.DeepEqual(actual, expected)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,4 @@
|
|||||||
- import: (data)/crawlers/marginalia.yaml
|
- import: (data)/crawlers/marginalia.yaml
|
||||||
- import: (data)/crawlers/mojeekbot.yaml
|
- import: (data)/crawlers/mojeekbot.yaml
|
||||||
- import: (data)/crawlers/commoncrawl.yaml
|
- import: (data)/crawlers/commoncrawl.yaml
|
||||||
- import: (data)/crawlers/wikimedia-citoid.yaml
|
|
||||||
- import: (data)/crawlers/yandexbot.yaml
|
- import: (data)/crawlers/yandexbot.yaml
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
# Wikimedia Foundation citation services
|
|
||||||
# https://www.mediawiki.org/wiki/Citoid
|
|
||||||
|
|
||||||
- name: wikimedia-citoid
|
|
||||||
user_agent_regex: "Citoid/WMF"
|
|
||||||
action: ALLOW
|
|
||||||
remote_addresses: [
|
|
||||||
"208.80.152.0/22",
|
|
||||||
"2620:0:860::/46",
|
|
||||||
]
|
|
||||||
|
|
||||||
- name: wikimedia-zotero-translation-server
|
|
||||||
user_agent_regex: "ZoteroTranslationServer/WMF"
|
|
||||||
action: ALLOW
|
|
||||||
remote_addresses: [
|
|
||||||
"208.80.152.0/22",
|
|
||||||
"2620:0:860::/46",
|
|
||||||
]
|
|
||||||
@@ -11,16 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- Expose [pprof endpoints](https://pkg.go.dev/net/http/pprof) on the metrics listener to enable profiling Anubis in production.
|
|
||||||
- fix: prevent nil pointer panic in challenge validation when threshold rules match during PassChallenge (#1463)
|
|
||||||
- Instruct reverse proxies to not cache error pages.
|
|
||||||
- Fixed mixed tab/space indentation in Caddy documentation code block
|
|
||||||
- Improve error messages and fix broken REDIRECT_DOMAINS link in docs ([#1193](https://github.com/TecharoHQ/anubis/issues/1193))
|
|
||||||
- Add Bulgarian locale ([#1394](https://github.com/TecharoHQ/anubis/pull/1394))
|
|
||||||
- Add option to hide source code origin of log lines in [logging configuration](./admin/policies.mdx#logging-management)
|
|
||||||
|
|
||||||
<!-- This changes the project to: -->
|
<!-- This changes the project to: -->
|
||||||
|
|
||||||
- Fix CEL internal errors when iterating `headers`/`query` map wrappers by implementing map iterators for `HTTPHeaders` and `URLValues` ([#1465](https://github.com/TecharoHQ/anubis/pull/1465)).
|
- Fix CEL internal errors when iterating `headers`/`query` map wrappers by implementing map iterators for `HTTPHeaders` and `URLValues` ([#1465](https://github.com/TecharoHQ/anubis/pull/1465)).
|
||||||
|
|
||||||
## v1.25.0: Necron
|
## v1.25.0: Necron
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ yourdomain.example.com {
|
|||||||
tls your@email.address
|
tls your@email.address
|
||||||
|
|
||||||
reverse_proxy http://anubis:3000 {
|
reverse_proxy http://anubis:3000 {
|
||||||
header_up X-Real-Ip {remote_host}
|
header_up X-Real-Ip {remote_host}
|
||||||
header_up X-Http-Version {http.request.proto}
|
header_up X-Http-Version {http.request.proto}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,6 @@ This simply enables SSL offloading, sets some useful and required headers and ro
|
|||||||
|
|
||||||
Due to the fact that HAProxy can decode JWT, we are able to verify the Anubis token directly in HAProxy and route the traffic to the specific backends ourselves.
|
Due to the fact that HAProxy can decode JWT, we are able to verify the Anubis token directly in HAProxy and route the traffic to the specific backends ourselves.
|
||||||
|
|
||||||
Mind that rule logic to allow Git HTTP and other legit bot traffic to bypass is delegated from Anubis to HAProxy then. If required, you should implement any whitelisting in HAProxy using `acl_anubis_ignore` yourself.
|
|
||||||
|
|
||||||
In this example are three applications behind one HAProxy frontend. Only App1 and App2 are secured via Anubis; App3 is open for everyone. The path `/excluded/path` can also be accessed by anyone.
|
In this example are three applications behind one HAProxy frontend. Only App1 and App2 are secured via Anubis; App3 is open for everyone. The path `/excluded/path` can also be accessed by anyone.
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
|
|||||||
@@ -130,52 +130,3 @@ Then point your Ingress to the Anubis port:
|
|||||||
# diff-add
|
# diff-add
|
||||||
name: anubis
|
name: anubis
|
||||||
```
|
```
|
||||||
|
|
||||||
## Envoy Gateway
|
|
||||||
|
|
||||||
If you are using envoy-gateway, the `X-Real-Ip` header is not set by default, but Anubis does require it. You can resolve this by adding the header, either on the specific `HTTPRoute` where Anubis is listening, or on the `ClientTrafficPolicy` to apply it to any number of Gateways:
|
|
||||||
|
|
||||||
HTTPRoute:
|
|
||||||
```yaml
|
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
|
||||||
kind: HTTPRoute
|
|
||||||
metadata:
|
|
||||||
name: app-route
|
|
||||||
spec:
|
|
||||||
hostnames: ["app.domain.tld"]
|
|
||||||
parentRefs:
|
|
||||||
- name: envoy-external
|
|
||||||
namespace: network
|
|
||||||
sectionName: https
|
|
||||||
rules:
|
|
||||||
- backendRefs:
|
|
||||||
- identifier: *app
|
|
||||||
port: anubis
|
|
||||||
filters:
|
|
||||||
- type: RequestHeaderModifier
|
|
||||||
requestHeaderModifier:
|
|
||||||
set:
|
|
||||||
- name: X-Real-Ip
|
|
||||||
value: "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
|
|
||||||
```
|
|
||||||
|
|
||||||
Applying to any number of Gateways:
|
|
||||||
```yaml
|
|
||||||
apiVersion: gateway.envoyproxy.io/v1alpha1
|
|
||||||
kind: ClientTrafficPolicy
|
|
||||||
metadata:
|
|
||||||
name: envoy
|
|
||||||
spec:
|
|
||||||
headers:
|
|
||||||
earlyRequestHeaders:
|
|
||||||
set:
|
|
||||||
- name: X-Real-Ip
|
|
||||||
value: "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
|
|
||||||
clientIPDetection:
|
|
||||||
xForwardedFor:
|
|
||||||
trustedCIDRs:
|
|
||||||
- 10.96.0.0/16 # Cluster pod CIDR
|
|
||||||
targetSelectors: # These will apply to all Gateways
|
|
||||||
- group: gateway.networking.k8s.io
|
|
||||||
kind: Gateway
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ Anubis uses these environment variables for configuration:
|
|||||||
| `OVERLAY_FOLDER` | unset | <EO /> If set, treat the given path as an [overlay folder](./botstopper.mdx#custom-images-and-css), allowing you to customize CSS, fonts, images, and add other assets to BotStopper deployments. |
|
| `OVERLAY_FOLDER` | unset | <EO /> If set, treat the given path as an [overlay folder](./botstopper.mdx#custom-images-and-css), allowing you to customize CSS, fonts, images, and add other assets to BotStopper deployments. |
|
||||||
| `POLICY_FNAME` | unset | The file containing [bot policy configuration](./policies.mdx). See the bot policy documentation for more details. If unset, the default bot policy configuration is used. |
|
| `POLICY_FNAME` | unset | The file containing [bot policy configuration](./policies.mdx). See the bot policy documentation for more details. If unset, the default bot policy configuration is used. |
|
||||||
| `PUBLIC_URL` | unset | The externally accessible URL for this Anubis instance, used for constructing redirect URLs (e.g., for Traefik forwardAuth). Leave it unset when Anubis terminates traffic directly (sidecar/standalone deployments) or redirect building will fail with `redir=null`. |
|
| `PUBLIC_URL` | unset | The externally accessible URL for this Anubis instance, used for constructing redirect URLs (e.g., for Traefik forwardAuth). Leave it unset when Anubis terminates traffic directly (sidecar/standalone deployments) or redirect building will fail with `redir=null`. |
|
||||||
| `REDIRECT_DOMAINS` | unset | Comma-separated list of domain names that Anubis should allow redirects to when passing a challenge. See [Redirect Domain Configuration](./configuration/redirect-domains.mdx) for more details. |
|
| `REDIRECT_DOMAINS` | unset | Comma-separated list of domain names that Anubis should allow redirects to when passing a challenge. See [Redirect Domain Configuration](./configuration/redirect-domains) for more details. |
|
||||||
| `SERVE_ROBOTS_TXT` | `false` | If set `true`, Anubis will serve a default `robots.txt` file that disallows all known AI scrapers by name and then additionally disallows every scraper. This is useful if facts and circumstances make it difficult to change the underlying service to serve such a `robots.txt` file. |
|
| `SERVE_ROBOTS_TXT` | `false` | If set `true`, Anubis will serve a default `robots.txt` file that disallows all known AI scrapers by name and then additionally disallows every scraper. This is useful if facts and circumstances make it difficult to change the underlying service to serve such a `robots.txt` file. |
|
||||||
| `SLOG_LEVEL` | `INFO` | The log level for structured logging. Valid values are `DEBUG`, `INFO`, `WARN`, and `ERROR`. Set to `DEBUG` to see all requests, evaluations, and detailed diagnostic information. |
|
| `SLOG_LEVEL` | `INFO` | The log level for structured logging. Valid values are `DEBUG`, `INFO`, `WARN`, and `ERROR`. Set to `DEBUG` to see all requests, evaluations, and detailed diagnostic information. |
|
||||||
| `SOCKET_MODE` | `0770` | _Only used when at least one of the `*_BIND_NETWORK` variables are set to `unix`._ The socket mode (permissions) for Unix domain sockets. |
|
| `SOCKET_MODE` | `0770` | _Only used when at least one of the `*_BIND_NETWORK` variables are set to `unix`._ The socket mode (permissions) for Unix domain sockets. |
|
||||||
|
|||||||
@@ -339,7 +339,6 @@ Anubis exposes the following logging settings in the policy file:
|
|||||||
| `level` | [log level](#log-levels) | `info` | The logging level threshold. Any logs that are at or above this threshold will be drained to the sink. Any other logs will be discarded. |
|
| `level` | [log level](#log-levels) | `info` | The logging level threshold. Any logs that are at or above this threshold will be drained to the sink. Any other logs will be discarded. |
|
||||||
| `sink` | string | `stdio`, `file` | The sink where the logs drain to as they are being recorded in Anubis. |
|
| `sink` | string | `stdio`, `file` | The sink where the logs drain to as they are being recorded in Anubis. |
|
||||||
| `parameters` | object | | Parameters for the given logging sink. This will vary based on the logging sink of choice. See below for more information. |
|
| `parameters` | object | | Parameters for the given logging sink. This will vary based on the logging sink of choice. See below for more information. |
|
||||||
| `hideSource` | boolean | `false` | If set, hide the details of which line of code triggered a log line. Setting this to `true` may make getting support more difficult. |
|
|
||||||
|
|
||||||
Anubis supports the following logging sinks:
|
Anubis supports the following logging sinks:
|
||||||
|
|
||||||
@@ -394,32 +393,6 @@ logging:
|
|||||||
|
|
||||||
When files are rotated out, the old files will be named after the rotation timestamp in [RFC 3339 format](https://www.rfc-editor.org/rfc/rfc3339).
|
When files are rotated out, the old files will be named after the rotation timestamp in [RFC 3339 format](https://www.rfc-editor.org/rfc/rfc3339).
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
If you are running Anubis in systemd via a native package, the default systemd unit settings are very restrictive and will forbid writing to folders in `/var/log`. In order to fix this, please make a [drop-in unit](https://www.flatcar.org/docs/latest/setup/systemd/drop-in-units/) like the following:
|
|
||||||
|
|
||||||
```text
|
|
||||||
# /etc/systemd/anubis@instance-name.service.d/50-var-log-readwrite.conf
|
|
||||||
[Service]
|
|
||||||
ReadWritePaths=/run /var/log/anubis
|
|
||||||
```
|
|
||||||
|
|
||||||
Once you write this to the correct place, reload the systemd configuration:
|
|
||||||
|
|
||||||
```text
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
```
|
|
||||||
|
|
||||||
And then restart Anubis:
|
|
||||||
|
|
||||||
```text
|
|
||||||
sudo systemctl restart anubis@instance-name
|
|
||||||
```
|
|
||||||
|
|
||||||
You may be required to make drop-ins for each Anubis instance depending on the facts and circumstances of your deployment.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### `stdio` sink
|
### `stdio` sink
|
||||||
|
|
||||||
By default, Anubis logs everything to the standard error stream of its process. This requires no configuration:
|
By default, Anubis logs everything to the standard error stream of its process. This requires no configuration:
|
||||||
|
|||||||
31
docs/docs/developer/code-quality.md
Normal file
31
docs/docs/developer/code-quality.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
title: Code quality guidelines
|
||||||
|
---
|
||||||
|
|
||||||
|
When submitting code to Anubis, please take the time to consider the fact that this project is security software. If things go bad, bots can pummel sites into oblivion. This is not ideal for uptime.
|
||||||
|
|
||||||
|
As such, code reviews will be a bit more strict than you have seen in other projects. This is not people trying to be mean, this is a side effect of taking the problem seriously.
|
||||||
|
|
||||||
|
When making code changes, try to do the following:
|
||||||
|
|
||||||
|
- If you're submitting a bugfix, add a test case for it
|
||||||
|
- If you're changing the JavaScript, make sure the integration tests pass (`npm run test:integration`)
|
||||||
|
|
||||||
|
## Commit messages
|
||||||
|
|
||||||
|
Anubis follows the Go project's conventions for commit messages. In general, an ideal commit message should read like this:
|
||||||
|
|
||||||
|
```text
|
||||||
|
path/to/folder: brief description of the change
|
||||||
|
|
||||||
|
If the change is subtle, has implementation consequences, or is otherwise
|
||||||
|
not entirely self-describing: take the time to spell out why. If things
|
||||||
|
are very subtle, please also amend the documentation accordingly
|
||||||
|
```
|
||||||
|
|
||||||
|
The subject of a commit message should be the second half of the sentence "This commit changes the Anubis project to:". Here's a few examples:
|
||||||
|
|
||||||
|
- `disable DroneBL by default`
|
||||||
|
- `port the challenge to WebAssembly`
|
||||||
|
|
||||||
|
The extended commit message is also your place to give rationale for a new feature. When maintainers are reviewing your code, they will use this to figure out if the burden from feature maintainership is worth the merge.
|
||||||
@@ -35,12 +35,6 @@ Anubis is brought to you by sponsors and donors like:
|
|||||||
|
|
||||||
### Gold Tier
|
### Gold Tier
|
||||||
|
|
||||||
<a href="https://www.unipromos.com/?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
|
||||||
<img src="/img/sponsors/unipromos.webp" alt="Uvensys" height="64" />
|
|
||||||
</a>
|
|
||||||
<a href="https://uvensys.de/?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
|
||||||
<img src="/img/sponsors/uvensys.webp" alt="Uvensys" height="64" />
|
|
||||||
</a>
|
|
||||||
<a href="https://distrust.co?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
<a href="https://distrust.co?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||||
<img src="/img/sponsors/distrust-logo.webp" alt="Distrust" height="64" />
|
<img src="/img/sponsors/distrust-logo.webp" alt="Distrust" height="64" />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -22,13 +22,3 @@ If you use a browser extension such as [JShelter](https://jshelter.org/), you wi
|
|||||||
## Does Anubis mine Bitcoin?
|
## Does Anubis mine Bitcoin?
|
||||||
|
|
||||||
No. Anubis does not mine Bitcoin or any other cryptocurrency.
|
No. Anubis does not mine Bitcoin or any other cryptocurrency.
|
||||||
|
|
||||||
## I disabled Just-in-time compilation in my browser. Why is Anubis slow?
|
|
||||||
|
|
||||||
Anubis proof-of-work checks run an open source JavaScript program in your browser. These checks do a lot of complicated math and aim to be done quickly, so the execution speed depends on [Just-in-time (JIT) compilation](https://en.wikipedia.org/wiki/Just-in-time_compilation). JIT compiles JavaScript from the Internet into native machine code at runtime. The code produced by the JIT engine is almost as good as if it was written in a native programming language and compiled for your computer in particular. Without JIT, all JavaScript programs on every website you visit run through a slow interpreter.
|
|
||||||
|
|
||||||
This interpreter is much slower than native code because it has to translate each low level JavaScript operation into many dozens of calls to execute. This means that using the interpreter incurs a massive performance hit by its very nature; it takes longer to add numbers than if the CPU just added the numbers directly.
|
|
||||||
|
|
||||||
Some users choose to disable JIT as a hardening measure against theoretical browser exploits. This is a reasonable choice if you face targeted attacks from well-resourced adversaries (such as nation-state actors), but it comes with real performance costs.
|
|
||||||
|
|
||||||
If you've disabled JIT and find Anubis checks slow, re-enabling JIT is the fix. There is no way for Anubis to work around this on our end.
|
|
||||||
|
|||||||
@@ -38,8 +38,10 @@ This page contains a non-exhaustive list with all websites using Anubis.
|
|||||||
- https://squirreljme.cc/
|
- https://squirreljme.cc/
|
||||||
- https://superlove.sayitditto.net/
|
- https://superlove.sayitditto.net/
|
||||||
- https://svnweb.freebsd.org/
|
- https://svnweb.freebsd.org/
|
||||||
|
- https://trac.ffmpeg.org/
|
||||||
- https://tumfatig.net/
|
- https://tumfatig.net/
|
||||||
- https://wiki.archlinux.org/
|
- https://wiki.archlinux.org/
|
||||||
|
- https://wiki.dolphin-emu.org/
|
||||||
- https://wiki.freepascal.org/
|
- https://wiki.freepascal.org/
|
||||||
- https://wiki.koha-community.org/
|
- https://wiki.koha-community.org/
|
||||||
- https://www.cfaarchive.org/
|
- https://www.cfaarchive.org/
|
||||||
@@ -51,11 +53,6 @@ This page contains a non-exhaustive list with all websites using Anubis.
|
|||||||
- https://bbs.archlinux32.org/
|
- https://bbs.archlinux32.org/
|
||||||
- https://bugs.archlinux32.org/
|
- https://bugs.archlinux32.org/
|
||||||
</details>
|
</details>
|
||||||
- <details>
|
|
||||||
<summary>Dolphin Emulator</summary>
|
|
||||||
- https://forums.dolphin-emu.org/
|
|
||||||
- https://wiki.dolphin-emu.org/
|
|
||||||
</details>
|
|
||||||
- <details>
|
- <details>
|
||||||
<summary>Duke University</summary>
|
<summary>Duke University</summary>
|
||||||
- https://repository.duke.edu/
|
- https://repository.duke.edu/
|
||||||
@@ -63,11 +60,6 @@ This page contains a non-exhaustive list with all websites using Anubis.
|
|||||||
- https://find.library.duke.edu/
|
- https://find.library.duke.edu/
|
||||||
- https://nicholas.duke.edu/
|
- https://nicholas.duke.edu/
|
||||||
</details>
|
</details>
|
||||||
- <details>
|
|
||||||
<summary>FFmpeg</summary>
|
|
||||||
- https://git.ffmpeg.org/
|
|
||||||
- https://trac.ffmpeg.org/
|
|
||||||
</details>
|
|
||||||
- <details>
|
- <details>
|
||||||
<summary>Forschungszentrum Jülich</summary>
|
<summary>Forschungszentrum Jülich</summary>
|
||||||
- https://juser.fz-juelich.de/
|
- https://juser.fz-juelich.de/
|
||||||
@@ -120,8 +112,11 @@ This page contains a non-exhaustive list with all websites using Anubis.
|
|||||||
- https://git.kernel.org/
|
- https://git.kernel.org/
|
||||||
- https://lore.kernel.org/
|
- https://lore.kernel.org/
|
||||||
</details>
|
</details>
|
||||||
|
- <details>
|
||||||
|
<summary>The United Nations</summary>
|
||||||
|
- https://policytoolbox.iiep.unesco.org/
|
||||||
|
</details>
|
||||||
- <details>
|
- <details>
|
||||||
<summary>Valve Corporation</summary>
|
<summary>Valve Corporation</summary>
|
||||||
- https://developer.valvesoftware.com/wiki/Main_Page
|
- https://developer.valvesoftware.com/wiki/Main_Page
|
||||||
- https://wiki.teamfortress.com/wiki/Main_Page
|
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
BIN
docs/static/img/sponsors/unipromos.webp
vendored
BIN
docs/static/img/sponsors/unipromos.webp
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
BIN
docs/static/img/sponsors/uvensys.webp
vendored
BIN
docs/static/img/sponsors/uvensys.webp
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB |
@@ -36,7 +36,7 @@ func Glob(pattern, subj string) bool {
|
|||||||
end := len(parts) - 1
|
end := len(parts) - 1
|
||||||
|
|
||||||
// Go over the leading parts and ensure they match.
|
// Go over the leading parts and ensure they match.
|
||||||
for i := range end {
|
for i := 0; i < end; i++ {
|
||||||
idx := strings.Index(subj, parts[i])
|
idx := strings.Index(subj, parts[i])
|
||||||
|
|
||||||
switch i {
|
switch i {
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ func TestHashCollisions(t *testing.T) {
|
|||||||
for _, prefix := range prefixes {
|
for _, prefix := range prefixes {
|
||||||
for _, suffix := range suffixes {
|
for _, suffix := range suffixes {
|
||||||
for _, variation := range variations {
|
for _, variation := range variations {
|
||||||
for i := range 100 {
|
for i := 0; i < 100; i++ {
|
||||||
input := fmt.Sprintf("%s%s%s-%d", prefix, suffix, variation, i)
|
input := fmt.Sprintf("%s%s%s-%d", prefix, suffix, variation, i)
|
||||||
hash := XXHash64sum(input)
|
hash := XXHash64sum(input)
|
||||||
if existing, exists := xxhashHashes[hash]; exists {
|
if existing, exists := xxhashHashes[hash]; exists {
|
||||||
@@ -211,7 +211,7 @@ func TestHashCollisions(t *testing.T) {
|
|||||||
|
|
||||||
seqCount := 0
|
seqCount := 0
|
||||||
for _, pattern := range patterns {
|
for _, pattern := range patterns {
|
||||||
for i := range 10000 {
|
for i := 0; i < 10000; i++ {
|
||||||
input := fmt.Sprintf(pattern, i)
|
input := fmt.Sprintf(pattern, i)
|
||||||
hash := XXHash64sum(input)
|
hash := XXHash64sum(input)
|
||||||
if existing, exists := xxhashHashes[hash]; exists {
|
if existing, exists := xxhashHashes[hash]; exists {
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ func (i *Impl) makeAffirmations() []string {
|
|||||||
count := rand.IntN(5) + 1
|
count := rand.IntN(5) + 1
|
||||||
|
|
||||||
var result []string
|
var result []string
|
||||||
for range count {
|
for j := 0; j < count; j++ {
|
||||||
result = append(result, i.affirmation.Spin())
|
result = append(result, i.affirmation.Spin())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ func (i *Impl) makeSpins() []string {
|
|||||||
count := rand.IntN(5) + 1
|
count := rand.IntN(5) + 1
|
||||||
|
|
||||||
var result []string
|
var result []string
|
||||||
for range count {
|
for j := 0; j < count; j++ {
|
||||||
result = append(result, i.body.Spin())
|
result = append(result, i.body.Spin())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ func (lo *ListOr[T]) UnmarshalJSON(data []byte) error {
|
|||||||
|
|
||||||
// Check if first non-whitespace character is '['
|
// Check if first non-whitespace character is '['
|
||||||
firstChar := data[0]
|
firstChar := data[0]
|
||||||
for i := range data {
|
for i := 0; i < len(data); i++ {
|
||||||
if data[i] != ' ' && data[i] != '\t' && data[i] != '\n' && data[i] != '\r' {
|
if data[i] != ' ' && data[i] != '\t' && data[i] != '\n' && data[i] != '\r' {
|
||||||
firstChar = data[i]
|
firstChar = data[i]
|
||||||
break
|
break
|
||||||
@@ -36,4 +36,4 @@ func (lo *ListOr[T]) UnmarshalJSON(data []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitSlog(level string, sink io.Writer, hideSource bool) *slog.Logger {
|
func InitSlog(level string, sink io.Writer) *slog.Logger {
|
||||||
var programLevel slog.Level
|
var programLevel slog.Level
|
||||||
if err := (&programLevel).UnmarshalText([]byte(level)); err != nil {
|
if err := (&programLevel).UnmarshalText([]byte(level)); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "invalid log level %s: %v, using info\n", level, err)
|
fmt.Fprintf(os.Stderr, "invalid log level %s: %v, using info\n", level, err)
|
||||||
@@ -20,16 +20,10 @@ func InitSlog(level string, sink io.Writer, hideSource bool) *slog.Logger {
|
|||||||
leveler := &slog.LevelVar{}
|
leveler := &slog.LevelVar{}
|
||||||
leveler.Set(programLevel)
|
leveler.Set(programLevel)
|
||||||
|
|
||||||
opts := &slog.HandlerOptions{
|
h := slog.NewJSONHandler(sink, &slog.HandlerOptions{
|
||||||
AddSource: true,
|
AddSource: true,
|
||||||
Level: leveler,
|
Level: leveler,
|
||||||
}
|
})
|
||||||
|
|
||||||
if hideSource {
|
|
||||||
opts.AddSource = false
|
|
||||||
}
|
|
||||||
|
|
||||||
h := slog.NewJSONHandler(sink, opts)
|
|
||||||
result := slog.New(h)
|
result := slog.New(h)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ func TestMemoryUsage(t *testing.T) {
|
|||||||
|
|
||||||
// Run getTarget many times
|
// Run getTarget many times
|
||||||
u, _ := url.Parse("/path/to/resource?query=1&foo=bar&baz=qux")
|
u, _ := url.Parse("/path/to/resource?query=1&foo=bar&baz=qux")
|
||||||
for range 10000 {
|
for i := 0; i < 10000; i++ {
|
||||||
_ = cache.getTarget(u)
|
_ = cache.getTarget(u)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ func TestMemoryUsage(t *testing.T) {
|
|||||||
runtime.GC()
|
runtime.GC()
|
||||||
runtime.ReadMemStats(&m1)
|
runtime.ReadMemStats(&m1)
|
||||||
|
|
||||||
for range 1000 {
|
for i := 0; i < 1000; i++ {
|
||||||
_ = cache.extractOGTags(doc)
|
_ = cache.extractOGTags(doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package ogtags
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/url"
|
"net/url"
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
@@ -79,7 +78,7 @@ func FuzzGetTarget(f *testing.F) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ensure no memory corruption by calling multiple times
|
// Ensure no memory corruption by calling multiple times
|
||||||
for range 3 {
|
for i := 0; i < 3; i++ {
|
||||||
result2 := cache.getTarget(u)
|
result2 := cache.getTarget(u)
|
||||||
if result != result2 {
|
if result != result2 {
|
||||||
t.Errorf("getTarget not deterministic: %q != %q", result, result2)
|
t.Errorf("getTarget not deterministic: %q != %q", result, result2)
|
||||||
@@ -149,8 +148,11 @@ func FuzzExtractOGTags(f *testing.F) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !approved {
|
if !approved {
|
||||||
if slices.Contains(cache.approvedTags, property) {
|
for _, tag := range cache.approvedTags {
|
||||||
approved = true
|
if property == tag {
|
||||||
|
approved = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !approved {
|
if !approved {
|
||||||
@@ -258,8 +260,11 @@ func FuzzExtractMetaTagInfo(f *testing.F) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !approved {
|
if !approved {
|
||||||
if slices.Contains(cache.approvedTags, property) {
|
for _, tag := range cache.approvedTags {
|
||||||
approved = true
|
if property == tag {
|
||||||
|
approved = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !approved {
|
if !approved {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package ogtags
|
package ogtags
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"golang.org/x/net/html"
|
"golang.org/x/net/html"
|
||||||
@@ -66,8 +65,10 @@ func (c *OGTagCache) extractMetaTagInfo(n *html.Node) (property, content string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check exact matches
|
// Check exact matches
|
||||||
if slices.Contains(c.approvedTags, propertyKey) {
|
for _, tag := range c.approvedTags {
|
||||||
return propertyKey, content
|
if propertyKey == tag {
|
||||||
|
return propertyKey, content
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", content
|
return "", content
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ func TestPlaywrightBrowser(t *testing.T) {
|
|||||||
|
|
||||||
var performedAction action
|
var performedAction action
|
||||||
var err error
|
var err error
|
||||||
for i := range 5 {
|
for i := 0; i < 5; i++ {
|
||||||
performedAction, err = executeTestCase(t, tc, typ, anubisURL)
|
performedAction, err = executeTestCase(t, tc, typ, anubisURL)
|
||||||
if performedAction == tc.action {
|
if performedAction == tc.action {
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ type Server struct {
|
|||||||
func (s *Server) getTokenKeyfunc() jwt.Keyfunc {
|
func (s *Server) getTokenKeyfunc() jwt.Keyfunc {
|
||||||
// return ED25519 key if HS512 is not set
|
// return ED25519 key if HS512 is not set
|
||||||
if len(s.hs512Secret) == 0 {
|
if len(s.hs512Secret) == 0 {
|
||||||
return func(token *jwt.Token) (any, error) {
|
return func(token *jwt.Token) (interface{}, error) {
|
||||||
return s.ed25519Priv.Public().(ed25519.PublicKey), nil
|
return s.ed25519Priv.Public().(ed25519.PublicKey), nil
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return func(token *jwt.Token) (any, error) {
|
return func(token *jwt.Token) (interface{}, error) {
|
||||||
return s.hs512Secret, nil
|
return s.hs512Secret, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,13 +106,6 @@ func (s *Server) issueChallenge(ctx context.Context, r *http.Request, lg *slog.L
|
|||||||
//return nil, errors.New("[unexpected] this codepath should be impossible, asked to issue a challenge for a non-challenge rule")
|
//return nil, errors.New("[unexpected] this codepath should be impossible, asked to issue a challenge for a non-challenge rule")
|
||||||
}
|
}
|
||||||
|
|
||||||
if rule.Challenge == nil {
|
|
||||||
rule.Challenge = &config.ChallengeRules{
|
|
||||||
Difficulty: s.policy.DefaultDifficulty,
|
|
||||||
Algorithm: config.DefaultAlgorithm,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
id, err := uuid.NewV7()
|
id, err := uuid.NewV7()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -498,11 +491,7 @@ func (s *Server) PassChallenge(w http.ResponseWriter, r *http.Request) {
|
|||||||
chall, err := s.getChallenge(r)
|
chall, err := s.getChallenge(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
lg.Error("getChallenge failed", "err", err)
|
lg.Error("getChallenge failed", "err", err)
|
||||||
algorithm := "unknown"
|
s.respondWithError(w, r, fmt.Sprintf("%s: %s", localizer.T("internal_server_error"), rule.Challenge.Algorithm), makeCode(err))
|
||||||
if rule.Challenge != nil {
|
|
||||||
algorithm = rule.Challenge.Algorithm
|
|
||||||
}
|
|
||||||
s.respondWithError(w, r, fmt.Sprintf("%s: %s", localizer.T("internal_server_error"), algorithm), makeCode(err))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -649,16 +638,8 @@ func (s *Server) check(r *http.Request, lg *slog.Logger) (policy.CheckResult, *p
|
|||||||
}
|
}
|
||||||
|
|
||||||
if matches {
|
if matches {
|
||||||
challRules := t.Challenge
|
|
||||||
if challRules == nil {
|
|
||||||
// Non-CHALLENGE thresholds (ALLOW/DENY) don't have challenge config.
|
|
||||||
// Use an empty struct so hydrateChallengeRule can fill from stored
|
|
||||||
// challenge data during validation, rather than baking in defaults
|
|
||||||
// that could mismatch the difficulty the client actually solved for.
|
|
||||||
challRules = &config.ChallengeRules{}
|
|
||||||
}
|
|
||||||
return cr("threshold/"+t.Name, t.Action, weight), &policy.Bot{
|
return cr("threshold/"+t.Name, t.Action, weight), &policy.Bot{
|
||||||
Challenge: challRules,
|
Challenge: t.Challenge,
|
||||||
Rules: &checker.List{},
|
Rules: &checker.List{},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ func NewTLogWriter(t *testing.T) io.Writer {
|
|||||||
|
|
||||||
// Write splits input on newlines and logs each line separately.
|
// Write splits input on newlines and logs each line separately.
|
||||||
func (w *TLogWriter) Write(p []byte) (n int, err error) {
|
func (w *TLogWriter) Write(p []byte) (n int, err error) {
|
||||||
lines := strings.SplitSeq(string(p), "\n")
|
lines := strings.Split(string(p), "\n")
|
||||||
for line := range lines {
|
for _, line := range lines {
|
||||||
if line != "" {
|
if line != "" {
|
||||||
w.t.Log(line)
|
w.t.Log(line)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ var (
|
|||||||
ErrFailed = errors.New("challenge: user failed challenge")
|
ErrFailed = errors.New("challenge: user failed challenge")
|
||||||
ErrMissingField = errors.New("challenge: missing field")
|
ErrMissingField = errors.New("challenge: missing field")
|
||||||
ErrInvalidFormat = errors.New("challenge: field has invalid format")
|
ErrInvalidFormat = errors.New("challenge: field has invalid format")
|
||||||
ErrInvalidInput = errors.New("challenge: input is nil or missing required fields")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewError(verb, publicReason string, privateReason error) *Error {
|
func NewError(verb, publicReason string, privateReason error) *Error {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package challenge
|
package challenge
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
@@ -51,44 +50,12 @@ type IssueInput struct {
|
|||||||
Store store.Interface
|
Store store.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in *IssueInput) Valid() error {
|
|
||||||
if in == nil {
|
|
||||||
return fmt.Errorf("%w: IssueInput is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
if in.Rule == nil {
|
|
||||||
return fmt.Errorf("%w: Rule is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
if in.Rule.Challenge == nil {
|
|
||||||
return fmt.Errorf("%w: Rule.Challenge is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
if in.Challenge == nil {
|
|
||||||
return fmt.Errorf("%w: Challenge is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ValidateInput struct {
|
type ValidateInput struct {
|
||||||
Rule *policy.Bot
|
Rule *policy.Bot
|
||||||
Challenge *Challenge
|
Challenge *Challenge
|
||||||
Store store.Interface
|
Store store.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in *ValidateInput) Valid() error {
|
|
||||||
if in == nil {
|
|
||||||
return fmt.Errorf("%w: ValidateInput is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
if in.Rule == nil {
|
|
||||||
return fmt.Errorf("%w: Rule is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
if in.Rule.Challenge == nil {
|
|
||||||
return fmt.Errorf("%w: Rule.Challenge is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
if in.Challenge == nil {
|
|
||||||
return fmt.Errorf("%w: Challenge is nil", ErrInvalidInput)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type Impl interface {
|
type Impl interface {
|
||||||
// Setup registers any additional routes with the Impl for assets or API routes.
|
// Setup registers any additional routes with the Impl for assets or API routes.
|
||||||
Setup(mux *http.ServeMux)
|
Setup(mux *http.ServeMux)
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ type Impl struct{}
|
|||||||
func (i *Impl) Setup(mux *http.ServeMux) {}
|
func (i *Impl) Setup(mux *http.ServeMux) {}
|
||||||
|
|
||||||
func (i *Impl) Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in *challenge.IssueInput) (templ.Component, error) {
|
func (i *Impl) Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in *challenge.IssueInput) (templ.Component, error) {
|
||||||
if err := in.Valid(); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
u, err := r.URL.Parse(anubis.BasePrefix + "/.within.website/x/cmd/anubis/api/pass-challenge")
|
u, err := r.URL.Parse(anubis.BasePrefix + "/.within.website/x/cmd/anubis/api/pass-challenge")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("can't render page: %w", err)
|
return nil, fmt.Errorf("can't render page: %w", err)
|
||||||
@@ -53,10 +49,6 @@ func (i *Impl) Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Impl) Validate(r *http.Request, lg *slog.Logger, in *challenge.ValidateInput) error {
|
func (i *Impl) Validate(r *http.Request, lg *slog.Logger, in *challenge.ValidateInput) error {
|
||||||
if err := in.Valid(); err != nil {
|
|
||||||
return challenge.NewError("validate", "invalid input", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
wantTime := in.Challenge.IssuedAt.Add(time.Duration(in.Rule.Challenge.Difficulty) * 800 * time.Millisecond)
|
wantTime := in.Challenge.IssuedAt.Add(time.Duration(in.Rule.Challenge.Difficulty) * 800 * time.Millisecond)
|
||||||
|
|
||||||
if time.Now().Before(wantTime) {
|
if time.Now().Before(wantTime) {
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ type impl struct{}
|
|||||||
func (i *impl) Setup(mux *http.ServeMux) {}
|
func (i *impl) Setup(mux *http.ServeMux) {}
|
||||||
|
|
||||||
func (i *impl) Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in *challenge.IssueInput) (templ.Component, error) {
|
func (i *impl) Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in *challenge.IssueInput) (templ.Component, error) {
|
||||||
if err := in.Valid(); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
u, err := r.URL.Parse(anubis.BasePrefix + "/.within.website/x/cmd/anubis/api/pass-challenge")
|
u, err := r.URL.Parse(anubis.BasePrefix + "/.within.website/x/cmd/anubis/api/pass-challenge")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("can't render page: %w", err)
|
return nil, fmt.Errorf("can't render page: %w", err)
|
||||||
@@ -61,10 +57,6 @@ func (i *impl) Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *impl) Validate(r *http.Request, lg *slog.Logger, in *challenge.ValidateInput) error {
|
func (i *impl) Validate(r *http.Request, lg *slog.Logger, in *challenge.ValidateInput) error {
|
||||||
if err := in.Valid(); err != nil {
|
|
||||||
return challenge.NewError("validate", "invalid input", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
wantTime := in.Challenge.IssuedAt.Add(time.Duration(in.Rule.Challenge.Difficulty) * 80 * time.Millisecond)
|
wantTime := in.Challenge.IssuedAt.Add(time.Duration(in.Rule.Challenge.Difficulty) * 80 * time.Millisecond)
|
||||||
|
|
||||||
if time.Now().Before(wantTime) {
|
if time.Now().Before(wantTime) {
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ func (i *Impl) Issue(w http.ResponseWriter, r *http.Request, lg *slog.Logger, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Impl) Validate(r *http.Request, lg *slog.Logger, in *chall.ValidateInput) error {
|
func (i *Impl) Validate(r *http.Request, lg *slog.Logger, in *chall.ValidateInput) error {
|
||||||
if err := in.Valid(); err != nil {
|
|
||||||
return chall.NewError("validate", "invalid input", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
rule := in.Rule
|
rule := in.Rule
|
||||||
challenge := in.Challenge.RandomData
|
challenge := in.Challenge.RandomData
|
||||||
|
|
||||||
|
|||||||
@@ -30,62 +30,6 @@ func mkRequest(t *testing.T, values map[string]string) *http.Request {
|
|||||||
return req
|
return req
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestValidateNilRuleChallenge reproduces the panic from
|
|
||||||
// https://github.com/TecharoHQ/anubis/issues/1463
|
|
||||||
//
|
|
||||||
// When a threshold rule matches during PassChallenge, check() can return
|
|
||||||
// a policy.Bot with Challenge == nil. After hydrateChallengeRule fails to
|
|
||||||
// run (or the error path hits before it), Validate dereferences
|
|
||||||
// rule.Challenge.Difficulty and panics.
|
|
||||||
func TestValidateNilRuleChallenge(t *testing.T) {
|
|
||||||
i := &Impl{Algorithm: "fast"}
|
|
||||||
lg := slog.With()
|
|
||||||
|
|
||||||
// This is the exact response for SHA256("hunter" + "0") with 0 leading zeros required.
|
|
||||||
const challengeStr = "hunter"
|
|
||||||
const response = "2652bdba8fb4d2ab39ef28d8534d7694c557a4ae146c1e9237bd8d950280500e"
|
|
||||||
|
|
||||||
req := mkRequest(t, map[string]string{
|
|
||||||
"nonce": "0",
|
|
||||||
"elapsedTime": "69",
|
|
||||||
"response": response,
|
|
||||||
})
|
|
||||||
|
|
||||||
for _, tc := range []struct {
|
|
||||||
name string
|
|
||||||
input *challenge.ValidateInput
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
name: "nil-rule-challenge",
|
|
||||||
input: &challenge.ValidateInput{
|
|
||||||
Rule: &policy.Bot{},
|
|
||||||
Challenge: &challenge.Challenge{RandomData: challengeStr},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "nil-rule",
|
|
||||||
input: &challenge.ValidateInput{
|
|
||||||
Challenge: &challenge.Challenge{RandomData: challengeStr},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "nil-challenge",
|
|
||||||
input: &challenge.ValidateInput{Rule: &policy.Bot{Challenge: &config.ChallengeRules{Algorithm: "fast"}}},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "nil-input",
|
|
||||||
input: nil,
|
|
||||||
},
|
|
||||||
} {
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
|
||||||
err := i.Validate(req, lg, tc.input)
|
|
||||||
if !errors.Is(err, challenge.ErrInvalidInput) {
|
|
||||||
t.Fatalf("expected ErrInvalidInput, got: %v", err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestBasic(t *testing.T) {
|
func TestBasic(t *testing.T) {
|
||||||
i := &Impl{Algorithm: "fast"}
|
i := &Impl{Algorithm: "fast"}
|
||||||
bot := &policy.Bot{
|
bot := &policy.Bot{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
ErrNoBotRulesDefined = errors.New("config: must define at least one (1) bot rule")
|
ErrNoBotRulesDefined = errors.New("config: must define at least one (1) bot rule")
|
||||||
ErrBotMustHaveName = errors.New("config.Bot: must set name")
|
ErrBotMustHaveName = errors.New("config.Bot: must set name")
|
||||||
ErrBotMustHaveUserAgentOrPath = errors.New("config.Bot: must set one of user_agent_regex, path_regex, headers_regex, remote_addresses, expression, or Thoth keyword")
|
ErrBotMustHaveUserAgentOrPath = errors.New("config.Bot: must set either user_agent_regex, path_regex, headers_regex, or remote_addresses")
|
||||||
ErrBotMustHaveUserAgentOrPathNotBoth = errors.New("config.Bot: must set either user_agent_regex, path_regex, and not both")
|
ErrBotMustHaveUserAgentOrPathNotBoth = errors.New("config.Bot: must set either user_agent_regex, path_regex, and not both")
|
||||||
ErrUnknownAction = errors.New("config.Bot: unknown action")
|
ErrUnknownAction = errors.New("config.Bot: unknown action")
|
||||||
ErrInvalidUserAgentRegex = errors.New("config.Bot: invalid user agent regex")
|
ErrInvalidUserAgentRegex = errors.New("config.Bot: invalid user agent regex")
|
||||||
@@ -228,8 +228,8 @@ type ImportStatement struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (is *ImportStatement) open() (fs.File, error) {
|
func (is *ImportStatement) open() (fs.File, error) {
|
||||||
if after, ok := strings.CutPrefix(is.Import, "(data)/"); ok {
|
if strings.HasPrefix(is.Import, "(data)/") {
|
||||||
fname := after
|
fname := strings.TrimPrefix(is.Import, "(data)/")
|
||||||
fin, err := data.BotPolicies.Open(fname)
|
fin, err := data.BotPolicies.Open(fname)
|
||||||
return fin, err
|
return fin, err
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ func (sc StatusCodes) Valid() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type fileConfig struct {
|
type fileConfig struct {
|
||||||
OpenGraph openGraphFileConfig `json:"openGraph"`
|
OpenGraph openGraphFileConfig `json:"openGraph,omitempty"`
|
||||||
Impressum *Impressum `json:"impressum,omitempty"`
|
Impressum *Impressum `json:"impressum,omitempty"`
|
||||||
Store *Store `json:"store"`
|
Store *Store `json:"store"`
|
||||||
Bots []BotOrImport `json:"bots"`
|
Bots []BotOrImport `json:"bots"`
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ func TestBotValid(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, cs := range tests {
|
for _, cs := range tests {
|
||||||
|
cs := cs
|
||||||
t.Run(cs.name, func(t *testing.T) {
|
t.Run(cs.name, func(t *testing.T) {
|
||||||
err := cs.bot.Valid()
|
err := cs.bot.Valid()
|
||||||
if err == nil && cs.err == nil {
|
if err == nil && cs.err == nil {
|
||||||
@@ -215,6 +216,7 @@ func TestConfigValidKnownGood(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, st := range finfos {
|
for _, st := range finfos {
|
||||||
|
st := st
|
||||||
t.Run(st.Name(), func(t *testing.T) {
|
t.Run(st.Name(), func(t *testing.T) {
|
||||||
fin, err := os.Open(filepath.Join("testdata", "good", st.Name()))
|
fin, err := os.Open(filepath.Join("testdata", "good", st.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -301,6 +303,7 @@ func TestConfigValidBad(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, st := range finfos {
|
for _, st := range finfos {
|
||||||
|
st := st
|
||||||
t.Run(st.Name(), func(t *testing.T) {
|
t.Run(st.Name(), func(t *testing.T) {
|
||||||
fin, err := os.Open(filepath.Join("testdata", "bad", st.Name()))
|
fin, err := os.Open(filepath.Join("testdata", "bad", st.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ type Logging struct {
|
|||||||
Sink string `json:"sink"` // Logging sink, either "stdio" or "file"
|
Sink string `json:"sink"` // Logging sink, either "stdio" or "file"
|
||||||
Level *slog.Level `json:"level"` // Log level, if set supersedes the level in flags
|
Level *slog.Level `json:"level"` // Log level, if set supersedes the level in flags
|
||||||
Parameters *LoggingFileConfig `json:"parameters"` // Logging parameters, to be dynamic in the future
|
Parameters *LoggingFileConfig `json:"parameters"` // Logging parameters, to be dynamic in the future
|
||||||
HideSource bool `json:"hideSource"` // If true, hide the `source` field in log lines
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ func TestBadConfigs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, st := range finfos {
|
for _, st := range finfos {
|
||||||
|
st := st
|
||||||
t.Run(st.Name(), func(t *testing.T) {
|
t.Run(st.Name(), func(t *testing.T) {
|
||||||
if _, err := LoadPoliciesOrDefault(t.Context(), filepath.Join("config", "testdata", "bad", st.Name()), anubis.DefaultDifficulty, "info"); err == nil {
|
if _, err := LoadPoliciesOrDefault(t.Context(), filepath.Join("config", "testdata", "bad", st.Name()), anubis.DefaultDifficulty, "info"); err == nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -41,6 +42,7 @@ func TestGoodConfigs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, st := range finfos {
|
for _, st := range finfos {
|
||||||
|
st := st
|
||||||
t.Run(st.Name(), func(t *testing.T) {
|
t.Run(st.Name(), func(t *testing.T) {
|
||||||
t.Run("with-thoth", func(t *testing.T) {
|
t.Run("with-thoth", func(t *testing.T) {
|
||||||
ctx := thothmock.WithMockThoth(t)
|
ctx := thothmock.WithMockThoth(t)
|
||||||
|
|||||||
28
lib/http.go
28
lib/http.go
@@ -182,7 +182,10 @@ func makeCode(err error) string {
|
|||||||
enc := base64.StdEncoding.EncodeToString(buf.Bytes())
|
enc := base64.StdEncoding.EncodeToString(buf.Bytes())
|
||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
for i := 0; i < len(enc); i += width {
|
for i := 0; i < len(enc); i += width {
|
||||||
end := min(i+width, len(enc))
|
end := i + width
|
||||||
|
if end > len(enc) {
|
||||||
|
end = len(enc)
|
||||||
|
}
|
||||||
builder.WriteString(enc[i:end])
|
builder.WriteString(enc[i:end])
|
||||||
builder.WriteByte('\n')
|
builder.WriteByte('\n')
|
||||||
}
|
}
|
||||||
@@ -219,12 +222,8 @@ func (s *Server) RenderIndex(w http.ResponseWriter, r *http.Request, cr policy.C
|
|||||||
chall, err := s.issueChallenge(r.Context(), r, lg, cr, rule)
|
chall, err := s.issueChallenge(r.Context(), r, lg, cr, rule)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
lg.Error("can't get challenge", "err", err)
|
lg.Error("can't get challenge", "err", err)
|
||||||
algorithm := "unknown"
|
|
||||||
if rule.Challenge != nil {
|
|
||||||
algorithm = rule.Challenge.Algorithm
|
|
||||||
}
|
|
||||||
s.ClearCookie(w, CookieOpts{Name: anubis.TestCookieName, Host: r.Host})
|
s.ClearCookie(w, CookieOpts{Name: anubis.TestCookieName, Host: r.Host})
|
||||||
s.respondWithError(w, r, fmt.Sprintf("%s: %s", localizer.T("internal_server_error"), algorithm), makeCode(err))
|
s.respondWithError(w, r, fmt.Sprintf("%s: %s", localizer.T("internal_server_error"), rule.Challenge.Algorithm), makeCode(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,13 +248,9 @@ func (s *Server) RenderIndex(w http.ResponseWriter, r *http.Request, cr policy.C
|
|||||||
|
|
||||||
impl, ok := challenge.Get(chall.Method)
|
impl, ok := challenge.Get(chall.Method)
|
||||||
if !ok {
|
if !ok {
|
||||||
algorithm := "unknown"
|
lg.Error("check failed", "err", "can't get algorithm", "algorithm", rule.Challenge.Algorithm)
|
||||||
if rule.Challenge != nil {
|
|
||||||
algorithm = rule.Challenge.Algorithm
|
|
||||||
}
|
|
||||||
lg.Error("check failed", "err", "can't get algorithm", "algorithm", algorithm)
|
|
||||||
s.ClearCookie(w, CookieOpts{Name: anubis.TestCookieName, Host: r.Host})
|
s.ClearCookie(w, CookieOpts{Name: anubis.TestCookieName, Host: r.Host})
|
||||||
s.respondWithError(w, r, fmt.Sprintf("%s: %s", localizer.T("internal_server_error"), algorithm), makeCode(err))
|
s.respondWithError(w, r, fmt.Sprintf("%s: %s", localizer.T("internal_server_error"), rule.Challenge.Algorithm), makeCode(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,14 +333,7 @@ func (s *Server) respondWithError(w http.ResponseWriter, r *http.Request, messag
|
|||||||
func (s *Server) respondWithStatus(w http.ResponseWriter, r *http.Request, msg, code string, status int) {
|
func (s *Server) respondWithStatus(w http.ResponseWriter, r *http.Request, msg, code string, status int) {
|
||||||
localizer := localization.GetLocalizer(r)
|
localizer := localization.GetLocalizer(r)
|
||||||
|
|
||||||
component := web.Base(
|
templ.Handler(web.Base(localizer.T("oh_noes"), web.ErrorPage(msg, s.opts.WebmasterEmail, code, localizer), s.policy.Impressum, localizer), templ.WithStatus(status)).ServeHTTP(w, r)
|
||||||
localizer.T("oh_noes"),
|
|
||||||
web.ErrorPage(msg, s.opts.WebmasterEmail, code, localizer),
|
|
||||||
s.policy.Impressum,
|
|
||||||
localizer,
|
|
||||||
)
|
|
||||||
handler := internal.NoStoreCache(templ.Handler(component, templ.WithStatus(status)))
|
|
||||||
handler.ServeHTTP(w, r)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/TecharoHQ/anubis"
|
"github.com/TecharoHQ/anubis"
|
||||||
"github.com/TecharoHQ/anubis/internal"
|
|
||||||
"github.com/TecharoHQ/anubis/lib/policy"
|
"github.com/TecharoHQ/anubis/lib/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -192,34 +191,3 @@ func TestRenderIndexUnauthorized(t *testing.T) {
|
|||||||
t.Errorf("expected body %q, got %q", "Authorization required", body)
|
t.Errorf("expected body %q, got %q", "Authorization required", body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNoCacheOnError(t *testing.T) {
|
|
||||||
pol := loadPolicies(t, "testdata/useragent.yaml", 0)
|
|
||||||
srv := spawnAnubis(t, Options{Policy: pol})
|
|
||||||
ts := httptest.NewServer(internal.RemoteXRealIP(true, "tcp", srv))
|
|
||||||
defer ts.Close()
|
|
||||||
|
|
||||||
for userAgent, expectedCacheControl := range map[string]string{
|
|
||||||
"DENY": "no-store",
|
|
||||||
"CHALLENGE": "no-store",
|
|
||||||
"ALLOW": "",
|
|
||||||
} {
|
|
||||||
t.Run(userAgent, func(t *testing.T) {
|
|
||||||
req, err := http.NewRequest(http.MethodGet, ts.URL, nil)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
req.Header.Set("User-Agent", userAgent)
|
|
||||||
|
|
||||||
resp, err := ts.Client().Do(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if resp.Header.Get("Cache-Control") != expectedCacheControl {
|
|
||||||
t.Errorf("wanted Cache-Control header %q, got %q", expectedCacheControl, resp.Header.Get("Cache-Control"))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"loading": "Зареждане...",
|
|
||||||
"why_am_i_seeing": "Защо виждам това?",
|
|
||||||
"protected_by": "Защитено от",
|
|
||||||
"protected_from": "От",
|
|
||||||
"made_with": "Направено с ❤️ в 🇨🇦",
|
|
||||||
"mascot_design": "Дизайн на талисмана от",
|
|
||||||
"ai_companies_explanation": "Виждате това, защото администраторът на този уебсайт е kонфигурирал Anubis, за да защити сървъра от агресивното събиране на данни от компании, занимаващи се с изкуствен интелект. Това може и причинява прекъсвания на уебсайтовете, което прави техните ресурси недостъпни за всички.",
|
|
||||||
"anubis_compromise": "Anubis е компромис. Anubis използва схема за ддоказателство-за-работа по подобие на Hashcash, предложена схема за доказателство-за-работа за намаляване на спама в имейлите. Идеята е, че при индивидуални мащаби допълнителното натоварване е пренебрежимо, но при масов ниво на събиране на данни то се натрупва и прави събирането на данни много по-скъпо.",
|
|
||||||
"hack_purpose": "В крайна сметка, това е временно решение, за да се отдели повече време за идентифициране и разпознаване на безглави браузъри (например чрез това как те рендират шрифтовете), така че страницата за доказателство-за-работа да не се налага да се показва на потребители, които е по-вероятно да са легитимни.",
|
|
||||||
"simplified_explanation": "Това е мярка срещу ботове и злонамерени заявки, подобна на CAPTCHA. Вместо да трябва да правите нещо сами, браузърът ви получава задача за изчисление, която трябва да реши, за да се увери, че е валиден клиент. Тази концепция се нарича схема доказателство-за-работа. Задачата се изчислява за няколко секунди и ви се дава достъп до уебсайта. Благодаря ви за разбирането и търпението.",
|
|
||||||
"jshelter_note": "Моля, имайте предвид, че Anubis изисква използването на модерни функции на JavaScript, сред които и като JShelter ще деактивират. Моля, деактивирайте JShelter или други подобни добавки за този домейн.",
|
|
||||||
"version_info": "Този уебсайт използва версия на Anubis",
|
|
||||||
"try_again": "Опитайте отново",
|
|
||||||
"go_home": "Отидете на началната страница",
|
|
||||||
"contact_webmaster": "или ако смятате, че не трябва да бъдете блокирани, моля свържете се с уебмастъра на",
|
|
||||||
"connection_security": "Моля, изчакайте, докато се уверим в сигурността на връзката ви",
|
|
||||||
"javascript_required": "За съжаление, трябва да включите JavaScript, за да минете през това предизвикателство. Това е необходимо, защото компаниите за изкуствен интелект промениха социалния договор около начина на хостинг на уебсайтове. Решение без JavaScript е в процес на разработка.",
|
|
||||||
"benchmark_requires_js": "За да използвате инструмента за тестване, е необходимо да включите JavaScript.",
|
|
||||||
"difficulty": "Трудност:",
|
|
||||||
"algorithm": "Алгоритъм:",
|
|
||||||
"compare": "Сравни:",
|
|
||||||
"time": "Време",
|
|
||||||
"iters": "Итерации",
|
|
||||||
"time_a": "Време А",
|
|
||||||
"iters_a": "Итерации А",
|
|
||||||
"time_b": "Време Б",
|
|
||||||
"iters_b": "Итерации Б",
|
|
||||||
"static_check_endpoint": "Това е просто краен пункт за проверка, който да използва обратният ви прокси.",
|
|
||||||
"authorization_required": "Изисква се авторизация",
|
|
||||||
"cookies_disabled": "Браузърът ви е настроен да деактивира бисквитките. Anubis изисква бисквитки за законния интерес да се увери, че сте валиден клиент. Моля, включете бисквитките за този домейн",
|
|
||||||
"access_denied": "Достъпът е отказан: код на грешка",
|
|
||||||
"dronebl_entry": "DroneBL докладва запис",
|
|
||||||
"see_dronebl_lookup": "вижте",
|
|
||||||
"internal_server_error": "Вътрешна сървърна грешка: администраторът е грешно конфигурирал Anubis. Моля, свържете се с администратора и ги помолете да проверят логовете около",
|
|
||||||
"invalid_redirect": "Невалидно пренасочване",
|
|
||||||
"redirect_not_parseable": "URL адресът за пренасочване не може да бъде разпознат",
|
|
||||||
"redirect_domain_not_allowed": "Домейнът за пренасочване не е позволен",
|
|
||||||
"missing_required_forwarded_headers": "Липсват необходимите X-Forwarded-* заглавни части",
|
|
||||||
"failed_to_sign_jwt": "неуспешно подписване на JWT",
|
|
||||||
"invalid_invocation": "Невалидно извикване на MakeChallenge",
|
|
||||||
"client_error_browser": "Крешка в клиента: Моля, уверете се, че браузърът ви е актуализиран и опитайте отново по-късно.",
|
|
||||||
"oh_noes": "О, не!",
|
|
||||||
"benchmarking_anubis": "Тестване на Anubis!",
|
|
||||||
"you_are_not_a_bot": "Ти не си бот!",
|
|
||||||
"making_sure_not_bot": "Уверяваме се, че не си бот!",
|
|
||||||
"celphase": "CELPHASE",
|
|
||||||
"js_web_crypto_error": "Браузърът ви няма функциониращ web.crypto елемент. Гледате ли това през сигурен контекст?",
|
|
||||||
"js_web_workers_error": "Браузърът ви не поддържа уеб работници (Anubis използва това, за да избегне замръзване на браузъра ви). Имате ли инсталирана добавка като JShelter?",
|
|
||||||
"js_cookies_error": "Браузърът ви не съхранява бисквитки. Anubis използва бисквитки, за да определи които клиенти са преминали задачите, като съхранява подписан токен в бисквитка. Моля, включете съхраняването на бисквитки за този домейн. Имената на бисквитките, съхранени от Anubis, могат да се променят без предварително уведомление. Имената и стойностите на бисквитките не са част от публичния API.",
|
|
||||||
"js_context_not_secure": "Вашият контекст не е сигурен!",
|
|
||||||
"js_context_not_secure_msg": "Опитайте да се свържете чрез HTTPS или уведомете администратора да kонфигурира HTTPS. За повече информация вижте MDN.",
|
|
||||||
"js_calculating": "Изчисляване...",
|
|
||||||
"js_missing_feature": "Липсваща функция",
|
|
||||||
"js_challenge_error": "Грешка при задачата!",
|
|
||||||
"js_challenge_error_msg": "Неуспешно разрешаване на алгоритъма за проверка. Може би искате да презаредите страницата.",
|
|
||||||
"js_calculating_difficulty": "Изчисляване... Трудност:",
|
|
||||||
"js_speed": "Скорост:",
|
|
||||||
"js_verification_longer": "Проверката отнема повече време от очакваното. Моля, не презареждайте страницата.",
|
|
||||||
"js_success": "Успех!",
|
|
||||||
"js_done_took": "Готово! Отне",
|
|
||||||
"js_iterations": "итерации",
|
|
||||||
"js_finished_reading": "Приключих с четенето, продължете →",
|
|
||||||
"js_calculation_error": "Грешка при изчислението!",
|
|
||||||
"js_calculation_error_msg": "Неуспешно изчисление на задачата:"
|
|
||||||
}
|
|
||||||
@@ -1,38 +1,38 @@
|
|||||||
{
|
{
|
||||||
"loading": "Wird geladen …",
|
"loading": "Ladevorgang...",
|
||||||
"why_am_i_seeing": "Warum sehe ich diese Seite?",
|
"why_am_i_seeing": "Warum sehe ich diese Seite?",
|
||||||
"protected_by": "Geschützt durch",
|
"protected_by": "Geschützt durch",
|
||||||
"protected_from": "Von",
|
"protected_from": "Von",
|
||||||
"made_with": "Mit ❤️ entwickelt in 🇨🇦",
|
"made_with": "Mit ❤️ entwickelt in 🇨🇦",
|
||||||
"mascot_design": "Maskottchen entworfen von",
|
"mascot_design": "Maskottchen erstellt von",
|
||||||
"ai_companies_explanation": "Diese Seite wird angezeigt, weil der Betreiber dieser Website Anubis eingerichtet hat, um den Server vor aggressivem Scraping durch KI-Unternehmen zu schützen. Dieses Scraping kann Ausfälle verursachen, wodurch die Website für niemanden erreichbar ist.",
|
"ai_companies_explanation": "Diese Seite wird angezeigt, da der Betreiber der Website Anubis eingerichtet hat, um sie vor aggressiven Webcrawlern von KI-Unternehmen zu schützen. Diese können Ausfälle verursachen, wodurch die Website für niemanden erreichbar ist.",
|
||||||
"anubis_compromise": "Anubis ist ein Kompromiss. Es verwendet ein Proof-of-Work-Verfahren nach dem Vorbild von Hashcash, das ursprünglich zur Reduzierung von E-Mail-Spam entwickelt wurde. Die Idee dahinter ist, dass die zusätzliche Last für einzelne Nutzer vernachlässigbar ist, sich aber auf der Ebene von Massen-Scrapern summiert und das Scraping deutlich teurer macht.",
|
"anubis_compromise": "Anubis stellt einen Kompromiss dar. Es verwendet eine Proof-of-Work-Methode nach dem Hashcash-Prinzip, das ursprünglich zur Bekämpfung von E-Mail-Spam entwickelt wurde. Die Idee dahinter: Für einen einzelnen Besucher ist die Verzögerung vernachlässigbar, aber massenhaftes Scraping wird dadurch aufwändig und teuer.",
|
||||||
"hack_purpose": "Letztlich ist dies eine Übergangslösung, damit mehr Zeit in das Fingerprinting und die Erkennung von Headless-Browsern investiert werden kann (z. B. anhand ihrer Schriftart-Darstellung), sodass die Proof-of-Work-Seite Nutzern, die mit hoher Wahrscheinlichkeit legitim sind, nicht mehr angezeigt werden muss.",
|
"hack_purpose": "Letztendlich ist dies eine Übergangslösung, um mehr Zeit für Browser-Fingerprinting und die Identifizierung von Headless-Browsern (z. B. anhand ihrer Schriftwiedergabe) zu gewinnen. So muss die Proof-of-Work-Seite nicht Nutzern angezeigt werden, die sehr wahrscheinlich legitim sind.",
|
||||||
"simplified_explanation": "Dies ist eine Schutzmaßnahme gegen Bots und schädliche Anfragen, ähnlich einem CAPTCHA. Anstatt selbst eine Aufgabe lösen zu müssen, bekommt dein Browser eine Rechenaufgabe, die er lösen muss, um sicherzustellen, dass es sich um einen gültigen Client handelt. Dieses Konzept nennt sich <a href=\"https://de.wikipedia.org/wiki/Proof_of_Work\">Proof of Work</a>. Die Aufgabe wird innerhalb weniger Sekunden berechnet und du erhältst Zugang zur Website. Danke für dein Verständnis und deine Geduld.",
|
"simplified_explanation": "Dies ist eine Maßnahme gegen Bots und bösartige Anfragen, ähnlich einem CAPTCHA. Anstatt jedoch selbst arbeiten zu müssen, erhält dein Browser eine Rechenaufgabe, um sicherzustellen, dass es sich um einen gültigen Client handelt. Dieses Konzept nennt sich <a href=\"https://en.wikipedia.org/wiki/Proof_of_work\">Proof of Work</a>. Die Aufgabe wird in wenigen Sekunden berechnet und du erhältst Zugriff auf die Website. Danke für deine Geduld.",
|
||||||
"jshelter_note": "Anubis benötigt moderne JavaScript-Funktionen, die von Plugins wie JShelter deaktiviert werden. Bitte deaktiviere JShelter oder ähnliche Plugins für diese Domain.",
|
"jshelter_note": "Anubis benötigt moderne JavaScript-Features, die von Plugins wie JShelter deaktiviert werden. Bitte deaktiviere JShelter oder ähnliche Plugins für diese Domain.",
|
||||||
"version_info": "Diese Website nutzt Anubis Version",
|
"version_info": "Diese Website läuft mit Anubis-Version",
|
||||||
"try_again": "Erneut versuchen",
|
"try_again": "Erneut versuchen",
|
||||||
"go_home": "Zur Startseite",
|
"go_home": "Zur Startseite",
|
||||||
"contact_webmaster": "oder kontaktiere den Webmaster unter, falls du glaubst, dass du nicht blockiert werden solltest:",
|
"contact_webmaster": "Falls du glaubst, dass es sich um einen Fehler handelt, kontaktiere bitte den Administrator unter",
|
||||||
"connection_security": "Bitte warte einen Moment, während wir die Sicherheit deiner Verbindung überprüfen.",
|
"connection_security": "Bitte warte einen Moment, während wir die Sicherheit deiner Verbindung prüfen.",
|
||||||
"javascript_required": "Du musst JavaScript aktivieren, um diese Prüfung zu bestehen. Dies ist notwendig, da KI-Unternehmen den Gesellschaftsvertrag rund um Webhosting verändert haben. Eine Lösung ohne JavaScript ist in Arbeit.",
|
"javascript_required": "Du musst JavaScript aktivieren, um diese Prüfung durchführen zu können. Dies ist notwendig, da KI-Unternehmen die bisherigen Regeln für das Hosting von Websites nicht mehr respektieren. Eine Lösung ohne JavaScript ist in Entwicklung.",
|
||||||
"benchmark_requires_js": "Für das Benchmark-Tool muss JavaScript aktiviert sein.",
|
"benchmark_requires_js": "Für die Nutzung des Benchmark-Tools muss JavaScript aktiviert sein.",
|
||||||
"difficulty": "Schwierigkeit:",
|
"difficulty": "Schwierigkeit:",
|
||||||
"algorithm": "Algorithmus:",
|
"algorithm": "Algorithmus:",
|
||||||
"compare": "Vergleichen:",
|
"compare": "Vergleich:",
|
||||||
"time": "Zeit",
|
"time": "Zeit",
|
||||||
"iters": "Iterationen",
|
"iters": "Iterationen",
|
||||||
"time_a": "Zeit A",
|
"time_a": "Zeit A",
|
||||||
"iters_a": "Iterationen A",
|
"iters_a": "Iterationen A",
|
||||||
"time_b": "Zeit B",
|
"time_b": "Zeit B",
|
||||||
"iters_b": "Iterationen B",
|
"iters_b": "Iterationen B",
|
||||||
"static_check_endpoint": "Dies ist nur ein Prüf-Endpunkt für deinen Reverse-Proxy.",
|
"static_check_endpoint": "Dies ist ein Endpunkt zur Prüfung durch einen Reverse-Proxy.",
|
||||||
"authorization_required": "Autorisierung erforderlich",
|
"authorization_required": "Autorisierung erforderlich",
|
||||||
"cookies_disabled": "Cookies sind in deinem Browser deaktiviert. Anubis benötigt Cookies im berechtigten Interesse, sicherzustellen, dass es sich um einen gültigen Client handelt. Bitte aktiviere Cookies für diese Domain.",
|
"cookies_disabled": "Cookies sind in deinem Browser deaktiviert. Anubis benötigt Cookies, um sicherzustellen, dass es sich um einen legitimen Zugriff handelt. Bitte aktiviere Cookies für diese Domain.",
|
||||||
"access_denied": "Zugriff verweigert: Fehlercode",
|
"access_denied": "Zugriff verweigert – Fehlercode",
|
||||||
"dronebl_entry": "DroneBL hat einen Eintrag gemeldet",
|
"dronebl_entry": "Eintrag in DroneBL",
|
||||||
"see_dronebl_lookup": "anzeigen",
|
"see_dronebl_lookup": "anzeigen",
|
||||||
"internal_server_error": "Interner Serverfehler: Der Administrator hat Anubis fehlerhaft konfiguriert. Bitte kontaktiere den Administrator und bitte ihn, die Logs im Zeitraum um folgenden Zeitpunkt zu prüfen:",
|
"internal_server_error": "Interner Serverfehler: Der Administrator hat Anubis fehlerhaft konfiguriert. Bitte kontaktiere den Administrator und bitte ihn, die Logs zu prüfen.",
|
||||||
"invalid_redirect": "Ungültige Weiterleitung",
|
"invalid_redirect": "Ungültige Weiterleitung",
|
||||||
"redirect_not_parseable": "Weiterleitungs-URL kann nicht verarbeitet werden",
|
"redirect_not_parseable": "Weiterleitungs-URL kann nicht verarbeitet werden",
|
||||||
"redirect_domain_not_allowed": "Weiterleitungs-Domain nicht erlaubt",
|
"redirect_domain_not_allowed": "Weiterleitungs-Domain nicht erlaubt",
|
||||||
@@ -41,26 +41,26 @@
|
|||||||
"invalid_invocation": "Ungültiger Aufruf von MakeChallenge",
|
"invalid_invocation": "Ungültiger Aufruf von MakeChallenge",
|
||||||
"client_error_browser": "Client-Fehler: Bitte stelle sicher, dass dein Browser aktuell ist, und versuche es später erneut.",
|
"client_error_browser": "Client-Fehler: Bitte stelle sicher, dass dein Browser aktuell ist, und versuche es später erneut.",
|
||||||
"oh_noes": "Oh nein!",
|
"oh_noes": "Oh nein!",
|
||||||
"benchmarking_anubis": "Anubis-Benchmark wird durchgeführt!",
|
"benchmarking_anubis": "Benchmark wird durchgeführt!",
|
||||||
"you_are_not_a_bot": "Du bist kein Bot!",
|
"you_are_not_a_bot": "Du bist kein Bot!",
|
||||||
"making_sure_not_bot": "Dein Browser wird geprüft!",
|
"making_sure_not_bot": "Dein Browser wird geprüft!",
|
||||||
"celphase": "CELPHASE",
|
"celphase": "CELPHASE",
|
||||||
"js_web_crypto_error": "Dein Browser verfügt nicht über ein funktionierendes web.crypto-Element. Wird diese Seite in einem sicheren Kontext angezeigt?",
|
"js_web_crypto_error": "Dein Browser verfügt nicht über ein funktionierendes web.crypto-Element. Wird eine sichere Verbindung verwendet?",
|
||||||
"js_web_workers_error": "Dein Browser unterstützt keine Web Workers (Anubis verwendet diese, damit dein Browser nicht einfriert). Hast du ein Plugin wie JShelter installiert?",
|
"js_web_workers_error": "Dein Browser unterstützt keine Web-Worker (Anubis verwendet diese, damit der Browser nicht einfriert). Ist ein Plugin wie JShelter installiert?",
|
||||||
"js_cookies_error": "Dein Browser speichert keine Cookies. Anubis verwendet Cookies, um nach bestandener Prüfung ein signiertes Token abzulegen. Bitte aktiviere Cookies für diese Domain. Die Cookie-Namen von Anubis können sich jederzeit ohne Vorankündigung ändern. Cookie-Namen und -Werte sind nicht Teil der öffentlichen API.",
|
"js_cookies_error": "Dein Browser speichert keine Cookies. Anubis verwendet Cookies, um nach bestandener Prüfung ein signiertes Token abzulegen. Bitte aktiviere Cookies für diese Domain. Die Cookie-Namen von Anubis können sich jederzeit ändern. Cookie-Namen und gespeicherte Werte sind nicht Teil der öffentlichen API.",
|
||||||
"js_context_not_secure": "Diese Verbindung ist nicht sicher!",
|
"js_context_not_secure": "Diese Verbindung ist nicht sicher!",
|
||||||
"js_context_not_secure_msg": "Versuche, dich über HTTPS zu verbinden, oder informiere den Administrator, HTTPS einzurichten. Weitere Informationen unter <a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure\">MDN</a>.",
|
"js_context_not_secure_msg": "Bitte versuche, dich über HTTPS zu verbinden, oder weise den Administrator darauf hin, HTTPS einzurichten. Mehr Informationen: <a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure\">MDN</a>.",
|
||||||
"js_calculating": "Berechnung läuft …",
|
"js_calculating": "Berechnung läuft...",
|
||||||
"js_missing_feature": "Fehlendes Feature",
|
"js_missing_feature": "Fehlendes Feature",
|
||||||
"js_challenge_error": "Prüfung fehlgeschlagen!",
|
"js_challenge_error": "Prüfung fehlgeschlagen!",
|
||||||
"js_challenge_error_msg": "Der Prüfalgorithmus konnte nicht aufgelöst werden. Bitte lade die Seite neu.",
|
"js_challenge_error_msg": "Der Prüf-Algorithmus konnte nicht geladen werden. Bitte lade die Seite neu.",
|
||||||
"js_calculating_difficulty": "Berechnung läuft …<br/>Schwierigkeit:",
|
"js_calculating_difficulty": "Berechnung läuft...<br/>Schwierigkeit:",
|
||||||
"js_speed": "Geschwindigkeit:",
|
"js_speed": "Geschwindigkeit:",
|
||||||
"js_verification_longer": "Die Verifizierung dauert länger als erwartet. Bitte bleibe auf der Seite und lade sie nicht neu.",
|
"js_verification_longer": "Die Prüfung dauert länger als erwartet. Bitte warte und lade die Seite nicht neu.",
|
||||||
"js_success": "Geschafft!",
|
"js_success": "Erfolgreich!",
|
||||||
"js_done_took": "Fertig! Dauer:",
|
"js_done_took": "Fertig! Dauer:",
|
||||||
"js_iterations": "Iterationen",
|
"js_iterations": "Iterationen",
|
||||||
"js_finished_reading": "Fertig gelesen, weiter zur Seite →",
|
"js_finished_reading": "Fertig gelesen – weiter zur Seite →",
|
||||||
"js_calculation_error": "Berechnungsfehler!",
|
"js_calculation_error": "Berechnungsfehler!",
|
||||||
"js_calculation_error_msg": "Fehler bei der Berechnung der Prüfung:"
|
"js_calculation_error_msg": "Fehler bei der Berechnung der Prüfung:"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +1,66 @@
|
|||||||
{
|
{
|
||||||
"loading": "Chargement...",
|
"loading": "Chargement...",
|
||||||
"why_am_i_seeing": "Comment suis-je arrivé·e ici ?",
|
"why_am_i_seeing": "Pourquoi je vois ceci ?",
|
||||||
"protected_by": "Protégé par",
|
"protected_by": "Protégé par",
|
||||||
"protected_from": "de",
|
"protected_from": "From",
|
||||||
"made_with": "Fait avec ❤️ au 🇨🇦",
|
"made_with": "Fait avec ❤️ au 🇨🇦",
|
||||||
"mascot_design": "Design de la mascotte par",
|
"mascot_design": "Design de la mascotte par",
|
||||||
"ai_companies_explanation": "Vous voyez cette page car l'administrateur·rice de ce site Web a configuré Anubis pour protéger le serveur contre le fléau des entreprises d'IA qui récupèrent agressivement le contenu des sites Web. Cela perturbe leur fonctionnement et rend leurs ressources inaccessibles pour tout le monde.",
|
"ai_companies_explanation": "Vous voyez ceci car l'administrateur de ce site web a configuré Anubis pour protéger le serveur contre le fléau des entreprises d'IA qui scrapent agressivement les sites web. Cela peut et cause des temps d'arrêt pour les sites web, ce qui rend leurs ressources inaccessibles pour tout le monde.",
|
||||||
"anubis_compromise": "Anubis est un compromis. Anubis utilise un procédé de preuve de travail similaire à Hashcash, un procédé de preuve de travail proposé pour réduire le spam par e-mail. L'idée est qu'à l'échelle individuelle, la charge supplémentaire est négligeable, mais à l'échelle des scrapers de masse, la charge s'accumule et le scraping devient beaucoup plus coûteux.",
|
"anubis_compromise": "Anubis est un compromis. Anubis utilise un schéma de Preuve de Travail dans la veine de Hashcash, un schéma de preuve de travail proposé pour réduire le spam par email. L'idée est qu'à l'échelle individuelle, la charge supplémentaire est négligeable, mais à l'échelle des scrapers de masse, cela s'accumule et rend le scraping beaucoup plus coûteux.",
|
||||||
"hack_purpose": "En fin de compte, il s'agit d'une solution de substitution permettant de consacrer plus de temps à l'identification et à la prise d'empreintes des navigateurs headless (par exemple, en reconnaissant leur rendu des polices), pour que, à terme, la page de défi utilisant la preuve de travail n'ait plus besoin d'être présentée aux utilisateur·rices qui sont beaucoup plus susceptibles d'être légitimes.",
|
"hack_purpose": "En fin de compte, il s'agit d'une solution de substitution afin de consacrer plus de temps à l'identification et à l'empreinte digitale des navigateurs sans tête (par exemple, via leur rendu de police) afin que la page de preuve de travail du défi n'ait pas besoin d'être présentée aux utilisateurs qui sont beaucoup plus susceptibles d'être légitimes.",
|
||||||
"jshelter_note": "Veuillez noter qu'Anubis nécessite l'utilisation de fonctionnalités JavaScript modernes qui peuvent être désactivées par des plugins comme JShelter. Veuillez désactiver JShelter ou tout autre plugin similaire pour ce domaine.",
|
"jshelter_note": "Veuillez noter qu'Anubis nécessite l'utilisation de fonctionnalités JavaScript modernes que des plugins comme JShelter désactiveront. Veuillez désactiver JShelter ou d'autres plugins similaires pour ce domaine.",
|
||||||
"version_info": "Ce site Web utilise Anubis version",
|
"version_info": "Ce site web utilise Anubis version",
|
||||||
"try_again": "Réessayer",
|
"try_again": "Réessayer",
|
||||||
"go_home": "Accueil",
|
"go_home": "Accueil",
|
||||||
"contact_webmaster": "ou si vous pensez que vous ne devriez pas être bloqué, veuillez contacter le webmaster à l'adresse",
|
"contact_webmaster": "ou si vous pensez que vous ne devriez pas être bloqué, veuillez contacter le webmaster à",
|
||||||
"connection_security": "Veuillez patienter un instant pendant que nous assurons la sécurité de votre connexion.",
|
"connection_security": "Veuillez patienter un instant pendant que nous assurons la sécurité de votre connexion.",
|
||||||
"javascript_required": "Malheureusement, vous devez activer JavaScript pour passer cette page de défi. Cette obligation est imposée par les entreprises d'IA, qui ont décidé de modifier unilatéralement les termes du contrat social régissant l'hébergement de sites Web. Une solution sans JavaScript est en cours de développement.",
|
"javascript_required": "Malheureusement, vous devez activer JavaScript pour passer ce défi. Ceci est requis car les entreprises d'IA ont changé le contrat social autour du fonctionnement de l'hébergement de sites web. Une solution sans JS est en cours de développement.",
|
||||||
"benchmark_requires_js": "L'exécution de l'outil de benchmark nécessite l'activation de JavaScript.",
|
"benchmark_requires_js": "L'exécution de l'outil de benchmark nécessite l'activation de JavaScript.",
|
||||||
"difficulty": "Difficulté :",
|
"difficulty": "Difficulté :",
|
||||||
"algorithm": "Algorithme :",
|
"algorithm": "Algorithme :",
|
||||||
"compare": "Comparer :",
|
"compare": "Comparer :",
|
||||||
"time": "Temps",
|
"time": "Temps",
|
||||||
"iters": "Itérations",
|
"iters": "Itérations",
|
||||||
"time_a": "Temps A",
|
"time_a": "Temps A",
|
||||||
"iters_a": "Itér. A",
|
"iters_a": "Itér. A",
|
||||||
"time_b": "Temps B",
|
"time_b": "Temps B",
|
||||||
"iters_b": "Itér. B",
|
"iters_b": "Itér. B",
|
||||||
"static_check_endpoint": "Ceci est juste un point de terminaison de vérification à utiliser par votre proxy inverse.",
|
"static_check_endpoint": "Ceci est juste un point de terminaison de vérification pour votre proxy inverse à utiliser.",
|
||||||
"authorization_required": "Autorisation requise",
|
"authorization_required": "Autorisation requise",
|
||||||
"cookies_disabled": "Les cookies sont désactivés dans votre navigateur. Anubis a recours aux cookies pour l'intérêt légitime de s'assurer que vous êtes un client valide. Veuillez activer les cookies pour ce domaine.",
|
"cookies_disabled": "Votre navigateur est configuré pour désactiver les cookies. Anubis nécessite des cookies pour l'intérêt légitime de s'assurer que vous êtes un client valide. Veuillez activer les cookies pour ce domaine",
|
||||||
"access_denied": "Accès refusé : code d'erreur",
|
"access_denied": "Accès refusé : code d'erreur",
|
||||||
"dronebl_entry": "DroneBL a rapporté une entrée",
|
"dronebl_entry": "DroneBL a signalé une entrée",
|
||||||
"see_dronebl_lookup": "voir",
|
"see_dronebl_lookup": "voir",
|
||||||
"internal_server_error": "Erreur interne du serveur : l'administrateur·rice a mal configuré Anubis. Veuillez contacter l'administrateur·rice et lui demander de consulter les logs autour de",
|
"internal_server_error": "Erreur interne du serveur : l'administrateur a mal configuré Anubis. Veuillez contacter l'administrateur et lui demander de consulter les logs autour de",
|
||||||
"invalid_redirect": "Redirection invalide",
|
"invalid_redirect": "Redirection invalide",
|
||||||
"redirect_not_parseable": "URL de redirection non analysable",
|
"redirect_not_parseable": "URL de redirection non analysable",
|
||||||
"redirect_domain_not_allowed": "Domaine de redirection non autorisé",
|
"redirect_domain_not_allowed": "Domaine de redirection non autorisé",
|
||||||
"failed_to_sign_jwt": "échec de la signature du JWT",
|
"failed_to_sign_jwt": "échec de la signature JWT",
|
||||||
"invalid_invocation": "Invocation invalide de MakeChallenge",
|
"invalid_invocation": "Invocation invalide de MakeChallenge",
|
||||||
"client_error_browser": "Erreur client : Veuillez vous assurer que votre navigateur est à jour et réessayez plus tard.",
|
"client_error_browser": "Erreur client : Veuillez vous assurer que votre navigateur est à jour et réessayez plus tard.",
|
||||||
"oh_noes": "Oh non !",
|
"oh_noes": "Oh non !",
|
||||||
"benchmarking_anubis": "Je vérifie les performances d'Anubis !",
|
"benchmarking_anubis": "Test de performance d'Anubis !",
|
||||||
"you_are_not_a_bot": "Vous n'êtes pas un robot !",
|
"you_are_not_a_bot": "Vous n'êtes pas un robot !",
|
||||||
"making_sure_not_bot": "Je m'assure que vous n'êtes pas un robot !",
|
"making_sure_not_bot": "Vérification que vous n'êtes pas un robot !",
|
||||||
"celphase": "CELPHASE",
|
"celphase": "PHASE de CEL",
|
||||||
"js_web_crypto_error": "L'élément web.crypto de votre navigateur n'est pas fonctionnel. Consultez-vous bien cette page dans un contexte sécurisé ?",
|
"js_web_crypto_error": "Votre navigateur n'a pas d'élément web.crypto fonctionnel. Consultez-vous cette page dans un contexte sécurisé ?",
|
||||||
"js_web_workers_error": "Votre navigateur ne prend pas en charge les web workers (Anubis les utilise pour éviter de bloquer votre navigateur). Avez-vous installé un plugin comme JShelter ?",
|
"js_web_workers_error": "Votre navigateur ne prend pas en charge les web workers (Anubis les utilise pour éviter de bloquer votre navigateur). Avez-vous un plugin comme JShelter installé ?",
|
||||||
"js_cookies_error": "Votre navigateur ne stocke pas les cookies. Anubis a recours aux cookies pour déterminer quels clients ont réussi les défis en stockant un jeton signé dans un cookie. Veuillez activer le stockage des cookies pour ce domaine. Le nom des cookies stockés par Anubis peut varier à tout moment. Le nom et la valeur des cookies ne font pas partie de l'API publique.",
|
"js_cookies_error": "Votre navigateur ne stocke pas les cookies. Anubis utilise des cookies pour déterminer quels clients ont réussi les défis en stockant un jeton signé dans un cookie. Veuillez activer le stockage des cookies pour ce domaine. Les noms des cookies qu'Anubis stocke peuvent varier sans préavis. Les noms et valeurs des cookies ne font pas partie de l'API publique.",
|
||||||
"js_context_not_secure": "Votre contexte n'est pas sécurisé !",
|
"js_context_not_secure": "Votre contexte n'est pas sécurisé !",
|
||||||
"js_context_not_secure_msg": "Essayez de vous connecter via HTTPS ou demandez à l'administrateur·rice de configurer HTTPS. Pour plus d'informations, consultez <a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure\">MDN</a>.",
|
"js_context_not_secure_msg": "Essayez de vous connecter via HTTPS ou informez l'administrateur de configurer HTTPS. Pour plus d'informations, voir <a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure\">MDN</a>.",
|
||||||
"js_calculating": "Calcul en cours...",
|
"js_calculating": "Calcul en cours...",
|
||||||
"js_missing_feature": "Fonctionnalité manquante",
|
"js_missing_feature": "Fonctionnalité manquante",
|
||||||
"js_challenge_error": "Erreur de défi !",
|
"js_challenge_error": "Erreur de défi !",
|
||||||
"js_challenge_error_msg": "Échec de la résolution de l'algorithme de vérification. Vous pouvez essayer de recharger la page.",
|
"js_challenge_error_msg": "Échec de la résolution de l'algorithme de vérification. Vous pouvez essayer de recharger la page.",
|
||||||
"js_calculating_difficulty": "Calcul en cours...<br/>Difficulté :",
|
"js_calculating_difficulty": "Calcul en cours...<br/>Difficulté :",
|
||||||
"js_speed": "Vitesse :",
|
"js_speed": "Vitesse :",
|
||||||
"js_verification_longer": "La vérification prend plus de temps que prévu. Veuillez ne pas actualiser la page.",
|
"js_verification_longer": "La vérification prend plus de temps que prévu. Veuillez ne pas actualiser la page.",
|
||||||
"js_success": "Vérification réussie !",
|
"js_success": "Succès !",
|
||||||
"js_done_took": "Terminé ! Cela aura nécessité",
|
"js_done_took": "Terminé ! A pris",
|
||||||
"js_iterations": "itérations",
|
"js_iterations": "itérations",
|
||||||
"js_finished_reading": "J'ai fini de lire, continuer →",
|
"js_finished_reading": "J'ai fini de lire, continuer →",
|
||||||
"js_calculation_error": "Erreur de calcul !",
|
"js_calculation_error": "Erreur de calcul !",
|
||||||
"js_calculation_error_msg": "Échec du calcul du défi :",
|
"js_calculation_error_msg": "Échec du calcul du défi :",
|
||||||
"missing_required_forwarded_headers": "En-têtes X-Forwarded-* manquants",
|
"missing_required_forwarded_headers": "En-têtes X-Forwarded-* requis manquants",
|
||||||
"simplified_explanation": "Ceci est une mesure contre les robots et les requêtes malveillantes, similaire à un CAPTCHA. Cependant, au lieu d'avoir à faire le travail vous-même, votre navigateur se voit confier une tâche de calcul qu'il doit résoudre pour confirmer qu'il est un client valide. Ce concept est nommé <a href=\"https://en.wikipedia.org/wiki/Proof_of_work\">Preuve de travail</a>. La tâche s'effectue en quelques secondes, puis vous avez accès au site Web. Merci pour votre compréhension et votre patience."
|
"simplified_explanation": "Il s'agit d'une mesure contre les robots et les requêtes malveillantes similaire à un CAPTCHA. Cependant, au lieu d'avoir à faire le travail vous-même, votre navigateur se voit confier une tâche de calcul qu'il doit résoudre pour s'assurer qu'il est un client valide. Ce concept s'appelle <a href=\"https://en.wikipedia.org/wiki/Proof_of_work\">Preuve de travail</a>. La tâche est calculée en quelques secondes et vous avez accès au site Web. Merci de votre compréhension et de votre patience."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"anubis_compromise": "Anubisは妥協策です。AnubisはHashcashのようなProof-of-Work方式を採用しており、これは元々メールスパムを減らすために提案された仕組みです。個人レベルでは追加の負荷は無視できる程度ですが、大規模なスクレイピングでは負荷が積み重なり、スクレイピングのコストが大幅に増加します。",
|
"anubis_compromise": "Anubisは妥協策です。AnubisはHashcashのようなProof-of-Work方式を採用しており、これは元々メールスパムを減らすために提案された仕組みです。個人レベルでは追加の負荷は無視できる程度ですが、大規模なスクレイピングでは負荷が積み重なり、スクレイピングのコストが大幅に増加します。",
|
||||||
"hack_purpose": "最終的に、これはヘッドレスブラウザのフィンガープリントと識別に時間を費やすためのプレースホルダーソリューションです(例:フォントレンダリングの方法による)。これにより、正当なユーザーにはチャレンジのプルーフオブワークページを提示する必要がなくなります。",
|
"hack_purpose": "最終的に、これはヘッドレスブラウザのフィンガープリントと識別に時間を費やすためのプレースホルダーソリューションです(例:フォントレンダリングの方法による)。これにより、正当なユーザーにはチャレンジのプルーフオブワークページを提示する必要がなくなります。",
|
||||||
"jshelter_note": "Anubisは、JShelterのようなプラグインが無効化する最新のJavaScript機能を必要とします。このドメインではJShelterや同様のプラグインを無効にしてください。",
|
"jshelter_note": "Anubisは、JShelterのようなプラグインが無効化する最新のJavaScript機能を必要とします。このドメインではJShelterや同様のプラグインを無効にしてください。",
|
||||||
"version_info": "このウェブサイトはAnubisで動作しています バージョン",
|
"version_info": "このウェブサイトはAnubisバージョンで動作しています",
|
||||||
"try_again": "再試行",
|
"try_again": "再試行",
|
||||||
"go_home": "ホームに戻る",
|
"go_home": "ホームに戻る",
|
||||||
"contact_webmaster": "もしブロックされるべきでないと思われる場合は、ウェブマスターにご連絡ください:",
|
"contact_webmaster": "もしブロックされるべきでないと思われる場合は、ウェブマスターにご連絡ください:",
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
"vi",
|
"vi",
|
||||||
"zh-CN",
|
"zh-CN",
|
||||||
"zh-TW",
|
"zh-TW",
|
||||||
"sv",
|
"sv"
|
||||||
"bg"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
{
|
{
|
||||||
"loading": "Đang tải...",
|
"loading": "Đang nạp...",
|
||||||
"why_am_i_seeing": "Tại sao tôi thấy trang này?",
|
"why_am_i_seeing": "Tại sao tôi đang thấy trang này?",
|
||||||
"protected_by": "Bảo vệ bởi",
|
"protected_by": "Bảo vệ bởi",
|
||||||
"protected_from": "từ",
|
"protected_from": "từ",
|
||||||
"made_with": "Lập trình bằng ❤️ ở 🇨🇦",
|
"made_with": "Tạo ra bằng ❤️ tại 🇨🇦",
|
||||||
"mascot_design": "Mascot thiết kế bởi",
|
"mascot_design": "Thiết kế mascot bởi",
|
||||||
"ai_companies_explanation": "Bạn thấy trang này do quản trị viên của trang web này đã thiết lập Anubis để bảo vệ máy chủ của họ khỏi quấy rầy từ những công ty AI hung hãn cóp nhặt nội dung khắp Internet. Điều này dẫn tới tình trạng gián đoạn hoạt động trên nhiều trang web, khiến tài nguyên ở đó nằm ngoài tầm với của mọi người.",
|
"ai_companies_explanation": "Bạn đang thấy trang này do quản trị viên của trang web này đã thiết lập Anubis để bảo vệ máy chủ của họ khỏi quấy rầy từ những công ty AI hung hãn cóp nhặt nội dung khắp Internet. Điều này có thể và đã dẫn tới tình trạng gián đoạn hoạt động trên nhiều trang web, khiến tài nguyên tại đó nằm ngoài tầm với của mọi người.",
|
||||||
"anubis_compromise": "Anubis là giải pháp thỏa hiệp. Anubis sử dụng cơ chế Proof-of-Work dựa trên Hashcash, được thiết kế ban đầu để giảm bớt email spam. Ý tưởng đằng sau đó là với người dùng cá nhân phần nạp thêm sẽ không đáng kể, nhưng ở tầm mức quy mô lớn sẽ cộng dồn và dẫn tới chi phí tiêu hao hơn rất nhiều.",
|
"anubis_compromise": "Anubis là giải pháp thỏa hiệp. Anubis sử dụng cơ chế Proof-of-Work dựa trên Hashcash, được thiết kế ban đầu để giảm bớt email spam. Ý tưởng đằng sau đó là với người dùng cá nhân phần nạp thêm sẽ không đáng kể, nhưng ở tầm mức quy mô lớn sẽ cộng dồn và dẫn tới chi phí tiêu hao hơn rất nhiều.",
|
||||||
"hack_purpose": "Chốt lại, đây cũng chỉ là giải pháp \"tạm ổn\" với mục đích thực sự là để giành thêm thời gian nhận diện và truy vết những trình duyệt headless (VD: cách dựng font ra sao), sao cho hạn chế tối đa các yêu cầu tính toán trang thử thách Proof-of-Work tới nhóm người dùng có khả năng cao là con người hơn.",
|
"hack_purpose": "Chốt lại, đây cũng chỉ là giải pháp \"tạm ổn\" với mục đích thực sự là để giành thêm thời gian nhận diện và fingerprint những trình duyệt headless (VD: cách dựng font ra sao), sao cho hạn chế tối đa các yêu cầu tính toán trang thử thách Proof-of-Work tới nhóm người dùng có khả năng cao là con người hơn.",
|
||||||
"simplified_explanation": "Đây là một biện pháp chống lại bot và các yêu cầu độc hại tương tự như CAPTCHA. Tuy nhiên, thay vì bạn phải tự mình thực hiện, trình duyệt của bạn sẽ được giao một nhiệm vụ tính toán mà nó phải giải quyết để đảm bảo rằng nó là một máy khách hợp lệ. Khái niệm này được gọi là <a href=\"https://en.wikipedia.org/wiki/Proof_of_work\">Bằng chứng Công việc</a>. Nhiệm vụ được tính toán trong vài giây và bạn được cấp quyền truy cập vào trang web. Cảm ơn sự thông cảm và kiên nhẫn của bạn.",
|
"simplified_explanation": "Đây là một biện pháp chống lại bot và các yêu cầu độc hại tương tự như CAPTCHA. Tuy nhiên, thay vì bạn phải tự mình thực hiện, trình duyệt của bạn sẽ được giao một nhiệm vụ tính toán mà nó phải giải quyết để đảm bảo rằng nó là một máy khách hợp lệ. Khái niệm này được gọi là <a href=\"https://en.wikipedia.org/wiki/Proof_of_work\">Bằng chứng Công việc</a>. Nhiệm vụ được tính toán trong vài giây và bạn được cấp quyền truy cập vào trang web. Cảm ơn sự thông cảm và kiên nhẫn của bạn.",
|
||||||
"jshelter_note": "Vui lòng lưu ý Anubis cần sử dụng những tính năng JavaScript hiện đại mà một số phần mở rộng như JShelter sẽ tắt. Vui lòng vô hiệu hóa JShelter hoặc những phần mở rộng tương tự cho tên miền này.",
|
"jshelter_note": "Vui lòng lưu ý Anubis cần sử dụng những tính năng JavaScript hiện đại mà một số phần mở rộng như JShelter sẽ tắt. Vui lòng vô hiệu hóa JShelter hoặc những phần mở rộng tương tự cho tên miền này.",
|
||||||
"version_info": "Trang web này dùng Anubis bản",
|
"version_info": "Trang web này đang chạy Anubis phiên bản",
|
||||||
"try_again": "Thử lại",
|
"try_again": "Thử lại",
|
||||||
"go_home": "Về trang chủ",
|
"go_home": "Về trang chủ",
|
||||||
"contact_webmaster": "hoặc nếu bạn tin rằng mình không nên bị chặn, vui lòng liên hệ chủ trang web tại",
|
"contact_webmaster": "hoặc nếu bạn tin rằng mình không nên bị chặn, vui lòng liên hệ chủ trang web tại",
|
||||||
"connection_security": "Vui lòng chờ một chút trong lúc chúng tôi kiểm tra kết nối của bạn.",
|
"connection_security": "Vui lòng chờ một chút trong khi chúng tôi kiểm tra an ninh kết nối của bạn.",
|
||||||
"javascript_required": "Rất tiếc, bạn phải bật JavaScript để vượt qua thử thách này. Điều này bắt buộc do những công ty AI đã thay đổi luật ngầm quanh việc hoạt động máy chủ web ra sao. Giải pháp không có JavaScript đang được phát triển.",
|
"javascript_required": "Rất tiếc, bạn phải bật JavaScript để vượt qua thử thách này. Điều này bắt buộc do những công ty AI đã thay đổi luật ngầm quanh việc hoạt động máy chủ web ra sao. Giải pháp không có JavaScript đang được phát triển.",
|
||||||
"benchmark_requires_js": "Bắt buộc phải bật JavaScript để chạy công cụ benchmark.",
|
"benchmark_requires_js": "Bắt buộc phải bật JavaScript để chạy công cụ benchmark.",
|
||||||
"difficulty": "Độ khó:",
|
"difficulty": "Độ khó:",
|
||||||
@@ -28,14 +28,14 @@
|
|||||||
"iters_b": "Lặp lại kiểu B",
|
"iters_b": "Lặp lại kiểu B",
|
||||||
"static_check_endpoint": "Đây là điểm cuối cho reverse proxy của bạn sử dụng.",
|
"static_check_endpoint": "Đây là điểm cuối cho reverse proxy của bạn sử dụng.",
|
||||||
"authorization_required": "Bắt buộc xác thực",
|
"authorization_required": "Bắt buộc xác thực",
|
||||||
"cookies_disabled": "Trình duyệt của bạn đã vô hiệu hóa cookie. Anubis cần cookie cho mục đích chính đáng để kiểm tra chắc chắn bạn là người dùng hợp lệ. Vui lòng bật cookie cho tên miền này",
|
"cookies_disabled": "Trình duyệt của bạn được thiết lập để vô hiệu hóa cookie. Anubis cần cookie cho mục đích chính đáng để kiểm tra chắc chắn bạn là người dùng hợp lệ. Vui lòng bật cookie cho tên miền này",
|
||||||
"access_denied": "Truy cập bị từ chối: mã lỗi",
|
"access_denied": "Truy cập bị từ chối: mã lỗi",
|
||||||
"dronebl_entry": "DroneBL báo cáo truy cập",
|
"dronebl_entry": "DroneBL báo cáo truy cập",
|
||||||
"see_dronebl_lookup": "xem",
|
"see_dronebl_lookup": "xem",
|
||||||
"internal_server_error": "Lỗi nội bộ máy chủ: quản trị viên đã thiết lập sai Anubis. Vui lòng liên hệ quản trị viên và yêu cầu họ kiểm tra log",
|
"internal_server_error": "Lỗi máy chủ nội bộ: quản trị viên đã thiết lập sai Anubis. Vui lòng liên hệ quản trị viên và yêu cầu họ kiểm tra log",
|
||||||
"invalid_redirect": "Điều hướng không hợp lệ",
|
"invalid_redirect": "Điều hướng không hợp lệ",
|
||||||
"redirect_not_parseable": "Không thể xử lý liên kết điều hướng",
|
"redirect_not_parseable": "Liên kết điều hướng không thể xử lý",
|
||||||
"redirect_domain_not_allowed": "Không được phép điều hướng tên miền",
|
"redirect_domain_not_allowed": "Tên miền điều hướng không được phép",
|
||||||
"missing_required_forwarded_headers": "Thiếu các tiêu đề X-Forwarded-* bắt buộc",
|
"missing_required_forwarded_headers": "Thiếu các tiêu đề X-Forwarded-* bắt buộc",
|
||||||
"failed_to_sign_jwt": "không thể ký JWT",
|
"failed_to_sign_jwt": "không thể ký JWT",
|
||||||
"invalid_invocation": "Gọi hàm MakeChallenge không hợp lệ",
|
"invalid_invocation": "Gọi hàm MakeChallenge không hợp lệ",
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
"oh_noes": "Ôi không!",
|
"oh_noes": "Ôi không!",
|
||||||
"benchmarking_anubis": "Đang benchmark Anubis!",
|
"benchmarking_anubis": "Đang benchmark Anubis!",
|
||||||
"you_are_not_a_bot": "Bạn không phải là bot!",
|
"you_are_not_a_bot": "Bạn không phải là bot!",
|
||||||
"making_sure_not_bot": "Đảm bảo bạn không phải là bot!",
|
"making_sure_not_bot": "Đang kiểm tra bạn không phải là bot!",
|
||||||
"celphase": "CELPHASE",
|
"celphase": "CELPHASE",
|
||||||
"js_web_crypto_error": "Trình duyệt của bạn không có web.crypto hoạt động. Liệu bạn có đang xem trang này với kết nối bảo mật không?",
|
"js_web_crypto_error": "Trình duyệt của bạn không có web.crypto hoạt động. Liệu bạn có đang xem trang này với kết nối bảo mật không?",
|
||||||
"js_web_workers_error": "Trình duyệt của bạn không hỗ trợ tính năng web worker (Anubis sử dụng để trình duyệt của bạn bị đơ). Bạn có cài đặt và sử dụng phần mở rộng như JShelter hay không?",
|
"js_web_workers_error": "Trình duyệt của bạn không hỗ trợ tính năng web worker (Anubis sử dụng để trình duyệt của bạn bị đơ). Bạn có cài đặt và sử dụng phần mở rộng như JShelter hay không?",
|
||||||
@@ -53,12 +53,12 @@
|
|||||||
"js_calculating": "Đang tính toán...",
|
"js_calculating": "Đang tính toán...",
|
||||||
"js_missing_feature": "Thiếu tính năng",
|
"js_missing_feature": "Thiếu tính năng",
|
||||||
"js_challenge_error": "Lỗi thử thách!",
|
"js_challenge_error": "Lỗi thử thách!",
|
||||||
"js_challenge_error_msg": "Không thể xử lý thuật toán kiểm tra. Bạn nên tải lại trang này.",
|
"js_challenge_error_msg": "Không thể xử lý thuật toán kiểm tra. Bạn nên nạp lại trang này.",
|
||||||
"js_calculating_difficulty": "Đang tính toán...<br/>Độ khó:",
|
"js_calculating_difficulty": "Đang tính...<br/>Độ khó:",
|
||||||
"js_speed": "Tốc độ:",
|
"js_speed": "Tốc độ:",
|
||||||
"js_verification_longer": "Quá trình kiểm tra hơi lâu hơn dự kiến. Vui lòng không tải lại trang này.",
|
"js_verification_longer": "Quá trình kiểm tra đang kéo dài lâu hơn dự kiến. Vui lòng không nạp lại trang này.",
|
||||||
"js_success": "Thành công!",
|
"js_success": "Thành công!",
|
||||||
"js_done_took": "Xong rồi! Vào",
|
"js_done_took": "Hoàn tất! Mất",
|
||||||
"js_iterations": "lần lặp lại",
|
"js_iterations": "lần lặp lại",
|
||||||
"js_finished_reading": "Tôi đã đọc xong, tiếp tục →",
|
"js_finished_reading": "Tôi đã đọc xong, tiếp tục →",
|
||||||
"js_calculation_error": "Lỗi tính toán!",
|
"js_calculation_error": "Lỗi tính toán!",
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ func TestLocalizationService(t *testing.T) {
|
|||||||
service := NewLocalizationService()
|
service := NewLocalizationService()
|
||||||
|
|
||||||
loadingStrMap := map[string]string{
|
loadingStrMap := map[string]string{
|
||||||
"de": "Wird geladen …",
|
"de": "Ladevorgang...",
|
||||||
"en": "Loading...",
|
"en": "Loading...",
|
||||||
"es": "Cargando...",
|
"es": "Cargando...",
|
||||||
"et": "Laadin...",
|
"et": "Laadin...",
|
||||||
@@ -30,11 +30,10 @@ func TestLocalizationService(t *testing.T) {
|
|||||||
"tr": "Yükleniyor...",
|
"tr": "Yükleniyor...",
|
||||||
"ru": "Загрузка...",
|
"ru": "Загрузка...",
|
||||||
"uk": "Завантаження...",
|
"uk": "Завантаження...",
|
||||||
"vi": "Đang tải...",
|
"vi": "Đang nạp...",
|
||||||
"zh-CN": "加载中...",
|
"zh-CN": "加载中...",
|
||||||
"zh-TW": "載入中...",
|
"zh-TW": "載入中...",
|
||||||
"sv": "Laddar...",
|
"sv": "Laddar...",
|
||||||
"bg": "Зареждане...",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var keys []string
|
var keys []string
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ func TestBotEnvironment(t *testing.T) {
|
|||||||
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, _, err := prog.Eval(map[string]any{
|
result, _, err := prog.Eval(map[string]interface{}{
|
||||||
"headers": tt.headers,
|
"headers": tt.headers,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -168,7 +168,7 @@ func TestBotEnvironment(t *testing.T) {
|
|||||||
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, _, err := prog.Eval(map[string]any{
|
result, _, err := prog.Eval(map[string]interface{}{
|
||||||
"path": tt.path,
|
"path": tt.path,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -280,7 +280,7 @@ func TestBotEnvironment(t *testing.T) {
|
|||||||
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, _, err := prog.Eval(map[string]any{})
|
result, _, err := prog.Eval(map[string]interface{}{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
@@ -359,7 +359,7 @@ func TestBotEnvironment(t *testing.T) {
|
|||||||
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, _, err := prog.Eval(map[string]any{})
|
result, _, err := prog.Eval(map[string]interface{}{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
@@ -421,7 +421,7 @@ func TestBotEnvironment(t *testing.T) {
|
|||||||
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, _, err := prog.Eval(map[string]any{})
|
result, _, err := prog.Eval(map[string]interface{}{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
@@ -514,7 +514,7 @@ func TestBotEnvironment(t *testing.T) {
|
|||||||
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, _, err := prog.Eval(map[string]any{})
|
result, _, err := prog.Eval(map[string]interface{}{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to evaluate expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
@@ -572,7 +572,7 @@ func TestBotEnvironment(t *testing.T) {
|
|||||||
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
t.Fatalf("failed to compile expression %q: %v", tt.expression, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, _, err := prog.Eval(map[string]any{})
|
result, _, err := prog.Eval(map[string]interface{}{})
|
||||||
if tt.evalError {
|
if tt.evalError {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("%s: expected an evaluation error, but got none", tt.description)
|
t.Errorf("%s: expected an evaluation error, but got none", tt.description)
|
||||||
@@ -598,7 +598,7 @@ func TestThresholdEnvironment(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
variables map[string]any
|
variables map[string]interface{}
|
||||||
name string
|
name string
|
||||||
expression string
|
expression string
|
||||||
description string
|
description string
|
||||||
@@ -608,7 +608,7 @@ func TestThresholdEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "weight-variable-available",
|
name: "weight-variable-available",
|
||||||
expression: `weight > 100`,
|
expression: `weight > 100`,
|
||||||
variables: map[string]any{"weight": 150},
|
variables: map[string]interface{}{"weight": 150},
|
||||||
expected: types.Bool(true),
|
expected: types.Bool(true),
|
||||||
description: "should support weight variable in expressions",
|
description: "should support weight variable in expressions",
|
||||||
shouldCompile: true,
|
shouldCompile: true,
|
||||||
@@ -616,7 +616,7 @@ func TestThresholdEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "weight-variable-false-case",
|
name: "weight-variable-false-case",
|
||||||
expression: `weight > 100`,
|
expression: `weight > 100`,
|
||||||
variables: map[string]any{"weight": 50},
|
variables: map[string]interface{}{"weight": 50},
|
||||||
expected: types.Bool(false),
|
expected: types.Bool(false),
|
||||||
description: "should correctly evaluate weight comparisons",
|
description: "should correctly evaluate weight comparisons",
|
||||||
shouldCompile: true,
|
shouldCompile: true,
|
||||||
@@ -624,7 +624,7 @@ func TestThresholdEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "missingHeader-not-available",
|
name: "missingHeader-not-available",
|
||||||
expression: `missingHeader(headers, "Test")`,
|
expression: `missingHeader(headers, "Test")`,
|
||||||
variables: map[string]any{},
|
variables: map[string]interface{}{},
|
||||||
expected: types.Bool(false), // not used
|
expected: types.Bool(false), // not used
|
||||||
description: "should not have missingHeader function available",
|
description: "should not have missingHeader function available",
|
||||||
shouldCompile: false,
|
shouldCompile: false,
|
||||||
@@ -667,7 +667,7 @@ func TestNewEnvironment(t *testing.T) {
|
|||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
expression string
|
expression string
|
||||||
variables map[string]any
|
variables map[string]interface{}
|
||||||
expectBool *bool // nil if we just want to test compilation or non-bool result
|
expectBool *bool // nil if we just want to test compilation or non-bool result
|
||||||
description string
|
description string
|
||||||
shouldCompile bool
|
shouldCompile bool
|
||||||
@@ -675,7 +675,7 @@ func TestNewEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "randInt-function-compilation",
|
name: "randInt-function-compilation",
|
||||||
expression: `randInt(10)`,
|
expression: `randInt(10)`,
|
||||||
variables: map[string]any{},
|
variables: map[string]interface{}{},
|
||||||
expectBool: nil, // Don't check result, just compilation
|
expectBool: nil, // Don't check result, just compilation
|
||||||
description: "should compile randInt function",
|
description: "should compile randInt function",
|
||||||
shouldCompile: true,
|
shouldCompile: true,
|
||||||
@@ -683,7 +683,7 @@ func TestNewEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "randInt-range-validation",
|
name: "randInt-range-validation",
|
||||||
expression: `randInt(10) >= 0 && randInt(10) < 10`,
|
expression: `randInt(10) >= 0 && randInt(10) < 10`,
|
||||||
variables: map[string]any{},
|
variables: map[string]interface{}{},
|
||||||
expectBool: boolPtr(true),
|
expectBool: boolPtr(true),
|
||||||
description: "should return values in correct range",
|
description: "should return values in correct range",
|
||||||
shouldCompile: true,
|
shouldCompile: true,
|
||||||
@@ -691,7 +691,7 @@ func TestNewEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "strings-extension-size",
|
name: "strings-extension-size",
|
||||||
expression: `"hello".size() == 5`,
|
expression: `"hello".size() == 5`,
|
||||||
variables: map[string]any{},
|
variables: map[string]interface{}{},
|
||||||
expectBool: boolPtr(true),
|
expectBool: boolPtr(true),
|
||||||
description: "should support string extension functions",
|
description: "should support string extension functions",
|
||||||
shouldCompile: true,
|
shouldCompile: true,
|
||||||
@@ -699,7 +699,7 @@ func TestNewEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "strings-extension-contains",
|
name: "strings-extension-contains",
|
||||||
expression: `"hello world".contains("world")`,
|
expression: `"hello world".contains("world")`,
|
||||||
variables: map[string]any{},
|
variables: map[string]interface{}{},
|
||||||
expectBool: boolPtr(true),
|
expectBool: boolPtr(true),
|
||||||
description: "should support string contains function",
|
description: "should support string contains function",
|
||||||
shouldCompile: true,
|
shouldCompile: true,
|
||||||
@@ -707,7 +707,7 @@ func TestNewEnvironment(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "strings-extension-startsWith",
|
name: "strings-extension-startsWith",
|
||||||
expression: `"hello world".startsWith("hello")`,
|
expression: `"hello world".startsWith("hello")`,
|
||||||
variables: map[string]any{},
|
variables: map[string]interface{}{},
|
||||||
expectBool: boolPtr(true),
|
expectBool: boolPtr(true),
|
||||||
description: "should support string startsWith function",
|
description: "should support string startsWith function",
|
||||||
shouldCompile: true,
|
shouldCompile: true,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ func ParseConfig(ctx context.Context, fin io.Reader, fname string, defaultDiffic
|
|||||||
|
|
||||||
switch c.Logging.Sink {
|
switch c.Logging.Sink {
|
||||||
case config.LogSinkStdio:
|
case config.LogSinkStdio:
|
||||||
result.Logger = internal.InitSlog(logLevel, os.Stderr, c.Logging.HideSource)
|
result.Logger = internal.InitSlog(logLevel, os.Stderr)
|
||||||
case config.LogSinkFile:
|
case config.LogSinkFile:
|
||||||
out := &logrotate.Logger{
|
out := &logrotate.Logger{
|
||||||
Filename: c.Logging.Parameters.Filename,
|
Filename: c.Logging.Parameters.Filename,
|
||||||
@@ -87,7 +87,7 @@ func ParseConfig(ctx context.Context, fin io.Reader, fname string, defaultDiffic
|
|||||||
Compress: c.Logging.Parameters.Compress,
|
Compress: c.Logging.Parameters.Compress,
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Logger = internal.InitSlog(logLevel, out, c.Logging.HideSource)
|
result.Logger = internal.InitSlog(logLevel, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
lg := result.Logger.With("at", "config-validate")
|
lg := result.Logger.With("at", "config-validate")
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ func TestGoodConfigs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, st := range finfos {
|
for _, st := range finfos {
|
||||||
|
st := st
|
||||||
t.Run(st.Name(), func(t *testing.T) {
|
t.Run(st.Name(), func(t *testing.T) {
|
||||||
t.Run("with-thoth", func(t *testing.T) {
|
t.Run("with-thoth", func(t *testing.T) {
|
||||||
fin, err := os.Open(filepath.Join("..", "config", "testdata", "good", st.Name()))
|
fin, err := os.Open(filepath.Join("..", "config", "testdata", "good", st.Name()))
|
||||||
@@ -70,6 +71,7 @@ func TestBadConfigs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, st := range finfos {
|
for _, st := range finfos {
|
||||||
|
st := st
|
||||||
t.Run(st.Name(), func(t *testing.T) {
|
t.Run(st.Name(), func(t *testing.T) {
|
||||||
fin, err := os.Open(filepath.Join("..", "config", "testdata", "bad", st.Name()))
|
fin, err := os.Open(filepath.Join("..", "config", "testdata", "bad", st.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"maps"
|
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -37,7 +36,9 @@ func (m *mockS3) PutObject(ctx context.Context, in *s3.PutObjectInput, _ ...func
|
|||||||
m.data[aws.ToString(in.Key)] = bytes.Clone(b)
|
m.data[aws.ToString(in.Key)] = bytes.Clone(b)
|
||||||
if in.Metadata != nil {
|
if in.Metadata != nil {
|
||||||
m.meta[aws.ToString(in.Key)] = map[string]string{}
|
m.meta[aws.ToString(in.Key)] = map[string]string{}
|
||||||
maps.Copy(m.meta[aws.ToString(in.Key)], in.Metadata)
|
for k, v := range in.Metadata {
|
||||||
|
m.meta[aws.ToString(in.Key)][k] = v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m.bucket = aws.ToString(in.Bucket)
|
m.bucket = aws.ToString(in.Bucket)
|
||||||
return &s3.PutObjectOutput{}, nil
|
return &s3.PutObjectOutput{}, nil
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ func (s Sentinel) Valid() error {
|
|||||||
// redisClient is satisfied by *valkey.Client and *valkey.ClusterClient.
|
// redisClient is satisfied by *valkey.Client and *valkey.ClusterClient.
|
||||||
type redisClient interface {
|
type redisClient interface {
|
||||||
Get(ctx context.Context, key string) *valkey.StringCmd
|
Get(ctx context.Context, key string) *valkey.StringCmd
|
||||||
Set(ctx context.Context, key string, value any, expiration time.Duration) *valkey.StatusCmd
|
Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *valkey.StatusCmd
|
||||||
Del(ctx context.Context, keys ...string) *valkey.IntCmd
|
Del(ctx context.Context, keys ...string) *valkey.IntCmd
|
||||||
Ping(ctx context.Context) *valkey.StatusCmd
|
Ping(ctx context.Context) *valkey.StatusCmd
|
||||||
}
|
}
|
||||||
|
|||||||
12
lib/testdata/useragent.yaml
vendored
12
lib/testdata/useragent.yaml
vendored
@@ -1,12 +0,0 @@
|
|||||||
bots:
|
|
||||||
- name: deny
|
|
||||||
user_agent_regex: DENY
|
|
||||||
action: DENY
|
|
||||||
|
|
||||||
- name: challenge
|
|
||||||
user_agent_regex: CHALLENGE
|
|
||||||
action: CHALLENGE
|
|
||||||
|
|
||||||
- name: allow
|
|
||||||
user_agent_regex: ALLOW
|
|
||||||
action: ALLOW
|
|
||||||
@@ -11,8 +11,8 @@ func authUnaryClientInterceptor(token string) grpc.UnaryClientInterceptor {
|
|||||||
return func(
|
return func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
method string,
|
method string,
|
||||||
req any,
|
req interface{},
|
||||||
reply any,
|
reply interface{},
|
||||||
cc *grpc.ClientConn,
|
cc *grpc.ClientConn,
|
||||||
invoker grpc.UnaryInvoker,
|
invoker grpc.UnaryInvoker,
|
||||||
opts ...grpc.CallOption,
|
opts ...grpc.CallOption,
|
||||||
|
|||||||
592
package-lock.json
generated
592
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -20,11 +20,11 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^20.4.3",
|
"@commitlint/cli": "^20.4.1",
|
||||||
"@commitlint/config-conventional": "^20.4.3",
|
"@commitlint/config-conventional": "^20.4.1",
|
||||||
"baseline-browser-mapping": "^2.10.0",
|
"baseline-browser-mapping": "^2.9.19",
|
||||||
"cssnano": "^7.1.3",
|
"cssnano": "^7.1.2",
|
||||||
"cssnano-preset-advanced": "^7.0.11",
|
"cssnano-preset-advanced": "^7.0.10",
|
||||||
"esbuild": "^0.27.3",
|
"esbuild": "^0.27.3",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"playwright": "^1.52.0",
|
"playwright": "^1.52.0",
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-crypto/sha256-js": "^5.2.0",
|
"@aws-crypto/sha256-js": "^5.2.0",
|
||||||
"preact": "^10.28.4"
|
"preact": "^10.28.3"
|
||||||
},
|
},
|
||||||
"commitlint": {
|
"commitlint": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|||||||
Reference in New Issue
Block a user