Code

- restore old announcement header for next release...
[roundup.git] / doc / admin_guide.txt
1 ====================
2 Administration Guide
3 ====================
5 .. contents::
7 What does Roundup install?
8 ==========================
10 There's two "installations" that we talk about when using Roundup:
12 1. The installation of the software and its support files. This uses the
13    standard Python mechanism called "distutils" and thus Roundup's core code,
14    executable scripts and support data files are installed in Python's
15    directories. On Windows, this is typically:
17    Scripts
18      ``<python dir>\scripts\...``
19    Core code
20      ``<python dir>\lib\site-packages\roundup\...``
21    Support files
22      ``<python dir>\share\roundup\...``
24    and on Unix-like systems (eg. Linux):
26    Scripts
27      ``<python root>/bin/...``
28    Core code
29      ``<python root>/lib-<python version>/site-packages/roundup/...``
30    Support files
31      ``<python root>/share/roundup/...``
33 2. The installation of a specific tracker. When invoking the roundup-admin
34    "inst" (and "init") commands, you're creating a new Roundup tracker. This
35    installs configuration files, HTML templates, detector code and a new
36    database. You have complete control over where this stuff goes through
37    both choosing your "tracker home" and the ``main`` -> ``database`` variable
38    in the tracker's config.ini.
41 Configuring Roundup's Logging of Messages For Sysadmins
42 =======================================================
44 You may configure where Roundup logs messages in your tracker's config.ini
45 file. Roundup will use the standard Python (2.3+) logging implementation
46 when available. If not, then a very basic logging implementation will be used
47 (see BasicLogging in the roundup.rlog module for details).
49 Configuration for standard "logging" module:
50  - tracker configuration file specifies the location of a logging
51    configration file as ``logging`` -> ``config``
52  - ``roundup-server`` specifies the location of a logging configuration
53    file on the command line
54 Configuration for "BasicLogging" implementation:
55  - tracker configuration file specifies the location of a log file
56    ``logging`` -> ``filename``
57  - tracker configuration file specifies the level to log to as
58    ``logging`` -> ``level``
59  - ``roundup-server`` specifies the location of a log file on the command
60    line
61  - ``roundup-server`` specifies the level to log to on the command line
63 (``roundup-mailgw`` always logs to the tracker's log file)
65 In both cases, if no logfile is specified then logging will simply be sent
66 to sys.stderr with only logging of ERROR messages.
69 Configuring roundup-server
70 ==========================
72 The basic configuration file layout is as follows (take from the
73 ``roundup-server.ini.example`` file in the "doc" directory)::
75     [main]
76     port = 8080
77     ;host =
78     ;user =
79     ;group =
80     ;log_ip = yes
81     ;pidfile =
82     ;logfile =
83     ;template =
84     ;ssl = no
85     ;pem =
87     [trackers]
88     ; Add one of these per tracker being served
89     name = /path/to/tracker/name
91 Values ";commented out" are optional. The meaning of the various options
92 are as follows:
94 **port**
95   Defines the local TCP port to listen for clients on.
96 **host**
97   Defines the hostname or IP number to listen for clients on. Only
98   required if `localhost` is not sufficient. If left empty (as opposed
99   to no `host` keyword in the config-file) this will listen to all
100   network interfaces and is equivalent to an explicit address `0.0.0.0`.
101   The use of an empty string to listen to all interfaces is deprecated
102   and will go away in a future version.
103 **user** and **group**
104   Defines the Unix user and group to run the server as. Only work if the
105   server is started as root.
106 **log_ip**
107   If ``yes`` then we log IP addresses against accesses. If ``no`` then we
108   log the hostname of the client. The latter can be much slower.
109 **pidfile**
110   If specified, the server will fork at startup and write its new PID to
111   the file.
112 **logfile**
113   Any unhandled exception messages or other output from Roundup will be
114   written to this file. It must be specified if **pidfile** is specified.
115   If per-tracker logging is specified, then very little will be written to
116   this file.
117 **template**
118   Specifies a template used for displaying the tracker index when
119   multiple trackers are being used. The variable "trackers" is available
120   to the template and is a dict of all configured trackers.
121 **ssl**
122   Enables the use of SSL to secure the connection to the roundup-server.
123   If you enable this, ensure that your tracker's config.ini specifies
124   an *https* URL.
125 **pem**
126   If specified, the SSL PEM file containing the private key and certificate.
127   If not specified, roundup will generate a temporary, self-signed certificate
128   for use.
129 **trackers** section
130   Each line denotes a mapping from a URL component to a tracker home.
131   Make sure the name part doesn't include any url-unsafe characters like
132   spaces. Stick to alphanumeric characters and you'll be ok.
135 Users and Security
136 ==================
138 Roundup holds its own user database which primarily contains a username,
139 password and email address for the user. Roundup *must* have its own user
140 listing, in order to maintain internal consistency of its data. It is a
141 relatively simple exercise to update this listing on a regular basis, or on
142 demand, so that it matches an external listing (eg. unix passwd file, LDAP,
143 etc.)
145 Roundup identifies users in a number of ways:
147 1. Through the web, users may be identified by either HTTP Basic
148    Authentication or cookie authentication. If you are running the web
149    server (roundup-server) through another HTTP server (eg. apache or IIS)
150    then that server may require HTTP Basic Authentication, and it will pass
151    the ``REMOTE_USER`` variable through to Roundup. If this variable is not
152    present, then Roundup defaults to using its own cookie-based login
153    mechanism.
154 2. In email messages handled by roundup-mailgw, users are identified by the
155    From address in the message.
157 In both cases, Roundup's behaviour when dealing with unknown users is
158 controlled by Permissions defined in the "SECURITY SETTINGS" section of the
159 tracker's ``schema.py`` module:
161 Web Registration
162   If granted to the Anonymous Role, then anonymous users will be able to
163   register through the web.
164 Email Registration
165   If granted to the Anonymous Role, then email messages from unknown users
166   will result in those users being registered with the tracker.
168 More information about how to customise your tracker's security settings
169 may be found in the `customisation documentation`_.
172 Tasks
173 =====
175 Maintenance of Roundup can involve one of the following:
177 1. `tracker backup`_
178 2. `software upgrade`_
179 3. `migrating backends`_
180 4. `moving a tracker`_
181 5. `migrating from other software`_
182 6. `adding a user from the command-line`_
185 Tracker Backup
186 --------------
188 The roundup-admin import and export commands are **not** recommended for
189 performing backup.
191 Optionally stop the web and email frontends and to copy the contents of the
192 tracker home directory to some other place using standard backup tools.
193 This means using
194 *pg_dump* to take a snapshot of your Postgres backend database, for example.
195 A simple copy of the tracker home (and files storage area if you've configured
196 it to be elsewhere) will then complete the backup.
199 Software Upgrade
200 ----------------
202 Always make a backup of your tracker before upgrading software. Steps you may
203 take:
205 1. Ensure that the unit tests run on your system::
207     python run_tests.py
209 2. If you're using an RDBMS backend, make a backup of its contents now.
210 3. Make a backup of the tracker home itself.
211 4. Stop the tracker web and email frontends.
212 5. Install the new version of the software::
214     python setup.py install
216 6. Follow the steps in the `upgrading documentation`_ for the new version of
217    the software in the copied.
219    Usually you will be asked to run `roundup_admin migrate` on your tracker
220    before you allow users to start accessing the tracker.
222    It's safe to run this even if it's not required, so just get into the
223    habit.
224 7. Restart your tracker web and email frontends.
226 If something bad happens, you may reinstate your backup of the tracker and
227 reinstall the older version of the sofware using the same install command::
229     python setup.py install
232 Migrating Backends
233 ------------------
235 1. Stop the existing tracker web and email frontends (preventing changes).
236 2. Use the roundup-admin tool "export" command to export the contents of
237    your tracker to disk.
238 3. Copy the tracker home to a new directory.
239 4. Delete the "db" directory from the new directory.
240 5. Enter the new backend name in the tracker home ``db/backend_name`` file.
241 6. Use the roundup-admin "import" command to import the previous export with
242    the new tracker home. If non-interactively::
243      
244      roundup-admin -i <tracker home> import <tracker export dir>
246    If interactively, enter 'commit' before exitting.
247 7. Test each of the admin tool, web interface and mail gateway using the new
248    backend.
249 8. Move the old tracker home out of the way (rename to "tracker.old") and
250    move the new tracker home into its place.
251 9. Restart web and email frontends.
254 Moving a Tracker
255 ----------------
257 If you're moving the tracker to a similar machine, you should:
259 1. install Roundup on the new machine and test that it works there,
260 2. stop the existing tracker web and email frontends (preventing changes),
261 3. copy the tracker home directory over to the new machine, and
262 4. start the tracker web and email frontends on the new machine.
264 Most of the backends are actually portable across platforms (ie. from Unix to
265 Windows to Mac). If this isn't the case (ie. the tracker doesn't work when
266 moved using the above steps) then you'll need to:
268 1. install Roundup on the new machine and test that it works there,
269 2. stop the existing tracker web and email frontends (preventing changes),
270 3. use the roundup-admin tool "export" command to export the contents of
271    the existing tracker,
272 4. copy the export to the new machine,
273 5. use the roundup-admin "import" command to import the tracker on the new
274    machine, and
275 6. start the tracker web and email frontends on the new machine.
278 Migrating From Other Software
279 -----------------------------
281 You have a couple of choices. You can either use a CSV import into Roundup,
282 or you can write a simple Python script which uses the Roundup API
283 directly. The latter is almost always simpler -- see the "scripts"
284 directory in the Roundup source for some example uses of the API.
286 "roundup-admin import" will import data into your tracker from a
287 directory containing files with the following format:
289 - one colon-separated-values file per Class with columns for each property,
290   named <classname>.csv
291 - one colon-separated-values file per Class with journal information,
292   named <classname>-journals.csv (this is required, even if it's empty)
293 - if the Class is a FileClass, you may have the "content" property
294   stored in separate files from the csv files. This goes in a directory
295   structure::
297       <classname>-files/<N>/<designator>
299   where ``<designator>`` is the item's ``<classname><id>`` combination.
300   The ``<N>`` value is ``int(<id> / 1000)``.
303 Adding A User From The Command-Line
304 -----------------------------------
306 The ``roundup-admin`` program can create any data you wish to in the
307 database. To create a new user, use::
309     roundup-admin create user
311 To figure out what good values might be for some of the fields (eg. Roles)
312 you can just display another user::
314     roundup-admin list user
316 (or if you know their username, and it happens to be "richard")::
318     roundup-admin find username=richard
320 then using the user id you get from one of the above commands, you may
321 display the user's details::
323     roundup-admin display <userid>
326 Running the Servers
327 ===================
329 Unix
330 ----
332 On Unix systems, use the scripts/server-ctl script to control the
333 roundup-server server. Copy it somewhere and edit the variables at the top
334 to reflect your specific installation.
337 Windows
338 -------
340 On Windows, the roundup-server program runs as a Windows Service, and
341 therefore may be controlled through the Services control panel. The
342 roundup-server program may also control the service directly:
344 **install the service**
345   ``roundup-server -C /path/to/my/roundup-server.ini -c install``
346 **start the service**
347   ``roundup-server -c start``
348 **stop the service**
349   ``roundup-server -c stop``
351 To bring up the services panel:
353 Windows 2000 and later
354   Start/Control Panel/Administrative Tools/Services
355 Windows NT4
356   Start/Control Panel/Services
358 You will need a server configuration file (as described in
359 `Configuring roundup-server`_) for specifying tracker homes
360 and other roundup-server configuration. Specify the name of
361 this file using the ``-C`` switch when installing the service.
363 Running the Mail Gateway Script
364 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
366 The mail gateway script should be scheduled to run regularly on your
367 Windows server. Normally this will result in a window popping up. The
368 solution to this is to:
370 1. Create a new local account on the Roundup server
371 2. Set the scheduled task to run in the context of this user instead
372    of your normal login
375 .. _`customisation documentation`: customizing.html
376 .. _`upgrading documentation`: upgrading.html