forked from public/stack
k/forgejo: add robots to ban facebook/meta
This commit is contained in:
parent
f243bb2d4b
commit
4bba28e670
|
@ -19,6 +19,13 @@ spec:
|
|||
name: forgejo
|
||||
port:
|
||||
number: 80
|
||||
- path: /robots.txt
|
||||
pathType: Exact
|
||||
backend:
|
||||
service:
|
||||
name: robots
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- git.distrust.co
|
||||
|
|
|
@ -5,6 +5,7 @@ resources:
|
|||
- namespace.yaml
|
||||
- resources.yaml
|
||||
- ingress.yaml
|
||||
- robots.yaml
|
||||
- snapshots
|
||||
patches:
|
||||
- path: forgejo-env-vars.patch.yaml
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: robots
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: robots
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: robots
|
||||
spec:
|
||||
containers:
|
||||
- name: robots
|
||||
image: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
volumeMounts:
|
||||
- name: robots-txt
|
||||
mountPath: /usr/share/nginx/html
|
||||
volumes:
|
||||
- name: robots-txt
|
||||
configMap:
|
||||
name: robots-txt
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: robots-txt
|
||||
data:
|
||||
# Facebook/Meta have a web crawler that absolutely _spams_ Forgejo when
|
||||
# large repositories exist. It's nonstop requests.
|
||||
robots.txt: |-
|
||||
User-agent: facebookexternalhit
|
||||
User-agent: meta-externalagent
|
||||
Disallow: /
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: robots
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: robots
|
Loading…
Reference in New Issue