New domain options and properties for Debian Bookworm #1
@ -267,6 +267,10 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
|
|||||||
ifOption(templateVars, query, "passengerfriendlyerrorpages", Boolean.TRUE, Boolean.FALSE);
|
ifOption(templateVars, query, "passengerfriendlyerrorpages", Boolean.TRUE, Boolean.FALSE);
|
||||||
ifOption(templateVars, query, "cgi", Boolean.TRUE, Boolean.FALSE);
|
ifOption(templateVars, query, "cgi", Boolean.TRUE, Boolean.FALSE);
|
||||||
ifOption(templateVars, query, "fastcgi", Boolean.TRUE, Boolean.FALSE);
|
ifOption(templateVars, query, "fastcgi", Boolean.TRUE, Boolean.FALSE);
|
||||||
|
setPathInTemplate(templateVars, "passengerpython", "/usr/bin/python3", dom.getPassengerpython());
|
||||||
|
setPathInTemplate(templateVars, "passengernodejs", "/usr/bin/node", dom.getPassengernodejs());
|
||||||
|
setPathInTemplate(templateVars, "passengerruby", "/usr/bin/ruby", dom.getPassengerruby());
|
||||||
|
setPathInTemplate(templateVars, "fcgiphpbin", "/usr/bin/php", dom.getFcgiphpbin());
|
||||||
final boolean isSetLetsencryptOption = templateVars.get("letsencrypt").equals(Boolean.TRUE);
|
final boolean isSetLetsencryptOption = templateVars.get("letsencrypt").equals(Boolean.TRUE);
|
||||||
final Processor domSetupProcessor = new CompoundProcessor(
|
final Processor domSetupProcessor = new CompoundProcessor(
|
||||||
isSetLetsencryptOption ? new NullProcessor() : new ShellProcessor("rm -f /etc/apache2/pems-generated/" + domName + ".crt"),
|
isSetLetsencryptOption ? new NullProcessor() : new ShellProcessor("rm -f /etc/apache2/pems-generated/" + domName + ".crt"),
|
||||||
@ -296,6 +300,14 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
|
|||||||
return domSetupProcessor;
|
return domSetupProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setPathInTemplate(final Map<String, Object> templateVars, final String templateVariable, final String defaultPath, final String actualPath) {
|
||||||
|
String pathVariable = actualPath;
|
||||||
|
if (pathVariable == null || pathVariable.isEmpty()) {
|
||||||
|
pathVariable = defaultPath;
|
||||||
|
}
|
||||||
|
templateVars.put(templateVariable, pathVariable);
|
||||||
|
}
|
||||||
|
|
||||||
private void ifOption(Map<String, Object> templateVars, Query query, String option, Object optIsTrue, Object optIsFalse) {
|
private void ifOption(Map<String, Object> templateVars, Query query, String option, Object optIsTrue, Object optIsFalse) {
|
||||||
query.setParameter("option", option);
|
query.setParameter("option", option);
|
||||||
if (query.getResultList().isEmpty()) {
|
if (query.getResultList().isEmpty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user