IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Browse Source

Disabled Issues, Releases and Wiki for non-admin.

master
parent
commit
4837a1bdf5
4 changed files with 53 additions and 1 deletions
  1. +11
    -0
      example/gitea-disable/Fockerfile
  2. +13
    -0
      example/gitea-disable/files/403.html
  3. +27
    -0
      example/gitea-disable/files/nginx.conf
  4. +2
    -1
      example/gitea/focker-compose.yml

+ 11
- 0
example/gitea-disable/Fockerfile View File

@@ -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 ]

+ 13
- 0
example/gitea-disable/files/403.html View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/index.css" />
</head>
<body>
<div style="border-radius: .28571429rem; border-width: 1px; border-style: solid; border-color: rgba(34, 36, 38, 0.15); padding: 1em;">
<h1>403 Forbidden</h1>
<p>Issues, Releases and Wiki are disabled for forked repositories. Please use the source repository for those.</p>
<p><a href="javascript:history.back()">Go Back</a></p>
</div>
</body>
</html>

+ 27
- 0
example/gitea-disable/files/nginx.conf View File

@@ -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/;
}
}
}

+ 2
- 1
example/gitea/focker-compose.yml View File

@@ -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


Loading…
Cancel
Save