Merge lp:~cjohnston/charms/quantal/workitems-tracker/trunk into lp:~clint-fewbar/charms/quantal/workitems-tracker/trunk

Proposed by Chris Johnston
Status: Needs review
Proposed branch: lp:~cjohnston/charms/quantal/workitems-tracker/trunk
Merge into: lp:~clint-fewbar/charms/quantal/workitems-tracker/trunk
Diff against target: 209 lines (+91/-52)
3 files modified
config.yaml (+22/-12)
hooks/config-changed (+68/-39)
hooks/install (+1/-1)
To merge this branch: bzr merge lp:~cjohnston/charms/quantal/workitems-tracker/trunk
Reviewer Review Type Date Requested Status
Clint Byrum Pending
Review via email: mp+139295@code.launchpad.net
To post a comment you must log in.
22. By Chris Johnston

work on vhost

23. By Chris Johnston

Add more vhost info

24. By Chris Johnston

Adds apache-openid required files

25. By Chris Johnston

removes hard coding

26. By Chris Johnston

Adding descriptions

27. By Chris Johnston

Fixes vhost info

28. By Chris Johnston

Remove stray get_team_content

Unmerged revisions

28. By Chris Johnston

Remove stray get_team_content

27. By Chris Johnston

Fixes vhost info

26. By Chris Johnston

Adding descriptions

25. By Chris Johnston

removes hard coding

24. By Chris Johnston

Adds apache-openid required files

23. By Chris Johnston

Add more vhost info

22. By Chris Johnston

work on vhost

21. By Chris Johnston

