HSAdmin Backend Domains, E-Mail, Datenbanken
Michael Hierweck
2019-03-05 c09e9bba2e193126b4a65771722ad99ce4a0225f
merge IPv6 changes
6 files modified
1 files added
132 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm 32 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/zonefile.vm 34 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java 24 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/hosts.vm 21 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/httpd-virtual.vm 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/pac-addr-ipv6.vm 8 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/proftpd-pacs-conf.vm 9 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
@@ -1,9 +1,9 @@
#
#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
<VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80>
<VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80 ${pac.curINet6Addr.inetAddr}:80 ${pac.oldINet6Addr.inetAddr}:80>
    ServerName ${dom.name}
    ServerAlias ${dom.serveraliases}
    ServerAdmin webmaster@${dom.name}
@@ -59,8 +59,8 @@
#end
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# -d
    RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last]
    RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last]
#if( !${htdocsfallback} )
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
@@ -70,19 +70,19 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:80)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d
    RewriteRule ^(.*) - [redirect=404,last]
#end
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
</VirtualHost>
<VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443>
<VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443 ${pac.curINet6Addr.inetAddr}:443 ${pac.oldINet6Addr.inetAddr}:443>
    ServerName ${dom.name}
    ServerAlias ${dom.serveraliases}
    ServerAdmin webmaster@${dom.name}
    SuexecUserGroup ${dom.user.name} ${pac.name}
    PassengerEnabled Off
    PassengerUser ${dom.user.name}
    PassengerGroup ${pac.name}
@@ -92,7 +92,7 @@
    SSLCertificateFile /etc/apache2/pems-enabled/${dom.name}.crt
    SSLCertificateKeyFile /etc/apache2/pems-enabled/${dom.name}.key
    SSLCertificateChainFile /etc/apache2/pems-enabled/${dom.name}.chain
    DocumentRoot /home/doms/${dom.name}/htdocs-ssl
    Alias /cgi-bin/ /home/doms/${dom.name}/cgi-ssl/
@@ -123,19 +123,23 @@
        SetHandler fcgid-script
        Options +ExecCGI +IncludesNoExec -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
#if( ${phplatest} )
    FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php7.3
#end
    RewriteEngine On
    RewriteOptions Inherit
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
#if( ${letsencrypt} )
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
#end
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# -d
    RewriteRule ^(.*) /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1}$1 ]]# [last]
    RewriteRule ^(.*) /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1}$1 ]]# [last]
#if( !${htdocsfallback} )
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
@@ -145,7 +149,7 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:443)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# !-d
    RewriteRule ^(.*) - [redirect=404,last]
