diff --git a/forgejo.subdomain.conf.sample b/forgejo.subdomain.conf.sample index e4012110..30da3002 100644 --- a/forgejo.subdomain.conf.sample +++ b/forgejo.subdomain.conf.sample @@ -1,4 +1,4 @@ -## Version 2025/07/18 +## Version 2026/09/01 # make sure that your forgejo container is named forgejo # make sure that your dns has a cname set for forgejo # edit the following parameters in /data/forgejo/conf/app.ini or set as ENV vars in your container @@ -57,6 +57,11 @@ server { } + # Restrict access to the internal API + location ^~ /api/internal { + deny all; + } + location ~ (/forgejo)?/info/lfs { include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; diff --git a/forgejo.subfolder.conf.sample b/forgejo.subfolder.conf.sample index d23b3377..47ecc546 100644 --- a/forgejo.subfolder.conf.sample +++ b/forgejo.subfolder.conf.sample @@ -1,4 +1,4 @@ -## Version 2024/04/20 +## Version 2026/09/01 # make sure that your forgejo container is named forgejo # make sure that forgejo is set to work with the base url /forgejo/ # The following parameters in /data/forgejo/conf/app.ini should be edited to match your setup @@ -12,6 +12,11 @@ location /forgejo { return 301 $scheme://$host/forgejo/; } +# Restrict access to the internal API +location ^~ /forgejo/api/internal { + deny all; +} + location ^~ /forgejo/ { include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; diff --git a/gitea.subdomain.conf.sample b/gitea.subdomain.conf.sample index af64dcb2..373f15a6 100644 --- a/gitea.subdomain.conf.sample +++ b/gitea.subdomain.conf.sample @@ -1,4 +1,4 @@ -## Version 2026/07/03 +## Version 2026/09/01 # make sure that your gitea container is named gitea # make sure that your dns has a cname set for gitea # edit the following parameters in /data/gitea/conf/app.ini @@ -69,6 +69,11 @@ server { } + # Restrict access to the internal API + location ^~ /api/internal { + deny all; + } + location ~ (/gitea)?/(api|info/lfs) { include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; diff --git a/gitea.subfolder.conf.sample b/gitea.subfolder.conf.sample index 14f84a7f..7b764ff1 100644 --- a/gitea.subfolder.conf.sample +++ b/gitea.subfolder.conf.sample @@ -1,4 +1,4 @@ -## Version 2023/02/05 +## Version 2026/09/01 # make sure that your gitea container is named gitea # make sure that gitea is set to work with the base url /gitea/ # The following parameters in /data/gitea/conf/app.ini should be edited to match your setup @@ -11,6 +11,11 @@ location /gitea { return 301 $scheme://$host/gitea/; } +# Restrict access to the internal API +location ^~ /gitea/api/internal { + deny all; +} + location ^~ /gitea/ { include /config/nginx/proxy.conf; include /config/nginx/resolver.conf;