Merge lp:~mwhudson/launchpad/vostok-add-layer into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 11299
Proposed branch: lp:~mwhudson/launchpad/vostok-add-layer
Merge into: lp:launchpad
Diff against target: 277 lines (+163/-2)
12 files modified
Makefile (+3/-0)
configs/development/launchpad-lazr.conf (+3/-0)
configs/development/local-vostok-apache (+52/-0)
lib/canonical/config/schema-lazr.conf (+2/-0)
lib/canonical/launchpad/configure.zcml (+1/-0)
lib/lp/code/xmlrpc/tests/test_codehosting.py (+2/-2)
lib/lp/vostok/__init__.py (+4/-0)
lib/lp/vostok/configure.zcml (+14/-0)
lib/lp/vostok/publisher.py (+37/-0)
lib/lp/vostok/tests/__init__.py (+4/-0)
lib/lp/vostok/tests/test_publisher.py (+33/-0)
utilities/rocketfuel-setup (+8/-0)
To merge this branch: bzr merge lp:~mwhudson/launchpad/vostok-add-layer
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+31238@code.launchpad.net

Description of the change

Hi,

This branch is mostly unavoidable and boring stuff to add a new vhost
('vostok') and accompanying layer/skin.

The change to lib/lp/code/xmlrpc/tests/test_codehosting.py is just to remove a
meaningless hit when grepping launchpad for 'vostok'

