mirror of
https://code.forgejo.org/infrastructure/documentation
synced 2024-11-25 04:01:12 +00:00
next.forgejo.org: block depending on user agent
This commit is contained in:
parent
f5861bf000
commit
92f39f169d
|
@ -20,4 +20,4 @@
|
||||||
|
|
||||||
## Pod
|
## Pod
|
||||||
|
|
||||||
- `../k3s-host/subst.sh forgejo-values.yml | helm upgrade forgejo-$name -f - -f $name-values.yml -f $name-secrets.yml oci://code.forgejo.org/forgejo-helm/forgejo --atomic --wait --install`
|
- `../k3s-host/subst.sh forgejo-values.yml | helm upgrade forgejo-$name -f - -f $name-values.yml -f crawler-block-values.yml -f $name-secrets.yml oci://code.forgejo.org/forgejo-helm/forgejo --atomic --wait --install`
|
||||||
|
|
32
k8s-forgejo/crawler-block-values.yml
Normal file
32
k8s-forgejo/crawler-block-values.yml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
extraDeploy:
|
||||||
|
- apiVersion: traefik.io/v1alpha1
|
||||||
|
# https://doc.traefik.io/traefik/v3.1/routing/providers/kubernetes-crd/#kind-ingressroute
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: forgejo-crawler
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: traefik
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- web
|
||||||
|
- websecure
|
||||||
|
routes:
|
||||||
|
# https://doc.traefik.io/traefik/v3.1/routing/routers/#rule
|
||||||
|
- match: Host(`next.forgejo.org`) && HeaderRegexp(`user-agent`, `DataForSeoBot`)
|
||||||
|
kind: Rule
|
||||||
|
priority: 1000
|
||||||
|
services:
|
||||||
|
- name: noop@internal
|
||||||
|
kind: TraefikService
|
||||||
|
middlewares:
|
||||||
|
- name: forgejo-crawler-blocker
|
||||||
|
tls:
|
||||||
|
secretName: tls-forgejo-next-ingress-http
|
||||||
|
- apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: forgejo-crawler-blocker
|
||||||
|
spec:
|
||||||
|
ipAllowList:
|
||||||
|
sourceRange:
|
||||||
|
- 127.0.0.1/32
|
Loading…
Reference in a new issue