1
loggerhead: A web viewer for ``bzr`` branches
1
Loggerhead: A web viewer for ``bzr`` branches
2
2
==============================================
4
Loggerhead is a web viewer for projects in bazaar. It can be used to navigate
4
Loggerhead is a web viewer for projects in Bazaar. It can be used to navigate
5
5
a branch history, annotate files, view patches, perform searches, etc.
6
It is heavily based on ``bazaar-webserve``, which is itself based on ``hgweb``
6
Loggerhead is heavily based on `bazaar-webserve
7
<https://launchpad.net/bzr-webserve>`_, which was, in turn, loosely
8
based on `hgweb <http://mercurial.selenic.com/wiki/HgWebDirStepByStep>`_.
12
Loggerhead depends on:
14
1) SimpleTAL for templating.
15
On Ubuntu, ``sudo apt-get install python-simpletal``
16
or download from http://www.owlfish.com/software/simpleTAL/download.html
18
2) simplejson for producing JSON data.
19
On Ubuntu, ``sudo apt-get install python-simplejson``
20
or use `easy_install simplejson`.
22
3) Paste for the server. (You need version 1.2 or newer of Paste.)
23
On Ubuntu, ``sudo apt-get install python-paste``
24
or use `easy_install Paste`
26
4) Paste Deploy (optional, needed when proxying through Apache)
27
On Ubuntu, ``sudo apt-get install python-pastedeploy``
28
or use `easy_install PasteDeploy`
30
5) flup (optional, needed to use FastCGI, SCGI or AJP)
31
On Ubuntu, ``sudo apt-get install python-flup``
32
or use `easy_install flup`
34
Then simply run the 'serve-branches' with the branch you want to
35
serve on the command line:
14
Loggerhead depends on the following Python libraries.:
16
- SimpleTAL for templating.
18
- simplejson for producing JSON data.
20
- Paste for the server. (You need version 1.2 or newer of Paste).
22
- Paste Deploy (optional, needed when proxying through Apache).
24
- flup (optional, needed to use FastCGI, SCGI or AJP).
27
Installing Dependencies Using Ubuntu Packages
28
#############################################
32
$ sudo apt-get install python-simpletal
33
$ sudo apt-get install python-simplejson
34
$ sudo apt-get install python-paste
35
$ sudo apt-get install python-pastedeploy
36
$ sudo apt-get install python-flup
38
Installing Dependencies Using :command:`easy_install`
39
#####################################################
44
-f http://www.owlfish.com/software/simpleTAL/py2compatible/download.html \
46
$ easy_install simplejson
48
$ easy_install PasteDeploy
52
Running the Standalone Loggerhead Server
53
----------------------------------------
55
After installing all the dependencies, you should be able to run
56
:command:`serve-branches` with the branch you want to serve on the
39
61
./serve-branches ~/path/to/branch
41
The script listens on port 8080 so head to http://localhost:8080/ in
42
your browser to see the branch. You can also pass a directory that
43
contains branches to the script, and it will serve a very simple
44
directory listing at other pages.
63
By default, the script listens on port 8080, so head to
64
http://localhost:8080/ in your browser to see the branch.
66
You can also pass a directory that contains branches to the script,
67
and it will serve a very simple directory listing at other pages.
46
69
You may update the Bazaar branches being viewed at any time.
47
70
Loggerhead will notice and refresh, and Bazaar uses its own branch
48
71
locking to prevent corruption.
50
To run loggerhead as a linux daemon:
52
1) Copy loggerheadd to ``/etc/init.d``
54
2) Edit the file to configure where your loggerhead is installed, and which
73
See :doc:`serve-branches` for all command line options.
75
Running Loggerhead as a Daemon
76
------------------------------
78
To run Loggerhead as a linux daemon:
80
1) Copy the ``loggerheadd`` scipt to ``/etc/init.d``
84
$ sudo cp ./loggerheadd /etc/init.d
86
2) Edit the file to configure where your Loggerhead is installed, and which
55
87
serve-branches options you would like.
91
$ sudo vim /etc/init.d/loggerheadd
57
93
3) Register the service
60
a) on upstart based systems like Ubuntu run:
61
``update-rc.d loggerheadd defaults``
63
b) on Sysvinit based systems like Centos or SuSE run:
64
``chkconfig --add loggerheadd``
67
Loggerhead as a Bazaar Plugin
68
-----------------------------
97
# on upstart based systems like Ubuntu run:
98
$ sudo update-rc.d loggerheadd defaults
100
# on Sysvinit based systems like Centos or SuSE run:
101
$ sudo chkconfig --add loggerheadd
104
Using Loggerhead as a Bazaar Plugin
105
------------------------------------
70
107
This branch contains experimental support for using Loggerhead as a Bazaar
71
108
plugin. To use it, place the top-level Loggerhead directory (the one
72
containing this file) at ``~/.bazaar/plugins/loggerhead``.
109
containing COPYING.txt) at ``~/.bazaar/plugins/loggerhead``. E.g.:
113
$ bzr branch lp:loggerhead ~/.bazaar/plugins/loggerhead
75
118
Using a Config File
105
147
If Paste Deploy is installed, the :command:`serve-branches` script can be
106
148
run behind a proxy at the root of a site, but if you're running it at
107
some path into the site, you'll need to specify is using
149
some path into the site, you'll need to specify it using
108
150
``--prefix=/some_path``.
152
Serving Loggerhead with mod_wsgi
153
--------------------------------
155
A second method for using loggehead with apache is to have apache itself
156
execute loggerhead via mod_wsgi. You need to add configuration for apache and
157
for bazaar to make this work. Example config files are in the loggerhead doc
158
directory as apache-loggerhead.conf and bazaar.conf. You can copy them into
159
place and use them as a starting point following these directions:
161
1) Install mod_wsgi. On Ubuntu and other Debian derived distros::
163
sudo apt-get install libapache2-mod-wsgi
165
On Fedora-derived distros::
167
su -c yum install mod_wsgi
169
2) Copy the bazaar conf file where apache will find it (May be done for you if
170
you installed loggerhead from a distribution package)::
172
# install -d -o apache -g apache -m 0755 /etc/loggerhead
173
# cp -p /usr/share/doc/loggerhead*/bazaar.conf /etc/loggerhead/
174
# ln -s /etc/loggerhead /var/www/.bazaar
176
3) Create the cache directory (May be done for you if you installed loggerhead
177
from a distribution package)::
179
# install -d -o apache -g apache -m 0700 /var/cache/loggerhead/
181
4) Edit /etc/loggerhead/bazaar.conf. You need to set http_root_dir to the filesystem
182
path that you will find your bzr branches under. Note that normal
183
directories under that path will also be visible in loggerhead.
185
5) Install the apache conf file::
187
# cp -p /usr/share/doc/loggerhead*/apache-loggerhead.conf /etc/httpd/conf.d/loggerhead.conf
189
6) Edit /etc/httpd/conf.d/loggerhead.conf to point to the url you desire to
190
serve loggerhead on. This should match with the setting for
191
http_user_prefix in bazaar.conf
193
7) Restart apache and you should be able to start browsing
195
.. note:: If you have SELinux enabled on your system you may need to allow
196
apache to execute files in temporary directories. You will get a
197
MemoryError traceback from python if this is the case. This is because of
198
the way that python ctypes interacts with libffi. To rectify this, you may
199
have to do several things, such as mounting tmpdirs so programs can be
200
executed on them and setting this SELinux boolean::
202
setsebool httpd_tmp_exec on
204
This bug has information about how python and/or Linux distros might solve
205
this issue permanently and links to bugs which diagnose the root cause.
206
https://bugzilla.redhat.com/show_bug.cgi?id=582009
114
211
Search is currently supported by using the bzr-search plugin (available
115
at: ``https://launchpad.net/bzr-search``
212
at: https://launchpad.net/bzr-search ).
116
214
You need to have the plugin installed and each branch indexed to allow
117
215
searching on branches.
217
Command-Line Reference
218
----------------------
123
Loggerhead is loosely based on bazaar-webserve, which was loosely
124
based on hgweb. Discussion should take place on the bazaar-dev
125
mailing list at bazaar@lists.canonical.com. You can join the list at
231
Discussion should take place on the bazaar-dev mailing list at
232
mailto:bazaar@lists.canonical.com. You can join the list at
126
233
<https://lists.ubuntu.com/mailman/listinfo/bazaar>. You don't need to
127
234
subscribe to post, but your first post will be held briefly for manual
130
Bugs are tracked on Launchpad; start at:
237
Bugs, support questions and merge proposals are tracked on Launchpad, e.g:
132
239
https://bugs.launchpad.net/loggerhead