HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2017-06-21 d24c19f30ac7347eb5c1b4034a6de2254ad45968
domain option letsencrypt
7 files modified
83 ■■■■■ changed files
hsarback/database/data.sql 4 ●●●● patch | view | raw | blame | history
hsarback/database/database_update.sql 4 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/Domain.java 9 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java 26 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainOptionValues.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 1 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm 37 ●●●●● patch | view | raw | blame | history
hsarback/database/data.sql
@@ -193,8 +193,8 @@
    VALUES ('indexes');
INSERT INTO domain_option (domain_option_name)
    VALUES ('multiviews');
INSERT INTO domain_option (domain_option_name)
    VALUES ('php');
INSERT INTO domain_option (domain_option_name)
    VALUES ('letsencrypt');
--
-- table: price_list
hsarback/database/database_update.sql
@@ -1,4 +1,6 @@
INSERT INTO domain_option (domain_option_name)
    VALUES ('greylisting');
INSERT INTO contactrole_ref (contact_id, role) 
    ( SELECT contact_id, 'voting-right' FROM contact );
    
hsarback/src/de/hsadmin/mods/dom/Domain.java
@@ -180,13 +180,4 @@
        this.domainoptions = domainOptions;
    }
    public boolean isDynamic() {
        String basepacName = getUser().getPac().getBasepac().getName();
        return isPacDomain() || basepacName.equals(BasePacType.PAC_DW) || basepacName.equals(BasePacType.PAC_WEB);
    }
    public boolean isStatic() {
        return !isDynamic();
    }
}
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java
@@ -21,16 +21,32 @@
public class DomainModuleImpl extends AbstractModuleImpl {
    
    public static final String DOMOPT_GREYLISTING = "greylisting";
    public static final String DOMMULTIVIEWS = "multiviews";
    public static final String DOMOPT_MULTIVIEWS = "multiviews";
    public static final String DOMOPT_INDEXES = "indexes";
    public static final String DOMOPT_HTDOCSFALLBACK = "htdocsfallback";
    public static final String DOMOPT_INCLUDES = "includes";
    public static final String DOMOPT_BACKUPFOREXTERNALMX = "backupmxforexternalmx";
    public static final String DOMOPT_LETSENCRYPT = "letsencrypt";
    
    public static final String[] ALL_DOMOPTS = new String[] { DOMOPT_GREYLISTING, DOMMULTIVIEWS,
        DOMOPT_INDEXES, DOMOPT_HTDOCSFALLBACK, DOMOPT_INCLUDES, DOMOPT_BACKUPFOREXTERNALMX };
    public static final String[] DEFAULT_DOMOPTS = new String[] { DOMOPT_GREYLISTING, DOMMULTIVIEWS,
        DOMOPT_INDEXES, DOMOPT_HTDOCSFALLBACK, DOMOPT_INCLUDES };
    public static final String[] ALL_DOMOPTS =
            new String[] {
                    DOMOPT_GREYLISTING,
                    DOMOPT_MULTIVIEWS,
                    DOMOPT_INDEXES,
                    DOMOPT_HTDOCSFALLBACK,
                    DOMOPT_INCLUDES,
                    DOMOPT_BACKUPFOREXTERNALMX,
                    DOMOPT_LETSENCRYPT
            };
    public static final String[] DEFAULT_DOMOPTS =
            new String[] {
                    DOMOPT_GREYLISTING,
                    DOMOPT_MULTIVIEWS,
                    DOMOPT_INDEXES,
                    DOMOPT_HTDOCSFALLBACK,
                    DOMOPT_INCLUDES,
                    DOMOPT_LETSENCRYPT
            };
    @Override
    public AbstractEntity initialize(AbstractEntity newEntity) throws AuthorisationException {
hsarback/src/de/hsadmin/mods/dom/DomainOptionValues.java
@@ -24,7 +24,7 @@
        list.add(new BooleanListValue("includes"));
        list.add(new BooleanListValue("indexes"));
        list.add(new BooleanListValue("multiviews"));
//        list.add(new BooleanListValue("php"));
        list.add(new BooleanListValue("letsencrypt"));
        return list;
    }
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -258,7 +258,6 @@
    private Processor createApacheVHostSetupProcessor(final EntityManager em, final Domain dom)  throws ProcessorException {
        final Map<String, Object> templateVars = new HashMap<String, Object>();
        templateVars.put("dynamicWeb", new Boolean(dom.isDynamic()));
        final String domName = dom.getName();
        int level = domName.split("\\.").length;
        final String linkPrefix = Integer.toString(100 - level);
hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
@@ -10,12 +10,10 @@
    SuexecUserGroup ${dom.user.name} ${pac.name}
#if( ${dynamicWeb} )
    PassengerEnabled on
    PassengerUser ${dom.user.name}
    PassengerGroup ${pac.name}
    PassengerAppRoot /home/doms/${dom.name}/app/
#end
    DocumentRoot /home/doms/${dom.name}/htdocs
@@ -30,27 +28,15 @@
        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
    </Directory>
#if( ${dynamicWeb} )
    <Location /cgi-bin/>
        SetHandler cgi-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
#else
    <Location /cgi-bin/>
        Redirect 501 /
    </Location>
#end
#if( ${dynamicWeb} )
    <Location /fastcgi-bin/>
        SetHandler fcgid-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
#else
    <Location /fastcgi-bin/>
        Redirect 501 /
    </Location>
#end
    RewriteEngine On
    RewriteOptions Inherit
@@ -67,12 +53,10 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:80)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d
    RewriteRule ^(.*) - [redirect=404,last]
#end
#if( ${dynamicWeb} )
 #end
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
#end
</VirtualHost>
<VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443>
@@ -82,12 +66,10 @@
    SuexecUserGroup ${dom.user.name} ${pac.name}
    
#if( ${dynamicWeb} )
    PassengerEnabled on
    PassengerUser ${dom.user.name}
    PassengerGroup ${pac.name}
    PassengerAppRoot /home/doms/${dom.name}/app-ssl/
#end
    SSLEngine On
    SSLCertificateFile /etc/apache2/pems-enabled/${dom.name}.crt
@@ -108,27 +90,15 @@
        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
    </Directory>
#if( ${dynamicWeb} )
    <Location /cgi-bin/>
        SetHandler cgi-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
#else
    <Location /cgi-bin/>
        Redirect 501 /
    </Location>
#end
#if( ${dynamicWeb} )
    <Location /fastcgi-bin/>
        SetHandler fcgid-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
#else
    <Location /fastcgi-bin/>
        Redirect 501 /
    </Location>
#end
    
    RewriteEngine On
    RewriteOptions Inherit
@@ -147,8 +117,7 @@
    RewriteRule ^(.*) - [redirect=404,last]
#end
#if( ${dynamicWeb} )
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
#end
</VirtualHost>