HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2020-02-19 69c0882228aef7aaaeb311bccf20c2ba91f31e60
no autoconfig subdomain
2 files modified
30 ■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java 6 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 24 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java
@@ -28,7 +28,7 @@
    public static final String DOMOPT_INCLUDES = "includes";
    public static final String DOMOPT_BACKUPFOREXTERNALMX = "backupmxforexternalmx";
    public static final String DOMOPT_LETSENCRYPT = "letsencrypt";
//    public static final String DOMOPT_PHP5 = "php5";
    public static final String DOMOPT_AUTOCONFIG = "autoconfig";
    
    public static final String[] ALL_DOMOPTS = 
            new String[] { 
@@ -38,8 +38,8 @@
                    DOMOPT_HTDOCSFALLBACK, 
                    DOMOPT_INCLUDES, 
                    DOMOPT_BACKUPFOREXTERNALMX,
                    DOMOPT_LETSENCRYPT
//                    , DOMOPT_PHP5
                    DOMOPT_LETSENCRYPT,
                    DOMOPT_AUTOCONFIG
            };
    public static final String[] DEFAULT_DOMOPTS = 
            new String[] { 
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -410,29 +410,7 @@
        final Map<String, Object> templateVars = new HashMap<String, Object>();
        query.setParameter("hivename", hiveName);
        query.setParameter("option", "letsencrypt");        
        final List<?> domainsResultList = query.getResultList();
        for (Object domObj : domainsResultList) {
            if (domObj instanceof Domain) {
                final Domain d = (Domain) domObj;
                boolean autoconfig = false;
                final Set<DomainOption> domainoptions = d.getDomainoptions();
                for (DomainOption opt : domainoptions) {
                    if ("autoconfig".equals(opt.getName())) {
                        autoconfig = true;
                    }
                }
                final String validSubdomains = d.getValidsubdomainnames();
                if (autoconfig && !validSubdomains.contains("autoconfig")) {
                    if (validSubdomains.length() > 0) {
                        d.setValidsubdomainnames(validSubdomains + ",autoconfig");
                    }
                    else {
                        d.setValidsubdomainnames("autoconfig");
                    }
                }
            }
        }
        templateVars.put("domains", domainsResultList);
        templateVars.put("domains", query.getResultList());
        return new CompoundProcessor(
                new CreateFileProcessor("/de/hsadmin/mods/dom/acmebot-domain.properties.vm", templateVars, dom,
                        "/etc/hostsharing/acmebot/domain.properties.tmp", "acmebot", "acmebot", "640", true),