From 400c14a23e4e49f94de6f207d09d5c0633de6f76 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Thu, 20 Sep 2012 17:21:04 +0200 Subject: [PATCH 1/5] merged --- .../mods/dom/DomainProcessorFactory.java | 4 +- .../hsadmin/mods/dom/httpd-vhost-dynamic.jtpl | 19 +++-- .../hsadmin/mods/dom/httpd-vhost-static.jtpl | 12 ++-- .../dom/postgrey-whitelist-recipients.jtpl | 8 ++- .../hsadmin/mods/pac/PacProcessorFactory.java | 21 +++++- .../mods/pac/email_new_pac_account.jtpl | 71 ------------------- hsarback/src/de/hsadmin/mods/pac/hosts.jtpl | 7 +- .../de/hsadmin/mods/pac/httpd-virtual.jtpl | 28 ++++++++ .../src/de/hsadmin/mods/pac/interfaces.jtpl | 7 +- .../src/de/hsadmin/mods/pac/proftpd-conf.jtpl | 9 ++- hsarback/src/de/hsadmin/mods/pac/sudoers.jtpl | 8 ++- 11 files changed, 97 insertions(+), 97 deletions(-) delete mode 100644 hsarback/src/de/hsadmin/mods/pac/email_new_pac_account.jtpl create mode 100644 hsarback/src/de/hsadmin/mods/pac/httpd-virtual.jtpl diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index ead2757..23dade5 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -311,10 +311,10 @@ public class DomainProcessorFactory implements EntityProcessorFactory { } Processor domSetupProcessor = new CompoundProcessor( createDomainDirectoriesProcessor(dom, templateVars), - new CreateFileProcessor(selectVHostTemplate(dom), templateVars, "/etc/apache2/sites-available/" + domName + ".tmp", "root", "root", "644", true), + new CreateFileProcessor(selectVHostTemplate(dom), templateVars, iterateMaps.iterator(), "/etc/apache2/sites-available/" + domName + ".tmp", "root", "root", "644", true), new ShellProcessor("ls /etc/apache2/pems/" + pac + ".pem >/dev/null 2>&1 " + "&& sed -i '/SSLCertificate.*default/d' " + "/etc/apache2/sites-available/" + domName + ".tmp" + - " && (ls /etc/apache2/pems/" + pac + ".chain.pem >/dev/null 2>&1 || sed -i '/SSLCertificateChain.*" + pac + "/d' " + "/etc/apache2/sites-available/" + domName + ")" + + " && (ls /etc/apache2/pems/" + pac + ".chain.pem >/dev/null 2>&1 || sed -i '/SSLCertificateChain.*" + pac + "/d' " + "/etc/apache2/sites-available/" + domName + ".tmp )" + " || sed -i '/SSLCertificate.*" + pac + "/d' " + "/etc/apache2/sites-available/" + domName + ".tmp"), new ShellProcessor( " ( diff -q /etc/apache2/sites-available/" + domName + ".tmp /etc/apache2/sites-available/" + domName + " && rm /etc/apache2/sites-available/" + domName + ".tmp ) " + 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 3598247..7ff5764 100644 --- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl @@ -1,4 +1,9 @@ - +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# + + ServerName {DOM_HOSTNAME} ServerAlias *.{DOM_HOSTNAME} @@ -37,8 +42,8 @@ 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} !^/cgi-bin/ RewriteCond %{REQUEST_URI} !^/fastcgi-bin/ RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary] RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d @@ -95,14 +100,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} !^/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 + + 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 c6982a4..0f0cc6e 100644 --- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl @@ -1,4 +1,9 @@ - +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# + + ServerName {DOM_HOSTNAME} ServerAlias *.{DOM_HOSTNAME} @@ -30,7 +35,6 @@ 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] @@ -80,6 +84,6 @@ 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/postgrey-whitelist-recipients.jtpl b/hsarback/src/de/hsadmin/mods/dom/postgrey-whitelist-recipients.jtpl index e787e1c..d948b97 100644 --- a/hsarback/src/de/hsadmin/mods/dom/postgrey-whitelist-recipients.jtpl +++ b/hsarback/src/de/hsadmin/mods/dom/postgrey-whitelist-recipients.jtpl @@ -1,10 +1,12 @@ -### Do not edit this file manually -### Generated by HSAdmin Queue Server +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# abuse@ postmaster@ -################################################################################ +#################################################### {DOM} diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java index 9ded029..f55b656 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java @@ -16,6 +16,7 @@ import de.hsadmin.core.qserv.Processor; import de.hsadmin.core.qserv.ProcessorException; import de.hsadmin.core.qserv.ShellProcessor; import de.hsadmin.core.qserv.TemplateProcessor; +import de.hsadmin.core.qserv.CreateFileProcessor; import de.hsadmin.core.qserv.WaitingTasksProcessor; import de.hsadmin.core.util.Config; import de.hsadmin.core.util.PasswordTool; @@ -44,12 +45,27 @@ public class PacProcessorFactory implements EntityProcessorFactory { createSudouersProc(hiveValues, pacValuesList), createProftpdConfProc(hiveValues, pacValuesList), createMakePacDirectoryStructure(unixUser), - createIfUp(pacName)); + createIfUp(pacName), + createHttpdVirtualProc(pacName, pacValuesList)); WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor); // secProcessor.appendProcessor(pac.getHiveName(), createSendEMailProc(pacName, customerEMail, emailVars), "send email to customer"); return secProcessor; } + private Processor createHttpdVirtualProc( + String pacName, List> pacValuesList) throws ProcessorException { + Processor domSetupProcessor = new CompoundProcessor( + new CreateFileProcessor("/de/hsadmin/mods/pac/httpd-virtual.jtpl", new HashMap(), pacValuesList.iterator(), "/etc/apache2/virtual.conf.tmp", "root", "root", "644", true), + new ShellProcessor("ls /etc/apache2/pems/" + pacName + ".pem >/dev/null 2>&1 " + "&& sed -i '/SSLCertificate.*default/d' " + "/etc/apache2/apache.conf.tmp" + + " && (ls /etc/apache2/pems/" + pacName + ".chain.pem >/dev/null 2>&1" + + " || sed -i '/SSLCertificateChain.*" + pacName + "/d' " + "/etc/apache2/virtual.conf.tmp)" + + " || sed -i '/SSLCertificate.*" + pacName + "/d' " + "/etc/apache2/virtual.conf.tmp"), + new ShellProcessor("(diff -q /etc/apache2/apache.conf.tmp /etc/apache2/apache.conf" + + " && rm /etc/apache2/apache.conf.tmp)" + + " || invoke-rc.d apache2 reload >/dev/null 2>&1")); + return domSetupProcessor; + } + @Override public Processor createUpdateProcessor(EntityManager em, T entity) throws ProcessorException { @@ -68,7 +84,8 @@ public class PacProcessorFactory implements EntityProcessorFactory { createEtcHostsProc(hiveValues, pacValuesList), createNetworkInterfacesProc(hiveValues, pacValuesList), createSudouersProc(hiveValues, pacValuesList), - createProftpdConfProc(hiveValues, pacValuesList))); + createProftpdConfProc(hiveValues, pacValuesList), + createHttpdVirtualProc(pac.getName(), pacValuesList))); waitingProcessor.appendProcessor(pac.getHiveName(), createDelUserProc(pac.getName()), "remove packet"); return waitingProcessor; } diff --git a/hsarback/src/de/hsadmin/mods/pac/email_new_pac_account.jtpl b/hsarback/src/de/hsadmin/mods/pac/email_new_pac_account.jtpl deleted file mode 100644 index 3d8396f..0000000 --- a/hsarback/src/de/hsadmin/mods/pac/email_new_pac_account.jtpl +++ /dev/null @@ -1,71 +0,0 @@ -Das neue Hostsharing Paket {PAC} ist eingerichtet. -Die Zugangsdaten sind: - - Hostname (HTTP, FTP, SSH, POP3, IMAP): {PAC}.hostsharing.net - Benutzernamen (Paket-Admin-Account): {PAC} - Passwort: {PASSWORD} - -Wir bitten zu beruecksichtigen, dass man mit diesem Passwort sehr viel -Macht ueber das Paket hat. Bitte daher die u.g. Sicherheitshinweise -beachten und den Paketadmin-Account {PAC} nicht mit unsicheren -(unverschluesselten) Protokollen wie POP3 oder FTP ohne TLS verwenden! - -E-Mail-Benachrichtigungen fuer den Paket-Admin gehen direkt an den -o.g. Account. Ueber den E-Mail-Alias {PAC} koennen diese E-Mails -an externe E-Mail-Adressen weitergeleitet werden. Initial ist -eine Weiterleitung an {CUST_EMAIL} eingetragen. - -Wir empfehlen, Domains nicht unter dem Paketadmin {PAC} sondern z.B. -unter einem User "{PAC}-doms" anzulegen, um die Paket- und Domain- -Verwaltung zu trennen. Dies gilt insbesondere, wenn die Domain-Inhalte -per FTP gepflegt werden sollen. - -Weitere Accounts (neben dem Paketadmin-Account {PAC}) koennen nach einem -Login per SSH mit dem Kommandozeilen-Programm hsadmin eingerichtet -oder mit dem Web-Client unter http://admin.hostsharing.net -Dokumentation finden Sie unter: - - - -Der Webspace des Paketes ist theoretisch ab sofort unter - erreichbar, allerdings kann es durch -DNS-Caches Verzoegerungen geben. Das DocumentRoot ist - ~{PAC}/doms/{PAC}.hostsharing.net/htdocs/ -In SW Paketen darf diese Domain nur fuer administrative Zwecke verwendet -werden. - -Die vorgenannte Paket-Domain ist zum Testen und Ausprobieren gedacht. -Das Verfahren zum Bestellen weiterer Domains ist auf unserer Website unter -https://wiki.hostsharing.net/index.php?title=Domains -beschrieben. - -Bei evtl. auftretenden Problemen mit dem Server bitte zunaechst auf -unserer Status-Website nachsehen, -insbesondere auch auf der dortigen Seite "Aktionen", ob die Hostmaster -bereits aktiv sind. Falls nicht, koennen die Hostmaster bei dringenden -Problemen ueber die Rufnummer +49 40 209331331 erreicht werden. -Bitte ggf. lange klingeln lassen, aber nicht mehr anrufen, -wenn die Hostmaster laut Status-Seite "Aktionen" bereits dabei sind, -das Problem zu beheben, da dies die Arbeiten dann nur verzoegern wuerde. -Auch ist diese Rufnummer keine Support-Rufnummer, telefonische -Support-Anfragen koennen grundsaetzlich nicht beantwortet werden. - -Weitere Fragen beantworten wir gerne per E-Mail, am liebsten auf der -passenden oeffentlichen Mailingliste (in den meisten Faellen wohl -support@). Einen Ueberblick ueber unsere Mailinglisten bietet die Website: -https://www.hostsharing.net/gemeinschaft - -Viel Erfolg mit dem neuen Paket bei Hostsharing! - - die Hostsharing Hostmaster - -P.S. Diese E-Mail wurde automatisch erstellt und ist daher allgemein -formuliert. - --- -Hostsharing Service | http://www.hostsharing.net -Telefon: +49 40 209331311 | Fax: +49 40 209331312 -Hostsharing eG | Glockengiesserwall 17 | D-20095 Hamburg -Registergericht Hamburg, GnR 1007 | USt.-ID-Nr.: DE218602793 -vertretungsberechtigter Vorstand: Michael Hierweck, Uwe Mueller - \ No newline at end of file diff --git a/hsarback/src/de/hsadmin/mods/pac/hosts.jtpl b/hsarback/src/de/hsadmin/mods/pac/hosts.jtpl index 3e296da..40f7ee2 100644 --- a/hsarback/src/de/hsadmin/mods/pac/hosts.jtpl +++ b/hsarback/src/de/hsadmin/mods/pac/hosts.jtpl @@ -1,4 +1,9 @@ -127.0.0.1 localhost +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# + +127.0.0.1 localhost ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet diff --git a/hsarback/src/de/hsadmin/mods/pac/httpd-virtual.jtpl b/hsarback/src/de/hsadmin/mods/pac/httpd-virtual.jtpl new file mode 100644 index 0000000..719f1db --- /dev/null +++ b/hsarback/src/de/hsadmin/mods/pac/httpd-virtual.jtpl @@ -0,0 +1,28 @@ +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# + + +NameVirtualHost {PAC_IP}:80 +NameVirtualHost {PAC_IP}:443 + + + + Redirect 404 / + + + + + + SSLEngine On + SSLCertificateFile /etc/apache2/pems/default.pem + SSLCertificateChainFile /etc/apache2/pems/default.chain.pem + SSLCertificateFile /etc/apache2/pems/{PAC}.pem + SSLCertificateChainFile /etc/apache2/pems/{PAC}.chain.pem + + Redirect 404 / + + + + \ No newline at end of file diff --git a/hsarback/src/de/hsadmin/mods/pac/interfaces.jtpl b/hsarback/src/de/hsadmin/mods/pac/interfaces.jtpl index 80aafea..8a3810c 100644 --- a/hsarback/src/de/hsadmin/mods/pac/interfaces.jtpl +++ b/hsarback/src/de/hsadmin/mods/pac/interfaces.jtpl @@ -1,4 +1,9 @@ -auto lo +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# + +auto lo iface lo inet loopback auto eth0 diff --git a/hsarback/src/de/hsadmin/mods/pac/proftpd-conf.jtpl b/hsarback/src/de/hsadmin/mods/pac/proftpd-conf.jtpl index 608493e..b52113e 100644 --- a/hsarback/src/de/hsadmin/mods/pac/proftpd-conf.jtpl +++ b/hsarback/src/de/hsadmin/mods/pac/proftpd-conf.jtpl @@ -1,4 +1,7 @@ -# This proftpd config file is generated by hsadmin. +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# Include /etc/proftpd/modules.conf @@ -56,8 +59,8 @@ PassivePorts 60000 65534 -#---------------------------------------------------------------------- -# {PAC}.hostsharing.net +#################################################### + DefaultRoot ~ {PAC} ServerName "Hostsharing eG" diff --git a/hsarback/src/de/hsadmin/mods/pac/sudoers.jtpl b/hsarback/src/de/hsadmin/mods/pac/sudoers.jtpl index 89bf1a2..86600f0 100644 --- a/hsarback/src/de/hsadmin/mods/pac/sudoers.jtpl +++ b/hsarback/src/de/hsadmin/mods/pac/sudoers.jtpl @@ -1,5 +1,7 @@ -### Do not edit this file manually -### Generated by HSAdmin Queue Server +# +# This file is managed by HSAdmin. +# Do not edit manually. Changes will be overwritten. +# # Host alias specification @@ -18,7 +20,7 @@ Defaults listpw=all # siehe sudoers(5) root ALL=(ALL) ALL %adm ALL=NOPASSWD: ALL -################################################################################ +#################################################### {PAC} ALL = (%{PAC}) NOPASSWD: ALL From c1ecf8794ad79f0a9c2de09ae3c856b9e2b52aea Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Thu, 20 Sep 2012 18:16:25 +0200 Subject: [PATCH 2/5] 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 3/5] 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 4/5] 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 From 564d2807b742b821c19d0601815c9e8df40f03cd Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Thu, 20 Sep 2012 19:14:53 +0200 Subject: [PATCH 5/5] remove code from email to pac-admin --- .../hsadmin/mods/pac/PacProcessorFactory.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java index f55b656..63629a6 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java @@ -29,13 +29,11 @@ public class PacProcessorFactory implements EntityProcessorFactory { EntityManager em, T entity) throws ProcessorException { Pac pac = (Pac) entity; String pacName = pac.getName(); -// String customerEMail = pac.getCustomer().getContractualContact().getEmail(); Hive hive = pac.getHive(); UnixUser unixUser = getPacAdminUser(pac); String password = PasswordTool.generatePassword(); Map hiveValues = fillHiveValues(hive); List> pacValuesList = fillPacValuesList(hive, null); -// Map emailVars = fillEMailValues(pacName, customerEMail, password); Processor priProcessor = new CompoundProcessor( createAddUserProc(pacName, unixUser, password), createSetQuotaProc(pac), @@ -48,7 +46,6 @@ public class PacProcessorFactory implements EntityProcessorFactory { createIfUp(pacName), createHttpdVirtualProc(pacName, pacValuesList)); WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor); -// secProcessor.appendProcessor(pac.getHiveName(), createSendEMailProc(pacName, customerEMail, emailVars), "send email to customer"); return secProcessor; } @@ -168,16 +165,6 @@ public class PacProcessorFactory implements EntityProcessorFactory { ); } -// private Processor createSendEMailProc(String pacName, -// String customerEMail, Map emailVars) throws ProcessorException { -// return new MailerProcessor( -// customerEMail, -// "Zugangsdaten des neue Hostsharing Pakets " + pacName, -// "/de/hsadmin/mods/pac/email_new_pac_account.jtpl", -// emailVars -// ); -// } - private Processor createIfUp(String pacName) { return new ShellProcessor("ifup eth0:" + pacName); } @@ -224,13 +211,4 @@ public class PacProcessorFactory implements EntityProcessorFactory { return pacValuesList; } -// private Map fillEMailValues(String pacName, -// String customerEMail, String password) { -// Map emailVars = new HashMap(); -// emailVars.put("PAC", pacName); -// emailVars.put("PASSWORD", password); -// emailVars.put("CUST_EMAIL", customerEMail); -// return emailVars; -// } - }