[Kimchi-devel] [project-kimchi] [PATCH 2/4] Add a configuration for vnc websocket proxy
Mark Wu
wudxw at linux.vnet.ibm.com
Wed Dec 18 08:51:19 UTC 2013
We are going to use one proxy instance to forward all vm's
vnc traffics. The proxy instance listens on a fixed port instead
of a random one. This patch makes the port configurable and exported
to client by adding it to the response of '/config'.
Signed-off-by: Mark Wu <wudxw at linux.vnet.ibm.com>
---
docs/API.md | 1 +
src/kimchi.conf.in | 3 +++
src/kimchi/config.py.in | 1 +
src/kimchi/controller.py | 5 ++++-
4 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/docs/API.md b/docs/API.md
index 74bc1b5..b0bcefb 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -413,6 +413,7 @@ Contains information about the application environment and configuration.
* **GET**: Retrieve configuration information
* http_port: The port number on which the server is listening
+ * vnc_proxy_port: Port for vnc's websocket proxy to listen on
* **POST**: *See Configuration Actions*
**Actions (POST):**
diff --git a/src/kimchi.conf.in b/src/kimchi.conf.in
index bf26c26..4ce80ca 100644
--- a/src/kimchi.conf.in
+++ b/src/kimchi.conf.in
@@ -23,6 +23,9 @@
# Running environment of the server
#environment = development
+# Port for vnc's websocket proxy to listen on
+#vnc_proxy_port = 64667
+
[logging]
# Log directory
#log_dir = @localstatedir@/log/kimchi
diff --git a/src/kimchi/config.py.in b/src/kimchi/config.py.in
index 49d42db..e2b8423 100644
--- a/src/kimchi/config.py.in
+++ b/src/kimchi/config.py.in
@@ -174,6 +174,7 @@ config.set("server", "port", "8000")
config.set("server", "ssl_port", "8001")
config.set("server", "ssl_cert", "")
config.set("server", "ssl_key", "")
+config.set("server", "vnc_proxy_port", "64667")
config.set("server", "environment", "development")
config.add_section("logging")
config.set("logging", "log_dir", get_default_log_dir())
diff --git a/src/kimchi/controller.py b/src/kimchi/controller.py
index 3b27c27..695d58a 100644
--- a/src/kimchi/controller.py
+++ b/src/kimchi/controller.py
@@ -31,6 +31,7 @@ from jsonschema import Draft3Validator, ValidationError
import kimchi.template
from kimchi import auth
+from kimchi.config import config
from kimchi.exception import InvalidOperation, InvalidParameter, MissingParameter
from kimchi.exception import NotFoundError, OperationFailed
from kimchi.model import ISO_POOL_NAME
@@ -651,7 +652,9 @@ class Config(Resource):
@property
def data(self):
- return {'http_port': cherrypy.server.socket_port}
+ return {'http_port': cherrypy.server.socket_port,
+ 'vnc_proxy_port': config.get('server', 'vnc_proxy_port')}
+
class Capabilities(Resource):
def __init__(self, model, id=None):
--
1.8.3.1
--
project-kimchi mailing list <project-kimchi at googlegroups.com>
https://groups.google.com/forum/#!forum/project-kimchi
---
You received this message because you are subscribed to the Google Groups "project-kimchi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-kimchi+unsubscribe at googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
More information about the Kimchi-devel
mailing list