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
=== modified file 'README.md'
--- README.md 2012-12-20 18:02:44 +0000
+++ README.md 2013-01-02 17:08:22 +0000
@@ -58,9 +58,7 @@
58 machine: 158 machine: 1
59 open-ports:59 open-ports:
60 - 80/tcp60 - 80/tcp
61 <!--- Uncomment when TLS connections are re-enabled.
62 - 443/tcp61 - 443/tcp
63 -->
64 - 8080/tcp62 - 8080/tcp
65 public-address: ec2-204-236-250-8.compute-1.amazonaws.com63 public-address: ec2-204-236-250-8.compute-1.amazonaws.com
6664
6765
=== modified file 'config/config.js.template'
--- config/config.js.template 2012-11-30 16:36:47 +0000
+++ config/config.js.template 2013-01-02 17:08:22 +0000
@@ -5,6 +5,6 @@
5 container: '#main',5 container: '#main',
6 viewContainer: '#main',6 viewContainer: '#main',
7 transitions: false,7 transitions: false,
8 charm_store_url: 'http://jujucharms.com/',8 charm_store_url: 'https://jujucharms.com/',
9 socket_url: 'ws://%(address)s:%(port)s/ws'9 socket_url: 'ws://%(address)s:%(port)s/ws'
10};10};
1111
=== modified file 'config/nginx.conf.template'
--- config/nginx.conf.template 2012-12-21 15:22:50 +0000
+++ config/nginx.conf.template 2013-01-02 17:08:22 +0000
@@ -1,20 +1,16 @@
1# Uncomment to switch back to TLS connections.1server {
2# server {2 listen 80;
3# listen 80;3 server_name _;
4# server_name _;4 return 301 https://$host$request_uri;
5# return 301 https://$host$request_uri;5}
6# }
76
8server {7server {
9 # Uncomment to switch back to TLS connections.8 listen 443 default_server ssl;
10 # listen 443 default_server ssl;
11 listen 80; # Delete this line when TLS connections are re-enabled.
12 server_name _;9 server_name _;
13 root %(server_root)s;10 root %(server_root)s;
14 index index.html;11 index index.html;
15 # Uncomment to switch back to TLS connections.12 ssl_certificate %(ssl_cert_path)s/server.pem;
16 # ssl_certificate %(ssl_cert_path)s/server.pem;13 ssl_certificate_key %(ssl_cert_path)s/server.key;
17 # ssl_certificate_key %(ssl_cert_path)s/server.key;
1814
19 # Serve static assets.15 # Serve static assets.
20 location ^~ /juju-ui/ {16 location ^~ /juju-ui/ {
2117
=== modified file 'hooks/start'
--- hooks/start 2012-12-21 16:32:53 +0000
+++ hooks/start 2013-01-02 17:08:22 +0000
@@ -21,8 +21,7 @@
21 log('Exposing services.')21 log('Exposing services.')
22 # Open the Juju GUI web server HTTP and HTTPS ports.22 # Open the Juju GUI web server HTTP and HTTPS ports.
23 open_port(80)23 open_port(80)
24 # Uncomment to switch back to TLS connections.24 open_port(443)
25 # open_port(443)
26 # Open the Juju websocket server port.25 # Open the Juju websocket server port.
27 open_port(juju_api_port)26 open_port(juju_api_port)
2827
2928
=== modified file 'tests/deploy.test'
--- tests/deploy.test 2012-12-20 18:02:44 +0000
+++ tests/deploy.test 2013-01-02 17:08:22 +0000
@@ -35,7 +35,7 @@
3535
36 def setUp(self):36 def setUp(self):
37 self.charm = 'juju-gui'37 self.charm = 'juju-gui'
38 self.port = '80' # Set to 443 when TLS connections are re-enabled.38 self.port = '443'
3939
40 def tearDown(self):40 def tearDown(self):
41 juju('destroy-service', self.charm)41 juju('destroy-service', self.charm)
@@ -53,8 +53,7 @@
5353
54 def check_services(self, hostname, ws_port=8080):54 def check_services(self, hostname, ws_port=8080):
55 """Check the services are listening on their tcp ports."""55 """Check the services are listening on their tcp ports."""
56 # Use https below when TLS connections are re-enabled.56 url = 'https://{0}:{1}'.format(hostname, self.port)
57 url = 'http://{0}:{1}'.format(hostname, self.port)
58 response = open_url(url)57 response = open_url(url)
59 self.assertEqual(200, response.getcode())58 self.assertEqual(200, response.getcode())
60 ws_url = 'http://{0}:{1}/ws'.format(hostname, ws_port)59 ws_url = 'http://{0}:{1}/ws'.format(hostname, ws_port)

Subscribers

People subscribed via source and target branches