route banners through proxy when using tor

This commit is contained in:
Jonas Leder 2021-01-02 00:45:10 +01:00
parent 36f670efed
commit e4b58975b4
3 changed files with 37 additions and 4 deletions

View file

@ -3,6 +3,14 @@ include "internal/header.php";
include "internal/footer.php"; include "internal/footer.php";
include "internal/mysql.php"; include "internal/mysql.php";
if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
$heIMG = "/internal/getImage.php?imgID=1";
$abuseIPIMG = "/internal/getImage.php?imgID=2";
} else {
$abuseIPIMG = "https://www.abuseipdb.com/contributor/45130.svg";
$heIMG = "https://ipv6.he.net/certification/create_badge.php?pass_name=jonasled&badge=3";
}
getHeader("Jonas Leder", "home"); getHeader("Jonas Leder", "home");
?> ?>
<div class="center"> <div class="center">
@ -45,8 +53,8 @@ getHeader("Jonas Leder", "home");
</div> </div>
<div id="banner"> <div id="banner">
<h2>Banner</h2> <h2>Banner</h2>
<a target="_blank" href="https://ipv6.he.net"><img src="https://ipv6.he.net/certification/create_badge.php?pass_name=jonasled&badge=3"></a> <a target="_blank" href="https://ipv6.he.net"><img src="<?php echo($heIMG); ?>"></a>
<a target="_blank" href="https://www.abuseipdb.com/user/45130"><img style="background-color: white" src="https://www.abuseipdb.com/contributor/45130.svg" style="width: 401px;"></a> <a target="_blank" href="https://www.abuseipdb.com/user/45130"><img style="background-color: white" src="<?php echo($abuseIPIMG); ?>" style="width: 401px;"></a>
</div> </div>
</div> </div>
<?php <?php

View file

@ -0,0 +1,24 @@
<?php
$url = "";
if( isset( $_GET['imgID'] ) )
{
if($_GET['imgID'] == "1") {
$url = "https://ipv6.he.net/certification/create_badge.php?pass_name=jonasled&badge=3";
} else if($_GET['imgID'] == "2"){
$url = "https://www.abuseipdb.com/contributor/45130.svg";
} else {
die("wrong image id");
}
}
else
{
die("no image ID set");
}
$imginfo = getimagesize( $url );
header("Content-type: ".$imginfo['mime']);
readfile( $url );
?>

View file

@ -1,9 +1,10 @@
<?php <?php
include "config.php";
include "menue.php";
function getHeader($pagetitle, $navselect) function getHeader($pagetitle, $navselect)
{ {
include "config.php";
include "menue.php";
$menu = getMenu($navselect); $menu = getMenu($navselect);
if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) { if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
$trackURL = $trackURLTor; $trackURL = $trackURLTor;