Apache-DnsZone

 view release on metacpan or  search on metacpan

INSTALL  view on Meta::CPAN

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    USE_APACI=1 \
    EVERYTHING=1 \
    APACHE_PREFIX=/usr/local/modperl
$ make
$ make test
$ make install
 
That should get your mod_perl running.
 
Recommended modules to install before installing DnsZone: Bundle::Apache,
Apache::Request, Apache::AuthCookie, Apache::AuthTicket, Net::DNS,'
CGI::FastTemplate, Email::Valid, Bundle::ABH.
 
You might be forced to download Apache::Request 0.3103 by hand and
install it, the package is available from:
 
To install DnsZone:
 
$ perl Makefile.PL
$ make

INSTALL  view on Meta::CPAN

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  TransferLog  logs/dnszone-access_log
  PerlSetVar   DnsZoneDBsrc               'dbi:mysql:dnszone'
  PerlSetVar   DnsZoneDBuser              'dnszone'
  PerlSetVar   DnsZoneDBpass              '*******'
  PerlSetVar   DnsZoneDebugLevel          1
  PerlSetVar   DnsZoneLangDir             '/usr/local/modperl/dnszone'
  PerlSetVar   DnsZoneTemplateDir         '/usr/local/modperl/dnszone/template'
  PerlSetVar   DnsZoneLoginLang           'en'
  # or 'de' 'se' 'dk' 'fr' 'it'
  # DnsZoneLoginLang is used if the browser doesn't send an 'Accept-Language' header and the language isn't in DnsZone already
  PerlModule   Apache::DnsZone::AuthCookie
  PerlSetVar   DnsZoneTicketTable         'tickets:ticket_hash:ts'
  PerlSetVar   DnsZoneTicketUserTable     'users:username:password'
  PerlSetVar   DnsZoneTicketPasswordStyle cleartext
  PerlSetVar   DnsZoneTicketSecretTable   'ticketsecrets:sec_data:sec_version'
  PerlSetVar   DnsZoneTicketExpires       60
  PerlSetVar   DnsZoneTicketLogoutURI     /
  PerlSetVar   DnsZoneTicketLoginHandler  /login
  PerlSetVar   DnsZoneTicketIdleTimeout   10
  PerlSetVar   DnsZonePath                /
  PerlSetVar   DnsZoneLoginScript         /loginform
  <Location /admin>
    SetHandler        perl-script
    PerlHandler       Apache::DnsZone
    AuthType          Apache::DnsZone::AuthCookie
    AuthName          DnsZone
    PerlAuthenHandler Apache::DnsZone::AuthCookie->authenticate
    PerlAuthzHandler  Apache::DnsZone::AuthCookie->authorize
  </Location>
  <Location /loginform>
    SetHandler        perl-script
    Perlhandler       Apache::DnsZone::AuthCookie->login_screen
    AuthType          Apache::DnsZone::AuthCookie
    AuthName          DnsZone
  </Location>
  <Location /login>
    SetHandler        perl-script
    PerlHandler       Apache::DnsZone::AuthCookie->login
    AuthType          Apache::DnsZone::AuthCookie
    AuthName          DnsZone
  </Location>
</VirtualHost>
 
Copy the contents of htdocs/ to /path/to/your/apache/htdocs
 
