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
=== modified file 'Makefile'
--- Makefile 2012-03-27 17:40:11 +0000
+++ Makefile 2012-05-04 07:17:44 +0000
@@ -17,6 +17,8 @@
1717
18LPCONFIG?=development18LPCONFIG?=development
1919
20LISTEN_ADDRESS?=127.0.0.88
21
20ICING=lib/canonical/launchpad/icing22ICING=lib/canonical/launchpad/icing
21LP_BUILT_JS_ROOT=${ICING}/build23LP_BUILT_JS_ROOT=${ICING}/build
2224
@@ -464,6 +466,7 @@
464 # We insert the absolute path to the branch-rewrite script466 # We insert the absolute path to the branch-rewrite script
465 # into the Apache config as we copy the file into position.467 # into the Apache config as we copy the file into position.
466 sed -e 's,%BRANCH_REWRITE%,$(shell pwd)/scripts/branch-rewrite.py,' \468 sed -e 's,%BRANCH_REWRITE%,$(shell pwd)/scripts/branch-rewrite.py,' \
469 -e 's,%LISTEN_ADDRESS%,$(LISTEN_ADDRESS),' \
467 configs/development/local-launchpad-apache > \470 configs/development/local-launchpad-apache > \
468 /etc/apache2/sites-available/local-launchpad471 /etc/apache2/sites-available/local-launchpad
469 touch /var/tmp/bazaar.launchpad.dev/rewrite.log472 touch /var/tmp/bazaar.launchpad.dev/rewrite.log
470473
=== modified file 'configs/development/local-launchpad-apache'
--- configs/development/local-launchpad-apache 2012-01-18 01:03:20 +0000
+++ configs/development/local-launchpad-apache 2012-05-04 07:17:44 +0000
@@ -1,29 +1,55 @@
1NameVirtualHost 127.0.0.88:801NameVirtualHost %LISTEN_ADDRESS%:80
2NameVirtualHost %LISTEN_ADDRESS%:443
23
3RewriteLock /var/tmp/rewrite-lock4RewriteLock /var/tmp/rewrite-lock
45
5<VirtualHost 127.0.0.88:80>6# These have to be first so non-Host/non-SNI requests don't hit bazaar etc.
6 ServerName xmlrpc-private.launchpad.dev7# But they can't have a ServerAlias wildcard or they'll shadow bazaar.
7 ServerName xmlrpc.launchpad.dev8<VirtualHost %LISTEN_ADDRESS%:80>
9 ServerName launchpad.dev
10 ServerAlias answers.launchpad.dev api.launchpad.dev blueprints.launchpad.dev
11 ServerAlias bugs.launchpad.dev code.launchpad.dev feeds.launchpad.dev
12 ServerAlias translations.launchpad.dev xmlrpc.launchpad.dev testopenid.dev
13
14 RewriteEngine On
15 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
16</VirtualHost>
17
18<VirtualHost %LISTEN_ADDRESS%:443>
19 ServerName launchpad.dev
20 ServerAlias answers.launchpad.dev api.launchpad.dev blueprints.launchpad.dev
21 ServerAlias bugs.launchpad.dev code.launchpad.dev feeds.launchpad.dev
22 ServerAlias translations.launchpad.dev xmlrpc.launchpad.dev testopenid.dev
8 <Proxy *>23 <Proxy *>
9 Order deny,allow24 Order deny,allow
10 Allow from 127.0.0.0/255.0.0.025 Allow from 127.0.0.0/255.0.0.0
11 </Proxy>26 </Proxy>
27 SSLEngine On
28 SSLCertificateFile /etc/apache2/ssl/launchpad.crt
29 SSLCertificateKeyFile /etc/apache2/ssl/launchpad.key
30
12 ProxyPreserveHost on31 ProxyPreserveHost on
1332 ProxyPass /+longpoll/ http://localhost:22435/ retry=1
14 ProxyPass / http://localhost:8087/ retry=133 ProxyPass /+combo !
15</VirtualHost>34 ProxyPass / http://localhost:8086/ retry=1
1635
17<VirtualHost 127.0.0.88:80>36 <Location />
18 ServerName lists.launchpad.dev37 # Insert filter
19 Alias / /var/tmp/mailman/mhonarc/38 SetOutputFilter DEFLATE
20 <Directory /var/tmp/mailman/mhonarc>39
21 AllowOverride None40 # Don't compress images
22 DirectoryIndex maillist.html41 SetEnvIfNoCase Request_URI \
23 </Directory>42 \.(?:gif|jpe?g|png)$ no-gzip dont-vary
24</VirtualHost>43
2544 # Don't gzip anything that starts /@@/ and doesn't end .js (ie images)
26<VirtualHost 127.0.0.99:80>45 SetEnvIfNoCase Request_URI ^/@@/ no-gzip dont-vary
46 SetEnvIfNoCase Request_URI ^/@@/.*\.js$ !no-gzip !dont-vary
47 </Location>
48
49 WSGIScriptAlias /+combo /usr/share/convoy/convoy.wsgi
50</VirtualHost>
51
52<VirtualHost %LISTEN_ADDRESS%:80>
27 ServerName bazaar.launchpad.dev53 ServerName bazaar.launchpad.dev
28 LogLevel debug54 LogLevel debug
2955
@@ -54,7 +80,7 @@
54 </Location>80 </Location>
55</VirtualHost>81</VirtualHost>
5682
57<VirtualHost 127.0.0.99:443>83<VirtualHost %LISTEN_ADDRESS%:443>
58 ServerName bazaar.launchpad.dev84 ServerName bazaar.launchpad.dev
59 LogLevel debug85 LogLevel debug
6086
@@ -82,7 +108,7 @@
82 </Location>108 </Location>
83</VirtualHost>109</VirtualHost>
84110
85<VirtualHost 127.0.0.88:80>111<VirtualHost %LISTEN_ADDRESS%:80>
86 ServerName bazaar-internal.launchpad.dev112 ServerName bazaar-internal.launchpad.dev
87 LogLevel debug113 LogLevel debug
88114
@@ -97,7 +123,16 @@
97 </Directory>123 </Directory>
98</VirtualHost>124</VirtualHost>
99125
100<VirtualHost 127.0.0.88:80>126<VirtualHost %LISTEN_ADDRESS%:80>
127 ServerName lists.launchpad.dev
128 Alias / /var/tmp/mailman/mhonarc/
129 <Directory /var/tmp/mailman/mhonarc>
130 AllowOverride None
131 DirectoryIndex maillist.html
132 </Directory>
133</VirtualHost>
134
135<VirtualHost %LISTEN_ADDRESS%:80>
101 ServerName ppa.launchpad.dev136 ServerName ppa.launchpad.dev
102 ServerAlias private-ppa.launchpad.dev137 ServerAlias private-ppa.launchpad.dev
103 LogLevel debug138 LogLevel debug
@@ -112,7 +147,7 @@
112 </Directory>147 </Directory>
113</VirtualHost>148</VirtualHost>
114149
115<VirtualHost 127.0.0.88:80>150<VirtualHost %LISTEN_ADDRESS%:80>
116 ServerName archive.launchpad.dev151 ServerName archive.launchpad.dev
117 LogLevel debug152 LogLevel debug
118153
@@ -124,43 +159,3 @@
124 Options Indexes159 Options Indexes
125 </Directory>160 </Directory>
126</VirtualHost>161</VirtualHost>
127
128<VirtualHost 127.0.0.88:443>
129 ServerName launchpad.dev
130 ServerAlias *.launchpad.dev
131 <Proxy *>
132 Order deny,allow
133 Allow from 127.0.0.0/255.0.0.0
134 </Proxy>
135 SSLEngine On
136 SSLCertificateFile /etc/apache2/ssl/launchpad.crt
137 SSLCertificateKeyFile /etc/apache2/ssl/launchpad.key
138
139 ProxyPreserveHost on
140 ProxyPass /+longpoll/ http://localhost:22435/ retry=1
141 ProxyPass /+combo !
142 ProxyPass / http://localhost:8086/ retry=1
143
144 <Location />
145 # Insert filter
146 SetOutputFilter DEFLATE
147
148 # Don't compress images
149 SetEnvIfNoCase Request_URI \
150 \.(?:gif|jpe?g|png)$ no-gzip dont-vary
151
152 # Don't gzip anything that starts /@@/ and doesn't end .js (ie images)
153 SetEnvIfNoCase Request_URI ^/@@/ no-gzip dont-vary
154 SetEnvIfNoCase Request_URI ^/@@/.*\.js$ !no-gzip !dont-vary
155 </Location>
156
157 WSGIScriptAlias /+combo /usr/share/convoy/convoy.wsgi
158
159</VirtualHost>
160
161<VirtualHost 127.0.0.88:80>
162 ServerName launchpad.dev
163 ServerAlias *.launchpad.dev
164 RewriteEngine On
165 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
166</VirtualHost>
167162
=== modified file 'utilities/rocketfuel-setup'
--- utilities/rocketfuel-setup 2012-02-02 06:01:27 +0000
+++ utilities/rocketfuel-setup 2012-05-04 07:17:44 +0000
@@ -52,17 +52,14 @@
52 answers.launchpad.dev52 answers.launchpad.dev
53 archive.launchpad.dev53 archive.launchpad.dev
54 api.launchpad.dev54 api.launchpad.dev
55 bazaar.launchpad.dev
55 bazaar-internal.launchpad.dev56 bazaar-internal.launchpad.dev
56 beta.launchpad.dev
57 blueprints.launchpad.dev57 blueprints.launchpad.dev
58 bugs.launchpad.dev58 bugs.launchpad.dev
59 code.launchpad.dev59 code.launchpad.dev
60 feeds.launchpad.dev60 feeds.launchpad.dev
61 id.launchpad.dev
62 keyserver.launchpad.dev61 keyserver.launchpad.dev
63 lists.launchpad.dev62 lists.launchpad.dev
64 openid.launchpad.dev
65 ubuntu-openid.launchpad.dev
66 ppa.launchpad.dev63 ppa.launchpad.dev
67 private-ppa.launchpad.dev64 private-ppa.launchpad.dev
68 testopenid.dev65 testopenid.dev
@@ -76,14 +73,6 @@
76 dev_host;73 dev_host;
77done74done
7875
79grep -q "^127.0.0.99" /etc/hosts
80if [ $? -ne 0 ]; then
81 echo "
82127.0.0.99 bazaar.launchpad.dev
83" | sudo tee -a /etc/hosts > /dev/null
84 echo "bazaar.launchpad.dev added to /etc/hosts"
85fi
86
87# Enable relevant Ubuntu package repositories76# Enable relevant Ubuntu package repositories
88grep -q "^deb http:.* ${DISTRIB_CODENAME} .*universe" /etc/apt/sources.list77grep -q "^deb http:.* ${DISTRIB_CODENAME} .*universe" /etc/apt/sources.list
89if [ $? -ne 0 ]; then78if [ $? -ne 0 ]; then
9079
=== modified file 'utilities/setuplxc.py'
--- utilities/setuplxc.py 2012-04-26 19:33:45 +0000
+++ utilities/setuplxc.py 2012-05-04 07:17:44 +0000
@@ -81,14 +81,12 @@
81LXC_HOSTS_CONTENT = (81LXC_HOSTS_CONTENT = (
82 ('127.0.0.88',82 ('127.0.0.88',
83 'launchpad.dev answers.launchpad.dev archive.launchpad.dev '83 'launchpad.dev answers.launchpad.dev archive.launchpad.dev '
84 'api.launchpad.dev bazaar-internal.launchpad.dev beta.launchpad.dev '84 'api.launchpad.dev bazaar.launchpad.dev bazaar-internal.launchpad.dev'
85 'blueprints.launchpad.dev bugs.launchpad.dev code.launchpad.dev '85 'blueprints.launchpad.dev bugs.launchpad.dev code.launchpad.dev '
86 'feeds.launchpad.dev id.launchpad.dev keyserver.launchpad.dev '86 'feeds.launchpad.dev keyserver.launchpad.dev lists.launchpad.dev '
87 'lists.launchpad.dev openid.launchpad.dev '87 'ppa.launchpad.dev private-ppa.launchpad.dev testopenid.dev '
88 'ubuntu-openid.launchpad.dev ppa.launchpad.dev '88 'translations.launchpad.dev xmlrpc-private.launchpad.dev '
89 'private-ppa.launchpad.dev testopenid.dev translations.launchpad.dev '89 'xmlrpc.launchpad.dev'),
90 'xmlrpc-private.launchpad.dev xmlrpc.launchpad.dev'),
91 ('127.0.0.99', 'bazaar.launchpad.dev'),
92 )90 )
93LXC_NAME = 'lptests'91LXC_NAME = 'lptests'
94LXC_OPTIONS = """92LXC_OPTIONS = """