&My::Web::footer call is deprecated now, use just: exit;
[www.jankratochvil.net.git] / project / ssht / Index.pm
1 # $Id$
2 # Main page of 'My::Project::ssht'
3 # Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 package project::ssht::Index;
20 require 5.6.0;  # at least 'use warnings;' but we need some 5.6.0+ modules anyway
21 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
22 our $CVS_ID=q$Id$;
23 use strict;
24 use warnings;
25
26 use My::Web;
27 Wuse 'project::Lib';
28
29
30 our @ListItem=(
31                 "name"=>"ssht",
32                 "platform"=>"unixuser",
33                 "priority"=>90,
34                 "cvs"=>"ssht",
35                 "summary"=>sub {
36                                 return 'Unattended intranet host accessibility by '.a_href('http://www.openssh.org/','SSH').' tunnel';
37                                 },
38                 "license"=>"PD",
39                 "maintenance"=>"ready",
40                 "sponsorship"=>sub { return a_href('http://www.jklabs.cz/','JKLabs'); },
41                 "language"=>"bash",
42                 "description"=>sub { return <<"HERE"; },
43 <p>Do you need to admin remote host placed in the intranet behind firewall out of your control?
44 If the firewall performat NAT (masquerade) where you can connect from
45 the intranet to the outer world by @{[ a_href 'http://www.openssh.org/','SSH' ]}
46 you can use these security safe scripts.</p>
47 <p>If you are able to set up port forwarding on the firewall you do not need any such scripts.
48 In the case of HTTP-only proxy you cannot use these scripts - look elsewhere.</p>
49 HERE
50                 );
51
52 sub handler
53 {
54 project::Lib->init();
55
56
57 my $cvsfile=sub ($) {
58 my($file)=@_;
59
60         return a_href $W->{"project_viewcvs"}.'/*checkout*/ssht/hostintranet/etc-inittab?rev=HEAD',
61                         escapeHTML($file);
62 };
63
64 print <<"HERE";
65
66 <ul>
67         <li>
68                 <p>Replace all strings <b>hostintranet</b> by the name of your firewalled
69                 intranet machine (without any dots - it must be valid string token).</p>
70         </li>
71         <li>
72                 <p>Replace all strings <b>public.internet.com</b> by the hostname of your
73                 server in public Internet. Replace <b>1.2.3.4-IP-of-public.internet.com</b>
74                 with IP address of this host</p>
75         </li>
76         <li>
77                 <p>Generate new keypair by '<b>ssh-keygen -t dsa</b>'.</p>
78                 <p>Place its public key part to
79                 @{[ &{$cvsfile}('public.internet.com/home-hostintranet-ssht/.ssh/authorized_keys') ]}.</p>
80                 <p>Place its private key part to
81                 @{[ &{$cvsfile}('hostintranet/public.internet.com--hostintranet-ssht--identity') ]}.
82                 Protect this file by '<i>chmod 600 hostintranet/public.internet.com--hostintranet-ssht--identity</i>'.</p>
83         </li>
84         <li>
85                 <p>Append line from @{[ &{$cvsfile}('public.internet.com/etc-passwd') ]}
86                 to the file <b>/etc/passwd</b> on your server in public Internet.</p>
87         </li>
88         <li>
89                 <p>Append line from @{[ &{$cvsfile}('hostintranet/etc-inittab') ]} to
90                 the file <b>/etc/inittab</b> on your firewalled intranet machine.</p>
91                 <p>Execute '<i>init q</i>' command there.</p>
92         </li>
93 </ul>
94 HERE
95
96
97 exit;
98 }
99 1;