about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorfox <fox@fakecake.org>2026-10-14 21:14:32 +0300
committerGitLab <noreply@fakecake.org>2026-10-14 21:14:32 +0300
commitc0135cc03916ad22707064e8957dce3f8e067a5d (patch)
tree362eb039da29142b6bad295a03c56dd66255b2af
parent680836cd0983d13eebd4209416e4747c5ba17b58 (diff)
parentaf1855a81a1dc3f0838110bf4c4e394a05a36373 (diff)
downloadthe-epube-c0135cc03916ad22707064e8957dce3f8e067a5d.tar.gz
the-epube-c0135cc03916ad22707064e8957dce3f8e067a5d.tar.xz
Merge branch 'dev' into 'master'
forbid nginx access to dotfiles

See merge request git/the-epube!76
-rw-r--r--.docker/web-nginx/nginx.conf9
-rw-r--r--.dockerignore1
2 files changed, 10 insertions, 0 deletions
diff --git a/.docker/web-nginx/nginx.conf b/.docker/web-nginx/nginx.conf
index 1115616..e688a42 100644
--- a/.docker/web-nginx/nginx.conf
+++ b/.docker/web-nginx/nginx.conf
@@ -24,6 +24,15 @@ http {
 		listen [::]:8080;
 		root ${APP_WEB_ROOT};
 
+		# Deny direct access to dotfiles/underscore-prefixed path segments: git metadata, .env,
+		# editor/build junk (.phpstan-tmp/, .phpunit.result.cache, __pycache__ etc.). The dev
+		# compose override bind-mounts the whole project directory into this container, so those
+		# files are otherwise servable (and .phpstan-tmp/*.php would even be passed to php-fpm);
+		# unanchored on purpose, ${APP_BASE} may be "" (site root) or "/tt-rss".
+		location ~ "/[._]" {
+			deny all;
+		}
+
 		location ${APP_BASE}/db {
 			internal;
 		}
diff --git a/.dockerignore b/.dockerignore
index fbbef82..d14b055 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -13,3 +13,4 @@ phpunit*xml
 /.phpunit*
 /.phpstan*
 /docker-compose*yml
+/.env*