gitea: prevent bots from downloading archives
This commit is contained in:
parent
0893017a01
commit
3c901c5e2e
@ -50,6 +50,9 @@
|
|||||||
template: src=certs.j2 dest=/etc/acertmgr/{{ gitea_domain }}.conf
|
template: src=certs.j2 dest=/etc/acertmgr/{{ gitea_domain }}.conf
|
||||||
notify: Run acertmgr
|
notify: Run acertmgr
|
||||||
|
|
||||||
|
- name: Configure robots.txt for gitea
|
||||||
|
template: src=robots.txt.j2 dest=/opt/gitea/custom/robots.txt owner={{ gitea_user }}
|
||||||
|
|
||||||
- name: Configure vhost
|
- name: Configure vhost
|
||||||
template: src=vhost.j2 dest=/etc/nginx/sites-available/gitea
|
template: src=vhost.j2 dest=/etc/nginx/sites-available/gitea
|
||||||
notify: Restart nginx
|
notify: Restart nginx
|
||||||
|
4
roles/gitea/templates/robots.txt.j2
Normal file
4
roles/gitea/templates/robots.txt.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow: /*/*/archive/*.bundle$
|
||||||
|
Disallow: /*/*/archive/*.tar.gz$
|
||||||
|
Disallow: /*/*/archive/*.zip$
|
@ -23,6 +23,10 @@ server {
|
|||||||
ssl_certificate_key /etc/nginx/ssl/{{ gitea_domain }}.key;
|
ssl_certificate_key /etc/nginx/ssl/{{ gitea_domain }}.key;
|
||||||
ssl_certificate /etc/nginx/ssl/{{ gitea_domain }}.crt;
|
ssl_certificate /etc/nginx/ssl/{{ gitea_domain }}.crt;
|
||||||
|
|
||||||
|
location /robots.txt {
|
||||||
|
alias /opt/gitea/custom/robots.txt;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
client_max_body_size 1024M;
|
client_max_body_size 1024M;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user