From ba4133170a898427ef91557690426160d88c7c32 Mon Sep 17 00:00:00 2001 From: Al Beano Date: Thu, 15 Sep 2016 21:34:59 +0100 Subject: [PATCH] send alerts --- README.md | 5 +-- db.sql | 9 +++- tormon.yml | 1 + tormon/index.tt | 2 + tormon/notify.pl | 107 +++++++++++++++++++++++++++++++++++++++++++++ tormon/tormon.fcgi | 6 +-- tormon/wrapper.tt | 2 +- 7 files changed, 123 insertions(+), 9 deletions(-) create mode 100755 tormon/notify.pl diff --git a/README.md b/README.md index 77ed094..8f46395 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ chown www:www /var/www/run install -o www -g www -m 0400 httpd.conf /etc/ echo "permit nopass root as www" >> /etc/doas.conf curl -L https://cpanmin.us | perl - App::cpanminus -cpanm -l /var/www/perl5 FCGI Switch Template::Simple File::Slurp Email::Valid DBD::SQLite Math::Random::Secure Email::Sender::Simple Email::Simple Email::Simple::Creator Email::Sender::Transport::SMTPS YAML::Tiny +cpanm -l /var/www/perl5 FCGI Switch Template::Simple File::Slurp Email::Valid DBD::SQLite Math::Random::Secure Email::Sender::Simple Email::Simple Email::Simple::Creator Email::Sender::Transport::SMTPS YAML::Tiny LWP::UserAgent JSON::Tiny LWP::Protocol::https install -o www -g www -m 0500 tormon/* /var/www/tormon/ cat db.sql | sqlite3 /var/www/tormon.db chown www:www /var/www/tormon.db @@ -18,7 +18,4 @@ echo 'echo "Starting tormon" && doas -u www /var/www/tormon/tormon.fcgi &' >> /e sh /etc/rc.local # assuming tormon is the only thing in rc.local rcctl enable httpd rcctl start httpd - -# updating -install -o www -g www -m 0500 tormon/* /var/www/tormon/ ``` diff --git a/db.sql b/db.sql index b1680fe..fb396c7 100644 --- a/db.sql +++ b/db.sql @@ -3,5 +3,12 @@ create table users ( email text not null, confirmed integer not null, fp text not null, - secret text + secret text, + /* + status + 0 - everything is fine + 1 - the relay was down + 2 - the relay has gone! + */ + status integer not null ); diff --git a/tormon.yml b/tormon.yml index 7a6a624..5121a20 100644 --- a/tormon.yml +++ b/tormon.yml @@ -5,3 +5,4 @@ mail: port: 587 user: SMTP_Injection password: yourapikey + from: "tormon@tor.uptime.party" diff --git a/tormon/index.tt b/tormon/index.tt index 141b0a4..5f1e0c3 100644 --- a/tormon/index.tt +++ b/tormon/index.tt @@ -12,6 +12,8 @@
+
+ For bridges, you should use the hashed fingerprint.