51 lines
929 B
YAML
51 lines
929 B
YAML
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
|