cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [06/15] git commit: updated refs/heads/master to e4ba640
Date Tue, 28 Jun 2016 15:28:40 GMT
VR CsApp: Expose config to classes, move vhost confs to proper location, allow for multiple
IP's per intf, sanitize servername, don't open port 53 if no DNS is foreseen


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6055ed6e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6055ed6e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6055ed6e

Branch: refs/heads/master
Commit: 6055ed6ed67fc43b3fe27a6971020336dcc4ff9d
Parents: 748bf43
Author: Ronald van Zantvoort <ronald@pcextreme.nl>
Authored: Fri May 13 17:25:06 2016 +0200
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Tue Jun 7 13:03:09 2016 +0200

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/cs/CsApp.py     | 31 ++++++++++++--------
 1 file changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6055ed6e/systemvm/patches/debian/config/opt/cloud/bin/cs/CsApp.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsApp.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsApp.py
index a0b4c6e..003af48 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsApp.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsApp.py
@@ -28,35 +28,37 @@ class CsApp:
         self.ip = ip.get_ip_address()
         self.type = ip.get_type()
         self.fw = ip.fw
+        self.config = ip.config
 
 
 class CsApache(CsApp):
     """ Set up Apache """
 
     def remove(self):
-        file = "/etc/apache2/conf.d/vhost%s.conf" % self.dev
+        file = "/etc/apache2/sites-enabled/vhost-%s.conf" % self.dev
         if os.path.isfile(file):
             os.remove(file)
             CsHelper.service("apache2", "restart")
 
     def setup(self):
         CsHelper.copy_if_needed("/etc/apache2/vhostexample.conf",
-                                "/etc/apache2/conf.d/vhost%s.conf" % self.dev)
+                                "/etc/apache2/sites-enabled/vhost-%s.conf" % self.ip)
 
-        file = CsFile("/etc/apache2/conf.d/vhost%s.conf" % (self.dev))
+        file = CsFile("/etc/apache2/sites-enabled/vhost-%s.conf" % (self.ip))
         file.search("<VirtualHost.*:80>", "\t<VirtualHost %s:80>" % (self.ip))
         file.search("<VirtualHost.*:80>", "\t<VirtualHost %s:80>" % (self.ip))
         file.search("<VirtualHost.*:443>", "\t<VirtualHost %s:443>" % (self.ip))
         file.search("Listen .*:80", "Listen %s:80" % (self.ip))
         file.search("Listen .*:443", "Listen %s:443" % (self.ip))
-        file.search("ServerName.*", "\tServerName vhost%s.cloudinternal.com" % (self.dev))
+        file.search("ServerName.*", "\tServerName %s.%s" % (self.config.cl.get_type(), self.config.get_domain()))
         if file.is_changed():
             file.commit()
             CsHelper.service("apache2", "restart")
 
-        self.fw.append(["", "front",
-                        "-A INPUT -i %s -d %s/32 -p tcp -m tcp -m state --state NEW --dport
80 -j ACCEPT" % (self.dev, self.ip)
-                        ])
+        self.fw.append([
+            "", "front",
+            "-A INPUT -i %s -d %s/32 -p tcp -m tcp -m state --state NEW --dport 80 -j ACCEPT"
% (self.dev, self.ip)
+        ])
 
 
 class CsPasswdSvc():
@@ -94,10 +96,13 @@ class CsDnsmasq(CsApp):
                         "-A INPUT -i %s -p udp -m udp --dport 67 -j ACCEPT" % self.dev
                         ])
 
-        self.fw.append(["", "front",
-                        "-A INPUT -i %s -d %s/32 -p udp -m udp --dport 53 -j ACCEPT" % (self.dev,
self.ip)
-                        ])
+        if self.config.has_dns():
+            self.fw.append([
+                "", "front",
+                "-A INPUT -i %s -d %s/32 -p udp -m udp --dport 53 -j ACCEPT" % (self.dev,
self.ip)
+            ])
 
-        self.fw.append(["", "front",
-                        "-A INPUT -i %s -d %s/32 -p tcp -m tcp --dport 53 -j ACCEPT" % (self.dev,
self.ip)
-                        ])
+            self.fw.append([
+                "", "front",
+                "-A INPUT -i %s -d %s/32 -p tcp -m tcp --dport 53 -j ACCEPT" % (self.dev,
self.ip)
+            ])


Mime
View raw message