HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2020-06-08 ad193bd365572c52a824a92027c3df34dbdbe447
remove old code
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
@@ -46,7 +46,6 @@
        }
        mainProcessor.appendProcessor(hiveName, createDomainDirectoriesProcessor(dom), "Setup Domain Directories");
        mainProcessor.appendProcessor(hiveName, createApacheVHostSetupProcessor(em, dom), "Setup Apache VHost");
//        mainProcessor.appendProcessor(hiveName, createACMEBotProcessor(em, dom), "Setup ACMEBot");
        mainProcessor.appendProcessor(hiveName, createTriggerAcmebotProcessor(em, dom), "Trigger ACMEBot");
        return mainProcessor;
    }
@@ -56,11 +55,9 @@
        final UnixUser domUser = dom.getUser();
        final Pac pac = domUser.getPac();
        final Processor apacheVHostSetupProcessor = createApacheVHostSetupProcessor(em, dom);
//        final Processor letencryptSetupProcessor = createACMEBotProcessor(em, dom);
        final Processor triggerAcmebotProcessor = createTriggerAcmebotProcessor(em, dom);
        final WaitingTasksProcessor processor = new WaitingTasksProcessor(
                new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"), apacheVHostSetupProcessor, triggerAcmebotProcessor));
//                new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"), apacheVHostSetupProcessor, letencryptSetupProcessor, triggerAcmebotProcessor));
        final Config config = Config.getInstance();
        for (String queueName : config.getProperty("queues.mail").split(",")) {
            processor.appendProcessor(queueName, createMailinSetupProcessor(em, dom, pac), queueName + ".hostsharing.net");
@@ -73,7 +70,6 @@
        final String domName = dom.getName();
        final WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(
                new NullProcessor()
//                createACMEBotProcessor(em, dom)
            );
        final Config config = Config.getInstance();
        for (String queueName : config.getProperty("queues.mail").split(",")) {
@@ -350,23 +346,8 @@
        } else {
            return new ShellProcessor(
                    "sudo -u acmebot /usr/local/sbin/hs-lego-wrapper " + domName);            
//                    " && ln -s /etc/apache2/pems-generated/" + domName + ".key /etc/apache2/pems-enabled/" + domName + ".key" +
//                    " && ln -s /etc/apache2/pems-generated/" + domName + ".crt /etc/apache2/pems-enabled/" + domName + ".crt" +
//                    " && ln -s /etc/apache2/pems-generated/" + domName + ".chain /etc/apache2/pems-enabled/" + domName + ".chain" +
        }
    }
//    private Processor createACMEBotProcessor(final EntityManager em, final Domain dom) throws ProcessorException {
//        final Query query = em.createQuery("SELECT d FROM Domains d WHERE d.domainoptions.name = :option AND d.user.pac.hive.name = :hivename");
//        final String hiveName = dom.getHiveName();
//        final Map<String, Object> templateVars = new HashMap<String, Object>();
//        query.setParameter("hivename", hiveName);
//        query.setParameter("option", "letsencrypt");
//        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),
//                new ShellProcessor("mv /etc/hostsharing/acmebot/domain.properties.tmp /etc/hostsharing/acmebot/domain.properties"));
//    }
}