From 9aec22e5fd00800c6e7952ae5b85cc639d4b1e78 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Mar 2003 03:41:03 +0000 Subject: apache export! --- FS/FS/domain_record.pm | 4 ++-- FS/FS/part_export.pm | 28 +++++++++++++++++++++++++++- FS/FS/part_export/apache.pm | 7 +++++++ FS/MANIFEST | 1 + FS/t/part_export-apache.t | 5 +++++ 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 FS/FS/part_export/apache.pm create mode 100644 FS/t/part_export-apache.t (limited to 'FS') diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm index 37cc6c9e8..3297e6bfb 100644 --- a/FS/FS/domain_record.pm +++ b/FS/FS/domain_record.pm @@ -261,7 +261,7 @@ sub check { or return "Illegal data for PTR record: ". $self->recdata; $self->recdata($1); } elsif ( $self->rectype eq 'CNAME' ) { - $self->recdata =~ /^([a-z0-9\.\-]+)$/i + $self->recdata =~ /^([a-z0-9\.\-]+|\@)$/i or return "Illegal data for CNAME record: ". $self->recdata; $self->recdata($1); } elsif ( $self->rectype eq '_mstr' ) { @@ -313,7 +313,7 @@ sub svc_domain { =head1 VERSION -$Id: domain_record.pm,v 1.11 2002-06-23 19:16:45 ivan Exp $ +$Id: domain_record.pm,v 1.12 2003-03-20 03:41:03 ivan Exp $ =head1 BUGS diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index d62bef50d..b46d8439e 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -604,7 +604,7 @@ tie my %shellcommands_withdomain_options, 'Tie::IxHash', ; tie my %www_shellcommands_options, 'Tie::IxHash', - 'user' => { lable=>'Remote username', default=>'root' }, + 'user' => { label=>'Remote username', default=>'root' }, 'useradd' => { label=>'Insert command', default=>'mkdir /var/www/$zone; chown $username /var/www/$zone; ln -s /var/www/$zone $homedir/$zone', }, @@ -616,6 +616,27 @@ tie my %www_shellcommands_options, 'Tie::IxHash', }, ; +tie my %apache_options, 'Tie::IxHash', + 'user' => { label=>'Remote username', default=>'root' }, + 'httpd_conf' => { label=>'httpd.conf snippet location', + default=>'/etc/apache/httpd-freeside.conf', }, + 'template' => { + label => 'Template', + type => 'textarea', + default => <<'END', + #generic +# #preferred, http://httpd.apache.org/docs/dns-caveats.html +DocumentRoot /var/www/$zone +ServerName $zone +ServerAlias *.$zone +#BandWidthModule On +#LargeFileLimit 4096 12288 + + +END + }, +; + tie my %domain_shellcommands_options, 'Tie::IxHash', 'user' => { lable=>'Remote username', default=>'root' }, 'useradd' => { label=>'Insert command', @@ -894,6 +915,11 @@ tie my %ldap_options, 'Tie::IxHash', 'notes' => 'Run remote commands via SSH, for virtual web sites. You will need to setup SSH for unattended operation.', }, + 'apache' => { + 'desc' => 'Export an Apache httpd.conf file snippet.', + 'options' => \%apache_options, + 'notes' => 'Batch export of an httpd.conf snippet from a template. Typically used with something like Include /etc/apache/httpd-freeside.conf in httpd.conf. File::Rsync must be installed. Run bin/apache.export to export the files.', + }, }, 'svc_broadband' => { diff --git a/FS/FS/part_export/apache.pm b/FS/FS/part_export/apache.pm new file mode 100644 index 000000000..b72c9bdb0 --- /dev/null +++ b/FS/FS/part_export/apache.pm @@ -0,0 +1,7 @@ +package FS::part_export::bind; + +use vars qw(@ISA); +use FS::part_export::null; + +@ISA = qw(FS::part_export::null); + diff --git a/FS/MANIFEST b/FS/MANIFEST index 782286544..32a4e4f59 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -66,6 +66,7 @@ FS/part_bill_event.pm FS/export_svc.pm FS/part_export.pm FS/part_export_option.pm +FS/part_export/apache.pm FS/part_export/bind.pm FS/part_export/bind_slave.pm FS/part_export/bsdshell.pm diff --git a/FS/t/part_export-apache.t b/FS/t/part_export-apache.t new file mode 100644 index 000000000..b9995080f --- /dev/null +++ b/FS/t/part_export-apache.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::part_export::apache; +$loaded=1; +print "ok 1\n"; -- cgit v1.2.1