HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-09-20 400c14a23e4e49f94de6f207d09d5c0633de6f76
merged
1 files added
1 files deleted
9 files modified
194 ■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl 19 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl 12 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/postgrey-whitelist-recipients.jtpl 8 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java 21 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/email_new_pac_account.jtpl 71 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/hosts.jtpl 7 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/httpd-virtual.jtpl 28 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/interfaces.jtpl 7 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/proftpd-conf.jtpl 9 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/sudoers.jtpl 8 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -311,10 +311,10 @@
        }
        Processor domSetupProcessor = new CompoundProcessor(
            createDomainDirectoriesProcessor(dom, templateVars),
            new CreateFileProcessor(selectVHostTemplate(dom), templateVars, "/etc/apache2/sites-available/" + domName + ".tmp", "root", "root", "644", true),
            new CreateFileProcessor(selectVHostTemplate(dom), templateVars, iterateMaps.iterator(), "/etc/apache2/sites-available/" + domName + ".tmp", "root", "root", "644", true),
            new ShellProcessor("ls /etc/apache2/pems/" + pac + ".pem >/dev/null 2>&1 " +
                    "&& sed -i '/SSLCertificate.*default/d' " + "/etc/apache2/sites-available/" + domName + ".tmp" + 
                    " && (ls /etc/apache2/pems/" + pac + ".chain.pem >/dev/null 2>&1 || sed -i '/SSLCertificateChain.*" + pac + "/d' " + "/etc/apache2/sites-available/" + domName + ")" +
                    " && (ls /etc/apache2/pems/" + pac + ".chain.pem >/dev/null 2>&1 || sed -i '/SSLCertificateChain.*" + pac + "/d' " + "/etc/apache2/sites-available/" + domName + ".tmp )" +
                    " || sed -i '/SSLCertificate.*" + pac + "/d' " + "/etc/apache2/sites-available/" + domName + ".tmp"),
            new ShellProcessor(
                    " ( diff -q /etc/apache2/sites-available/" + domName + ".tmp /etc/apache2/sites-available/" + domName + " && rm /etc/apache2/sites-available/" + domName + ".tmp ) " +
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl
@@ -1,4 +1,9 @@
<!-- BEGIN: main --><VirtualHost {DOM_IPNUMBER}:80 {DOM_IPNUMBEREX}:80>
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
<VirtualHost {DOM_IPNUMBER}:80 {DOM_IPNUMBEREX}:80>
    ServerName {DOM_HOSTNAME}
    ServerAlias *.{DOM_HOSTNAME}
@@ -37,8 +42,8 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d
    RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last]
<!-- BEGIN: iterate -->    RewriteCond %{REQUEST_URI} !^/cgi-bin/
<!-- BEGIN: iterate -->
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d
@@ -95,14 +100,14 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} -d
    RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1}$1 [last]
<!-- BEGIN: nosubdomainfallbackforhttps -->    RewriteCond %{REQUEST_URI} !^/cgi-bin/
<!-- BEGIN: nosubdomainfallbackforhttps -->
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d
    RewriteRule ^(.*) - [redirect=404,last]
<!-- END: nosubdomainfallbackforhttps -->    AddType application/x-httpd-php .php .php5 .php4 .php3
<!-- END: nosubdomainfallbackforhttps -->
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
</VirtualHost>
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl
@@ -1,4 +1,9 @@
<!-- BEGIN: main --><VirtualHost {DOM_IPNUMBER}:80 {DOM_IPNUMBEREX}:80>
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
<VirtualHost {DOM_IPNUMBER}:80 {DOM_IPNUMBEREX}:80>
    ServerName {DOM_HOSTNAME}
    ServerAlias *.{DOM_HOSTNAME}
@@ -30,7 +35,6 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d
    RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last]
<!-- BEGIN: iterate -->    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d
    RewriteRule ^(.*) - [redirect=404,last]
@@ -80,6 +84,6 @@
<!-- BEGIN: nosubdomainfallbackforhttps -->    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d
    RewriteRule ^(.*) - [redirect=404,last]
<!-- END: nosubdomainfallbackforhttps --></VirtualHost>
<!-- END: nosubdomainfallbackforhttps -->
</VirtualHost>
<!-- END: main -->
hsarback/src/de/hsadmin/mods/dom/postgrey-whitelist-recipients.jtpl
@@ -1,10 +1,12 @@
<!-- BEGIN: main -->### Do not edit this file manually
### Generated by HSAdmin Queue Server
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
abuse@
postmaster@
################################################################################
####################################################
<!-- BEGIN: iterate -->{DOM}
<!-- END: iterate -->
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -16,6 +16,7 @@
import de.hsadmin.core.qserv.ProcessorException;
import de.hsadmin.core.qserv.ShellProcessor;
import de.hsadmin.core.qserv.TemplateProcessor;
import de.hsadmin.core.qserv.CreateFileProcessor;
import de.hsadmin.core.qserv.WaitingTasksProcessor;
import de.hsadmin.core.util.Config;
import de.hsadmin.core.util.PasswordTool;
@@ -44,10 +45,25 @@
                createSudouersProc(hiveValues, pacValuesList), 
                createProftpdConfProc(hiveValues, pacValuesList), 
                createMakePacDirectoryStructure(unixUser),
                createIfUp(pacName));
                createIfUp(pacName),
                createHttpdVirtualProc(pacName, pacValuesList));
        WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor);
