From 54475c9e7c8c88ca421299ba8e176a709233b1ee Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Jan 2025 20:51:45 +0100 Subject: [PATCH] added static-only mode --- nginx.conf | 20 ++++++++---- www/static.php | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 www/static.php diff --git a/nginx.conf b/nginx.conf index 96e69fb..0273198 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,11 +3,19 @@ server { listen [::]:4443; server_name uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion; - root /srv/darknet-onion-webring/www/; - location ~ \.php$ { - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; - } - index index.php; + root /srv/darknet-onion-webring/www/; + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; + } + + index index.php; + + # optional read-only static php file without the searchbar, to display all links by default : + # + #location /index.php { + # return 404; + #} + # index static.php; } diff --git a/www/static.php b/www/static.php new file mode 100644 index 0000000..3ea91e5 --- /dev/null +++ b/www/static.php @@ -0,0 +1,82 @@ + + + + + + Darknet Lantern + + + + +
+ + + +CSV LINES: " . $lines_uv . " " . $lines_v . "

"; + +?> + + + += $min_length and strlen($query) <= $max_length){ // if query length is more or equal minimum length then + + $query = htmlspecialchars($query); + // removes the risky characters + // there needs to be regex checking, only allow [a-zA-Z0-9.:/] + $query=preg_replace("/[^a-zA-Z0-9:\/.\ ]/", "", $query); + + + //echo "

Search results for " . $query . " :

"; + echo nl2br("\n"); + echo nl2br("\n"); + //echo $verifiedcsvpath; + //echo nl2br("\n"); + //echo $unverifiedcsvpath; + if ($lines_v >= 2){ + echo '

Verified Links


'; + echo nl2br("\n"); + DisplayCSVNEW($verifiedcsvpath,$query,$sensitive); + }else{ + echo "

Your verified.csv file is empty, check the documentation to know how to add links into it.

"; + } + if ($lines_uv >= 2){ + echo '


Unverified Links


'; + echo nl2br("\n"); + DisplayCSVNEW($unverifiedcsvpath,$query,$sensitive); + }else{ + echo "

Your unverified.csv file is empty, please check the documentation to know how to add links into it.

"; + } + // display the results of verified.csv + // only display the results of verified.csv that matches with the search term + // display the results of unverified.csv + // only display the results of unverified.csv that matches with the search term + + } + else{ // if query length is less than minimum or more than maximum + echo '

Search query must be between '.$min_length . " and ".$max_length . " characters.

"; + // TODO list the available categories + } +?> + + +