~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to docs/index.rst

  • Committer: Tres Seaver
  • Date: 2010-03-23 20:06:26 UTC
  • mto: This revision was merged to the branch mainline in revision 405.
  • Revision ID: tseaver@agendaless.com-20100323200626-p0wu0tzlqxhnksy1
Explain plugin usage, link bazaar-webserve and hgweb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
loggerhead:  A web viewer for ``bzr`` branches
 
2
==============================================
 
3
 
 
4
Loggerhead is a web viewer for projects in bazaar. It can be used to navigate 
 
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``
 
7
for Mercurial.
 
8
 
 
9
Getting Started
 
10
---------------
 
11
 
 
12
Loggerhead depends on the following Python libraries.:
 
13
 
 
14
- SimpleTAL for templating.
 
15
 
 
16
- simplejson for producing JSON data.
 
17
 
 
18
- Paste for the server. (You need version 1.2 or newer of Paste.)
 
19
 
 
20
- Paste Deploy  (optional, needed when proxying through Apache)
 
21
 
 
22
- flup (optional, needed to use FastCGI, SCGI or AJP)
 
23
 
 
24
 
 
25
Installing Dependencies Using Ubuntu Packages
 
26
#############################################
 
27
 
 
28
.. code-block:: sh
 
29
 
 
30
   $ sudo apt-get install python-simpletal
 
31
   $ sudo apt-get install python-simplejson
 
32
   $ sudo apt-get install python-paste
 
33
   $ sudo apt-get install python-pastedeploy
 
34
   $ sudo apt-get install python-flup
 
35
 
 
36
Installing Dependencies Using :command:`easy_install`
 
37
#####################################################
 
38
 
 
39
.. code-block:: sh
 
40
 
 
41
   $ easy_install \
 
42
     -f http://www.owlfish.com/software/simpleTAL/py2compatible/download.html \
 
43
     SimpleTAL
 
44
   $ easy_install simplejson
 
45
   $ easy_install Paste
 
46
   $ easy_install PasteDeploy
 
47
   $ easy_install flup
 
48
 
 
49
 
 
50
Running the Standalone Loggerhead Server
 
51
----------------------------------------
 
52
 
 
53
After installing all the dependencies, you should be able to run
 
54
:command:`serve-branches` with the branch you want to serve on the
 
55
command line:
 
56
 
 
57
.. code-block:: sh
 
58
 
 
59
    ./serve-branches ~/path/to/branch
 
60
 
 
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.
 
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
 
 
71
See :doc:`serve-branches` for all command line options.
 
72
 
 
73
Running Loggerhead as a Daemon
 
74
------------------------------
 
75
 
 
76
To run loggerhead as a linux daemon:
 
77
 
 
78
1) Copy the ``loggerheadd`` scipt to ``/etc/init.d``
 
79
 
 
80
.. code-block:: sh
 
81
 
 
82
   $ sudo cp ./loggerheadd /etc/init.d
 
83
 
 
84
2) Edit the file to configure where your loggerhead is installed, and which
 
85
   serve-branches options you would like.
 
86
 
 
87
.. code-block:: sh
 
88
 
 
89
   $ sudo vim /etc/init.d/loggerheadd
 
90
 
 
91
3) Register the service
 
92
 
 
93
a) on upstart based systems like Ubuntu run: 
 
94
 
 
95
.. code-block:: sh
 
96
 
 
97
   $ sudo update-rc.d loggerheadd defaults
 
98
 
 
99
b) on Sysvinit based systems like Centos or SuSE run:
 
100
 
 
101
.. code-block:: sh
 
102
 
 
103
   $ sudo chkconfig --add loggerheadd
 
104
 
 
105
 
 
106
Using Loggerhead as a Bazaar Plugin
 
107
------------------------------------
 
108
 
 
109
This branch contains experimental support for using Loggerhead as a Bazaar
 
110
plugin.  To use it, place the top-level Loggerhead directory (the one
 
111
containing this file) at ``~/.bazaar/plugins/loggerhead``.  E.g.:
 
112
 
 
113
.. code-block:: sh
 
114
 
 
115
   $ bzr branch lp:loggerhead ~/.bazaar/plugins/loggerhead
 
116
   $ cd ~/myproject
 
117
   $ bzr serve --http
 
118
 
 
119
 
 
120
Using a Config File
 
121
-------------------
 
122
 
 
123
To hide branches from being displayed, add to ``~/.bazaar/locations.conf``,
 
124
under the branch's section:
 
125
 
 
126
.. code-block:: ini
 
127
 
 
128
    [/path/to/branch]
 
129
    http_serve = False
 
130
 
 
131
More configuration options to come soon.
 
132
 
 
133
 
 
134
Serving Loggerhead from Behind Apache
 
135
-------------------------------------
 
136
 
 
137
If you want to view Bazaar branches from your existing Apache
 
138
installation, you'll need to configure Apache to proxy certain
 
139
requests to Loggerhead.  Adding lines like this to you Apache
 
140
configuration is one way to do this:
 
141
 
 
142
.. code-block:: apache
 
143
 
 
144
    <Location "/branches/">
 
145
        ProxyPass http://127.0.0.1:8080/branches/
 
146
        ProxyPassReverse http://127.0.0.1:8080/branches/
 
147
    </Location>
 
148
 
 
149
If Paste Deploy is installed, the :command:`serve-branches` script can be
 
150
run behind a proxy at the root of a site, but if you're running it at
 
151
some path into the site, you'll need to specify is using
 
152
``--prefix=/some_path``.
 
153
 
 
154
 
 
155
Search
 
156
------
 
157
 
 
158
Search is currently supported by using the bzr-search plugin (available
 
159
at: https://launchpad.net/bzr-search ).
 
160
 
 
161
You need to have the plugin installed and each branch indexed to allow
 
162
searching on branches.
 
163
 
 
164
Script Reference
 
165
----------------
 
166
 
 
167
.. toctree::
 
168
   :maxdepth: 2
 
169
 
 
170
   serve-branches
 
171
   start-loggerhead
 
172
   stop-loggerhead
 
173
 
 
174
 
 
175
Support
 
176
-------
 
177
 
 
178
Loggerhead is loosely based on `bazaar-webserve
 
179
<https://launchpad.net/bzr-webserve>`_, which was, in turn, loosely
 
180
based on `hgweb <http://mercurial.selenic.com/wiki/HgWebDirStepByStep>`_.
 
181
 
 
182
Discussion should take place on the bazaar-dev mailing list at
 
183
mailto:bazaar@lists.canonical.com.  You can join the list at
 
184
<https://lists.ubuntu.com/mailman/listinfo/bazaar>.  You don't need to
 
185
subscribe to post, but your first post will be held briefly for manual
 
186
moderation.
 
187
 
 
188
Bugs are tracked on Launchpad; start at:
 
189
 
 
190
    https://bugs.launchpad.net/loggerhead
 
191
 
 
192
 
 
193
Hacking
 
194
-------
 
195
 
 
196
To run loggerhead tests, you will need to install the package ``python-nose``,
 
197
and run its :command:`nosetests` script in the loggerhead directory:
 
198
 
 
199
.. code-block:: sh
 
200
 
 
201
    nosetests
 
202
 
 
203
 
 
204
License
 
205
-------
 
206
 
 
207
GNU GPLv2 or later.
 
208
 
 
209
See Also
 
210
--------
 
211
 
 
212
https://launchpad.net/loggerhead
 
213
 
 
214
Indices and tables
 
215
==================
 
216
 
 
217
* :ref:`genindex`
 
218
* :ref:`modindex`
 
219
* :ref:`search`
 
220