index template
This commit is contained in:
parent
be0ec1c8d7
commit
d54340e067
|
@ -0,0 +1,19 @@
|
||||||
|
<h1>Tor Relay/Bridge Monitor</h1>
|
||||||
|
<p>This is a simple service which sends emails when a Tor relay/bridge goes down. I built it after Tor's Weather service which also did this vanished mysteriously.</p>
|
||||||
|
<form action=subscribe method=post>
|
||||||
|
<label for=fp>Relay/bridge fingerprint to monitor:</label>
|
||||||
|
<input id=fp type=text name=fp>
|
||||||
|
<br />
|
||||||
|
<label for=email>Your email:</label>
|
||||||
|
<input id=email type=email name=email>
|
||||||
|
<br />
|
||||||
|
<!-- simple but effective anti-spam check -->
|
||||||
|
<label for=spam>What is the capital city of England?</label>
|
||||||
|
<input id=spam type=text name=spam>
|
||||||
|
<br />
|
||||||
|
<button action=submit>Submit</button>
|
||||||
|
</form>
|
||||||
|
<hr>
|
||||||
|
<p id="footer">
|
||||||
|
tormon version <% version %> by <a href="https://keybase.io/albino">albino</a> | for help, contact albino AT autistici DOT org
|
||||||
|
</p>
|
|
@ -8,6 +8,8 @@ use File::Slurp;
|
||||||
use Template::Simple;
|
use Template::Simple;
|
||||||
use FindBin qw($Bin);
|
use FindBin qw($Bin);
|
||||||
|
|
||||||
|
my $VERSION = "1.0";
|
||||||
|
|
||||||
my $tmpl = new Template::Simple (
|
my $tmpl = new Template::Simple (
|
||||||
pre_delim => "<%",
|
pre_delim => "<%",
|
||||||
post_delim => "%>",
|
post_delim => "%>",
|
||||||
|
@ -33,11 +35,13 @@ while ($request->Accept() <= 0) {
|
||||||
|
|
||||||
switch ($ENV{"REQUEST_URI"}) {
|
switch ($ENV{"REQUEST_URI"}) {
|
||||||
case "/debug" {
|
case "/debug" {
|
||||||
|
# TODO - remove this, it's a security vulnerability
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
$content = "<textarea>" . Dumper(\%ENV) . "</textarea>";
|
$content = "<textarea>" . Dumper(\%ENV) . "</textarea>";
|
||||||
}
|
}
|
||||||
case "/" {
|
case "/" {
|
||||||
$content = "Hello, world!";
|
my $tt = read_file("$Bin/index.tt");
|
||||||
|
$content = ${ $tmpl->render($tt, {version => $VERSION}) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,13 @@
|
||||||
<head>
|
<head>
|
||||||
<title>Tor Relay/Bridge Monitor</title>
|
<title>Tor Relay/Bridge Monitor</title>
|
||||||
<style>
|
<style>
|
||||||
body{margin:40px auto;max-width:650px;line-height:1.6;font-size:18px;color:#444;padding:0 10px;font-family: serif}h1,h2,h3{line-height:1.2}
|
body{margin:40px auto;max-width:650px;line-height:1.6;font-size:18px;color:#444;padding:0 10px;font-family: serif}
|
||||||
|
h1,h2,h3{line-height:1.2}
|
||||||
|
input{width: calc(30% - 20px);}
|
||||||
|
label{width: 70%;}
|
||||||
|
label, input{display: inline-block;}
|
||||||
|
form{margin-bottom: 30px}
|
||||||
|
#footer{margin-top: 0;color:#666;font-style:italic;font-size:12px;}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in New Issue