Commit | Line | Data |
---|---|---|
2342da66 MW |
1 | #! /usr/bin/cgi-fcgi-interp /usr/bin/perl |
2 | ### -*-perl-*- | |
128543b0 | 3 | ### |
7b798293 | 4 | ### IP-address reporting webservice for Odin |
128543b0 MW |
5 | ### |
6 | ### (c) 2017 Mark Wooding | |
7 | ### | |
8 | ||
9 | ###----- Licensing notice --------------------------------------------------- | |
10 | ### | |
11 | ### This file is part of the `odin.gg' service, `odin-cgi'. | |
12 | ### | |
13 | ### `odin-cgi' is free software; you can redistribute it and/or modify | |
14 | ### it under the terms of the GNU Affero General Public License as | |
15 | ### published by the Free Software Foundation; either version 3 of the | |
16 | ### License, or (at your option) any later version. | |
17 | ### | |
18 | ### `odin-cgi' is distributed in the hope that it will be useful, | |
19 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | ### GNU Affero General Public License for more details. | |
22 | ### | |
23 | ### You should have received a copy of the GNU Affero General Public | |
24 | ### License along with `odin-cgi'; if not, see | |
25 | ### <http://www.gnu.org/licenses/>. | |
26 | ||
27 | use lib 'lib'; | |
28 | use Odin; | |
2342da66 | 29 | use CGI::Fast; |
128543b0 | 30 | |
2342da66 MW |
31 | while (my $cgi = CGI::Fast->new) { |
32 | my $addr = $cgi->remote_addr; | |
33 | print <<EOF; | |
f6bbb033 | 34 | Content-type: text/plain; charset=us-ascii |
128543b0 | 35 | X-AGPL-Source: $Odin::SRCURL |
f6bbb033 | 36 | |
2342da66 | 37 | $addr |
f6bbb033 | 38 | EOF |
2342da66 | 39 | } |