Merge lp:~cjwatson/charms/trusty/turnip/direct-haproxy into lp:~canonical-launchpad-branches/charms/trusty/turnip/devel

Proposed by Colin Watson
Status: Merged
Merged at revision: 62
Proposed branch: lp:~cjwatson/charms/trusty/turnip/direct-haproxy
Merge into: lp:~canonical-launchpad-branches/charms/trusty/turnip/devel
Diff against target: 41 lines (+20/-3)
1 file modified
hooks/actions.py (+20/-3)
To merge this branch: bzr merge lp:~cjwatson/charms/trusty/turnip/direct-haproxy
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+257417@code.launchpad.net

Commit message

Expect to be proxied directly using haproxy, rather than via Apache; this entails setting up our service relations a little differently.

Description of the change

Expect to be proxied directly using haproxy, rather than via Apache; this entails setting up our service relations a little differently.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

The new service could do with a comment that it is because dodgy haproxy charm.

review: Approve (code)
63. By Colin Watson

Add HSTS header to git-service-smart-http, per Mozilla Security recommendations.

64. By Colin Watson

Comment dubious use of haproxy charm.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/actions.py'
2--- hooks/actions.py 2015-04-19 00:04:11 +0000
3+++ hooks/actions.py 2015-04-25 02:21:36 +0000
4@@ -199,11 +199,28 @@
5 'check',
6 ]],
7 },
8+ # This is a slightly dubious use of the haproxy charm, but we don't
9+ # have good relation settings and end up needing to hardcode some
10+ # ports.
11+ {
12+ 'service_name': 'git-service-http-redirect',
13+ 'service_host': '0.0.0.0',
14+ 'service_port': '80',
15+ 'service_options':
16+ http_options +
17+ ['redirect scheme https code 301 if !{ ssl_fc }'],
18+ 'servers': [],
19+ },
20 {
21 'service_name': 'git-service-smart-http',
22 'service_host': '0.0.0.0',
23- 'service_port': str(config['port_smart_http']),
24- 'service_options': http_options + ['option httpchk'],
25+ 'service_port': '443',
26+ 'service_options':
27+ http_options +
28+ ['option httpchk',
29+ 'rspadd Strict-Transport-Security:\\ max-age=15768000',
30+ ],
31+ 'crts': ['DEFAULT'],
32 'servers': [[
33 server_name, server_ip, str(config['port_smart_http']),
34 'check',
35@@ -234,5 +251,5 @@
36 hookenv.relation_set(
37 relid,
38 hostname=hookenv.unit_private_ip(),
39- port=config['port_smart_http'],
40+ port='443',
41 services=haproxy_services)

Subscribers

People subscribed via source and target branches

to all changes: