replace acmebot with lego, replace some deprecated code
This commit is contained in:
parent
64126e089e
commit
4b5fdd06ef
@ -8,23 +8,17 @@
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="lib/activemq-core-5.4.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-beanutils-1.8.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-dbcp-1.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-net2-2.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-pool-1.5.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/geronimo-j2ee-management_1.1_spec-1.0.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/geronimo-jms_1.1_spec-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/geronimo-jpa_2.0_spec-1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/geronimo-jta_1.1_spec-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/geronimo-validation_1.0_spec-1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/mail.jar"/>
|
||||
<classpathentry kind="lib" path="lib/openjpa-2.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/org.apache.bval.bundle-0.2-incubating.jar"/>
|
||||
<classpathentry kind="lib" path="lib/serp-1.13.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/servlet-api-2.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/ws-commons-util-1.0.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xmlrpc-client-3.1.3.jar"/>
|
||||
@ -32,8 +26,17 @@
|
||||
<classpathentry kind="lib" path="lib/xmlrpc-server-3.1.3.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="lib" path="lib/velocity-1.7.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-logging-api-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/hsadmin-util-4.0.1-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-beanutils-1.9.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-collections-3.2.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-lang3-3.9.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-pool-1.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/openjpa-2.4.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/org.apache.bval.bundle-0.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/serp-1.15.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xbean-asm6-shaded-4.8.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -46,7 +46,7 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
|
||||
}
|
||||
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, createACMEBotProcessor(em, dom), "Setup ACMEBot");
|
||||
mainProcessor.appendProcessor(hiveName, createTriggerAcmebotProcessor(em, dom), "Trigger ACMEBot");
|
||||
return mainProcessor;
|
||||
}
|
||||
@ -56,10 +56,11 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
|
||||
final UnixUser domUser = dom.getUser();
|
||||
final Pac pac = domUser.getPac();
|
||||
final Processor apacheVHostSetupProcessor = createApacheVHostSetupProcessor(em, dom);
|
||||
final Processor letencryptSetupProcessor = createACMEBotProcessor(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, letencryptSetupProcessor, triggerAcmebotProcessor));
|
||||
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");
|
||||
@ -71,7 +72,8 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
|
||||
final Domain dom = (Domain) entity;
|
||||
final String domName = dom.getName();
|
||||
final WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(
|
||||
createACMEBotProcessor(em, dom)
|
||||
new NullProcessor()
|
||||
// createACMEBotProcessor(em, dom)
|
||||
);
|
||||
final Config config = Config.getInstance();
|
||||
for (String queueName : config.getProperty("queues.mail").split(",")) {
|
||||
@ -347,27 +349,24 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
|
||||
return new NullProcessor();
|
||||
} else {
|
||||
return new ShellProcessor(
|
||||
"rm -f /etc/apache2/pems-enabled/" + domName + ".crt" +
|
||||
" && rm -f /etc/apache2/pems-enabled/" + domName + ".key" +
|
||||
" && rm -f /etc/apache2/pems-enabled/" + domName + ".chain" +
|
||||
" && 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" +
|
||||
" && sudo -u acmebot /usr/sbin/acmebot -d " + domName);
|
||||
"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"));
|
||||
}
|
||||
// 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"));
|
||||
// }
|
||||
|
||||
}
|
||||
|
@ -104,10 +104,10 @@ public class UnixUser extends AbstractEntity implements Serializable {
|
||||
shell = "/bin/false";
|
||||
}
|
||||
if (quotaSoftlimit == null) {
|
||||
quotaSoftlimit = new Integer(0);
|
||||
quotaSoftlimit = Integer.valueOf(0);
|
||||
}
|
||||
if (quotaHardlimit == null) {
|
||||
quotaHardlimit = new Integer(0);
|
||||
quotaHardlimit = Integer.valueOf(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
|
||||
private void appendSetQuotaProcessor(CompoundProcessor aCP, UnixUser user) {
|
||||
Integer quotaSoft = user.getQuotaSoftlimit();
|
||||
if (quotaSoft == null) {
|
||||
quotaSoft = new Integer(0);
|
||||
quotaSoft = Integer.valueOf(0);
|
||||
} else {
|
||||
quotaSoft = quotaSoft * 1024;
|
||||
}
|
||||
@ -90,7 +90,7 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
|
||||
}
|
||||
Integer quotaHard = user.getQuotaHardlimit();
|
||||
if (quotaHard == null) {
|
||||
quotaHard = new Integer(0);
|
||||
quotaHard = Integer.valueOf(0);
|
||||
} else {
|
||||
quotaHard = quotaHard * 1024;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.Query;
|
||||
|
@ -33,7 +33,7 @@ public class ModulePropertiesRemote implements IRemote {
|
||||
properties.load(resourceAsStream);
|
||||
for (Object moduleKey : properties.keySet()) {
|
||||
Class<?> remoteClass = Class.forName(properties.getProperty((String) moduleKey));
|
||||
Object newInstance = remoteClass.newInstance();
|
||||
Object newInstance = remoteClass.getDeclaredConstructor().newInstance();
|
||||
if (newInstance instanceof AbstractRemote) {
|
||||
Map<String,Object> modMap = new HashMap<String, Object>();
|
||||
modMap.put("module", moduleKey);
|
||||
@ -58,7 +58,7 @@ public class ModulePropertiesRemote implements IRemote {
|
||||
String fullPropertyName = fieldName+"."+s;
|
||||
propertiesList.add(createReferredPropertyInfo(fullPropertyName, f, s));
|
||||
}
|
||||
DefaultSelectableValues selectableValuesInstance = fieldIO.selectableValues().newInstance() ;
|
||||
DefaultSelectableValues selectableValuesInstance = fieldIO.selectableValues().getDeclaredConstructor().newInstance();
|
||||
KindOfSelectableValue kind = selectableValuesInstance.getkind();
|
||||
HashMap<String,Object> kindMap = new HashMap<String,Object>();
|
||||
kindMap.put("kind", kind.name());
|
||||
|
@ -31,7 +31,7 @@ public class PropertyRemote implements IRemote {
|
||||
properties.load(resourceAsStream);
|
||||
for (Object moduleKey : properties.keySet()) {
|
||||
Class<?> remoteClass = Class.forName(properties.getProperty((String) moduleKey));
|
||||
Object newInstance = remoteClass.newInstance();
|
||||
Object newInstance = remoteClass.getDeclaredConstructor().newInstance();
|
||||
if (newInstance instanceof AbstractRemote) {
|
||||
AbstractRemote remote = (AbstractRemote) newInstance;
|
||||
Class<? extends AbstractEntity> entityClass = remote.getAnnotatedEntityClass();
|
||||
|
Loading…
Reference in New Issue
Block a user