remove certs on domain remove

This commit is contained in:
Peter Hormanns 2017-06-28 15:01:45 +02:00
parent 5de9f974d1
commit b22842eb7d

View File

@ -79,16 +79,9 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
} }
mainProcessor.appendProcessor(dom.getHiveName(), createApacheVHostDeleteProcessor(dom), "remove apache vhost"); mainProcessor.appendProcessor(dom.getHiveName(), createApacheVHostDeleteProcessor(dom), "remove apache vhost");
mainProcessor.appendProcessor(dom.getHiveName(), createACMEBotProcessor(em, dom), "remove letsencrypt config"); mainProcessor.appendProcessor(dom.getHiveName(), createACMEBotProcessor(em, dom), "remove letsencrypt config");
mainProcessor.appendProcessor(dom.getHiveName(), createRemoveCertsProcessor(dom), "remove letsencrypt certs");
return mainProcessor; return mainProcessor;
} }
private ShellProcessor createRemoveCertsProcessor(Domain dom) {
return new ShellProcessor("rm -f /etc/apache2/pems-generated/" + dom.getName() + ".crt && "
+ "rm -f /etc/apache2/pems-generated/" + dom.getName() + ".key && "
+ "rm -f /etc/apache2/pems-generated/" + dom.getName() + ".chain ");
}
private Processor createDNSServerConfigProcessor(EntityManager em) { private Processor createDNSServerConfigProcessor(EntityManager em) {
Query query = em.createQuery("SELECT d FROM Domains d"); Query query = em.createQuery("SELECT d FROM Domains d");
HashMap<String, Object> templateVars = new HashMap<String, Object>(); HashMap<String, Object> templateVars = new HashMap<String, Object>();
@ -325,9 +318,9 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
" && rm -f /etc/apache2/pems-enabled/" + domName + ".crt" + " && rm -f /etc/apache2/pems-enabled/" + domName + ".crt" +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".key" + " && rm -f /etc/apache2/pems-enabled/" + domName + ".key" +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".chain" + " && rm -f /etc/apache2/pems-enabled/" + domName + ".chain" +
" && rm -f /etc/apache2/pems-generated/_." + domName + ".crt" + " && rm -f /etc/apache2/pems-generated/" + domName + ".crt" +
" && rm -f /etc/apache2/pems-generated/_." + domName + ".key" + " && rm -f /etc/apache2/pems-generated/" + domName + ".key" +
" && rm -f /etc/apache2/pems-generated/_." + domName + ".chain" + " && rm -f /etc/apache2/pems-generated/" + domName + ".chain" +
" && rm -rf " + dom.getUser().getHomedir() + "/doms/" + domName + " && rm -rf " + dom.getUser().getHomedir() + "/doms/" + domName +
" && invoke-rc.d apache2 reload >/dev/null 2>&1"); " && invoke-rc.d apache2 reload >/dev/null 2>&1");
return vhostDelProcessor; return vhostDelProcessor;