Skip to content

Commit bdc8c75

Browse files
author
Marius Burkard
committed
Merge branch 'csp-index-stats' into 'stable-3.1'
Set DirectoryIndex and unset CSP for /stats See merge request ispconfig/ispconfig3!1071
2 parents 36e7be7 + 61eac82 commit bdc8c75

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

server/conf/nginx_vhost.conf.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ server {
168168
index index.html index.php;
169169
auth_basic "Members Only";
170170
auth_basic_user_file <tmpl_var name='stats_auth_passwd_file'>;
171+
add_header Content-Security-Policy "default-src * 'self' 'unsafe-inline';";
171172
}
172173

173174
location ^~ /awstats-icon {

server/plugins-available/apache2_plugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ function update($event_name, $data) {
18651865

18661866
if($data['new']['stats_type'] != '') {
18671867
if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats');
1868-
$ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user";
1868+
$ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user\nDirectoryIndex index.html index.php\nHeader unset Content-Security-Policy";
18691869
$app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', $ht_file);
18701870
$app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0755);
18711871
unset($ht_file);

0 commit comments

Comments
 (0)