HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2019-12-03 a759d312fc4805d76e762a0980b8d6e379fcb049
add autoconfig to validsubdomais if needed
1 files modified
19 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 19 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -410,7 +410,24 @@
        final Map<String, Object> templateVars = new HashMap<String, Object>();
        query.setParameter("hivename", hiveName);
        query.setParameter("option", "letsencrypt");        
        templateVars.put("domains", query.getResultList());
        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")) {
                    d.setValidsubdomainnames(validSubdomains + ",autoconfig");
                }
            }
        }
        templateVars.put("domains", domainsResultList);
        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),