temmie/userweb: render path denylist into Directory/Files directives

This commit is contained in:
h7x4
2026-06-16 18:52:25 +09:00
parent 8252bba3ad
commit b738f08c09
+42 -27
View File
@@ -103,38 +103,53 @@ in
Require all granted Require all granted
</Directory> </Directory>
<DirectoryMatch "^/home/pvv/.*/web-docs/(${lib.concatStringsSep "|" [ ${lib.concatMapStringsSep "\n" (d: ''
"\\.git" <Directory "${d}">
"\\.hg" Require all denied
"\\.svn" </Directory>
"\\.ssh" '') [
"\\.env" ".git"
"\\.env\\..*" ".hg"
"\\.envs" ".svn"
"\\.envs\\..*" ".ssh"
"\\.envrc" ".bzr"
"\\.bzr" ".venv"
"\\.venv"
"CVS" "CVS"
"RCS" "RCS"
".*\\.swp" "*.bak"
".*~" "*.bak*"
"*.bkp"
"*.bkp*"
"*.backup"
"*.backup*"
]}
".*\\.bak" ${lib.concatMapStringsSep "\n" (d: ''
".*\\.bak.*" <Files "${d}">
".*\\.bkp"
".*\\.bkp.*"
".*\\.backup"
".*\\.backup.*"
".*\\.lck"
".*\\.lock"
"LCK\\.\\..*"
]})(/|$)">
AllowOverride All
Require all denied Require all denied
</DirectoryMatch> </Files>
'') [
".env"
".env.*"
".envs"
".envs.*"
".envrc"
"*.swp"
"*~"
"*.bak"
"*.bak*"
"*.bkp"
"*.bkp*"
"*.backup"
"*.backup*"
"*.lck"
"*.lock"
"LCK..*"
]}
<FilesMatch ".+\.ph(p[3457]?|t|tml)$"> <FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler application/x-httpd-php SetHandler application/x-httpd-php