From f539c87aea067c4506fa4f02f6f32e57f59ede94 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Tue, 19 Dec 2023 20:37:03 +0100 Subject: [PATCH] group domainoptions --- db-migration/pom.xml | 6 ++ pom.xml | 2 +- .../de/hsadmin/web/DomainOptionsEditor.java | 72 +++++++++++++++---- .../de/hsadmin/web/GenericEditorFactory.java | 16 +++-- .../de/hsadmin/web/main_de.properties | 2 +- .../de/hsadmin/web/main_es.properties | 4 ++ 6 files changed, 81 insertions(+), 21 deletions(-) diff --git a/db-migration/pom.xml b/db-migration/pom.xml index 9d51e14..6fd00fa 100644 --- a/db-migration/pom.xml +++ b/db-migration/pom.xml @@ -40,6 +40,12 @@ + + org.apache.maven.plugins + maven-war-plugin + 2.2 + + diff --git a/pom.xml b/pom.xml index 7cf0b84..4010065 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ UTF-8 1.0.4 - 8.0.16 + 9.1.1 4.0.1 4.17.2 3.2.2 diff --git a/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java b/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java index 2732a18..ba93b65 100644 --- a/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java +++ b/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java @@ -9,6 +9,7 @@ import java.util.Map; import com.vaadin.v7.data.Validator; import com.vaadin.v7.ui.CheckBox; import com.vaadin.ui.CustomComponent; +import com.vaadin.ui.Label; import com.vaadin.v7.ui.VerticalLayout; import de.hsadmin.rpc.HSAdminSession; @@ -18,17 +19,23 @@ public class DomainOptionsEditor extends CustomComponent implements IHSEditor { private static final long serialVersionUID = 2L; - private static final String[] OPTIONS = + private static final String[] EMAIL_OPTIONS = new String[] { "greylisting", "autoconfig", "dkim", - "backupmxforexternalmx", + "backupmxforexternalmx" + }; + private static final String[] APACHE_OPTIONS = + new String[] { "multiviews", "indexes", "htdocsfallback", "includes", - "letsencrypt", + "letsencrypt" + }; + private static final String[] SCRIPTING_OPTIONS = + new String[] { "cgi", "fastcgi", "passenger", @@ -37,17 +44,34 @@ public class DomainOptionsEditor extends CustomComponent implements IHSEditor { private final PropertyInfo propertyInfo; private final VerticalLayout layout; - private final Map checkboxes; + private final Map emailCheckboxes; + private final Map apacheCheckboxes; + private final Map scriptingCheckboxes; public DomainOptionsEditor(final PropertyInfo propertyInfo, final HSAdminSession session, final Map whereContext) { - this.checkboxes = new HashMap<>(); + this.emailCheckboxes = new HashMap<>(); + this.apacheCheckboxes = new HashMap<>(); + this.scriptingCheckboxes = new HashMap<>(); this.propertyInfo = propertyInfo; final I18N i18n = session.getI18N(); this.setCaption(i18n.getText(propertyInfo.getName())); layout = new VerticalLayout(); - for (String opt : OPTIONS) { + layout.addComponent(new Label("E-Mail-Optionen")); + for (String opt : EMAIL_OPTIONS) { final CheckBox checkBox = new CheckBox(i18n.getText("domainoption." + opt)); - checkboxes.put(opt, checkBox); + emailCheckboxes.put(opt, checkBox); + layout.addComponent(checkBox); + } + layout.addComponent(new Label("Apache-Webserver-Optionen")); + for (String opt : APACHE_OPTIONS) { + final CheckBox checkBox = new CheckBox(i18n.getText("domainoption." + opt)); + apacheCheckboxes.put(opt, checkBox); + layout.addComponent(checkBox); + } + layout.addComponent(new Label("Apache-Scripting-Optionen")); + for (String opt : SCRIPTING_OPTIONS) { + final CheckBox checkBox = new CheckBox(i18n.getText("domainoption." + opt)); + scriptingCheckboxes.put(opt, checkBox); layout.addComponent(checkBox); } layout.setCaption(i18n.getText(propertyInfo.getName())); @@ -58,14 +82,26 @@ public class DomainOptionsEditor extends CustomComponent implements IHSEditor { public void setValues(final Map valuesMap) { final Object optionsObject = valuesMap.get(propertyInfo.getName()); if (optionsObject == null) { - for (String opt : OPTIONS) { - checkboxes.get(opt).setValue(!"backupmxforexternalmx".equals(opt)); + for (String opt : EMAIL_OPTIONS) { + emailCheckboxes.get(opt).setValue(!"backupmxforexternalmx".equals(opt)); + } + for (String opt : APACHE_OPTIONS) { + apacheCheckboxes.get(opt).setValue("letsencrypt".equals(opt)); + } + for (String opt : SCRIPTING_OPTIONS) { + scriptingCheckboxes.get(opt).setValue("fastcgi".equals(opt)); } } if (optionsObject instanceof Object[]) { final List options = Arrays.asList((Object[]) optionsObject); - for (String opt : OPTIONS) { - checkboxes.get(opt).setValue(options.contains(opt)); + for (String opt : EMAIL_OPTIONS) { + emailCheckboxes.get(opt).setValue(options.contains(opt)); + } + for (String opt : APACHE_OPTIONS) { + apacheCheckboxes.get(opt).setValue(options.contains(opt)); + } + for (String opt : SCRIPTING_OPTIONS) { + scriptingCheckboxes.get(opt).setValue(options.contains(opt)); } } } @@ -73,8 +109,18 @@ public class DomainOptionsEditor extends CustomComponent implements IHSEditor { @Override public Object getValue() { final List values = new ArrayList<>(); - for (final String opt : OPTIONS) { - if (checkboxes.get(opt).getValue()) { + for (final String opt : EMAIL_OPTIONS) { + if (emailCheckboxes.get(opt).getValue()) { + values.add(opt); + } + } + for (final String opt : APACHE_OPTIONS) { + if (apacheCheckboxes.get(opt).getValue()) { + values.add(opt); + } + } + for (final String opt : SCRIPTING_OPTIONS) { + if (scriptingCheckboxes.get(opt).getValue()) { values.add(opt); } } diff --git a/web/src/main/java/de/hsadmin/web/GenericEditorFactory.java b/web/src/main/java/de/hsadmin/web/GenericEditorFactory.java index d1b7240..98ce5a5 100644 --- a/web/src/main/java/de/hsadmin/web/GenericEditorFactory.java +++ b/web/src/main/java/de/hsadmin/web/GenericEditorFactory.java @@ -38,11 +38,14 @@ public class GenericEditorFactory implements IEditorFactory, Serializable { if ("user".equals(inputName)) { return getSelectFromRemote(action, propertyInfo, session, "user", whereContext); } + if ("validsubdomainnames".equals(inputName)) { + return getValidsubdomainnamesEditor(action, propertyInfo); + } if ("domainoptions".equals(inputName)) { return getDomainOptionsEditor(action, propertyInfo, session, whereContext); } - if ("validsubdomainnames".equals(inputName)) { - return getValidsubdomainnamesEditor(action, propertyInfo, session, whereContext); + if ("passengerpython".equals(inputName)|"passengernodejs".equals(inputName)|"passengerruby".equals(inputName)|"fcgiphpbin".equals(inputName)) { + return getScriptingPathEditor(action, propertyInfo); } } if ("emailaddress".equals(module) || "emailalias".equals(module)) { @@ -73,12 +76,13 @@ public class GenericEditorFactory implements IEditorFactory, Serializable { return getEditor(action, propertyInfo); } - - private IHSEditor getValidsubdomainnamesEditor(final String action, final PropertyInfo propertyInfo, final HSAdminSession session, - final Map whereContext) { + private IHSEditor getValidsubdomainnamesEditor(final String action, final PropertyInfo propertyInfo) { return PanelToolbar.ACTION_EDIT.equals(action) ? getEditor(action, propertyInfo) : new NullEditor(); } + private IHSEditor getScriptingPathEditor(final String action, final PropertyInfo propertyInfo) { + return PanelToolbar.ACTION_EDIT.equals(action) ? getEditor(action, propertyInfo) : new NullEditor(); + } private IHSEditor getDomainOptionsEditor(final String action, final PropertyInfo propertyInfo, final HSAdminSession session, final Map whereContext) { return PanelToolbar.ACTION_EDIT.equals(action) ? new DomainOptionsEditor(propertyInfo, session, whereContext) : new NullEditor(); @@ -161,7 +165,7 @@ public class GenericEditorFactory implements IEditorFactory, Serializable { private IHSEditor getShellSelect(final String action, final PropertyInfo propertyInfo) { - final String[] items = new String[] { "/bin/false", "/bin/bash", "/bin/csh", "/bin/dash", "/bin/ksh", "/bin/tcsh", "/bin/zsh", "/usr/bin/passwd", "/usr/bin/scponly" }; + final String[] items = new String[] { "/bin/false", "/bin/bash", "/bin/csh", "/bin/dash", "/usr/bin/tcsh", "/usr/bin/zsh", "/usr/bin/passwd" }; final HSSelect field = new HSSelect(i18n, propertyInfo, 7, Arrays.asList(items)); field.setWidth("100%"); field.setEnabled(isWriteAble(propertyInfo, action)); diff --git a/web/src/main/resources/de/hsadmin/web/main_de.properties b/web/src/main/resources/de/hsadmin/web/main_de.properties index 5313250..c4b7003 100644 --- a/web/src/main/resources/de/hsadmin/web/main_de.properties +++ b/web/src/main/resources/de/hsadmin/web/main_de.properties @@ -49,7 +49,7 @@ domainoption.letsencrypt=Let's Encrypt-Zertifikat domainoption.autoconfig=E-Mail Auto-Konfiguration domainoption.dkim=Domain Key - DKIM domainoption.cgi=CGI-Funktion aktiv -domainoption.fastcgi=FastCGI-Funltion aktiv +domainoption.fastcgi=FastCGI-Funktion aktiv domainoption.passenger=Passenger-Modul aktiv domainoption.passengerfriendlyerrorpages=Passenger Debug-Modus aktiv mysqluser.name=MySQL-Benutzer diff --git a/web/src/main/resources/de/hsadmin/web/main_es.properties b/web/src/main/resources/de/hsadmin/web/main_es.properties index a76409f..fbb0000 100644 --- a/web/src/main/resources/de/hsadmin/web/main_es.properties +++ b/web/src/main/resources/de/hsadmin/web/main_es.properties @@ -44,6 +44,10 @@ domainoption.backupmxforexternalmx=backupmxforexternalmx domainoption.letsencrypt=letsencrypt domainoption.autoconfig=email autoconfig and autodiscover domainoption.dkim=domain key - dkim +domainoption.cgi=enable CGI +domainoption.fastcgi=enable FastCGI +domainoption.passenger=enable passenger module +domainoption.passengerfriendlyerrorpages=enable passenger error page mysqluser.name=Nombre de usuario MySql mysqluser.instance=Instancia de MySql mysqluser.pac=Paquete de usuario MySql