clean code

This commit is contained in:
Peter Hormanns 2020-05-06 19:15:54 +02:00
parent d2e57c9752
commit a100a21ce2
2 changed files with 1 additions and 38 deletions

View File

@ -115,18 +115,11 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
} }
private Processor createHiveDNSSetupProcessor(EntityManager em, Domain dom) throws ProcessorException { private Processor createHiveDNSSetupProcessor(EntityManager em, Domain dom) throws ProcessorException {
final Map<String, Object> zonefileTemplateVars = new HashMap<String, Object>();
zonefileTemplateVars.put("sio", Long.toString(System.currentTimeMillis()/1000L));
final String domName = dom.getName(); final String domName = dom.getName();
final String zonefileTargetPath = "/etc/bind/pri." + domName; 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 getZonefileProcessor = new ShellProcessor("echo \"{DEFAULT_ZONEFILE}\" | /usr/local/sbin/gen-zonefile " + domName + " > " + zonefileTargetPath);
final Processor zonefileACLProcessor = 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 String hiveName = dom.getUser().getHiveName();
final Query domsQuery = em.createQuery("SELECT d FROM Domains d WHERE d.user.pac.hive.name = :hivename"); final Query domsQuery = em.createQuery("SELECT d FROM Domains d WHERE d.user.pac.hive.name = :hivename");
domsQuery.setParameter("hivename", hiveName); domsQuery.setParameter("hivename", hiveName);

View File

@ -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"