/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk
401.2.7 by Tres Seaver
Use 'Loggerhead' as the display name; fix typos.
1
Loggerhead:  A web viewer for ``bzr`` branches
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
2
==============================================
3
491.2.8 by Jelmer Vernooij
Update references to breezy.
4
Loggerhead is a web viewer for projects in . It can be used to navigate 
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
5
a branch history, annotate files, view patches, perform searches, etc.
401.2.7 by Tres Seaver
Use 'Loggerhead' as the display name; fix typos.
6
Loggerhead is heavily based on `bazaar-webserve
401.2.4 by Tres Seaver
Move cross-ref of bazaar-webserve and hgweb to intro graph; remove dead modindex and search.
7
<https://launchpad.net/bzr-webserve>`_, which was, in turn, loosely
8
based on `hgweb <http://mercurial.selenic.com/wiki/HgWebDirStepByStep>`_.
9
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
10
11
Getting Started
12
---------------
13
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
14
Loggerhead depends on the following Python libraries.:
15
16
- SimpleTAL for templating.
17
18
- simplejson for producing JSON data.
19
401.2.8 by Tres Seaver
Consistent punctuation.
20
- Paste for the server. (You need version 1.2 or newer of Paste).
21
22
- Paste Deploy  (optional, needed when proxying through Apache).
23
24
- flup (optional, needed to use FastCGI, SCGI or AJP).
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
25
26
27
Installing Dependencies Using Ubuntu Packages
28
#############################################
29
30
.. code-block:: sh
31
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
37
38
Installing Dependencies Using :command:`easy_install`
39
#####################################################
40
41
.. code-block:: sh
42
43
   $ easy_install \
44
     -f http://www.owlfish.com/software/simpleTAL/py2compatible/download.html \
45
     SimpleTAL
46
   $ easy_install simplejson
47
   $ easy_install Paste
48
   $ easy_install PasteDeploy
49
   $ easy_install flup
50
51
52
Running the Standalone Loggerhead Server
53
----------------------------------------
54
55
After installing all the dependencies, you should be able to run
491.2.45 by Jelmer Vernooij
Rename serve-branches to loggerhead-serve.
56
:command:`loggerhead-serve` with the branch you want to serve on the
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
57
command line:
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
58
59
.. code-block:: sh
60
491.2.45 by Jelmer Vernooij
Rename serve-branches to loggerhead-serve.
61
    ./loggerhead-serve ~/path/to/branch
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
62
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
63
By default, the script listens on port 8080, so head to
64
http://localhost:8080/ in your browser to see the branch.
65
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.
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
68
69
You may update the Bazaar branches being viewed at any time.
70
Loggerhead will notice and refresh, and Bazaar uses its own branch
71
locking to prevent corruption.
72
491.2.45 by Jelmer Vernooij
Rename serve-branches to loggerhead-serve.
73
See :doc:`loggerhead-serve` for all command line options.
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
74
75
Running Loggerhead as a Daemon
76
------------------------------
77
401.2.7 by Tres Seaver
Use 'Loggerhead' as the display name; fix typos.
78
To run Loggerhead as a linux daemon:
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
79
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
80
1) Copy the ``loggerheadd`` scipt to ``/etc/init.d``
81
82
.. code-block:: sh
83
84
   $ sudo cp ./loggerheadd /etc/init.d
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
85
401.2.7 by Tres Seaver
Use 'Loggerhead' as the display name; fix typos.
86
2) Edit the file to configure where your Loggerhead is installed, and which
491.2.45 by Jelmer Vernooij
Rename serve-branches to loggerhead-serve.
87
   loggerhead-serve options you would like.
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
88
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
89
.. code-block:: sh
90
91
   $ sudo vim /etc/init.d/loggerheadd
92
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
93
3) Register the service
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
94
95
.. code-block:: sh
96
401.2.7 by Tres Seaver
Use 'Loggerhead' as the display name; fix typos.
97
   # on upstart based systems like Ubuntu run: 
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
98
   $ sudo update-rc.d loggerheadd defaults
99
401.2.7 by Tres Seaver
Use 'Loggerhead' as the display name; fix typos.
100
   # on Sysvinit based systems like Centos or SuSE run:
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
101
   $ sudo chkconfig --add loggerheadd
