From c1ecf8794ad79f0a9c2de09ae3c856b9e2b52aea Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Thu, 20 Sep 2012 18:16:25 +0200 Subject: [PATCH 1/3] pac.add: Create .bak directory, refresh traffic accounting rules pac.delete: Refresh traffic accounting rules --- .../src/de/hsadmin/mods/pac/PacProcessorFactory.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java index f55b656..04e135a 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java @@ -46,12 +46,17 @@ public class PacProcessorFactory implements EntityProcessorFactory { createProftpdConfProc(hiveValues, pacValuesList), createMakePacDirectoryStructure(unixUser), createIfUp(pacName), - createHttpdVirtualProc(pacName, pacValuesList)); + createHttpdVirtualProc(pacName, pacValuesList), + createAccountingRulesProc()); WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor); // secProcessor.appendProcessor(pac.getHiveName(), createSendEMailProc(pacName, customerEMail, emailVars), "send email to customer"); return secProcessor; } + private Processor createAccountingRulesProc() { + return new ShellProcessor("mk-iptables-rules Accounting"); + } + private Processor createHttpdVirtualProc( String pacName, List> pacValuesList) throws ProcessorException { Processor domSetupProcessor = new CompoundProcessor( @@ -85,7 +90,8 @@ public class PacProcessorFactory implements EntityProcessorFactory { createNetworkInterfacesProc(hiveValues, pacValuesList), createSudouersProc(hiveValues, pacValuesList), createProftpdConfProc(hiveValues, pacValuesList), - createHttpdVirtualProc(pac.getName(), pacValuesList))); + createHttpdVirtualProc(pac.getName(), pacValuesList), + createAccountingRulesProc())); waitingProcessor.appendProcessor(pac.getHiveName(), createDelUserProc(pac.getName()), "remove packet"); return waitingProcessor; } @@ -155,11 +161,13 @@ public class PacProcessorFactory implements EntityProcessorFactory { String username = unixUser.getName(); return new ShellProcessor("chmod 711 " + homedir + " && " + "su -l " + username + " -s \"/bin/bash\" -c \"mkdir -p " + + homedir + "/.bak " + homedir + "/doms " + homedir + "/etc " + homedir + "/users " + homedir + "/var " + "\" && " + + "chmod 0700 " + homedir + "/.bak && " + "chown httpd " + homedir + "/doms && " + "chmod 1550 " + homedir + "/doms && " + "chmod 2700 " + homedir + "/etc && " + From 58b9c96c7610c1e52bbcde1ce1a2e2fc578e057d Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Thu, 20 Sep 2012 18:16:40 +0200 Subject: [PATCH 2/3] Whitespace --- hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl | 4 ++++ hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl | 3 +++ hsarback/src/de/hsadmin/mods/dom/index.html.jtpl | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl index 7ff5764..63722b4 100644 --- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl @@ -42,12 +42,14 @@ RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last] + RewriteCond %{REQUEST_URI} !^/cgi-bin/ RewriteCond %{REQUEST_URI} !^/fastcgi-bin/ RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d RewriteRule ^(.*) - [redirect=404,last] + AddType application/x-httpd-php .php .php5 .php4 .php3 Action application/x-httpd-php /fastcgi-bin/phpstub @@ -100,12 +102,14 @@ RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} -d RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1}$1 [last] + RewriteCond %{REQUEST_URI} !^/cgi-bin/ RewriteCond %{REQUEST_URI} !^/fastcgi-bin/ RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d RewriteRule ^(.*) - [redirect=404,last] + AddType application/x-httpd-php .php .php5 .php4 .php3 Action application/x-httpd-php /fastcgi-bin/phpstub diff --git a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl index 0f0cc6e..3079099 100644 --- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl @@ -35,9 +35,11 @@ RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last] + RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d RewriteRule ^(.*) - [redirect=404,last] + @@ -84,6 +86,7 @@ RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d RewriteRule ^(.*) - [redirect=404,last] + \ No newline at end of file diff --git a/hsarback/src/de/hsadmin/mods/dom/index.html.jtpl b/hsarback/src/de/hsadmin/mods/dom/index.html.jtpl index b55e909..08d1a9d 100644 --- a/hsarback/src/de/hsadmin/mods/dom/index.html.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/index.html.jtpl @@ -10,11 +10,11 @@

Diese neue Website wurde gerade bei der Hostsharing eG -für {USER_NAME} eingerichtet.

+für {USER_NAME} eingerichtet.

Der Inhaber der Domain ist bereits per Email unter webmaster(at){DOMAIN} -zu erreichen.

+zu erreichen.

From 968560db41934a4c27f66c5130598fe89760336b Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Thu, 20 Sep 2012 18:50:00 +0200 Subject: [PATCH 3/3] Virtual Host Templates: ServerAdmin webmaster@ cgi+fastcgi: Location => Directory --- .../src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl | 10 +++++----- .../src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl index 63722b4..e8d7af6 100644 --- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl @@ -7,7 +7,7 @@ ServerName {DOM_HOSTNAME} ServerAlias *.{DOM_HOSTNAME} - ServerAdmin {DOM_USERNAME}@{HIVE}.hostsharing.net + ServerAdmin webmaster@{DOM_HOSTNAME} SuexecUserGroup {DOM_USERNAME} {PAC} @@ -24,15 +24,15 @@ AllowOverride AuthConfig FileInfo Indexes Limit - + SetHandler cgi-script Options +ExecCGI -Indexes -MultiViews - + - + SetHandler fcgid-script Options +ExecCGI -Indexes -MultiViews - + RewriteEngine On RewriteOptions Inherit diff --git a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl index 3079099..4a2cb1c 100644 --- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl @@ -7,7 +7,7 @@ ServerName {DOM_HOSTNAME} ServerAlias *.{DOM_HOSTNAME} - ServerAdmin {DOM_USERNAME}@{HIVE}.hostsharing.net + ServerAdmin webmaster@{DOM_HOSTNAME} SuexecUserGroup {DOM_USERNAME} {PAC} @@ -21,13 +21,13 @@ AllowOverride AuthConfig FileInfo Indexes Limit - + Redirect 501 / - + - + Redirect 501 / - + RewriteEngine On RewriteOptions Inherit