mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2025-12-23 21:47:44 -05:00
Apache protect more non-public folders and files (#6881)
* Apache protect more non-public folders * Also protect root * Do the same for /p/ * Simplify Require all denied In case of Apache 2.2, it will just make an error 500 instead of 403 * .htaccess.dist * Simplify * Better comment
This commit is contained in:
committed by
GitHub
parent
b30a8fa652
commit
91624037c7
1
.devcontainer/.htaccess
Normal file
1
.devcontainer/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
Require all denied
|
||||
1
.github/.htaccess
vendored
Normal file
1
.github/.htaccess
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Require all denied
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,10 +1,11 @@
|
||||
/.htaccess
|
||||
/bin/
|
||||
/constants.local.php
|
||||
/data.back/
|
||||
/extensions/node_modules/
|
||||
/extensions/vendor/
|
||||
/node_modules/
|
||||
/vendor/
|
||||
/data.back/
|
||||
/constants.local.php
|
||||
|
||||
.vscode/
|
||||
|
||||
|
||||
7
.htaccess.dist
Normal file
7
.htaccess.dist
Normal file
@@ -0,0 +1,7 @@
|
||||
# Copy this file to `.htaccess` for additional root-level protection
|
||||
# if you cannot set Apache `DocumentRoot` to `./p/` as recommended.
|
||||
|
||||
# Deny files starting with a dot, or without extension, or not in a whitelist of extensions
|
||||
<FilesMatch "^\.|^[^.]+$|\.(?!css|gif|html|ico|js|php|png|svg|txt|woff|woff2)[^.]*$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
1
Docker/.htaccess
Normal file
1
Docker/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
Require all denied
|
||||
@@ -1,11 +1 @@
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
Satisfy all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
Require all denied
|
||||
|
||||
@@ -1,11 +1 @@
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
Satisfy all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
Require all denied
|
||||
|
||||
@@ -25,17 +25,7 @@ foreach ($dirs as $dir) {
|
||||
}
|
||||
|
||||
file_put_contents(DATA_PATH . '/.htaccess', <<<'EOF'
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
Satisfy all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
Require all denied
|
||||
|
||||
EOF
|
||||
);
|
||||
|
||||
@@ -1,11 +1 @@
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
Satisfy all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
Require all denied
|
||||
|
||||
1
docs/.htaccess
Normal file
1
docs/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
Require all denied
|
||||
1
extensions/.htaccess
Normal file
1
extensions/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
Require all denied
|
||||
13
extensions/index.html
Normal file
13
extensions/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Refresh" content="0; url=/" />
|
||||
<title>Redirection</title>
|
||||
<meta name="robots" content="noindex" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><a href="/">Redirection</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,11 +1 @@
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
Satisfy all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
Require all denied
|
||||
|
||||
13
lib/index.html
Normal file
13
lib/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Refresh" content="0; url=/" />
|
||||
<title>Redirection</title>
|
||||
<meta name="robots" content="noindex" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><a href="/">Redirection</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +1,10 @@
|
||||
<IfModule mod_authz_core.c>
|
||||
# Deny files starting with a dot, or without extension, or not in a whitelist of extensions
|
||||
<FilesMatch "^\.|^[^.]+$|\.(?!css|gif|html|ico|js|php|png|svg|txt|woff|woff2)[^.]*$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_dir.c>
|
||||
DirectoryIndex index.php index.html
|
||||
</IfModule>
|
||||
|
||||
1
tests/.htaccess
Normal file
1
tests/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
Require all denied
|
||||
13
tests/index.html
Normal file
13
tests/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Refresh" content="0; url=/" />
|
||||
<title>Redirection</title>
|
||||
<meta name="robots" content="noindex" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><a href="/">Redirection</a></p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user