Skip to content

Commit

Permalink
Fixes #4383: Diagnose file changes added
Browse files Browse the repository at this point in the history
  • Loading branch information
saravanan477 committed Feb 28, 2022
1 parent c11e778 commit 05137ee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
1 change: 0 additions & 1 deletion .htpasswd

This file was deleted.

6 changes: 6 additions & 0 deletions diagnose.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
* @license http://restya.com/ Restya Licence
* @link http://restya.com/
*/
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != 'restya' ||$_SERVER['PHP_AUTH_PW'] != 'restya123') { // https://www.php.net/manual/en/features.http-auth.php
header("WWW-Authenticate: Basic realm=\"Newsletter\"");
header("HTTP/1.0 401 Unauthorized");
echo '<html><body><h1>Rejected!</h1><big>Wrong Username or Password!</big></body></html>';
exit;
}
$nginx_class = true;
exec("which nginx", $nginx_version);
if (!empty($nginx_version[0])) {
Expand Down
10 changes: 0 additions & 10 deletions docker-scripts/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ server {
deny all;
}

location = /diagnose.php {
auth_basic "Restricted Area";
auth_basic_user_file /usr/share/nginx/html/.htpasswd;
try_files $uri =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
Expand Down
10 changes: 0 additions & 10 deletions restyaboard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ server {
deny all;
}

location = /diagnose.php {
auth_basic "Restricted Area";
auth_basic_user_file /usr/share/nginx/html/.htpasswd;
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
Expand Down

0 comments on commit 05137ee

Please sign in to comment.