HSAdmin Backend Domains, E-Mail, Datenbanken
5866337e217aa515c16ecf87fd3320ca750d8c0f..2d2c320454a15efe84c253cb91c334c497ec1f1d
2019-10-04 Peter Hormanns
do salt-call
2d2c32 diff | tree
2019-10-04 Peter Hormanns
for testing purpose
8d017e diff | tree
2019-10-04 Peter Hormanns
generate domains list also on pac.remove
8ecd23 diff | tree
3 files modified
25 ■■■■ changed files
hsarback/src/de/hsadmin/core/util/IPv6Trick.java 9 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java 10 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/httpd-virtual.vm 6 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/util/IPv6Trick.java
@@ -7,6 +7,10 @@
public class IPv6Trick {
    
    private static final String IPv4_LOCALHOST = "127.0.0";
    private static final String IPv6_LOCALHOST = "::1";
    private static final String IPv6_LOCALHOST_ALT = "0:0:0:0:0:0:0:1";
    private static final String IPv4_83_223_79 = "83.223.79";     // Alboin-Kontor Berlin
    private static final String IPv4_83_223_91 = "83.223.91";     // Alboin-Kontor Berlin
    private static final String IPv4_83_223_95 = "83.223.95";     // Alboin-Kontor Berlin
@@ -42,6 +46,11 @@
    public static boolean isKnownRemote(final String remoteAddress) {
        boolean isKnown = false;
        System.out.print(remoteAddress + "\n");
        if (remoteAddress.startsWith(IPv4_LOCALHOST) || remoteAddress.startsWith(IPv6_LOCALHOST) || remoteAddress.startsWith(IPv6_LOCALHOST_ALT)) {
            // localhost
            isKnown = true;
        }
        if (remoteAddress.startsWith(IPv6_PREFIX_HS) || remoteAddress.startsWith(IPv6_PREFIX_HS_ALT)) {
            // Hostsharing IPv6
            isKnown = true;
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -52,6 +52,7 @@
                createMakePacDirectoryStructure(unixUser),
                createIfUp(pac),
                createHttpdVirtualProc(hive),
                createSaltCallProc(),
                createAccountingRulesProc()));
            final Config config = Config.getInstance();
            for (String queueName : config.getProperty("queues.dns").split(",")) {
@@ -75,6 +76,7 @@
                createNetworkInterfacesProc(hive),
                createProftpdConfProc(hive),
                createHttpdVirtualProc(hive),
                createSaltCallProc(),
                createSetQuotaProc(pac)
                ));
            final Config config = Config.getInstance();
@@ -105,6 +107,10 @@
                createHttpdVirtualProc(hive),
                createHiveDNSRemoveProcessor(domainName),
                createAccountingRulesProc()), "remove packet");
            final Config config = Config.getInstance();
            for (String queueName : config.getProperty("queues.dns").split(",")) {
                waiting.appendProcessor(queueName, createDNSServerConfigProcessor(em), queueName + ".hostsharing.net");
            }
            return waiting;
        } else {
            return new NullProcessor();
@@ -149,6 +155,10 @@
        return new ShellProcessor("mk-iptables-rules Accounting");
    }
    private Processor createSaltCallProc() {
        return new ShellProcessor("salt-call state.sls pacs && invoke-rc.d apache2 reload >/dev/null 2>&1");
    }
    private Processor createZonefileProc(final EntityManager em, final Pac pac) {
        final Map<String, Object> zonefileTemplateVars = new HashMap<String, Object>();
        zonefileTemplateVars.put("sio", Long.toString(System.currentTimeMillis()/1000L));
hsarback/src/de/hsadmin/mods/pac/httpd-virtual.vm
@@ -20,9 +20,9 @@
    ServerAdmin webmaster@${pac.name}.hostsharing.net
    SSLEngine On
    SSLCertificateFile /etc/apache2/pems-enabled/${pac.name}.hostsharing.net.crt
    SSLCertificateKeyFile /etc/apache2/pems-enabled/${pac.name}.hostsharing.net.key
    SSLCertificateChainFile /etc/apache2/pems-enabled/${pac.name}.hostsharing.net.chain
    SSLCertificateFile /etc/apache2/pems-custom/_.hostsharing.net.crt
    SSLCertificateKeyFile /etc/apache2/pems-custom/_.hostsharing.net.key
    SSLCertificateChainFile /etc/apache2/pems-custom/_.hostsharing.net.chain
    <Directory />
        SSLRequireSSL On