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