Merge lp:~frankban/charms/precise/juju-gui/bug-1095281-restore-tls into lp:~juju-gui/charms/precise/juju-gui/trunk

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 20
Proposed branch: lp:~frankban/charms/precise/juju-gui/bug-1095281-restore-tls
Merge into: lp:~juju-gui/charms/precise/juju-gui/trunk
Diff against target: 95 lines (+12/-20)
5 files modified
README.md (+0/-2)
config/config.js.template (+1/-1)
config/nginx.conf.template (+8/-12)
hooks/start (+1/-2)
tests/deploy.test (+2/-3)
To merge this branch: bzr merge lp:~frankban/charms/precise/juju-gui/bug-1095281-restore-tls
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+141646@code.launchpad.net

Description of the change

Restore TLS in the charm

Now the charm is served using SSL again.

https://codereview.appspot.com/7026046/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :
Download full text (4.0 KiB)

Reviewers: mp+141646_code.launchpad.net,

Message:
Please take a look.

Description:
Restore TLS in the charm

Now the charm is served using SSL again.

https://code.launchpad.net/~frankban/charms/precise/juju-gui/bug-1095281-restore-tls/+merge/141646

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/7026046/

Affected files:
   M README.md
   A [revision details]
   M config/config.js.template
   M config/nginx.conf.template
   M hooks/start
   M tests/deploy.test

Index: README.md
=== modified file 'README.md'
--- README.md 2012-12-20 18:02:44 +0000
+++ README.md 2013-01-02 13:31:03 +0000
@@ -58,9 +58,7 @@
              machine: 1
              open-ports:
              - 80/tcp
- <!--- Uncomment when TLS connections are re-enabled.
              - 443/tcp
- -->
              - 8080/tcp
              public-address: ec2-204-236-250-8.compute-1.amazonaws.com

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision:
<email address hidden>

Index: config/config.js.template
=== modified file 'config/config.js.template'
--- config/config.js.template 2012-11-30 16:36:47 +0000
+++ config/config.js.template 2013-01-02 13:31:03 +0000
@@ -5,6 +5,6 @@
    container: '#main',
    viewContainer: '#main',
    transitions: false,
- charm_store_url: 'http://jujucharms.com/',
+ charm_store_url: 'https://jujucharms.com/',
    socket_url: 'ws://%(address)s:%(port)s/ws'
  };

Index: config/nginx.conf.template
=== modified file 'config/nginx.conf.template'
--- config/nginx.conf.template 2012-12-21 15:22:50 +0000
+++ config/nginx.conf.template 2013-01-02 13:31:03 +0000
@@ -1,20 +1,16 @@
-# Uncomment to switch back to TLS connections.
-# server {
-# listen 80;
-# server_name _;
-# return 301 https://$host$request_uri;
-# }
+server {
+ listen 80;
+ server_name _;
+ return 301 https://$host$request_uri;
+}

  server {
- # Uncomment to switch back to TLS connections.
- # listen 443 default_server ssl;
- listen 80; # Delete this line when TLS connections are re-enabled.
+ listen 443 default_server ssl;
      server_name _;
      root %(server_root)s;
      index index.html;
- # Uncomment to switch back to TLS connections.
- # ssl_certificate %(ssl_cert_path)s/server.pem;
- # ssl_certificate_key %(ssl_cert_path)s/server.key;
+ ssl_certificate %(ssl_cert_path)s/server.pem;
+ ssl_certificate_key %(ssl_cert_path)s/server.key;

      # Serve static assets.
      location ^~ /juju-ui/ {

Index: hooks/start
=== modified file 'hooks/start'
--- hooks/start 2012-12-21 16:32:53 +0000
+++ hooks/start 2013-01-02 13:31:03 +0000
@@ -21,8 +21,7 @@
      log('Exposing services.')
      # Open the Juju GUI web server HTTP and HTTPS ports.
      open_port(80)
- # Uncomment to switch back to TLS connections.
- # open_port(443)
+ open_port(443)
      # Open the Juju websocket server port.
      o...

Read more...

Revision history for this message
Nicola Larosa (teknico) wrote :

Land as is.

Nice changes, thanks for the hints. :-)

https://codereview.appspot.com/7026046/

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

On 2013/01/02 17:16:26, teknico wrote:
> Land as is.

> Nice changes, thanks for the hints. :-)

