diff --git a/example/gitea-disable/Fockerfile b/example/gitea-disable/Fockerfile new file mode 100644 index 0000000..6aa3108 --- /dev/null +++ b/example/gitea-disable/Fockerfile @@ -0,0 +1,11 @@ +base: gitea-custom + +steps: + - run: + - ASSUME_ALWAYS_YES=yes IGNORE_OSVERSION=yes pkg install nginx + - sysrc nginx_enable=YES + - copy: + - [ files/nginx.conf, + /usr/local/etc/nginx/nginx.conf ] + - [ files/403.html, + /usr/local/share/gitea/public/403.html ] diff --git a/example/gitea-disable/files/403.html b/example/gitea-disable/files/403.html new file mode 100644 index 0000000..64b7b14 --- /dev/null +++ b/example/gitea-disable/files/403.html @@ -0,0 +1,13 @@ + + + + + + +
+

403 Forbidden

+

Issues, Releases and Wiki are disabled for forked repositories. Please use the source repository for those.

+

Go Back

+
+ + diff --git a/example/gitea-disable/files/nginx.conf b/example/gitea-disable/files/nginx.conf new file mode 100644 index 0000000..0d6a92a --- /dev/null +++ b/example/gitea-disable/files/nginx.conf @@ -0,0 +1,27 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + + server { + listen 80; + + location / { + rewrite ^/admin1/ $uri break; + if ($uri ~ ^/([^/]*)/([^/]*)/(wiki|releases|issues)) { + return 403; + } + + root /usr/local/share/gitea/public; + + error_page 403 /403.html; + + proxy_pass http://localhost:3000/; + } + } +} diff --git a/example/gitea/focker-compose.yml b/example/gitea/focker-compose.yml index 0722952..0bbd671 100644 --- a/example/gitea/focker-compose.yml +++ b/example/gitea/focker-compose.yml @@ -2,6 +2,7 @@ images: gitea: . gitea-logo: ../gitea-logo gitea-custom: ../gitea-custom + gitea-disable: ../gitea-disable certbot-latest: ../certbot volumes: @@ -15,7 +16,7 @@ jails: domains: - xyz.com - www.xyz.com - image: gitea-custom + image: gitea-disable mounts: gitea-data: /var/db/gitea ip4.addr: 127.0.8.1