Removing django

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2012-11-22 01:38:55 +0000
+++ config.yaml 2012-12-14 22:19:20 +0000
@@ -22,27 +22,37 @@
22 type: string22 type: string
23 default: http://bazaar.launchpad.net/~wi-tracker-configurators/launchpad-work-items-tracker/ubuntu-config23 default: http://bazaar.launchpad.net/~wi-tracker-configurators/launchpad-work-items-tracker/ubuntu-config
24 description: Pull configs from this branch.24 description: Pull configs from this branch.
25 team-content-bzr-branch:
26 type: string
27 default: http://bazaar.launchpad.net/~clint-fewbar/+junk/team-content
28 description: Where to pull the team-content django app for keeping content private.
29 team-content-admin-user:
30 type: string
31 default: admin
32 description: User to create as a super user for setting up groups in team-content.
33 team-content-admin-email:
34 type: string
35 default: nowhere@devnull.foo
36 description: email to attach to the admin user.
37 config-relative-path:25 config-relative-path:
38 type: string26 type: string
39 default: config/ubuntu-_devfocus_.cfg27 default: config/ubuntu-_devfocus_.cfg
28 config-file-name:
29 type: string
30 default: ubuntu-_devfocus_
31 description: |
32 The name of the config file, which will also turn into the end of the URL to access the site, without the
33 filename extension.
34 private-team:
35 type: string
36 default: ''
37 description: |
38 Team(s) that will be authorized to login to the private instance.
39 sso-provider:
40 type: string
41 default: Ubuntu=login.ubuntu.com
42 description: |
43 This is the SSO provider that will be used for authentication when
44 private is set to true.
40 project:45 project:
41 type: string46 type: string
42 default: ubuntu47 default: ubuntu
43 description: |48 description: |
44 Project/Distro to use to determine _devfocus_. Ignored if49 Project/Distro to use to determine _devfocus_. Ignored if
45 _devfocus_ is not in use.50 _devfocus_ is not in use.
51 base-url:
52 type: string
53 default: status.ubuntu.com/
54 description: |
55 The base URL of the site with the "http://" or the trailing "/".
46 minute-interval:56 minute-interval:
47 type: string57 type: string
48 default: '0'58 default: '0'
4959
=== modified file 'hooks/config-changed'
--- hooks/config-changed 2012-11-30 00:05:02 +0000
+++ hooks/config-changed 2012-12-14 22:19:20 +0000
@@ -6,18 +6,37 @@
66
7setup_apache() {7setup_apache() {
8 local private=$(config-get private --format=json)8 local private=$(config-get private --format=json)
9 local private_team=$(config-get private-team)
10 local base_url=$(config-get base-url)
11 local file_name=$(config-get config-file-name)
9 local port=""12 local port=""
13 local sso=$(config-get sso-provider)
10 a2dissite default14 a2dissite default
11 if [ "$private" = "false" ] ; then15 if [ "$private" = "false" ] ; then
12 a2dissite default-ssl16 a2dissite default-ssl
13 a2dismod ssl17 a2dismod ssl
14 cat > /etc/apache2/sites-available/witrack <<EOF18 cat > /etc/apache2/sites-available/witrack <<EOF
15<VirtualHost *:80>19<VirtualHost *:80>
16 DocumentRoot $DOCROOT20 ServerName ${base_url}
21 ServerAdmin admins@admin.canonical.com
22
23 DocumentRoot ${RUNAS_HOME}
24 RedirectMatch ^/$ http://${base_url}${file_name}/
25 <Directory />
26 Options FollowSymLinks
27 AllowOverride None
28 </Directory>
29 <Directory ${RUNAS_HOME}>
30 Options Indexes FollowSymLinks MultiViews
31 AllowOverride None
32 Order allow,deny
33 allow from all
34 </Directory>
35 LogLevel warn
36 CustomLog /var/log/apache2/${base_url}access.log combined
37 ErrorLog /var/log/apache2/${base_url}-error.log
38
17</VirtualHost>39</VirtualHost>
18<Directory $DOCROOT>
19 Options +Indexes
20</Directory>
21EOF40EOF
22 port=8041 port=80
23 close_port=44342 close_port=443
@@ -25,15 +44,51 @@
25 a2ensite default-ssl44 a2ensite default-ssl
26 a2enmod ssl45 a2enmod ssl
27 cat > /etc/apache2/sites-available/witrack <<EOF46 cat > /etc/apache2/sites-available/witrack <<EOF
28Alias /static/ "${RUNAS_HOME}/static/"47<VirtualHost *:443>
29<Directory "${RUNAS_HOME}/static">48 ServerName ${base_url}
30Order allow,deny49 ServerAdmin admins@admin.canonical.com
31Options Indexes50
32Allow from all51 DocumentRoot ${RUNAS_HOME}
33IndexOptions FancyIndexing52 RedirectMatch ^/$ https://${base_url}${file_name}/
34</Directory>53 <Location "/">
3554 PythonAccessHandler apache_openid::protect
36WSGIScriptAlias / $RUNAS_HOME/team_content/team_content.wsgi55 PythonOption handler openidteams
56 PythonOption authorized-teams-list-url "file:///etc/apache2/security/canonical.txt"
57 PythonOption action-path "/openid/" ###NOT SURE WHAT THIS IS
58 </Location>
59
60 <Location "/openid/">
61 Allow from All
62 SetHandler mod_python
63 PythonOption handler openidteams
64 PythonOption store-type file
65 PythonOption store-directory /var/cache/apache2/openid/
66 PythonOption allowed-op-list-url "file:///etc/apache2/security/allowed-ops.txt" ###NEED A FILE
67 PythonOption authorized-teams-list-url "file:///etc/apache2/security/canonical.txt" ###NEED A FILE
68 PythonOption action-path "/openid/"
69 </Location>
70
71 <Directory />
72 Options FollowSymLinks
73 AllowOverride None
74 </Directory>
75 <Directory ${RUNAS_HOME}>
76 Options Indexes FollowSymLinks MultiViews
77 AllowOverride None
78 Order allow,deny
79 allow from all
80 </Directory>
81
82 LogLevel warn
83 CustomLog /var/log/apache2/${base_url}access.log combined
84 ErrorLog /var/log/apache2/${base_url}-error.log
85</VirtualHost>
86EOF
87 cat > /etc/apache2/security/canonical.txt <<EOF
88${private_team}
89EOF
90 cat > /etc/apache2/security/allowed-ops.txt <<EOF
91${sso}
37EOF92EOF
38 port=44393 port=443
39 close_port=8094 close_port=80
@@ -112,31 +167,6 @@
112 get_branch $config_bzr_branch configs167 get_branch $config_bzr_branch configs
113}168}
114169
115get_team_content() {
116 local tc_bzr_branch=$(config-get team-content-bzr-branch)
117 local admin_user=$(config-get team-content-admin-user)
118 local admin_email=$(config-get team-content-admin-email)
119 get_branch $tc_bzr_branch team_content
120 pushd team_content
121 # Generate a production settings from the dev ones
122 sed -i -e "s,protected_content,$RUNAS_HOME/public_html,g" team_content/settings.py
123 sed -i -e 's,DEBUG =.*,DEBUG = False,g' team_content/settings.py
124 sed -i -e "s,STATIC_ROOT =.*,STATIC_ROOT = '${RUNAS_HOME}/static',g" team_content/settings.py
125 mkdir -p $RUNAS_HOME/static
126 chgrp www-data $RUNAS_HOME/static
127 export DJANGO_SETTINGS_MODULE=team_content.settings
128 ./manage.py syncdb --noinput
129 ./manage.py collectstatic --noinput
130 # This feels a bit hacky but umask failed
131 chmod 0660 ../db/team_content.sqlite3
132 # XXX Should probably do more to see if the user exists, but
133 # for now, || : works too.
134 ./manage.py createsuperuser --username=$admin_user \
135 --email=$admin_email \
136 --noinput || :
137 popd
138}
139
140# Uses a hash of the url to avoid re-pulling170# Uses a hash of the url to avoid re-pulling
141get_branch() {171get_branch() {
142 local bzr_loc=$1172 local bzr_loc=$1
@@ -163,7 +193,6 @@
163193
164get_witrack194get_witrack
165get_configs195get_configs
166get_team_content
167196
168set_project_config() {197set_project_config() {
169 local cfg_rpath=$(config-get config-relative-path)198 local cfg_rpath=$(config-get config-relative-path)
170199
=== modified file 'hooks/install'
--- hooks/install 2012-11-22 01:38:55 +0000
+++ hooks/install 2012-12-14 22:19:20 +0000
@@ -1,3 +1,3 @@
1#!/bin/bash1#!/bin/bash
22
3exec apt-get install --no-install-recommends -y bzr uuid apache2-mpm-event apache2 sqlite3 python-simplejson python-launchpadlib python-pychart python-testtools python-storm python-mako postfix bsd-mailx libapache2-mod-wsgi python-django python-django-openid-auth3exec apt-get install --no-install-recommends -y bzr uuid apache2-mpm-event apache2 sqlite3 python-simplejson python-launchpadlib python-pychart python-testtools python-storm python-mako postfix bsd-mailx apache-openid

Subscribers

People subscribed via source and target branches

to all changes: