Merge lp:~wgrant/launchpad/easier-remote-access into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 15202
Proposed branch: lp:~wgrant/launchpad/easier-remote-access
Merge into: lp:launchpad
Diff against target: 249 lines (+66/-81)
4 files modified
Makefile (+3/-0)
configs/development/local-launchpad-apache (+57/-62)
utilities/rocketfuel-setup (+1/-12)
utilities/setuplxc.py (+5/-7)
To merge this branch: bzr merge lp:~wgrant/launchpad/easier-remote-access
Reviewer Review Type Date Requested Status
Ian Booth (community) Approve
Review via email: mp+104684@code.launchpad.net

Commit message

Make it easy to set up a development instance for remote access.

Description of the change

This branch makes it a bit less painful to set up remote access to a Launchpad instance (most commonly from a VM host to a guest). The old instructions are https://dev.launchpad.net/Running/RemoteAccess, the new method is `make LISTEN_ADDRESS=* install`.

Note that I've merged bazaar.launchpad.dev onto the main launchpad.dev IP address. It was previously on a separate IP so it could have a separate HTTPS vhost, but with SNI widely supported by all browsers except IE on Windows XP it's no longer useful.

I also trimmed three hostnames that have been obsolete for more than two years.

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :

Look ok to my untrained eye. Fingers crossed...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2012-03-27 17:40:11 +0000
3+++ Makefile 2012-05-04 07:17:44 +0000
4@@ -17,6 +17,8 @@
5
6 LPCONFIG?=development
7
8+LISTEN_ADDRESS?=127.0.0.88
9+
10 ICING=lib/canonical/launchpad/icing
11 LP_BUILT_JS_ROOT=${ICING}/build
12
13@@ -464,6 +466,7 @@
14 # We insert the absolute path to the branch-rewrite script
15 # into the Apache config as we copy the file into position.
16 sed -e 's,%BRANCH_REWRITE%,$(shell pwd)/scripts/branch-rewrite.py,' \
17+ -e 's,%LISTEN_ADDRESS%,$(LISTEN_ADDRESS),' \
18 configs/development/local-launchpad-apache > \
19 /etc/apache2/sites-available/local-launchpad
20 touch /var/tmp/bazaar.launchpad.dev/rewrite.log
21
22=== modified file 'configs/development/local-launchpad-apache'
23--- configs/development/local-launchpad-apache 2012-01-18 01:03:20 +0000
24+++ configs/development/local-launchpad-apache 2012-05-04 07:17:44 +0000
25@@ -1,29 +1,55 @@
26-NameVirtualHost 127.0.0.88:80
27+NameVirtualHost %LISTEN_ADDRESS%:80
28+NameVirtualHost %LISTEN_ADDRESS%:443
29
30 RewriteLock /var/tmp/rewrite-lock
31
32-<VirtualHost 127.0.0.88:80>
33- ServerName xmlrpc-private.launchpad.dev
34- ServerName xmlrpc.launchpad.dev
35+# These have to be first so non-Host/non-SNI requests don't hit bazaar etc.
36+# But they can't have a ServerAlias wildcard or they'll shadow bazaar.
37+<VirtualHost %LISTEN_ADDRESS%:80>
38+ ServerName launchpad.dev
39+ ServerAlias answers.launchpad.dev api.launchpad.dev blueprints.launchpad.dev
40+ ServerAlias bugs.launchpad.dev code.launchpad.dev feeds.launchpad.dev
41+ ServerAlias translations.launchpad.dev xmlrpc.launchpad.dev testopenid.dev
42+
43+ RewriteEngine On
44+ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
45+</VirtualHost>
46+
47+<VirtualHost %LISTEN_ADDRESS%:443>
48+ ServerName launchpad.dev
49+ ServerAlias answers.launchpad.dev api.launchpad.dev blueprints.launchpad.dev
50+ ServerAlias bugs.launchpad.dev code.launchpad.dev feeds.launchpad.dev
51+ ServerAlias translations.launchpad.dev xmlrpc.launchpad.dev testopenid.dev
52 <Proxy *>
53 Order deny,allow
54 Allow from 127.0.0.0/255.0.0.0
55 </Proxy>
56+ SSLEngine On
57+ SSLCertificateFile /etc/apache2/ssl/launchpad.crt
58+ SSLCertificateKeyFile /etc/apache2/ssl/launchpad.key
59+
60 ProxyPreserveHost on
61-
62- ProxyPass / http://localhost:8087/ retry=1
63-</VirtualHost>
64-
65-<VirtualHost 127.0.0.88:80>
66- ServerName lists.launchpad.dev
67- Alias / /var/tmp/mailman/mhonarc/
68- <Directory /var/tmp/mailman/mhonarc>
69- AllowOverride None
70- DirectoryIndex maillist.html
71- </Directory>
72-</VirtualHost>
73-
74-<VirtualHost 127.0.0.99:80>
75+ ProxyPass /+longpoll/ http://localhost:22435/ retry=1
76+ ProxyPass /+combo !
77+ ProxyPass / http://localhost:8086/ retry=1
78+
79+ <Location />
80+ # Insert filter
81+ SetOutputFilter DEFLATE
82+
83+ # Don't compress images
84+ SetEnvIfNoCase Request_URI \
85+ \.(?:gif|jpe?g|png)$ no-gzip dont-vary
86+
87+ # Don't gzip anything that starts /@@/ and doesn't end .js (ie images)
88+ SetEnvIfNoCase Request_URI ^/@@/ no-gzip dont-vary
89+ SetEnvIfNoCase Request_URI ^/@@/.*\.js$ !no-gzip !dont-vary
90+ </Location>
91+
92+ WSGIScriptAlias /+combo /usr/share/convoy/convoy.wsgi
93+</VirtualHost>
94+
95+<VirtualHost %LISTEN_ADDRESS%:80>
96 ServerName bazaar.launchpad.dev
97 LogLevel debug
98
99@@ -54,7 +80,7 @@
100 </Location>
101 </VirtualHost>
102
103-<VirtualHost 127.0.0.99:443>
104+<VirtualHost %LISTEN_ADDRESS%:443>
105 ServerName bazaar.launchpad.dev
106 LogLevel debug
107
108@@ -82,7 +108,7 @@
109 </Location>
110 </VirtualHost>
111
112-<VirtualHost 127.0.0.88:80>
113+<VirtualHost %LISTEN_ADDRESS%:80>
114 ServerName bazaar-internal.launchpad.dev
115 LogLevel debug
116
117@@ -97,7 +123,16 @@
118 </Directory>
119 </VirtualHost>
120
121-<VirtualHost 127.0.0.88:80>
122+<VirtualHost %LISTEN_ADDRESS%:80>
123+ ServerName lists.launchpad.dev
124+ Alias / /var/tmp/mailman/mhonarc/
125+ <Directory /var/tmp/mailman/mhonarc>
126+ AllowOverride None
127+ DirectoryIndex maillist.html
128+ </Directory>
129+</VirtualHost>
130+
131+<VirtualHost %LISTEN_ADDRESS%:80>
132 ServerName ppa.launchpad.dev
133 ServerAlias private-ppa.launchpad.dev
134 LogLevel debug
135@@ -112,7 +147,7 @@
136 </Directory>
137 </VirtualHost>
138
139-<VirtualHost 127.0.0.88:80>
140+<VirtualHost %LISTEN_ADDRESS%:80>
141 ServerName archive.launchpad.dev
142 LogLevel debug
143
144@@ -124,43 +159,3 @@
145 Options Indexes
146 </Directory>
147 </VirtualHost>
148-
149-<VirtualHost 127.0.0.88:443>
150- ServerName launchpad.dev
151- ServerAlias *.launchpad.dev
152- <Proxy *>
153- Order deny,allow
154- Allow from 127.0.0.0/255.0.0.0
155- </Proxy>
156- SSLEngine On
157- SSLCertificateFile /etc/apache2/ssl/launchpad.crt
158- SSLCertificateKeyFile /etc/apache2/ssl/launchpad.key
159-
160- ProxyPreserveHost on
161- ProxyPass /+longpoll/ http://localhost:22435/ retry=1
162- ProxyPass /+combo !
163- ProxyPass / http://localhost:8086/ retry=1
164-
165- <Location />
166- # Insert filter
167- SetOutputFilter DEFLATE
168-
169- # Don't compress images
170- SetEnvIfNoCase Request_URI \
171- \.(?:gif|jpe?g|png)$ no-gzip dont-vary
172-
173- # Don't gzip anything that starts /@@/ and doesn't end .js (ie images)
174- SetEnvIfNoCase Request_URI ^/@@/ no-gzip dont-vary
175- SetEnvIfNoCase Request_URI ^/@@/.*\.js$ !no-gzip !dont-vary
176- </Location>
177-
178- WSGIScriptAlias /+combo /usr/share/convoy/convoy.wsgi
179-
180-</VirtualHost>
181-
182-<VirtualHost 127.0.0.88:80>
183- ServerName launchpad.dev
184- ServerAlias *.launchpad.dev
185- RewriteEngine On
186- RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
187-</VirtualHost>
188
189=== modified file 'utilities/rocketfuel-setup'
190--- utilities/rocketfuel-setup 2012-02-02 06:01:27 +0000
191+++ utilities/rocketfuel-setup 2012-05-04 07:17:44 +0000
192@@ -52,17 +52,14 @@
193 answers.launchpad.dev
194 archive.launchpad.dev
195 api.launchpad.dev
196+ bazaar.launchpad.dev
197 bazaar-internal.launchpad.dev
198- beta.launchpad.dev
199 blueprints.launchpad.dev
200 bugs.launchpad.dev
201 code.launchpad.dev
202 feeds.launchpad.dev
203- id.launchpad.dev
204 keyserver.launchpad.dev
205 lists.launchpad.dev
206- openid.launchpad.dev
207- ubuntu-openid.launchpad.dev
208 ppa.launchpad.dev
209 private-ppa.launchpad.dev
210 testopenid.dev
211@@ -76,14 +73,6 @@
212 dev_host;
213 done
214
215-grep -q "^127.0.0.99" /etc/hosts
216-if [ $? -ne 0 ]; then
217- echo "
218-127.0.0.99 bazaar.launchpad.dev
219-" | sudo tee -a /etc/hosts > /dev/null
220- echo "bazaar.launchpad.dev added to /etc/hosts"
221-fi
222-
223 # Enable relevant Ubuntu package repositories
224 grep -q "^deb http:.* ${DISTRIB_CODENAME} .*universe" /etc/apt/sources.list
225 if [ $? -ne 0 ]; then
226
227=== modified file 'utilities/setuplxc.py'
228--- utilities/setuplxc.py 2012-04-26 19:33:45 +0000
229+++ utilities/setuplxc.py 2012-05-04 07:17:44 +0000
230@@ -81,14 +81,12 @@
231 LXC_HOSTS_CONTENT = (
232 ('127.0.0.88',
233 'launchpad.dev answers.launchpad.dev archive.launchpad.dev '
234- 'api.launchpad.dev bazaar-internal.launchpad.dev beta.launchpad.dev '
235+ 'api.launchpad.dev bazaar.launchpad.dev bazaar-internal.launchpad.dev'
236 'blueprints.launchpad.dev bugs.launchpad.dev code.launchpad.dev '
237- 'feeds.launchpad.dev id.launchpad.dev keyserver.launchpad.dev '
238- 'lists.launchpad.dev openid.launchpad.dev '
239- 'ubuntu-openid.launchpad.dev ppa.launchpad.dev '
240- 'private-ppa.launchpad.dev testopenid.dev translations.launchpad.dev '
241- 'xmlrpc-private.launchpad.dev xmlrpc.launchpad.dev'),
242- ('127.0.0.99', 'bazaar.launchpad.dev'),
243+ 'feeds.launchpad.dev keyserver.launchpad.dev lists.launchpad.dev '
244+ 'ppa.launchpad.dev private-ppa.launchpad.dev testopenid.dev '
245+ 'translations.launchpad.dev xmlrpc-private.launchpad.dev '
246+ 'xmlrpc.launchpad.dev'),
247 )
248 LXC_NAME = 'lptests'
249 LXC_OPTIONS = """