domain option letsencrypt

This commit is contained in:
Peter Hormanns 2017-06-21 11:18:54 +02:00
parent d7e8d6825f
commit d24c19f30a
7 changed files with 30 additions and 53 deletions

View File

@ -193,8 +193,8 @@ INSERT INTO domain_option (domain_option_name)
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

View File

@ -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 );

View File

@ -180,13 +180,4 @@ public class Domain extends AbstractEntity {
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();
}
}

View File

@ -21,16 +21,32 @@ import de.hsadmin.mods.user.UnixUser;
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 {

View File

@ -24,7 +24,7 @@ public class DomainOptionValues extends DefaultSelectableValues {
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;
}

View File

@ -258,7 +258,6 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
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);

View File

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