$ cp -R htdocs/* /path/to/your/apache/htdocs
 
Now you need to import the tables that DnsZone needs into your database.

MANIFEST  view on Meta::CPAN

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
MANIFEST
INSTALL
conf/dnszone.conf
lib/Apache/DnsZone/DB/MySQL.pm
lib/Apache/DnsZone/DB/Postgresql.pm
lib/Apache/DnsZone/DB/Oracle.pm
lib/Apache/DnsZone/Config.pm
lib/Apache/DnsZone/DB.pm
lib/Apache/DnsZone/Resolver.pm
lib/Apache/DnsZone/Language.pm
lib/Apache/DnsZone/AuthCookie.pm
lib/Apache/DnsZone.pm
Makefile.PL
test.pl
sql/mysql.sql
sql/postgresql.sql
sql/oracle.sql
sql/upgrade/mysql-0.1-0.2.sql
bin/mysql/addzone.pl
bin/mysql/addreversezone.pl
bin/mysql/conf.pl

Makefile.PL  view on Meta::CPAN

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use Apache::src ();
 
require 5.005;
 
WriteMakefile(
              'NAME' => __PACKAGE__,
              'VERSION_FROM' => 'lib/Apache/DnsZone.pm',
              'INC' => Apache::src->new->inc,
              'PREREQ_PM' => {
                  'Apache::AuthCookie' => 0,
                  'Apache::AuthTicket' => 0,
                  'Apache::Request' => 0.3103,
                  'mod_perl' => 1.24,
                  'Net::DNS' => 0.12,
                  'DBI' => 1.13,
                  'Email::Valid' => 0,
                  'CGI::FastTemplate' => 1.09,
                  'MLDBM' => 0,
                  'GDBM_File' => 0,
                  'Net::IP' => 0

TODO  view on Meta::CPAN

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
[Fixed] Duplicate records || round robin! + database lookups
[Fixed] $DEBUG record in templates, for giving information about duplicate hostnames and bad hostnames/ips/whatever Call it $EXPLANATION?
[Fixed] Clean up after old header outputing stuff
[Fixed] Check wheter the "edit" submission is the changed at all
[Fixed] import scripts!
[Fixed] soa_locks? are soa locks enforced?
[Fixed] || Apache->request on all handlers
[Fixed] redo global vars shit! instead of $DnsZone::whatever, just have a global my $whatever
[Fixed] Ability to set a default language for login page? (DnsZoneLoginLang); Default login language!!
[Fixed] cookie stuff error codes in language files uc(cookiereturn)
[Fixed] Implement own Apache::AuthCookie derivate with templates! (use Apache::(AuthTicket|AuthCookieDBI) as examples)
[Fixed] TimeOut of cookie + 15 minute renewal of each cookie! If not done anything for the last 15 minutes and request another page => re-login; subclass of Apache::AuthCookie; Needs to take defaults from Apache::DnsZone::Config
[Fixed] Login template needs to be unfucked!
[Fixed] Maybe a layer above the menu system so that menus and stuff wont be on login page?
[Fixed] Template system outputter (so menu will only be shown on non-login page && list_domains (maybe even show all the domains you have in the url?))
[Fixed] logout?
[Fixed] is_updated_SOA? (Is SOA updated in edit submit request)
[Fixed] GET/POST where? POST => when submitting forms to avoid 4K limit
[Fixed] is_updated_* ttl eq and not == ?
[Fixed] which pages need caching and which don't? All pages should have caching turned off so no pages will be in cache if user is not authenticated
[Fixed] Settings, Logout, Menu, List domain texts! Menu with list_domains and settings and logout (if appropriate)
[Fixed] SSL - why would there be any issues with using ssl?

conf/dnszone.conf  view on Meta::CPAN

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  ErrorLog     logs/dnszone-error_log
  TransferLog  logs/dnszone-access_log
  PerlSetVar   DnsZoneDBsrc               'dbi:mysql:dnszone'
  PerlSetVar   DnsZoneDBuser              'dnszone'
  PerlSetVar   DnsZoneDBpass              '*******'
  PerlSetVar   DnsZoneDebugLevel          1
  PerlSetVar   DnsZoneLangDir             '/usr/local/modperl/dnszone'
  PerlSetVar   DnsZoneTemplateDir         '/usr/local/modperl/dnszone/template'
  PerlSetVar   DnsZoneLoginLang           'en'
  PerlSetVar   DnsZoneLogoutHandler       /logout
  PerlModule   Apache::DnsZone::AuthCookie
  PerlSetVar   DnsZoneTicketTable         'tickets:ticket_hash:ts'
  PerlSetVar   DnsZoneTicketUserTable     'users:username:password'
  PerlSetVar   DnsZoneTicketPasswordStyle cleartext
  PerlSetVar   DnsZoneTicketSecretTable   'ticketsecrets:sec_data:sec_version'
  PerlSetVar   DnsZoneTicketExpires       60
  PerlSetVar   DnsZoneTicketLogoutURI     /
  PerlSetVar   DnsZoneTicketLoginHandler  /login
  PerlSetVar   DnsZoneTicketIdleTimeout   10
  PerlSetVar   DnsZonePath                /
  PerlSetVar   DnsZoneLoginScript         /loginform
  <Location /admin>
    SetHandler        perl-script
    PerlHandler       Apache::DnsZone
    AuthType          Apache::DnsZone::AuthCookie
    AuthName          DnsZone
    PerlAuthenHandler Apache::DnsZone::AuthCookie->authenticate
    PerlAuthzHandler  Apache::DnsZone::AuthCookie->authorize
    require           valid-user
  </Location>
  <Location /loginform>
    SetHandler        perl-script
    Perlhandler       Apache::DnsZone::AuthCookie->login_screen
    AuthType          Apache::DnsZone::AuthCookie
    AuthName          DnsZone
  </Location>
  <Location /login>
    SetHandler        perl-script
    PerlHandler       Apache::DnsZone::AuthCookie->login
    AuthType          Apache::DnsZone::AuthCookie
    AuthName          DnsZone
  </Location>
  <Location /logout>
    SetHandler        perl-script
    PerlHandler       Apache::DnsZone::AuthCookie->logout
    AuthType          Apache::DnsZone::AuthCookie
    AuthName          DnsZone
  </Location>
</VirtualHost>

lang/br.lang  view on Meta::CPAN

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
            'ERROR_REFRESH'     => 'Valor do Tempo de Atualiza&ccedil;&atilde;o Inv&aacute;lido',
            'ERROR_RETRY'       => 'Valor para o Tempo de Tentativa Inv&aacute;lido',
            'ERROR_EXPIRE'      => 'Valor do Tempo de Expira&ccedil;&atilde;o Inv&aacute;lido',
            'FILLOUT_FIELDS'    => 'Por Favor Complete os Seguintes Campos:',
            'EDIT_FIELDS'       => 'Por Favor Altere os Campos:',
            'DELETE_RECORD'     => 'Voc&ecirc; Ir&aacute; Apagar os Seguintes Registros:',
            'USERNAME'          => 'Usu&aacute;rio',
            'PASSWORD'          => 'Senha',
            'LOGIN_BUTTON'      => 'Entrar',
            'PAGE_LOGIN'        => 'P&aacute;gina de Login',
            'LOGIN_NOTE'        => 'Nota: Configure seu Navegador para Aceitar Cooks para poder se logar. Sua Senha Ser&aacute; Solicitada depois de algum tempo.',
            'IDLE_TIMEOUT'      => 'Motivo da Desconex&atilde;oao: Tempo Esgotado',
            'MALFORMED_TICKET'  => 'Motivo da Desconex&atilde;o: Ticket com Malforma&ccedil;&atilde;o',
            'INVALID_HASH'      => 'Motivo da Desconex&atilde;o: Ticket Desconhecido',
            'EXPIRED_TICKET'    => 'Motivo da Desconex&atilde;o: Ticket Expirou',
            'MISSING_SECRET'    => 'Motivo da Desconex&atilde;o: Server secret n&atilde;o pode ser carregado',
            'TAMPERED_HASH'     => 'Motivo da Desconex&atilde;o: Ticket dados alterados com',
            'PASSWORD_CHANGE'   => 'A senha s&oacute; ser&aacute; alterada se voc&ecirc; digitar algo nos campos abaixo.'
            );
 
return %text;

lang/de.lang  view on Meta::CPAN

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
            'ERROR_REFRESH'     => 'Ung&uuml;ltiger Wert f&uuml;r Aktualisierungszeit',
            'ERROR_RETRY'       => 'Ung&uuml;ltiger Wert f&uuml;r Wiederholungszeit',
            'ERROR_EXPIRE'      => 'Ung&uuml;ltiger Wert f&uuml;r Ablaufzeit',
            'FILLOUT_FIELDS'    => 'Bitte f&uuml;llen sie die folgenden Felder aus:',
            'EDIT_FIELDS'       => 'Bitte bearbeiten sie diese Felder:',
            'DELETE_RECORD'     => 'Sie sind dabei folgenden Eintrag zu l&ouml;schen:',
            'USERNAME'          => 'Benutzername',
            'PASSWORD'          => 'Passwort',
            'LOGIN_BUTTON'      => 'Anmelden',
            'PAGE_LOGIN'        => 'Anmeldeseite',
            'LOGIN_NOTE'        => 'Anmerkung: Cookies m&uuml;ssen bei Ihrem Browser aktiviert sein, um sich anmelden zu k&ouml;nnen. Nach einiger Zeit werden Sie aufgefordert sicher erneut anzumelden.',
            'IDLE_TIMEOUT'      => 'Abmeldegrund: Zeitablauf nach Unt&auml;tigkeit',
            'MALFORMED_TICKET'  => 'Abmeldegrund: Ticket besch&auml;digt',
            'INVALID_HASH'      => 'Abmeldegrund: Unbekanntes Ticket',
            'EXPIRED_TICKET'    => 'Abmeldegrund: Ticket ist abgelaufen',
            'MISSING_SECRET'    => 'Abmeldegrund: Server Secret konnte nicht geladen werden',
            'TAMPERED_HASH'     => 'Abmeldegrund: Ticket Daten wurden manipuliert',
            'PASSWORD_CHANGE'   => 'Das Passwort wird nur ver&auml;ndert wenn Sie die untenstehenden Felder ausf&uuml;llen.'
            );
 
return %text;

lib/Apache/DnsZone.pm  view on Meta::CPAN

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
%EXPORT_TAGS = ();
$VERSION = '0.2';
 
use Apache ();
use Apache::Constants qw(:common REDIRECT);
use Net::IP qw(:PROC);
 
my %lang = ();
my $cfg;
my $res;

lib/Apache/DnsZone.pm  view on Meta::CPAN

879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
    $dbh->close();
    return OK;
}
 
sub logout {
    my $r = shift || Apache->request();
    Debug(3, qq{calling logout()});
    init($r);
    output_redirect($r, 1, $cfg->{'cfg'}->{DnsZoneLogoutHandler});
#    $r->push_handlers(PerlHandler => sub {
#      Apache::DnsZone::AuthCookie->logout(Apache->request);
#    });
    $dbh->close();
    return REDIRECT;
}
 
sub list_domains {
    my $r = shift || Apache->request();
    Debug(3, qq{calling list_domains()});
    init($r);
    my ($uid, $email, $lang_id, $lang) = $dbh->get_user_info($r->connection->user);

lib/Apache/DnsZone/AuthCookie.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
# $Id: AuthCookie.pm,v 1.8 2001/06/03 11:10:23 thomas Exp $
 
use strict;
use vars qw(@ISA $VERSION);
 
use Apache::Constants qw(OK);
use DBI;
use Digest::MD5 qw(md5_hex);
 
($VERSION) = qq$Revision: 1.8 $ =~ /([\d\.]+)/;
@ISA = qw(Apache::AuthTicket);
 
sub make_login_screen {
    my ($self, $r, $action, $destination) = @_;
    my $reason = $r->prev->subprocess_env("AuthCookieReason");
    my $ticket_reason = undef;
    Apache::DnsZone::Debug(5, qq{make_login_screen called});
    if ($reason eq 'bad_cookie') {
        $ticket_reason = $r->prev->subprocess_env("AuthTicketReason");
    }
 
    my $cfg = Apache::DnsZone::Config->new($r);
 
    my $lang = $cfg->{'cfg'}->{DnsZoneLoginLang}; # choose default login language

lib/Apache/DnsZone/AuthCookie.pm  view on Meta::CPAN

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    Apache::DnsZone::output_headers($r, 1, length(${$content_ref}));
 
    $r->print(${$content_ref});
 
    return OK;
}
 
sub dbi_connect {
    my ($this) = @_;
    Apache::DnsZone::Debug(5, qq{Apache::DnsZone::AuthCookie::dbi_connect called});   
    my $r = $this->request;
     
    my $cfg = Apache::DnsZone::Config->new($r);
    my $dbh = Apache::DnsZone::DB->new($cfg);
 
    return $dbh->db();
}
 
1;



( run in 0.578 second using v1.01-cache-2.11-cpan-eab888a1d7d )