From a100a21ce2b5826d50e4d19391cfc93aec1ee54d Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Wed, 6 May 2020 19:15:54 +0200 Subject: [PATCH] clean code --- .../mods/dom/DomainProcessorFactory.java | 9 +----- hsarback/src/de/hsadmin/mods/dom/zonefile.vm | 30 ------------------- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 hsarback/src/de/hsadmin/mods/dom/zonefile.vm diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index 82366f6..1a9da86 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -115,18 +115,11 @@ public class DomainProcessorFactory implements EntityProcessorFactory { } private Processor createHiveDNSSetupProcessor(EntityManager em, Domain dom) throws ProcessorException { - final Map zonefileTemplateVars = new HashMap(); - zonefileTemplateVars.put("sio", Long.toString(System.currentTimeMillis()/1000L)); final String domName = dom.getName(); final String zonefileTargetPath = "/etc/bind/pri." + domName; -// final Processor zonefileTemplateProcessor = -// new VelocityProcessor("/de/hsadmin/mods/dom/zonefile.vm", zonefileTemplateVars, dom, zonefileTargetPath, false); - final Processor getZonefileProcessor = new ShellProcessor("echo \"{DEFAULT_ZONEFILE}\" | /usr/local/sbin/gen-zonefile " + domName + " > " + zonefileTargetPath); - final Processor zonefileACLProcessor = - new ShellProcessor("chown root:bind " + zonefileTargetPath + " && chmod 644 " + zonefileTargetPath); - + new ShellProcessor("chown root:bind " + zonefileTargetPath + " && chmod 644 " + zonefileTargetPath); final String hiveName = dom.getUser().getHiveName(); final Query domsQuery = em.createQuery("SELECT d FROM Domains d WHERE d.user.pac.hive.name = :hivename"); domsQuery.setParameter("hivename", hiveName); diff --git a/hsarback/src/de/hsadmin/mods/dom/zonefile.vm b/hsarback/src/de/hsadmin/mods/dom/zonefile.vm deleted file mode 100644 index 7519bd5..0000000 --- a/hsarback/src/de/hsadmin/mods/dom/zonefile.vm +++ /dev/null @@ -1,30 +0,0 @@ -$TTL 6H -${dom.name}. IN SOA ${dom.dnsMaster}.hostsharing.net. hostmaster.hostsharing.net. ( - ${sio} ; serial secs since Jan 1 1970 - 6H ; refresh (>=10000) - 1H ; retry (>=1800) - 1W ; expire - 1H ; minimum -) - -${dom.name}. IN NS dns1.hostsharing.net. -${dom.name}. IN NS dns2.hostsharing.net. -${dom.name}. IN NS dns3.hostsharing.net. - -${dom.name}. IN MX 30 mailin1.hostsharing.net. -${dom.name}. IN MX 30 mailin2.hostsharing.net. -${dom.name}. IN MX 30 mailin3.hostsharing.net. - -${dom.name}. IN A ${pac.curINetAddr.inet4Addr} -${dom.name}. IN AAAA ${pac.curINetAddr.inet6Addr} - -${dom.name}. IN TXT "v=spf1 include:spf.hostsharing.net ?all" - -*.${dom.name}. IN MX 30 mailin1.hostsharing.net. -*.${dom.name}. IN MX 30 mailin2.hostsharing.net. -*.${dom.name}. IN MX 30 mailin3.hostsharing.net. - -*.${dom.name}. IN A ${pac.curINetAddr.inet4Addr} -*.${dom.name}. IN AAAA ${pac.curINetAddr.inet6Addr} - -*.${dom.name}. IN TXT "v=spf1 include:spf.hostsharing.net ?all"