looks good, we also get the websocket over tls?

https://codereview.appspot.com/7026046/

Revision history for this message
Nicola Larosa (teknico) wrote :

hazmat wrote:
> looks good, we also get the websocket over tls?

Nope, I'm working on it elsewhere.

https://codereview.appspot.com/7026046/

Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Restore TLS in the charm

Now the charm is served using SSL again.

R=teknico, hazmat
CC=
https://codereview.appspot.com/7026046

https://codereview.appspot.com/7026046/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2012-12-20 18:02:44 +0000
3+++ README.md 2013-01-02 17:08:22 +0000
4@@ -58,9 +58,7 @@
5 machine: 1
6 open-ports:
7 - 80/tcp
8- <!--- Uncomment when TLS connections are re-enabled.
9 - 443/tcp
10- -->
11 - 8080/tcp
12 public-address: ec2-204-236-250-8.compute-1.amazonaws.com
13
14
15=== modified file 'config/config.js.template'
16--- config/config.js.template 2012-11-30 16:36:47 +0000
17+++ config/config.js.template 2013-01-02 17:08:22 +0000
18@@ -5,6 +5,6 @@
19 container: '#main',
20 viewContainer: '#main',
21 transitions: false,
22- charm_store_url: 'http://jujucharms.com/',
23+ charm_store_url: 'https://jujucharms.com/',
24 socket_url: 'ws://%(address)s:%(port)s/ws'
25 };
26
27=== modified file 'config/nginx.conf.template'
28--- config/nginx.conf.template 2012-12-21 15:22:50 +0000
29+++ config/nginx.conf.template 2013-01-02 17:08:22 +0000
30@@ -1,20 +1,16 @@
31-# Uncomment to switch back to TLS connections.
32-# server {
33-# listen 80;
34-# server_name _;
35-# return 301 https://$host$request_uri;
36-# }
37+server {
38+ listen 80;
39+ server_name _;
40+ return 301 https://$host$request_uri;
41+}
42
43 server {
44- # Uncomment to switch back to TLS connections.
45- # listen 443 default_server ssl;
46- listen 80; # Delete this line when TLS connections are re-enabled.
47+ listen 443 default_server ssl;
48 server_name _;
49 root %(server_root)s;
50 index index.html;
51- # Uncomment to switch back to TLS connections.
52- # ssl_certificate %(ssl_cert_path)s/server.pem;
53- # ssl_certificate_key %(ssl_cert_path)s/server.key;
54+ ssl_certificate %(ssl_cert_path)s/server.pem;
55+ ssl_certificate_key %(ssl_cert_path)s/server.key;
56
57 # Serve static assets.
58 location ^~ /juju-ui/ {
59
60=== modified file 'hooks/start'
61--- hooks/start 2012-12-21 16:32:53 +0000
62+++ hooks/start 2013-01-02 17:08:22 +0000
63@@ -21,8 +21,7 @@
64 log('Exposing services.')
65 # Open the Juju GUI web server HTTP and HTTPS ports.
66 open_port(80)
67- # Uncomment to switch back to TLS connections.
68- # open_port(443)
69+ open_port(443)
70 # Open the Juju websocket server port.
71 open_port(juju_api_port)
72
73
74=== modified file 'tests/deploy.test'
75--- tests/deploy.test 2012-12-20 18:02:44 +0000
76+++ tests/deploy.test 2013-01-02 17:08:22 +0000
77@@ -35,7 +35,7 @@
78
79 def setUp(self):
80 self.charm = 'juju-gui'
81- self.port = '80' # Set to 443 when TLS connections are re-enabled.
82+ self.port = '443'
83
84 def tearDown(self):
85 juju('destroy-service', self.charm)
86@@ -53,8 +53,7 @@
87
88 def check_services(self, hostname, ws_port=8080):
89 """Check the services are listening on their tcp ports."""
90- # Use https below when TLS connections are re-enabled.
91- url = 'http://{0}:{1}'.format(hostname, self.port)
92+ url = 'https://{0}:{1}'.format(hostname, self.port)
93 response = open_url(url)
94 self.assertEqual(200, response.getcode())
95 ws_url = 'http://{0}:{1}/ws'.format(hostname, ws_port)

Subscribers

People subscribed via source and target branches