#end
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
hsarback/src/de/hsadmin/mods/dom/zonefile.vm
@@ -1,24 +1,26 @@
$TTL 6H
${dom.name}. IN SOA ${dom.dnsMaster}.hostsharing.net. hostmaster.hostsharing.net. (
                ${sio}    ; serial secs since Jan 1 1970
                6H        ; refresh (>=10000)
                1H        ; retry (>=1800)
                1W        ; expire
                1H        ; minimum
        ${sio}  ; serial secs since Jan 1 1970
        6H    ; refresh (>=10000)
        1H    ; retry (>=1800)
        1W    ; expire
        1H    ; minimum
)
${dom.name}.            IN        NS    dns1.hostsharing.net.
${dom.name}.            IN        NS    dns2.hostsharing.net.
${dom.name}.            IN        NS    dns3.hostsharing.net.
${dom.name}.      IN    NS  dns1.hostsharing.net.
${dom.name}.      IN    NS  dns2.hostsharing.net.
${dom.name}.      IN    NS  dns3.hostsharing.net.
${dom.name}.            IN        MX    30 mailin1.hostsharing.net.
${dom.name}.            IN        MX    30 mailin2.hostsharing.net.
${dom.name}.            IN        MX    30 mailin3.hostsharing.net.
${dom.name}.      IN    MX  30 mailin1.hostsharing.net.
${dom.name}.      IN    MX  30 mailin2.hostsharing.net.
${dom.name}.      IN    MX  30 mailin3.hostsharing.net.
${dom.name}.            IN        A    ${pac.curINetAddr.inetAddr}
${dom.name}.      IN    A ${pac.curINetAddr.inetAddr}
;${dom.name}.      IN    AAAA ${pac.curINet6Addr.inetAddr}
*.${dom.name}.               IN        MX    30 mailin1.hostsharing.net.
*.${dom.name}.            IN        MX    30 mailin2.hostsharing.net.
*.${dom.name}.            IN        MX    30 mailin3.hostsharing.net.
*.${dom.name}.    IN    MX  30 mailin1.hostsharing.net.
*.${dom.name}.    IN    MX  30 mailin2.hostsharing.net.
*.${dom.name}.    IN    MX  30 mailin3.hostsharing.net.
*.${dom.name}.            IN        A   ${pac.curINetAddr.inetAddr}
*.${dom.name}.    IN    A    ${pac.curINetAddr.inetAddr}
;*.${dom.name}.    IN    AAAA ${pac.curINet6Addr.inetAddr}
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -176,21 +176,29 @@
    }
    private Processor createIfUp(final Pac pac) {
//        return new ShellProcessor("ifup eth0:" + pacName);
        return new ShellProcessor("ip addr add "
        return new CompoundProcessor(new ShellProcessor("ip addr add "
                + pac.getCurINetAddr().getInetAddr()
                + "/32 dev eth0 label eth0:"
                + "/32 dev eth0"
                + pac.getName()
            );
            ),
        new ShellProcessor("ip addr add "
        + pac.getCurINet6Addr().getInetAddr()
        + "/128 dev eth0 noprefixroute preferred_lft 0"
        + pac.getName()
      ));
    }
    private Processor createIfDown(final Pac pac) {
//        return new ShellProcessor("ifdown eth0:" + pacName);
        return new ShellProcessor("ip addr del "
        return new CompoundProcessor(new ShellProcessor("ip addr del "
                + pac.getCurINetAddr().getInetAddr()
                + "/32 dev eth0 label eth0:"
                + "/32 dev eth0"
                + pac.getName()
            );
            ),
        new ShellProcessor("ip addr add "
        + pac.getCurINet6Addr().getInetAddr()
        + "/128 dev eth0 noprefixroute preferred_lft 0"
        + pac.getName()
      ));
    }
    private UnixUser getPacAdminUser(Pac pac) throws ProcessorException {
hsarback/src/de/hsadmin/mods/pac/hosts.vm
@@ -3,17 +3,18 @@
# Do not edit manually. Changes will be overwritten.
#
127.0.0.1       localhost
127.0.0.1                       localhost
::1                             ip6-localhost ip6-loopback
fe00::0                         ip6-localnet
ff00::0                         ip6-mcastprefix
ff02::1                         ip6-allnodes
ff02::2                         ip6-allrouters
ff02::3                         ip6-allhosts
::1             ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
ff02::3         ip6-allhosts
${hive.inetAddr.inetAddr}    ${hive.name}.hostsharing.net    ${hive.name}    localhive
${hive.inetAddr.inetAddr} ${hive.name}.hostsharing.net ${hive.name} localhive
${hive.inet6Addr.inetAddr} ${hive.name}.hostsharing.net ${hive.name} localhive
#foreach( $pac in ${hive.webpacs} )
${pac.curINetAddr.inetAddr}        ${pac.name}.hostsharing.net        ${pac.name}
${pac.curINetAddr.inetAddr} ${pac.name}.hostsharing.net ${pac.name}
${pac.curINet6Addr.inetAddr} ${pac.name}.hostsharing.net ${pac.name}
#end
hsarback/src/de/hsadmin/mods/pac/httpd-virtual.vm
@@ -4,7 +4,7 @@
#
#foreach( $pac in ${hive.webpacs} )
<VirtualHost ${pac.curINetAddr.inetAddr}:80>
<VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.curINet6Addr.inetAddr}:80>
    ServerName _
    ServerAdmin webmaster@${pac.name}.hostsharing.net
@@ -15,7 +15,7 @@
</VirtualHost>
<VirtualHost ${pac.curINetAddr.inetAddr}:443>
<VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.curINet6Addr.inetAddr}:443>
    ServerName _
    ServerAdmin webmaster@${pac.name}.hostsharing.net
hsarback/src/de/hsadmin/mods/pac/pac-addr-ipv6.vm
New file
@@ -0,0 +1,8 @@
#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
#
#foreach( $pac in ${hive.webpacs} )
eth0:${pac.name}:${pac.curINet6Addr.inetAddr}/128
#end
hsarback/src/de/hsadmin/mods/pac/proftpd-pacs-conf.vm
@@ -1,21 +1,19 @@
#
#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
#foreach( $pac in ${hive.webpacs} )
<VirtualHost ${pac.curINetAddr.inetAddr}>
<VirtualHost ${pac.curINetAddr.inetAddr} ${pac.curINet6Addr.inetAddr}>
        DefaultRoot             ~ ${pac.name}
        ServerName              "${pac.name}.hostsharing.net"
        AllowOverwrite          on
        AllowForeignAddress     on
        <Limit LOGIN>
                Order           allow,deny
                AllowGroup      ${pac.name}
                DenyAll
        </Limit>
        <Anonymous /home/pacs/${pac.name}/ftp>
                User            ${pac.name}
                Group           ${pac.name}
@@ -25,13 +23,10 @@
                DirFakeGroup    on ftp
                DirFakeMode     000
                AuthAliasOnly   on
                <Limit WRITE>
                        DenyAll
                </Limit>
        </Anonymous>
</VirtualHost>
#end