Code

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