102
103
491.2.8 by Jelmer Vernooij
Update references to breezy.
104
Using Loggerhead as a Breezy Plugin
105
-----------------------------------
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
106
491.2.8 by Jelmer Vernooij
Update references to breezy.
107
This branch contains experimental support for using Loggerhead as a Breezy
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
108
plugin.  To use it, place the top-level Loggerhead directory (the one
491.2.8 by Jelmer Vernooij
Update references to breezy.
109
containing COPYING.txt) at ``~/.config/breezy/plugins/loggerhead``.  E.g.:
401.2.3 by Tres Seaver
Explain plugin usage, link bazaar-webserve and hgweb.
110
111
.. code-block:: sh
112
491.2.8 by Jelmer Vernooij
Update references to breezy.
113
   $ bzr branch lp:loggerhead ~/.config/breezy/plugins/loggerhead
401.2.3 by Tres Seaver
Explain plugin usage, link bazaar-webserve and hgweb.
114
   $ cd ~/myproject
115
   $ bzr serve --http
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
116
117
118
Using a Config File
119
-------------------
120
491.2.8 by Jelmer Vernooij
Update references to breezy.
121
To hide branches from being displayed, add to ``~/.config/breezy/locations.conf``,
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
122
under the branch's section:
123
124
.. code-block:: ini
125
126
    [/path/to/branch]
127
    http_serve = False
128
129
More configuration options to come soon.
130
131
401.2.6 by Tres Seaver
Better section title.
132
Serving Loggerhead behind Apache
133
--------------------------------
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
134
491.2.8 by Jelmer Vernooij
Update references to breezy.
135
If you want to view Breezy branches from your existing Apache
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
136
installation, you'll need to configure Apache to proxy certain
401.2.11 by Ian Clatworthy
Minor tweaks to Tres' content
137
requests to Loggerhead.  Adding lines like this to your Apache
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
138
configuration is one way to do this:
139
140
.. code-block:: apache
141
142
    <Location "/branches/">
143
        ProxyPass http://127.0.0.1:8080/branches/
144
        ProxyPassReverse http://127.0.0.1:8080/branches/
145
    </Location>
146
491.2.45 by Jelmer Vernooij
Rename serve-branches to loggerhead-serve.
147
If Paste Deploy is installed, the :command:`loggerhead-serve` script can be
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
148
run behind a proxy at the root of a site, but if you're running it at
401.2.11 by Ian Clatworthy
Minor tweaks to Tres' content
149
some path into the site, you'll need to specify it using
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
150
``--prefix=/some_path``.
151
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
152
Serving Loggerhead with mod_wsgi
153
--------------------------------
154
407.2.7 by Toshio Kuratomi
mispellings/capitalization of Loggerhead.
155
A second method for using Loggerhead with apache is to have apache itself
156
execute Loggerhead via mod_wsgi.  You need to add configuration for apache and
491.2.8 by Jelmer Vernooij
Update references to breezy.
157
for breezy to make this work.  Example config files are in the Loggerhead doc
158
directory as apache-loggerhead.conf and breezy.conf.  You can copy them into
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
159
place and use them as a starting point following these directions:
160
161
1) Install mod_wsgi.  On Ubuntu and other Debian derived distros::
162
163
    sudo apt-get install libapache2-mod-wsgi
164
165
   On Fedora-derived distros::
166
167
    su -c yum install mod_wsgi
168
491.2.8 by Jelmer Vernooij
Update references to breezy.
169
2) Copy the breezy.conf file where apache will find it (May be done for you if
407.2.7 by Toshio Kuratomi
mispellings/capitalization of Loggerhead.
170
   you installed Loggerhead from a distribution package)::
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
171
172
    # install -d -o apache -g apache -m 0755 /etc/loggerhead
491.2.8 by Jelmer Vernooij
Update references to breezy.
173
    # cp -p /usr/share/doc/loggerhead*/breezy.conf /etc/loggerhead/
174
    # mkdir -p /var/www/.config