//        secProcessor.appendProcessor(pac.getHiveName(), createSendEMailProc(pacName, customerEMail, emailVars), "send email to customer");
        return secProcessor;
    }
    private Processor createHttpdVirtualProc(
            String pacName, List<Map<String, String>> pacValuesList) throws ProcessorException {
        Processor domSetupProcessor = new CompoundProcessor(
                new CreateFileProcessor("/de/hsadmin/mods/pac/httpd-virtual.jtpl", new HashMap<String, String>(), pacValuesList.iterator(), "/etc/apache2/virtual.conf.tmp", "root", "root", "644", true),
                new ShellProcessor("ls /etc/apache2/pems/" + pacName + ".pem >/dev/null 2>&1 " + "&& sed -i '/SSLCertificate.*default/d' " + "/etc/apache2/apache.conf.tmp"
                                + " && (ls /etc/apache2/pems/" + pacName + ".chain.pem >/dev/null 2>&1"
                                + " || sed -i '/SSLCertificateChain.*" + pacName + "/d' " + "/etc/apache2/virtual.conf.tmp)"
                                + " || sed -i '/SSLCertificate.*" + pacName + "/d' " + "/etc/apache2/virtual.conf.tmp"),
                new ShellProcessor("(diff -q /etc/apache2/apache.conf.tmp /etc/apache2/apache.conf"
                                + " && rm /etc/apache2/apache.conf.tmp)"
                                + " || invoke-rc.d apache2 reload >/dev/null 2>&1"));
        return domSetupProcessor;
    }
    @Override
@@ -68,7 +84,8 @@
                createEtcHostsProc(hiveValues, pacValuesList), 
                createNetworkInterfacesProc(hiveValues, pacValuesList), 
                createSudouersProc(hiveValues, pacValuesList), 
                createProftpdConfProc(hiveValues, pacValuesList)));
                createProftpdConfProc(hiveValues, pacValuesList),
                createHttpdVirtualProc(pac.getName(), pacValuesList)));
        waitingProcessor.appendProcessor(pac.getHiveName(), createDelUserProc(pac.getName()), "remove packet");
        return waitingProcessor;
    }
hsarback/src/de/hsadmin/mods/pac/email_new_pac_account.jtpl
File was deleted
hsarback/src/de/hsadmin/mods/pac/hosts.jtpl
@@ -1,4 +1,9 @@
<!-- BEGIN: main -->127.0.0.1       localhost
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
127.0.0.1       localhost
::1             ip6-localhost ip6-loopback
fe00::0         ip6-localnet
hsarback/src/de/hsadmin/mods/pac/httpd-virtual.jtpl
New file
@@ -0,0 +1,28 @@
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
<!-- BEGIN: iterate -->
NameVirtualHost {PAC_IP}:80
NameVirtualHost {PAC_IP}:443
<VirtualHost {PAC_IP}:80>
   Redirect 404 /
</VirtualHost>
<VirtualHost {PAC_IP}:443>
    SSLEngine On
    SSLCertificateFile /etc/apache2/pems/default.pem
    SSLCertificateChainFile /etc/apache2/pems/default.chain.pem
    SSLCertificateFile /etc/apache2/pems/{PAC}.pem
    SSLCertificateChainFile /etc/apache2/pems/{PAC}.chain.pem
    Redirect 404 /
</VirtualHost>
<!-- END: iterate -->
<!-- END: main -->
hsarback/src/de/hsadmin/mods/pac/interfaces.jtpl
@@ -1,4 +1,9 @@
<!-- BEGIN: main -->auto lo
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
auto lo
iface lo inet loopback
auto eth0
hsarback/src/de/hsadmin/mods/pac/proftpd-conf.jtpl
@@ -1,4 +1,7 @@
<!-- BEGIN: main --># This proftpd config file is generated by hsadmin.
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
Include                         /etc/proftpd/modules.conf
@@ -56,8 +59,8 @@
</Directory>
<!-- BEGIN: iterate -->
#----------------------------------------------------------------------
# {PAC}.hostsharing.net
####################################################
<VirtualHost {PAC_IP}>
        DefaultRoot             ~ {PAC}
        ServerName              "Hostsharing eG"
hsarback/src/de/hsadmin/mods/pac/sudoers.jtpl
@@ -1,5 +1,7 @@
<!-- BEGIN: main -->### Do not edit this file manually
### Generated by HSAdmin Queue Server
<!-- BEGIN: main -->#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
# Host alias specification
@@ -18,7 +20,7 @@
root    ALL=(ALL) ALL
%adm    ALL=NOPASSWD: ALL
################################################################################
####################################################
<!-- BEGIN: iterate -->{PAC} ALL = (%{PAC}) NOPASSWD: ALL
<!-- END: iterate -->