Cheers,
mwh

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Looks fine. As mentioned on IRC I was wondering whether or not we should add the path
/var/tmp/vostok-archive somewhere into the makefile as it is used by the vostok apache config.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2010-06-25 15:03:10 +0000
+++ Makefile 2010-07-30 03:26:45 +0000
@@ -200,6 +200,7 @@
200 configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)200 configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)
201201
202compile: $(PY) $(BZR_VERSION_INFO)202compile: $(PY) $(BZR_VERSION_INFO)
203 mkdir -p /var/tmp/vostok-archive
203 ${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \204 ${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \
204 LPCONFIG=${LPCONFIG}205 LPCONFIG=${LPCONFIG}
205 ${SHHH} LPCONFIG=${LPCONFIG} ${PY} -t buildmailman.py206 ${SHHH} LPCONFIG=${LPCONFIG} ${PY} -t buildmailman.py
@@ -398,11 +399,13 @@
398 # We insert the absolute path to the branch-rewrite script399 # We insert the absolute path to the branch-rewrite script
399 # into the Apache config as we copy the file into position.400 # into the Apache config as we copy the file into position.
400 sed -e 's,%BRANCH_REWRITE%,$(shell pwd)/scripts/branch-rewrite.py,' configs/development/local-launchpad-apache > /etc/apache2/sites-available/local-launchpad401 sed -e 's,%BRANCH_REWRITE%,$(shell pwd)/scripts/branch-rewrite.py,' configs/development/local-launchpad-apache > /etc/apache2/sites-available/local-launchpad
402 cp configs/development/local-vostok-apache /etc/apache2/sites-available/local-vosok
401 touch /var/tmp/bazaar.launchpad.dev/rewrite.log403 touch /var/tmp/bazaar.launchpad.dev/rewrite.log
402 chown $(SUDO_UID):$(SUDO_GID) /var/tmp/bazaar.launchpad.dev/rewrite.log404 chown $(SUDO_UID):$(SUDO_GID) /var/tmp/bazaar.launchpad.dev/rewrite.log
403405
404enable-apache-launchpad: copy-apache-config copy-certificates406enable-apache-launchpad: copy-apache-config copy-certificates
405 a2ensite local-launchpad407 a2ensite local-launchpad
408 a2ensite local-vostok
406409
407reload-apache: enable-apache-launchpad410reload-apache: enable-apache-launchpad
408 /etc/init.d/apache2 restart411 /etc/init.d/apache2 restart
409412
=== modified file 'configs/development/launchpad-lazr.conf'
--- configs/development/launchpad-lazr.conf 2010-07-25 05:16:58 +0000
+++ configs/development/launchpad-lazr.conf 2010-07-30 03:26:45 +0000
@@ -330,6 +330,9 @@
330[vhost.feeds]330[vhost.feeds]
331hostname: feeds.launchpad.dev331hostname: feeds.launchpad.dev
332332
333[vhost.vostok]
334hostname: vostok.dev
335
333[zopeless]336[zopeless]
334# XXX sinzui 2008-03-26:337# XXX sinzui 2008-03-26:
335# A development box should never send email to the outer world,338# A development box should never send email to the outer world,
336339
=== added file 'configs/development/local-vostok-apache'
--- configs/development/local-vostok-apache 1970-01-01 00:00:00 +0000
+++ configs/development/local-vostok-apache 2010-07-30 03:26:45 +0000
@@ -0,0 +1,52 @@
1NameVirtualHost 127.0.0.77:80
2
3RewriteLock /var/tmp/vostok-rewrite-lock
4
5<VirtualHost 127.0.0.77:80>
6 ServerName archive.vostok.dev
7 LogLevel debug
8
9 DocumentRoot /var/tmp/vostok-archive
10 <Directory /var/tmp/vostok-archive/>
11 Order Deny,Allow
12 Deny from all
13 Allow from 127.0.0.0/255.0.0.0
14 Options Indexes
15 </Directory>
16</VirtualHost>
17
18<VirtualHost 127.0.0.77:443>
19 ServerName vostok.dev
20 ServerAlias *.vostok.dev
21 <Proxy *>
22 Order deny,allow
23 Allow from 127.0.0.0/255.0.0.0
24 </Proxy>
25 SSLEngine On
26 SSLCertificateFile /etc/apache2/ssl/launchpad.crt
27 SSLCertificateKeyFile /etc/apache2/ssl/launchpad.key
28
29 ProxyPreserveHost on
30 ProxyPass / http://localhost:8086/ retry=1
31
32 <Location />
33 # Insert filter
34 SetOutputFilter DEFLATE
35
36 # Don't compress images
37 SetEnvIfNoCase Request_URI \
38 \.(?:gif|jpe?g|png)$ no-gzip dont-vary
39
40 # Don't gzip anything that starts /@@/ and doesn't end .js (ie images)
41 SetEnvIfNoCase Request_URI ^/@@/ no-gzip dont-vary
42 SetEnvIfNoCase Request_URI ^/@@/.*\.js$ !no-gzip !dont-vary
43 </Location>
44
45</VirtualHost>
46
47<VirtualHost 127.0.0.77:80>
48 ServerName vostok.dev
49 ServerAlias *.vostok.dev
50 RewriteEngine On
51 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
52</VirtualHost>
053
=== modified file 'lib/canonical/config/schema-lazr.conf'
--- lib/canonical/config/schema-lazr.conf 2010-07-26 09:23:26 +0000
+++ lib/canonical/config/schema-lazr.conf 2010-07-30 03:26:45 +0000
@@ -2000,6 +2000,8 @@
20002000
2001[vhost.feeds]2001[vhost.feeds]
20022002
2003[vhost.vostok]
2004
20032005
2004[windmill]2006[windmill]
2005# The location of the windmill server debug logs. This will be written to2007# The location of the windmill server debug logs. This will be written to
20062008
=== modified file 'lib/canonical/launchpad/configure.zcml'
--- lib/canonical/launchpad/configure.zcml 2010-06-04 20:59:50 +0000
+++ lib/canonical/launchpad/configure.zcml 2010-07-30 03:26:45 +0000
@@ -32,6 +32,7 @@
32 <include package="lp.testopenid" />32 <include package="lp.testopenid" />
33 <include package="lp.blueprints" />33 <include package="lp.blueprints" />
34 <include package="lp.services.comments" />34 <include package="lp.services.comments" />
35 <include package="lp.vostok" />
3536
36 <browser:url37 <browser:url
37 for="canonical.launchpad.interfaces.IPersonSet"38 for="canonical.launchpad.interfaces.IPersonSet"
3839
=== modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py'
--- lib/lp/code/xmlrpc/tests/test_codehosting.py 2010-07-28 04:18:53 +0000
+++ lib/lp/code/xmlrpc/tests/test_codehosting.py 2010-07-30 03:26:45 +0000
@@ -206,11 +206,11 @@
206 started_tuple = tuple(started.utctimetuple())206 started_tuple = tuple(started.utctimetuple())
207 completed_tuple = tuple(completed.utctimetuple())207 completed_tuple = tuple(completed.utctimetuple())
208 success = self.codehosting_api.recordSuccess(208 success = self.codehosting_api.recordSuccess(
209 'test-recordsuccess', 'vostok', started_tuple, completed_tuple)209 'test-recordsuccess', 'server-name', started_tuple, completed_tuple)
210 self.assertEqual(True, success)210 self.assertEqual(True, success)
211211
212 activity = self.getLastActivity('test-recordsuccess')212 activity = self.getLastActivity('test-recordsuccess')
213 self.assertEqual('vostok', activity.hostname)213 self.assertEqual('server-name', activity.hostname)
214 self.assertEqual(started, activity.date_started)214 self.assertEqual(started, activity.date_started)
215 self.assertEqual(completed, activity.date_completed)215 self.assertEqual(completed, activity.date_completed)
216216
217217
=== added directory 'lib/lp/vostok'
=== added file 'lib/lp/vostok/__init__.py'
--- lib/lp/vostok/__init__.py 1970-01-01 00:00:00 +0000
+++ lib/lp/vostok/__init__.py 2010-07-30 03:26:45 +0000
@@ -0,0 +1,4 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""The Linaro archive management skin."""
05
=== added file 'lib/lp/vostok/configure.zcml'
--- lib/lp/vostok/configure.zcml 1970-01-01 00:00:00 +0000
+++ lib/lp/vostok/configure.zcml 2010-07-30 03:26:45 +0000
@@ -0,0 +1,14 @@
1<configure
2 xmlns="http://namespaces.zope.org/zope"
3 xmlns:browser="http://namespaces.zope.org/browser"
4 xmlns:i18n="http://namespaces.zope.org/i18n"
5 xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc"
6 i18n_domain="launchpad">
7
8 <publisher
9 name="vostok"
10 factory="lp.vostok.publisher.vostok_request_publication_factory"
11 methods="*"
12 mimetypes="*" />
13
14</configure>
015
=== added file 'lib/lp/vostok/publisher.py'
--- lib/lp/vostok/publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/vostok/publisher.py 2010-07-30 03:26:45 +0000
@@ -0,0 +1,37 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Vostok's custom publication."""
5
6__metaclass__ = type
7__all__ = [
8 'VostokBrowserRequest',
9 'VostokLayer',
10 'vostok_request_publication_factory',
11 ]
12
13
14from zope.interface import implements
15from zope.publisher.interfaces.browser import (
16 IBrowserRequest, IDefaultBrowserLayer)
17
18from canonical.launchpad.webapp.publication import LaunchpadBrowserPublication
19from canonical.launchpad.webapp.servers import (
20 LaunchpadBrowserRequest, VirtualHostRequestPublicationFactory)
21
22
23class VostokLayer(IBrowserRequest, IDefaultBrowserLayer):
24 """The Vostok layer."""
25
26
27class VostokBrowserRequest(LaunchpadBrowserRequest):
28 implements(VostokLayer)
29
30
31# We *might* end up customizing the root object and so need our own
32# LaunchpadBrowserPublication subclass. Not yet though.
33
34
35def vostok_request_publication_factory():
36 return VirtualHostRequestPublicationFactory(
37 'vostok', VostokBrowserRequest, LaunchpadBrowserPublication)
038
=== added directory 'lib/lp/vostok/tests'
=== added file 'lib/lp/vostok/tests/__init__.py'
--- lib/lp/vostok/tests/__init__.py 1970-01-01 00:00:00 +0000
+++ lib/lp/vostok/tests/__init__.py 2010-07-30 03:26:45 +0000
@@ -0,0 +1,4 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for the Linaro archive management skin."""
05
=== added file 'lib/lp/vostok/tests/test_publisher.py'
--- lib/lp/vostok/tests/test_publisher.py 1970-01-01 00:00:00 +0000
+++ lib/lp/vostok/tests/test_publisher.py 2010-07-30 03:26:45 +0000
@@ -0,0 +1,33 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for vostok's custom publications."""
5
6__metaclass__ = type
7
8import unittest
9
10from canonical.config import config
11from canonical.testing.layers import FunctionalLayer
12
13from lp.testing import TestCase
14from lp.testing.publication import get_request_and_publication
15
16from lp.vostok.publisher import VostokLayer
17
18
19class TestRegistration(TestCase):
20 """Vostok's publication customizations are installed correctly."""
21
22 layer = FunctionalLayer
23
24 def test_vostok_request_provides_vostok_layer(self):
25 # The request constructed for requests to the vostok hostname provides
26 # VostokLayer.
27 request, publication = get_request_and_publication(
28 host=config.vhost.vostok.hostname)
29 self.assertProvides(request, VostokLayer)
30
31
32def test_suite():
33 return unittest.TestLoader().loadTestsFromName(__name__)
034
=== modified file 'utilities/rocketfuel-setup'
--- utilities/rocketfuel-setup 2010-02-12 15:34:28 +0000
+++ utilities/rocketfuel-setup 2010-07-30 03:26:45 +0000
@@ -155,6 +155,14 @@
155 echo "bazaar.launchpad.dev added to /etc/hosts"155 echo "bazaar.launchpad.dev added to /etc/hosts"
156fi156fi
157157
158grep -q "^127.0.0.77" /etc/hosts
159if [ $? -ne 0 ]; then
160 echo "
161127.0.0.77 vostok.dev archive.vostok.dev
162" | sudo tee -a /etc/hosts > /dev/null
163 echo "vostok.dev added to /etc/hosts"
164fi
165
158# Enable relevant Ubuntu package repositories166# Enable relevant Ubuntu package repositories
159grep -q "^deb http:.* ${DISTRIB_CODENAME} .*universe" /etc/apt/sources.list167grep -q "^deb http:.* ${DISTRIB_CODENAME} .*universe" /etc/apt/sources.list
160if [ $? -ne 0 ]; then168if [ $? -ne 0 ]; then