175
    # ln -s /etc/loggerhead /var/www/.config/breezy
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
176
407.2.7 by Toshio Kuratomi
mispellings/capitalization of Loggerhead.
177
3) Create the cache directory (May be done for you if you installed Loggerhead
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
178
   from a distribution package)::
179
180
    # install -d -o apache -g apache -m 0700 /var/cache/loggerhead/
181
491.2.8 by Jelmer Vernooij
Update references to breezy.
182
4) Edit /etc/loggerhead/breezy.conf.  You need to set http_root_dir to the filesystem
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
183
   path that you will find your bzr branches under.  Note that normal
407.2.7 by Toshio Kuratomi
mispellings/capitalization of Loggerhead.
184
   directories under that path will also be visible in Loggerhead.
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
185
186
5) Install the apache conf file::
187
188
     # cp -p /usr/share/doc/loggerhead*/apache-loggerhead.conf /etc/httpd/conf.d/loggerhead.conf
189
190
6) Edit /etc/httpd/conf.d/loggerhead.conf to point to the url you desire to
407.2.7 by Toshio Kuratomi
mispellings/capitalization of Loggerhead.
191
   serve Loggerhead on.  This should match with the setting for
491.2.8 by Jelmer Vernooij
Update references to breezy.
192
   http_user_prefix in breezy.conf
407.2.3 by Toshio Kuratomi
Merge README.mod_wsgi into the installation instructions in docs/index.rst and add mod_wsgi note to NEWS
193
194
7) Restart apache and you should be able to start browsing
195
196
.. note:: If you have SELinux enabled on your system you may need to allow
197
   apache to execute files in temporary directories.  You will get a
198
   MemoryError traceback from python if this is the case.  This is because of
199
   the way that python ctypes interacts with libffi.  To rectify this, you may
200
   have to do several things, such as mounting tmpdirs so programs can be
201
   executed on them and setting this SELinux boolean::
202
203
       setsebool httpd_tmp_exec on
204
205
   This bug has information about how python and/or Linux distros might solve
206
   this issue permanently and links to bugs which diagnose the root cause.
207
   https://bugzilla.redhat.com/show_bug.cgi?id=582009
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
208
209
Search
210
------
211
212
Search is currently supported by using the bzr-search plugin (available
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
213
at: https://launchpad.net/bzr-search ).
214
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
215
You need to have the plugin installed and each branch indexed to allow
216
searching on branches.
217
401.2.5 by Tres Seaver
Better section title.
218
Command-Line Reference
219
----------------------
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
220
221
.. toctree::
222
   :maxdepth: 2
223
491.2.45 by Jelmer Vernooij
Rename serve-branches to loggerhead-serve.
224
   loggerhead-serve
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
225
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
226
227
Support
228
-------
229
401.2.3 by Tres Seaver
Explain plugin usage, link bazaar-webserve and hgweb.
230
Discussion should take place on the bazaar-dev mailing list at
231
mailto:bazaar@lists.canonical.com.  You can join the list at
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
232
<https://lists.ubuntu.com/mailman/listinfo/bazaar>.  You don't need to
233
subscribe to post, but your first post will be held briefly for manual
234
moderation.
235
401.2.11 by Ian Clatworthy
Minor tweaks to Tres' content
236
Bugs, support questions and merge proposals are tracked on Launchpad, e.g:
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
237
238
    https://bugs.launchpad.net/loggerhead
239
240
241
Hacking
242
-------
243
401.2.7 by Tres Seaver
Use 'Loggerhead' as the display name; fix typos.
244
To run Loggerhead tests, you will need to install the package ``python-nose``,
245
and run its :command:`nosetests` script in the Loggerhead directory:
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
246
247
.. code-block:: sh
248
249
    nosetests
250
401.2.2 by Tres Seaver
ReST fixups, better cross-references.
251
401.2.1 by Tres Seaver
Add Sphinx-based documentation.
252
License
253
-------
254
255
GNU GPLv2 or later.
256
257
See Also
258
--------
259
260
https://launchpad.net/loggerhead
261
401.2.4 by Tres Seaver
Move cross-ref of bazaar-webserve and hgweb to intro graph; remove dead modindex and search.
262
Index
263
=====
264
265
- :ref:`genindex`