Mercurial > p > roundup > code
annotate doc/admin_guide.txt @ 8487:b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
nanoid is a shorter unique id generator and faster than uuid.
I truncate nanoid id's to 12 chars to make it more readable.
Also added decorator to allow setting the default processName
definition in the logging module. admin.py and wsgi_handler now set
processName. configuration.py knows how to overide the processName if
set to the default MainProcess.
Updated install docs to add nanoid as optional, how to switch to
different trace_id output. pydoc generated docs include logcontext
module and are referenced from admin.py.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 08 Dec 2025 00:23:14 -0500 |
| parents | ed4ef394d5d6 |
| children | 7142740e6547 |
| rev | line source |
|---|---|
|
6586
24e2eeb2ed9a
Add meta description to some doc pages.
John Rouillard <rouilj@ieee.org>
parents:
6458
diff
changeset
|
1 .. meta:: |
|
6774
e7b4ad2c57ac
landmarks, skiplink, remove bad attrs, autocomplete search
John Rouillard <rouilj@ieee.org>
parents:
6751
diff
changeset
|
2 :description: |
|
6586
24e2eeb2ed9a
Add meta description to some doc pages.
John Rouillard <rouilj@ieee.org>
parents:
6458
diff
changeset
|
3 How to administer, backup, upgrade a Roundup installation. |
|
24e2eeb2ed9a
Add meta description to some doc pages.
John Rouillard <rouilj@ieee.org>
parents:
6458
diff
changeset
|
4 System and user security, configuring web compression, |
|
24e2eeb2ed9a
Add meta description to some doc pages.
John Rouillard <rouilj@ieee.org>
parents:
6458
diff
changeset
|
5 documentation on using roundup-server and running |
|
24e2eeb2ed9a
Add meta description to some doc pages.
John Rouillard <rouilj@ieee.org>
parents:
6458
diff
changeset
|
6 roundup-admin. |
|
24e2eeb2ed9a
Add meta description to some doc pages.
John Rouillard <rouilj@ieee.org>
parents:
6458
diff
changeset
|
7 |
|
24e2eeb2ed9a
Add meta description to some doc pages.
John Rouillard <rouilj@ieee.org>
parents:
6458
diff
changeset
|
8 |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
9 ==================== |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
10 Administration Guide |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
11 ==================== |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
12 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
13 .. contents:: |
|
4890
609edf9de0a5
docs: Remove one nesting level from ToC on subpages
anatoly techtonik <techtonik@gmail.com>
parents:
4786
diff
changeset
|
14 :local: |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
15 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
16 What does Roundup install? |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
17 ========================== |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
18 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
19 There's two "installations" that we talk about when using Roundup: |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
20 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
21 1. The installation of the software and its support files. This uses the |
|
6727
3f3ce3004013
issue2551206 - remove mention of roundup installer, fix up windows docs
John Rouillard <rouilj@ieee.org>
parents:
6613
diff
changeset
|
22 standard Python mechanism called "setuptools" and thus Roundup's core code, |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 executable scripts and support data files are installed in Python's |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
24 directories. On Windows, this is typically: |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
25 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
26 Scripts |
|
2068
65b5297b488f
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2005
diff
changeset
|
27 ``<python dir>\scripts\...`` |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
28 Core code |
|
2068
65b5297b488f
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2005
diff
changeset
|
29 ``<python dir>\lib\site-packages\roundup\...`` |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
30 Support files |
|
2068
65b5297b488f
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2005
diff
changeset
|
31 ``<python dir>\share\roundup\...`` |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
32 |
|
2005
fc52d57c6c3e
documentation cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
2003
diff
changeset
|
33 and on Unix-like systems (eg. Linux): |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
34 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
35 Scripts |
|
2068
65b5297b488f
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2005
diff
changeset
|
36 ``<python root>/bin/...`` |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
37 Core code |
|
2068
65b5297b488f
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2005
diff
changeset
|
38 ``<python root>/lib-<python version>/site-packages/roundup/...`` |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
39 Support files |
|
2068
65b5297b488f
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2005
diff
changeset
|
40 ``<python root>/share/roundup/...`` |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
41 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
42 2. The installation of a specific tracker. When invoking the roundup-admin |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
43 "inst" (and "init") commands, you're creating a new Roundup tracker. This |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
44 installs configuration files, HTML templates, detector code and a new |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
45 database. You have complete control over where this stuff goes through |
|
2921
ad4fb8a14a97
more doc updates, not so many TODOs any more
Richard Jones <richard@users.sourceforge.net>
parents:
2632
diff
changeset
|
46 both choosing your "tracker home" and the ``main`` -> ``database`` variable |
|
3780
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
47 in the tracker's config.ini. |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
48 |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
49 .. _rounduplogging: |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
50 |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
51 Configuring Roundup Message Logging |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
52 =================================== |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
53 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
54 You can control how Roundup logs messages using your tracker's |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
55 config.ini file. Roundup uses the standard Python logging |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
56 implementation. The config file and ``roundup-server`` provide |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
57 very basic control over logging. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
58 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
59 ``roundup-server``'s logging is controlled from the command |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
60 line. You can: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
61 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
62 - specify the location of a log file or |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
63 - enable logging using the standard Python logging library under |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
64 the tag/channel ``roundup.http`` |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
65 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
66 Configuration for "BasicLogging" implementation for your tracker |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
67 is done using the settings in the tracker's ``config.ini`` under |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
68 the ``logging`` section: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
69 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
70 - ``filename`` setting: specifies the location of a log file |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
71 - ``level`` setting: specifies the minimum level to log |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
72 - ``disable_loggers`` setting: disable other loggers (e.g. when |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
73 running under a wsgi framework) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
74 - ``format`` setting: set the log format template. See |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
75 :ref:`logFormat` for more info. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
76 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
77 In either case, if logfile is not specified, logging is sent to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
78 sys.stderr. If level is not set, only ERROR or higher priority |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
79 log messages will be reported. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
80 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
81 You can get more control over logging by using the ``config`` |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
82 setting in the tracker's ``config.ini``. Using a logging config |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
83 file overrides all the rest of the other logging settings in |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
84 ``config.ini``. You get more control over the logs by supplying |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
85 a log config file in ini or json (dictionary) format. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
86 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
87 Using this, you can set different levels by channel. For example |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
88 roundup.hyperdb can be set to WARNING while other Roundup log |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
89 channels are set to INFO and the roundup.mailgw channel logs at |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
90 the DEBUG level. You can also control the distribution of |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
91 logs. For example roundup.mailgw logs to syslog, other channels |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
92 log to an automatically rotating log file, or are submitted to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
93 your log aggregator over https. |
|
2572
d15b71b8a85a
more logging goodness
Richard Jones <richard@users.sourceforge.net>
parents:
2479
diff
changeset
|
94 |
|
8443
39a6825d10ca
feat: allow admin to set logging format from config.ini
John Rouillard <rouilj@ieee.org>
parents:
8442
diff
changeset
|
95 .. _logFormat: |
|
39a6825d10ca
feat: allow admin to set logging format from config.ini
John Rouillard <rouilj@ieee.org>
parents:
8442
diff
changeset
|
96 |
|
39a6825d10ca
feat: allow admin to set logging format from config.ini
John Rouillard <rouilj@ieee.org>
parents:
8442
diff
changeset
|
97 Defining the Log Format |
|
39a6825d10ca
feat: allow admin to set logging format from config.ini
John Rouillard <rouilj@ieee.org>
parents:
8442
diff
changeset
|
98 ----------------------- |
|
39a6825d10ca
feat: allow admin to set logging format from config.ini
John Rouillard <rouilj@ieee.org>
parents:
8442
diff
changeset
|
99 |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
100 Starting with Roundup 2.6 you can specify the logging format in |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
101 config.ini. The ``logging`` -> ``format`` setting of config.ini |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
102 supports all of the `standard logging LogRecord attributes |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
103 <https://docs.python.org/3/library/logging.html#logrecord-attributes>`_ |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
104 or Roundup logging attributes. However you must double any ``%`` |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
105 format markers. The default value is:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
106 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
107 %%(asctime)s %%(trace_id)s %%(levelname)s %%(message)s |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
108 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
109 Roundup Logging Attributes |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
110 -------------------------- |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
111 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
112 The `logging package has a number of attributes |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
113 <https://docs.python.org/3/library/logging.html#logrecord-attributes>`_ |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
114 that can be expanded in the format template. In addition to the |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
115 ones supplied by Python's logging module, Roundup defines |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
116 additional attributes: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
117 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
118 trace_id |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
119 a unique string that is generated for each request. It is |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
120 unique per thread. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
121 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
122 trace_reason |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
123 a string describing the reason for the trace/request. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
124 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
125 * the URL for a web triggered (http, rest, xmlrpc) request |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
126 * the email message id for an email triggered request |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
127 * the roundup-admin os user and start of command. Only first |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
128 two words in command are printed so seting a password will |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
129 not be leaked to the logs. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
130 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
131 sinfo |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
132 the stack traceback information at the time the log call id |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
133 made. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
134 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
135 This must be intentionally activated by using the extras |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
136 parameter. For example calling:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
137 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
138 logging.get_logger('roundup.something').warning( |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
139 "I am here\n%(sinfo)s", extra={"sinfo": 2}) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
140 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
141 in the function confirmid() of the file detectors/reauth.py |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
142 in your demo tracker will print 2 items on the stack |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
143 including the log call. It results in the following (5 lines |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
144 total in the log file):: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
145 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
146 2025-09-14 23:07:58,668 Cm0ZPlBaklLZ3Mm6hAAgoC WARNING I am here |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
147 File "[...]/roundup/hyperdb.py", line 1924, in fireAuditors |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
148 audit(self.db, self, nodeid, newvalues) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
149 File "demo/detectors/reauth.py", line 7, in confirmid |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
150 logging.getLogger('roundup.something').warning( |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
151 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
152 Note that the output does not include the arguments to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
153 ``warning`` because they are on the following line. If you |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
154 want arguments to the log call included, they have to be on |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
155 the same line. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
156 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
157 Setting ``sinfo`` to an integer value N includes N lines up |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
158 the stack ending with the logging call. Setting it to 0 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
159 includes all the lines in the stack ending with the logging |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
160 call. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
161 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
162 If the value is less than 0, the stack dump doesn't end at |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
163 the logging call but continues to the function that |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
164 generates the stack report. So it includes functions inside |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
165 the logging module. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
166 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
167 Setting it to a number larger than the stack trace will |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
168 print the trace down to the log call. So using ``-1000`` |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
169 will print up to 1000 stack frames and start at the function |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
170 that generates the stack report. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
171 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
172 Setting ``sinfo`` to a non-integer value ``{"sinfo": None}`` |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
173 will produce 5 lines of the stack trace ending at the |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
174 logging call. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
175 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
176 pct_char |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
177 produces a single ``%`` sign in the log. The usual way of |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
178 embedding a percent sign in a formatted string is to double |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
179 it like: ``%%``. However when the format string is specified |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
180 in the config.ini file percent signs are manipulated. So |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
181 ``%%(pct_char)s`` can be used in config.ini to print a |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
182 percent sign. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
183 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
184 The default logging template is defined in config.ini in the |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
185 ``logging`` -> ``format`` setting. It includes the ``trace_id``. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
186 When searching logs, you can use the trace_id to see all the log |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
187 messages associated with a request. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
188 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
189 If you want to log from a detector, extension or other code, you |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
190 can use these tokens in your messages when calling the logging |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
191 functions. (Note that doubling ``%`` signs is only required when |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
192 defining the log format in a config file, not when defining a |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
193 msg.) For example:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
194 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
195 logging.getLogger('roundup.myextension').error('problem with ' |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
196 '%(trace_reason)s') |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
197 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
198 will include the url in the message when triggered from the |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
199 web. This also works with other log methods: ``warning()``, |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
200 ``debug()``, .... |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
201 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
202 Note you must **not** use positional arguments in your |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
203 message. Using:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
204 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
205 logging.getLogger('roundup.myextension').error( |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
206 '%s problem with %(trace_reason)s', "a") |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
207 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
208 will not properly substitute the argument. You must use mapping |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
209 key based arguments and define the local values as part of the |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
210 extra dictionary. For example:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
211 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
212 logging.getLogger('roundup.myextension').error('%(article)s ' |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
213 'problem with %(trace_reason)', |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
214 extra={"article": some_local_variable}) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
215 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
216 Also if you are logging any data supplied by a user, you must not |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
217 log it directly. If the variable ``url`` contains the url typed in |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
218 by the user, never use: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
219 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
220 logger.info(url) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
221 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
222 or |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
223 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
224 logger.info("Url is %s" % url) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
225 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
226 Use: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
227 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
228 logger.info("Url is %s", url) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
229 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
230 or |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
231 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
232 logger.info("Url is %(url)s", extra={"url": url) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
233 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
234 This prevents printf style tokens in ``url`` from being processed |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
235 where it can raise an exception. This could be used to prevent |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
236 the log message from being generated. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
237 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
238 More on trace_id |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
239 ~~~~~~~~~~~~~~~~ |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
240 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
241 The trace_id provides a unique token (a UUID4 encoded to make it |
|
8487
b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
John Rouillard <rouilj@ieee.org>
parents:
8478
diff
changeset
|
242 shorter or a nanoid) for each transaction in the database. It is |
|
b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
John Rouillard <rouilj@ieee.org>
parents:
8478
diff
changeset
|
243 unique to each thread or transaction. A transaction: |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
244 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
245 for the web interface is |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
246 each web, rest or xmlrpc request |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
247 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
248 for the email interface is |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
249 each email request. Using pipe mode will generate one |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
250 transaction. Using pop/imap etc can generate multiple |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
251 transactions, one for each email. Logging that occurs prior |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
252 to processing an email transaction has the default |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
253 ``not_set`` value for trace_id |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
254 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
255 for the roundup-admin interface is |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
256 each command in the interactive interface or on the command |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
257 line. Plus one transaction when/if a commit happens on |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
258 roundup-admin exit. |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
259 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
260 When creating scripts written using the roundup package the entry |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
261 point should use the ``@gen_trace_id`` decorator. For example to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
262 decorate the entry point that performs one transaction:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
263 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
264 from roundup.logcontext import gen_trace_id |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
265 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
266 # stuff ... |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
267 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
268 @gen_trace_id() |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
269 def main(...): |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
270 ... |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
271 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
272 If your script does multiple processing operations, decorate the entry |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
273 point for the processing operation:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
274 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
275 from roundup.logcontext import gen_trace_id |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
276 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
277 @gen_trace_id() |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
278 def process_one(thing): |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
279 ... |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
280 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
281 def main(): |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
282 for thing in things: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
283 process_one(thing) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
284 |
|
8487
b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
John Rouillard <rouilj@ieee.org>
parents:
8478
diff
changeset
|
285 You can change the format of the trace_id if required using the |
|
b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
John Rouillard <rouilj@ieee.org>
parents:
8478
diff
changeset
|
286 tracker's interfaces.py file. See the :ref:`module docs for the |
|
b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
John Rouillard <rouilj@ieee.org>
parents:
8478
diff
changeset
|
287 logcontext module <logcontext_pydoc>` for details. |
|
b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
John Rouillard <rouilj@ieee.org>
parents:
8478
diff
changeset
|
288 |
|
b09ef85f0da6
feat: add nanoid pkg trace_id gen and decorator for setting processName
John Rouillard <rouilj@ieee.org>
parents:
8478
diff
changeset
|
289 |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
290 Advanced Logging Setup |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
291 ---------------------- |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
292 |
|
8443
39a6825d10ca
feat: allow admin to set logging format from config.ini
John Rouillard <rouilj@ieee.org>
parents:
8442
diff
changeset
|
293 If the settings in config.ini are not sufficient for your logging |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
294 requirements, you can specify a full logging configuration in one |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
295 of two formats: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
296 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
297 * `dictConfig format |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
298 <https://docs.python.org/3/library/logging.config.html#logging.config.dictConfig>`_ |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
299 using json with comment support |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
300 * `fileConfig format |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
301 <https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig>`_ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
302 in ini style |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
303 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
304 The dictConfig format allows more control over configuration |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
305 including loading your own log handlers and disabling existing |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
306 handlers. If you use the fileConfig format, the ``logging`` -> |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
307 ``disable_loggers`` flag in the tracker's config is used to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
308 enable/disable pre-existing loggers as there is no way to do this |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
309 in the logging config file. |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
310 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
311 .. _`dictLogConfig`: |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
312 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
313 dictConfig Based Logging Config |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
314 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
315 |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
316 dictConfigs are specified in JSON format with support for |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
317 comments. The file name in the tracker's config for the |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
318 ``logging`` -> ``config`` setting must end with ``.json`` to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
319 choose the correct processing. |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
320 |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
321 Comments have to be in one of two forms based on javascript line |
|
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
322 comments: |
|
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
323 |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
324 1. A ``//`` possibly indented with whitespace on a line is |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
325 considereda a comment and is stripped from the file before |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
326 being passed to the json parser. This is a "line comment". |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
327 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
328 2. A ``//`` with at least three white space characters before it |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
329 is stripped from the end of the line before being passed to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
330 the json parser. This is an "inline comment". |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
331 |
|
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
332 Block style comments are not supported. |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
333 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
334 Other than this the file is a standard json file that matches the |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
335 `Configuration dictionary schema |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
336 <https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema>`_ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
337 defined in the Python documentation. |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
338 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
339 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
340 Example dictConfig Logging Config |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
341 ................................. |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
342 |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
343 Note that this file is not actually JSON format as it include |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
344 comments. However by using javascript style comments, some tools |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
345 that treat JSON like javascript (editors, linters, formatters) |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
346 might work with it. A command like:: |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
347 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
348 sed -e 's#^\s*//.*##' -e 's#\s*\s\s\s//.*##' logging.json |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
349 |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
350 can be used to strip comments for programs that need it. |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
351 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
352 The config below works with the `Waitress wsgi server |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
353 <https://github.com/Pylons/waitress>`_ configured to use the |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
354 roundup.wsgi channel. It also controls the `TransLogger |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
355 middleware <https://github.com/pasteorg/paste>`_ configured to |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
356 use roundup.wsgi.translogger, to produce httpd style combined |
|
8477
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
357 logs. |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
358 |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
359 The log file is specified relative to the current working |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
360 directory not the tracker home. The tracker home is the |
|
8477
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
361 subdirectory demo under the current working directory. |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
362 |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
363 The config also expects the ``python-json-logger`` package to be |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
364 installed so that it can produce a jsonl (json line) formatted |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
365 output log file. This format is useful for sending to log |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
366 management/observability platforms like elasticsearch, splunk, |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
367 logly, or honeycomb. |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
368 |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
369 The commented config is:: |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
370 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
371 { |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
372 "version": 1, // only supported version |
|
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
373 "disable_existing_loggers": false, // keep the wsgi loggers |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
374 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
375 "formatters": { |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
376 // standard format for Roundup messages |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
377 "standard": { |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
378 "format": "%(asctime)s %(trace_id)s %(levelname)s %(name)s:%(module)s %(msg)s" |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
379 }, |
|
8477
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
380 // Used to dump all log requests in jsonl format. |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
381 // Each json object is on one line. Can be pretty printed |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
382 // using: |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
383 // python -m json.tool --json-lines --sort-keys < roundup.json.log |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
384 // jq --slurp --sort-keys . < roundup.json.log |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
385 // requires that you pip install python-json-logger |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
386 // * does not report the fields in reserved_attrs |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
387 // * example to remap a field in the log to traceID in |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
388 // the output json. (note trace_id_eg is not defined by |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
389 // logging |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
390 // * also adds the env atribute to json with the value of demo |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
391 "json": { |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
392 "()": "pythonjsonlogger.json.JsonFormatter", |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
393 "reserved_attrs": ["ROUNDUP_CONTEXT_FILTER_CALLED", |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
394 "msg", "pct_char", "relativeCreated"], |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
395 "rename_fields": { |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
396 "trace_id_eg": "traceID" |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
397 }, |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
398 "static_fields": { |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
399 "env": "demo" |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
400 } |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
401 }, |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
402 // used for waitress wsgi server to produce httpd style logs |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
403 "http": { |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
404 "format": "%(message)s %(trace_id)" |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
405 |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
406 } |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
407 }, |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
408 "handlers": { |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
409 // create an access.log style http log file |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
410 "access": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
411 "level": "INFO", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
412 "formatter": "http", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
413 "class": "logging.FileHandler", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
414 "filename": "demo/access.log" |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
415 }, |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
416 // logging for roundup.* loggers |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
417 "roundup": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
418 "level": "DEBUG", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
419 "formatter": "standard", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
420 "class": "logging.FileHandler", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
421 "filename": "demo/roundup.log" |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
422 }, |
|
8477
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
423 // handler for json output log file |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
424 "roundup_json": { |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
425 "level": "DEBUG", // "DEBUG", |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
426 "formatter": "json", |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
427 "class": "logging.FileHandler", |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
428 "filename": "demo/roundup.json.log" |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
429 }, |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
430 // print to stdout - fall through for other logging |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
431 "default": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
432 "level": "DEBUG", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
433 "formatter": "standard", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
434 "class": "logging.StreamHandler", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
435 "stream": "ext://sys.stdout" |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
436 } |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
437 }, |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
438 "loggers": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
439 "": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
440 "handlers": [ |
|
8477
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
441 "default", |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
442 "roundup_json" // add json formatted logging |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
443 ], |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
444 "level": "DEBUG", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
445 "propagate": false |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
446 }, |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
447 // used by roundup.* loggers |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
448 "roundup": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
449 "handlers": [ |
|
8477
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
450 "roundup", |
|
d36bd4c521ac
doc: add docs for producing jsonl formatted output
John Rouillard <rouilj@ieee.org>
parents:
8461
diff
changeset
|
451 "roundup_json" |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
452 ], |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
453 "level": "DEBUG", |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
454 "propagate": false // note pytest testing with caplog requires |
|
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
455 // this to be true |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
456 }, |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
457 "roundup.hyperdb": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
458 "handlers": [ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
459 "roundup" |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
460 ], |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
461 "level": "INFO", // can be a little noisy use INFO for production |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
462 "propagate": false |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
463 }, |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
464 "roundup.wsgi": { // using the waitress framework |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
465 "handlers": [ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
466 "roundup" |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
467 ], |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
468 "level": "DEBUG", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
469 "propagate": false |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
470 }, |
|
8433
de1dac9abcb6
feat: change comment in dictConfig json file to // from #
John Rouillard <rouilj@ieee.org>
parents:
8432
diff
changeset
|
471 "roundup.wsgi.translogger": { // httpd style logging |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
472 "handlers": [ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
473 "access" |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
474 ], |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
475 "level": "DEBUG", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
476 "propagate": false |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
477 }, |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
478 "root": { |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
479 "handlers": [ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
480 "default" |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
481 ], |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
482 "level": "DEBUG", |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
483 "propagate": false |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
484 } |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
485 } |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
486 } |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
487 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
488 fileConfig Based Logging Config |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
489 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
490 |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
491 The file config is an older and more limited method of |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
492 configuring logging. It is described by the `Configuration file |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
493 format |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
494 <https://docs.python.org/3/library/logging.config.html#configuration-file-format>`_ |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
495 in the Python documentation. The file name in the tracker's |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
496 config for the ``logging`` -> ``config`` setting must end with |
|
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
497 ``.ini`` to choose the correct processing. |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
498 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
499 Example fileConfig LoggingConfig |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
500 ................................ |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
501 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
502 This is an example .ini used with roundup-server configured to use |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
503 ``roundup.http`` channel. It also includes some custom logging |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
504 qualnames/tags/channels for logging schema/permission detector and |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
505 extension output:: |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
506 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
507 [loggers] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
508 #other keys: roundup.hyperdb.backend |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
509 keys=root,roundup,roundup.http,roundup.hyperdb,actions,schema,extension,detector |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
510 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
511 [logger_root] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
512 #also for root where channlel is not set (NOTSET) aka all |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
513 level=DEBUG |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
514 handlers=rotate |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
515 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
516 [logger_roundup] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
517 # logger for all roundup.* not otherwise configured |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
518 level=DEBUG |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
519 handlers=rotate |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
520 qualname=roundup |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
521 propagate=0 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
522 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
523 [logger_roundup.http] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
524 level=INFO |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
525 handlers=rotate_weblog |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
526 qualname=roundup.http |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
527 propagate=0 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
528 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
529 [logger_roundup.hyperdb] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
530 level=WARNING |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
531 handlers=rotate |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
532 qualname=roundup.hyperdb |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
533 propagate=0 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
534 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
535 [logger_actions] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
536 level=INFO |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
537 handlers=rotate |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
538 qualname=actions |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
539 propagate=0 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
540 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
541 [logger_detector] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
542 level=INFO |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
543 handlers=rotate |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
544 qualname=detector |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
545 propagate=0 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
546 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
547 [logger_schema] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
548 level=DEBUG |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
549 handlers=rotate |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
550 qualname=schema |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
551 propagate=0 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
552 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
553 [logger_extension] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
554 level=INFO |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
555 handlers=rotate |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
556 qualname=extension |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
557 propagate=0 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
558 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
559 [handlers] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
560 keys=basic,rotate,rotate_weblog |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
561 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
562 [handler_basic] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
563 class=StreamHandler |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
564 args=(sys.stderr,) |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
565 formatter=basic |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
566 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
567 [handler_rotate] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
568 class=logging.handlers.RotatingFileHandler |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
569 args=('roundup.log','a', 5120000, 2) |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
570 formatter=basic |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
571 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
572 [handler_rotate_weblog] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
573 class=logging.handlers.RotatingFileHandler |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
574 args=('httpd.log','a', 1024000, 2) |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
575 formatter=plain |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
576 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
577 [formatters] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
578 keys=basic,plain |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
579 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
580 [formatter_basic] |
|
8446
14c7c07b32d8
feature: add thread local trace_id and trace_reason to logging.
John Rouillard <rouilj@ieee.org>
parents:
8443
diff
changeset
|
581 format=%(asctime)s %(trace_id)s %(process)d %(name)s:%(module)s.%(funcName)s,%(levelname)s: %(message)s |
|
8423
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
582 datefmt=%Y-%m-%d %H:%M:%S |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
583 |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
584 [formatter_plain] |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
585 format=%(process)d %(message)s |
|
94eed885e958
feat: add support for using dictConfig to configure logging.
John Rouillard <rouilj@ieee.org>
parents:
8412
diff
changeset
|
586 |
| 3250 | 587 |
|
2632
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
588 Configuring roundup-server |
|
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
589 ========================== |
|
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
590 |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
591 The basic configuration file is as follows (taken from the |
|
2632
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
592 ``roundup-server.ini.example`` file in the "doc" directory):: |
|
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
593 |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
594 [main] |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
595 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
596 # Host name of the Roundup web server instance. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
597 # If left unconfigured (no 'host' setting) the default |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
598 # will be used. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
599 # If empty, listen on all network interfaces. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
600 # If you want to explicitly listen on all |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
601 # network interfaces, the address 0.0.0.0 is a more |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
602 # explicit way to achieve this, the use of an empty |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
603 # string for this purpose is deprecated and will go away |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
604 # in a future release. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
605 # Default: localhost |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
606 host = localhost |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
607 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
608 # Port to listen on. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
609 # Default: 8080 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
610 port = 8017 |
|
2632
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
611 |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
612 # Path to favicon.ico image file. If unset, built-in favicon.ico is used. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
613 # The path may be either absolute or relative |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
614 # to the directory containing this config file. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
615 # Default: favicon.ico |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
616 favicon = favicon.ico |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
617 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
618 # User ID as which the server will answer requests. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
619 # In order to use this option, the server must be run initially as root. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
620 # Availability: Unix. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
621 # Default: |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
622 user = roundup |
|
2632
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
623 |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
624 # Group ID as which the server will answer requests. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
625 # In order to use this option, the server must be run initially as root. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
626 # Availability: Unix. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
627 # Default: |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
628 group = |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
629 |
|
7387
46f92ac4e170
- issue2551275 - Allow configuring max_children in roundup-server.
John Rouillard <rouilj@ieee.org>
parents:
7385
diff
changeset
|
630 # Maximum number of children to spawn using fork multiprocess mode. |
|
46f92ac4e170
- issue2551275 - Allow configuring max_children in roundup-server.
John Rouillard <rouilj@ieee.org>
parents:
7385
diff
changeset
|
631 # Default: 40 |
|
46f92ac4e170
- issue2551275 - Allow configuring max_children in roundup-server.
John Rouillard <rouilj@ieee.org>
parents:
7385
diff
changeset
|
632 max_children = 40 |
|
46f92ac4e170
- issue2551275 - Allow configuring max_children in roundup-server.
John Rouillard <rouilj@ieee.org>
parents:
7385
diff
changeset
|
633 |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
634 # don't fork (this overrides the pidfile mechanism)' |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
635 # Allowed values: yes, no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
636 # Default: no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
637 nodaemon = no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
638 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
639 # Log client machine names instead of IP addresses (much slower) |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
640 # Allowed values: yes, no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
641 # Default: no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
642 log_hostnames = no |
|
2632
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
643 |
|
7332
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
644 # Have http(s) request logging done via python logger module. |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
645 # If set to yes the python logging module is used with qualname |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
646 # 'roundup.http'. Otherwise logging is done to stderr or the file |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
647 # specified using the -l/logfile option. |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
648 # Allowed values: yes, no |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
649 # Default: no |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
650 loghttpvialogger = no |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
651 |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
652 # File to which the server records the process id of the daemon. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
653 # If this option is not set, the server will run in foreground |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
654 # |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
655 # The path may be either absolute or relative |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
656 # to the directory containing this config file. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
657 # Default: |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
658 pidfile = |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
659 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
660 # Log file path. If unset, log to stderr. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
661 # The path may be either absolute or relative |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
662 # to the directory containing this config file. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
663 # Default: |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
664 logfile = |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
665 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
666 # Set processing of each request in separate subprocess. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
667 # Allowed values: debug, none, thread, fork. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
668 # Default: fork |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
669 multiprocess = fork |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
670 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
671 # Tracker index template. If unset, built-in will be used. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
672 # The path may be either absolute or relative |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
673 # to the directory containing this config file. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
674 # Default: |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
675 template = |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
676 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
677 # Enable SSL support (requires pyopenssl) |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
678 # Allowed values: yes, no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
679 # Default: no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
680 ssl = no |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
681 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
682 # PEM file used for SSL. A temporary self-signed certificate |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
683 # will be used if left blank. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
684 # The path may be either absolute or relative |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
685 # to the directory containing this config file. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
686 # Default: |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
687 pem = |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
688 |
|
7332
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
689 # Comma separated list of extra headers that should |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
690 # be copied into the CGI environment. |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
691 # E.G. if you want to access the REMOTE_USER and |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
692 # X-Proxy-User headers in the back end, |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
693 # set to the value REMOTE_USER,X-Proxy-User. |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
694 # Allowed values: comma-separated list of words |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
695 # Default: |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
696 include_headers = |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
697 |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
698 # Change to HTTP/1.0 if needed. This disables keepalive. |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
699 # Default: HTTP/1.1 |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
700 http_version = HTTP/1.1 |
|
09af33304790
Update roundup-server example config file example and docs
John Rouillard <rouilj@ieee.org>
parents:
7306
diff
changeset
|
701 |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
702 # Roundup trackers to serve. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
703 # Each option in this section defines single Roundup tracker. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
704 # Option name identifies the tracker and will appear in the URL. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
705 # Option value is tracker home directory path. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
706 # The path may be either absolute or relative |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
707 # to the directory containing this config file. |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
708 [trackers] |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
709 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
710 demo = /trackers/demo |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
711 sysadmin = /trackers/sysadmin |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
712 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
713 Additional notes for each keyword: |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
714 |
|
3880
2359d6304a4f
Allow template for tracker index page
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3781
diff
changeset
|
715 **template** |
|
2359d6304a4f
Allow template for tracker index page
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3781
diff
changeset
|
716 Specifies a template used for displaying the tracker index when |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
717 multiple trackers are being used. It is processed by TAL and |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
718 the variable "trackers" is available to the template and is a |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
719 dict of all configured trackers. |
|
3883
679118b572d5
add SSL to roundup-server via pyopenssl
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3880
diff
changeset
|
720 **ssl** |
|
6835
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
721 Enables use of SSL to secure the connection to the |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
722 roundup-server. In most cases, you will want to run a |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
723 real web server (Apache, Nginx) as a proxy to |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
724 roundup-server running without SSL. The real web server |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
725 can filter/rate limit/firewall requests to roundup-server. |
|
3883
679118b572d5
add SSL to roundup-server via pyopenssl
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3880
diff
changeset
|
726 If you enable this, ensure that your tracker's config.ini specifies |
|
6835
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
727 an *https* URL. See roundup-server.1 man page for |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
728 additional information. |
|
3883
679118b572d5
add SSL to roundup-server via pyopenssl
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3880
diff
changeset
|
729 **pem** |
|
679118b572d5
add SSL to roundup-server via pyopenssl
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3880
diff
changeset
|
730 If specified, the SSL PEM file containing the private key and certificate. |
|
6835
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
731 The file must include both the private key and certificate with appropriate |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
732 headers (e.g. ``-----BEGIN PRIVATE KEY-----``, |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
733 ``-----END PRIVATE KEY-----`` and |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
734 ``-----BEGIN CERTIFICATE-----``, |
|
7a48f771cd4f
Clean up docs on roundup-sever SSL use.
John Rouillard <rouilj@ieee.org>
parents:
6819
diff
changeset
|
735 ``-----END CERTIFICATE-----``. |
|
3883
679118b572d5
add SSL to roundup-server via pyopenssl
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3880
diff
changeset
|
736 If not specified, roundup will generate a temporary, self-signed certificate |
|
679118b572d5
add SSL to roundup-server via pyopenssl
Justus Pendleton <jpend@users.sourceforge.net>
parents:
3880
diff
changeset
|
737 for use. |
|
8297
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
738 **loghttpvialogger** section |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
739 If you: |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
740 |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
741 * have **loghttpvialogger** enabled |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
742 * use **pidfile** |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
743 * use a logging config file in the tracker's config.ini |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
744 |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
745 it is essential to specify absolute paths for log files in the |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
746 tracker's logging.config file. The use of pidfile causes the |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
747 server to switch to the root directory ('/'). As a result |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
748 relative paths in the logging ini configuration file (as |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
749 opposed to the tracker's config.ini) will be written to the |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
750 system's root directory. The access error will cause the server |
|
03513f5066f3
fix: issue2551238 - roundup-server should exit with error ...
John Rouillard <rouilj@ieee.org>
parents:
8262
diff
changeset
|
751 to exit. |
|
3465
81542d49c8cb
fix admin doc description of roundup-server config file
Richard Jones <richard@users.sourceforge.net>
parents:
3341
diff
changeset
|
752 **trackers** section |
|
81542d49c8cb
fix admin doc description of roundup-server config file
Richard Jones <richard@users.sourceforge.net>
parents:
3341
diff
changeset
|
753 Each line denotes a mapping from a URL component to a tracker home. |
|
81542d49c8cb
fix admin doc description of roundup-server config file
Richard Jones <richard@users.sourceforge.net>
parents:
3341
diff
changeset
|
754 Make sure the name part doesn't include any url-unsafe characters like |
|
81542d49c8cb
fix admin doc description of roundup-server config file
Richard Jones <richard@users.sourceforge.net>
parents:
3341
diff
changeset
|
755 spaces. Stick to alphanumeric characters and you'll be ok. |
|
2632
9c55f2bc5961
roundup-server now has a configuration file (-C option)
Richard Jones <richard@users.sourceforge.net>
parents:
2572
diff
changeset
|
756 |
|
7333
b92ecb730510
Document how save-config replaces and backs up config.ini.
John Rouillard <rouilj@ieee.org>
parents:
7332
diff
changeset
|
757 To generate a config.ini in the current directory from the |
|
b92ecb730510
Document how save-config replaces and backs up config.ini.
John Rouillard <rouilj@ieee.org>
parents:
7332
diff
changeset
|
758 roundup-server command line use:: |
|
5102
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
759 |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
760 roundup_server -p 8017 -u roundup --save-config demo=/trackers/demo \ |
|
96dc9f07340a
issue2161722: oudated docs
John Rouillard <rouilj@ieee.org>
parents:
4891
diff
changeset
|
761 sysadmin=/trackers/sysadmin |
|
2572
d15b71b8a85a
more logging goodness
Richard Jones <richard@users.sourceforge.net>
parents:
2479
diff
changeset
|
762 |
| 7334 | 763 Note it will save an old config.ini file to config.bak and create a |
| 764 new config.ini. The file is recreated from scratch ignoring the | |
|
7335
b84718ea4228
document result of running save-config in a tracker home directory
John Rouillard <rouilj@ieee.org>
parents:
7334
diff
changeset
|
765 contents of the current config.ini. You may need to merge the backup |
|
b84718ea4228
document result of running save-config in a tracker home directory
John Rouillard <rouilj@ieee.org>
parents:
7334
diff
changeset
|
766 and config files. save-config doesn't attempt to load or verify an |
|
b84718ea4228
document result of running save-config in a tracker home directory
John Rouillard <rouilj@ieee.org>
parents:
7334
diff
changeset
|
767 existing config.ini. Running this in a tracker home directory will |
|
b84718ea4228
document result of running save-config in a tracker home directory
John Rouillard <rouilj@ieee.org>
parents:
7334
diff
changeset
|
768 move the exsiting config.ini to config.bak and replace it with the |
|
b84718ea4228
document result of running save-config in a tracker home directory
John Rouillard <rouilj@ieee.org>
parents:
7334
diff
changeset
|
769 roundup-server's config.ini. This will make the tracker in the |
|
b84718ea4228
document result of running save-config in a tracker home directory
John Rouillard <rouilj@ieee.org>
parents:
7334
diff
changeset
|
770 directory fail to start util the original config.ini is restored. |
|
7333
b92ecb730510
Document how save-config replaces and backs up config.ini.
John Rouillard <rouilj@ieee.org>
parents:
7332
diff
changeset
|
771 |
|
7981
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
772 .. _configuring-compression: |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
773 |
|
6458
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
774 Configuring Compression |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
775 ======================= |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
776 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
777 Roundup will compress HTTP responses to clients on the fly. Dynamic, |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
778 on the fly, compression is enabled by default, to disable it set:: |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
779 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
780 [web] |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
781 ... |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
782 dynamic_compression = No |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
783 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
784 in the tracker's ``config.ini``. You should disable compression if |
|
8461
1522e0e15903
doc: remove uWSGI references as it is in maint mode and not being updated
John Rouillard <rouilj@ieee.org>
parents:
8446
diff
changeset
|
785 your proxy (e.g. nginx or apache) is configured |
|
6458
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
786 to compress responses on the fly. The python standard library includes |
| 7385 | 787 gzip support. For brotli or zstd you will need to install packages. See |
|
6458
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
788 the `installation documentation`_ for details. |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
789 |
|
7853
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
790 .. index:: single: interfaces.py; configuring http compression |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
791 |
|
6458
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
792 Some assets will not be compressed on the fly. Assets with mime types |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
793 of "image/png" or "image/jpeg" will not be compressed. You |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
794 can add mime types to the list by using ``interfaces.py`` as discussed |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
795 in the `customisation documentation`_. As an example adding:: |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
796 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
797 from roundup.cgi.client import Client |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
798 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
799 Client.precompressed_mime_types.append('application/zip`) |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
800 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
801 to ``interfaces.py`` will prevent zip files from being compressed. |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
802 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
803 Any content less than 100 bytes in size will not be compressed (e.g |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
804 errors messages, short json responses). |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
805 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
806 Zstd will be used if the client can understand it, followed by brotli |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
807 then gzip encoding. Currently the preference order is hard coded into |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
808 the server and not parsed using ``q`` values from the client's |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
809 Accept-Encoding header. This is an area for improvement. |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
810 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
811 In addition to dynamic compression, static files/assets accessed using |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
812 ``@@file`` can be pre-compressed. This reduces CPU load on the server |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
813 and reduces the time required to respond to the client. By default |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
814 searching for pre-compressed files is disabled. To enable it set:: |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
815 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
816 [web] |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
817 ... |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
818 use_precompressed_files = Yes |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
819 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
820 in the tracker's ``config.ini`` file. Then you can create a |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
821 precompressed file and it will be served if the client is able to |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
822 accept it. For a file ``.../@@file/library.js`` you can create:: |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
823 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
824 tracker_home/html/library.js.gzip |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
825 tracker_home/html/library.js.br |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
826 tracker_home/html/library.js.zstd |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
827 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
828 which should be created by using (respectively):: |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
829 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
830 gzip --keep --suffix .gzip library.js |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
831 brotli library.js |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
832 zstd library.js && mv library.js.zst library.js.zstd |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
833 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
834 see the man pages for options that control compression level. Note |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
835 that some levels require additional memory on the client side, so you |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
836 may not always want to use the highest compression available. |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
837 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
838 A pre-compressed file will not be used if its modified date is earlier |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
839 than the uncompressed file. For example, if ``library.js.gzip`` is |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
840 older (has earlier modification date) than ``library.js``, |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
841 ``library.js.gzip`` will be ignored. ``library.js`` will be |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
842 served instead. ``library.js`` will be dynamically compressed on the |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
843 fly and a warning message will be logged. |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
844 |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
845 Precompressed files override dynamic compression. For example, assume |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
846 the client can accept brotli and gzip. If there are no precompressed |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
847 files, the data will be compressed dynamically (on the fly) using |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
848 brotli. If there is a precompressed gzip file present the client will |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
849 get the gzip version and not a brotli compressed version. This |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
850 mechanism allows the admin to allow use of brotli and zstd for |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
851 dynamic content, but not for static content. |
|
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
852 |
|
8039
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
853 .. _browser_handling_attached_files: |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
854 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
855 .. index:: single: interfaces.py; Controlling browser handling of attached files |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
856 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
857 Controlling Browser Handling of Attached Files |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
858 ============================================== |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
859 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
860 You may be aware of the ``allow_html_file`` `config.ini setting |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
861 <reference.html#config-ini-section-web>`_. When set to yes, it permits |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
862 html files to be attached and displayed in the browser as html |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
863 files. The underlying mechanism used to enable/disable attaching HTML |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
864 is exposed using ``interfaces.py``. |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
865 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
866 Similar to ``Client.precompressed_mime_types`` above, there is a |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
867 ``Client.mime_type_allowlist``. If a mime type is present in this |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
868 list, an attachment with this mime type is served to the browser. If |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
869 the mime type is not present, the mime type is set to |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
870 ``application/octet-stream`` which causes the browser to download the |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
871 attachment to a file. |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
872 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
873 In release 2.4.0, the mime type ``application/pdf`` was removed from |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
874 the precompressed_mime_types list. This prevents the browser from |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
875 executing scripts that may be included in the PDF file. If you trust |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
876 the individuals uploading PDF files to your tracker and wish to allow |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
877 viewing PDF files from your tracker, you can do so by editing your |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
878 tracker's "interfaces.py" file. Adding:: |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
879 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
880 from roundup.cgi.client import Client |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
881 Client.mime_type_allowlist.append('application/pdf') |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
882 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
883 will permit the PDF files to be viewed in the browser rather than |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
884 downloaded to a file. |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
885 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
886 Similarly, you can remove a mime type (e.g. audio/oog) using:: |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
887 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
888 from roundup.cgi.client import Client |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
889 Client.mime_type_allowlist.remove('audio/oog') |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
890 |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
891 which will force the browser to save the attachment to a file rather |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
892 than playing the audio file. |
|
e1cff9745fb4
refactor: make mime_type_allowlist class prop to configure from interfaces.py
John Rouillard <rouilj@ieee.org>
parents:
8016
diff
changeset
|
893 |
|
7853
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
894 .. index:: single: interfaces.py; setting REST maximum result limit |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
895 |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
896 Configuring REST Maximum Result Limit |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
897 ===================================== |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
898 |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
899 To prevent denial of service (DOS) and limit user wait time for an |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
900 unbounded request, the REST endpoint has a maximum limit on the number |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
901 of rows that can be returned. By default, this is set to 10 million. |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
902 This setting applies to all users of the REST interface. If you want |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
903 to change this limit, you can add the following code to the |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
904 ``interfaces.py`` file in your tracker:: |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
905 |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
906 # change max response rows |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
907 from roundup.rest import RestfulInstance |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
908 RestfulInstance.max_response_row_size = 26 |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
909 |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
910 This code will set the maximum number of rows to 25 (one less than the |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
911 value). Note that this setting is rarely used and is not available in |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
912 the tracker's ``config.ini`` file. Setting it through this mechanism |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
913 allows you to enter a string or number that may break Roundup, such as |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
914 "asdf" or 0. In general, it is recommended to keep the limit at its |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
915 default value. However, this option is available for cases when a |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
916 request requires more than 10 million rows and pagination using |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
917 ``@page_index`` and ``@page_size=9999999`` is not possible. |
|
03c1b7ae3a68
issue2551328/issue2551264 unneeded next link and total_count incorrect
John Rouillard <rouilj@ieee.org>
parents:
7797
diff
changeset
|
918 |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
919 Adding a Web Content Security Policy (CSP) |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
920 ========================================== |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
921 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
922 A Content Security Policy (`CSP`_) adds a layer of security to |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
923 Roundup's web interface. It makes it more difficult for an |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
924 attacker to compromise Roundup. By default Roundup does not add |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
925 a CSP. If you need to implement a CSP, this section will help you |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
926 understand how to add one and document the current level of |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
927 support for CSP in Roundup. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
928 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
929 Roundup's web interface has remained mostly unchanged since it |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
930 was created over a decade ago. Current releases have been slowly |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
931 modernizing the HTML to improve security. There are still some |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
932 improvements that need to happen before the tightest CSP |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
933 configurations can be used. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
934 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
935 Writing a CSP is complex. This section just touches on how to |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
936 create and install a CSP to improve security. Some of it might |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
937 break functionality. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
938 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
939 There are two ways to add a CSP: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
940 |
| 7367 | 941 1. a fixed CSP added by a server |
| 942 2. a dynamic CSP added by Roundup | |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
943 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
944 Fixed CSP |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
945 --------- |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
946 |
|
8461
1522e0e15903
doc: remove uWSGI references as it is in maint mode and not being updated
John Rouillard <rouilj@ieee.org>
parents:
8446
diff
changeset
|
947 If you are using a web server (Apache, Nginx) to run Roundup, you |
|
1522e0e15903
doc: remove uWSGI references as it is in maint mode and not being updated
John Rouillard <rouilj@ieee.org>
parents:
8446
diff
changeset
|
948 can add a ``Content-Security-Policy`` header using that |
|
1522e0e15903
doc: remove uWSGI references as it is in maint mode and not being updated
John Rouillard <rouilj@ieee.org>
parents:
8446
diff
changeset
|
949 server. WSGI middleware can be written to add headers. An example |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
950 header would look like:: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
951 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
952 Content-Security-Policy: default-src 'self' 'unsafe-inline' 'strict-dynamic'; |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
953 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
954 One thing that may need to be included is the ``unsafe-inline``. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
955 The default templates use ``onload``, ``onchange``, ``onsubmit``, |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
956 and ``onclick`` JavaScript handlers. Without ``unsafe-inline`` |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
957 these won't work and popup helpers will not work. Sadly the use |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
958 of ``unsafe-inline`` is a pretty big hole in this CSP. You can |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
959 set the hashes for all the JavaScript handlers in the CSP. Then |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
960 replace ``unsafe-inline`` with ``unsafe-hashes`` to help close |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
961 this hole, but has its own issues. See `remediating |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
962 unsafe-inline`_ for another way to mitigate this. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
963 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
964 The inclusion of ``strict-dynamic`` allows trusted JavaScript |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
965 files that are downloaded from Roundup to make changes to the web |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
966 interface. These changes are also trusted code that will be run |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
967 when invoked. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
968 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
969 More secure CSPs can also be created. However because of the ability |
|
7499
a072331c843b
Change customizing to customising in all variants.
John Rouillard <rouilj@ieee.org>
parents:
7477
diff
changeset
|
970 to customise the web interface, it is difficult to provide guidance. |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
971 |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
972 .. _dynamic_csp: |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
973 |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
974 Dynamic CSP |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
975 ----------- |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
976 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
977 Roundup creates a cryptographic nonce for every client request. The |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
978 nonce is the value of the ``client.client_nonce`` property. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
979 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
980 By changing the templates to use the nonce, we can better secure the |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
981 Roundup instance. However the nonce has to be set in the CSP returned |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
982 by Roundup. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
983 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
984 One way to do this is to add a templating utility to the extensions |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
985 directory that generates the CSP on the fly. For example:: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
986 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
987 default_security_headers = { |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
988 'Content-Security-Policy': ( |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
989 "default-src 'self'; " |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
990 "base-uri 'self'; " |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
991 "script-src https: 'nonce-{nonce}' 'strict-dynamic'; " |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
992 "style-src 'self' 'nonce-{nonce}'; " |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
993 "img-src 'self' data:; " |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
994 "frame-ancestors 'self'; " |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
995 "object-src 'self' 'nonce-{nonce}'; " |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
996 ), |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
997 } |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
998 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
999 |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1000 def AddHtmlHeaders(self, header_dict=None): |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1001 ''' Generate https headers from dict use default security headers |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1002 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1003 Setting the header with a value of None will not inject the |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1004 header and can override the default set. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1005 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1006 Header values will be formatted with a dictionary including a |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1007 nonce. Use to set a nonce for inline scripts. |
|
8352
6ea309c6d17c
docs: fix registerutilMethod docs, format for highlights.
John Rouillard <rouilj@ieee.org>
parents:
8297
diff
changeset
|
1008 |
|
6ea309c6d17c
docs: fix registerutilMethod docs, format for highlights.
John Rouillard <rouilj@ieee.org>
parents:
8297
diff
changeset
|
1009 self is an instance of the TemplatingUtilities class, so |
|
6ea309c6d17c
docs: fix registerutilMethod docs, format for highlights.
John Rouillard <rouilj@ieee.org>
parents:
8297
diff
changeset
|
1010 you have access to self.client as well as any functions added |
|
6ea309c6d17c
docs: fix registerutilMethod docs, format for highlights.
John Rouillard <rouilj@ieee.org>
parents:
8297
diff
changeset
|
1011 using registerUtil. |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1012 ''' |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1013 try: |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1014 if self.client.client_nonce is None: |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1015 # logger.warning("client_nonce is None") |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1016 self.client.client_nonce = self.client.session_api._gen_sid() |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1017 except AttributeError: |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1018 # self.client.client_nonce doesn't exist, create it |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1019 # logger.warning("client_nonce does not exist, creating") |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1020 self.client.client_nonce = client.session_api._gen_sid() |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1021 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1022 headers = default_security_headers.copy() |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1023 if isinstance(header_dict, dict): |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1024 headers.update(header_dict) |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1025 |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1026 client_headers = self.client.additional_headers |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1027 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1028 for header, value in list(headers.items()): |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1029 if value is None: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1030 continue |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1031 client_headers[header] = value.format( |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1032 nonce=self.client.client_nonce) |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1033 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1034 def init(instance): |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1035 # Note the use of the new (in version 2.5) registerUtilMethod |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1036 instance.registerUtilMethod('AddHtmlHeaders', AddHtmlHeaders) |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1037 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1038 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1039 Adding the following to ``page.html`` right after the opening |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1040 ``<html....`>`` tag:: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1041 |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1042 <tal:code tal:content="python:utils.AddHtmlHeaders()" /> |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1043 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1044 will invoke ``AddHtmlHeaders()`` to add the CSP header with the nonce. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1045 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1046 With this set of CSP headers, all style, script and object tags will |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1047 need a ``nonce`` attribute. This can be added by changing:: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1048 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1049 <script src="javascript.js"></script> |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1050 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1051 to:: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1052 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1053 <script |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1054 tal:attributes="nonce request/client/client_nonce" |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1055 src="javascript.js"></script> |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1056 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1057 for each script, object or style tag. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1058 |
|
8262
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1059 If you are using a version of Roundup before version 2.5, you need to |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1060 replace ``instance.registerUtilMethod`` with |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1061 ``instance.registerUtil``. For example:: |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1062 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1063 def init(instance): |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1064 instance.registerUtil('AddHtmlHeaders', AddHtmlHeaders) |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1065 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1066 The AddHtmlHeaders function needs to be changed so that ``self.client`` |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1067 is replaced by ``client``:: |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1068 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1069 # replace self parameter with client |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1070 def AddHtmlHeaders(client, header_dict=None): |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1071 ''' Generate https headers from dict use default security headers |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1072 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1073 Setting the header with a value of None will not inject the |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1074 header and can override the default set. |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1075 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1076 Header values will be formatted with a dictionary including a |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1077 nonce. Use to set a nonce for inline scripts. |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1078 ''' |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1079 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1080 ### Then change all references to self.client to client |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1081 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1082 try: |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1083 if client.client_nonce is None: # note self.client -> client |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1084 # logger.warning("client_nonce is None") |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1085 client.client_nonce = self.client.session_api._gen_sid() |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1086 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1087 ... |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1088 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1089 Lastly the client must be passed explicitly when calling |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1090 AddHtmlHeaders. The call looks like:: |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1091 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1092 <tal:code tal:content="python:utils.AddHtmlHeaders(request.client)" /> |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1093 |
|
2a7c3eeaf167
feat: add templating utils method dynamically; method to set http code
John Rouillard <rouilj@ieee.org>
parents:
8096
diff
changeset
|
1094 |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1095 Remediating ``unsafe-inline`` |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1096 ----------------------------- |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1097 .. _remediating unsafe-inline: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1098 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1099 Using a trusted script to set event handlers to replace the ``onX`` |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1100 handlers allows removal of the ``unsafe-inline`` handlers. If you |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1101 remove ``unsafe-inline`` the ``onX`` handlers will not run. However |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1102 you can use the label provided by the ``onX`` attribute to securely |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1103 enable a callback function. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1104 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1105 This method is a work in progress. As an example proof of concept, |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1106 adding this "decorator" script at the end of page.html:: |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1107 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1108 <script tal:attributes="nonce request/client/client_nonce"> |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1109 /* set submit event listener on forms that have an |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1110 onsubmit (case insensitive) attribute */ |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1111 forms = document.querySelectorAll(form[onsubmit]) |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1112 for (let form of f) { |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1113 form.addEventListener('submit', |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1114 () => submit_once()); |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1115 }; |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1116 </script> |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1117 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1118 will set callback for the submit even on any form that has an onsubmit |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1119 attribute to ``submit_once()``. ``submit_once`` is defined in Roundup's |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1120 base_javascript and is generated with a proper nonce. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1121 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1122 By including the nonce in the dynamic CSP, we can use our trusted |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1123 "decorator" script to add event listeners. These listeners will call |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1124 the trusted function in base_javascript to replace the ignored ``onX`` |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1125 handlers. |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1126 |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1127 .. _CSP: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP |
|
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1128 |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1129 Classhelper Web Component |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1130 ========================= |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1131 |
|
7974
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1132 Version 2.4.0 provides a new classhelper popup written as a web |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1133 component. By installing 3 files and editing the tracker's templates |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1134 you can enable the new component. |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1135 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1136 The `development of this component was done by team-03 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1137 <https://github.com/UMB-CS-682-Team-03/tracker>`_ of the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1138 Spring 2024 CS682 graduate software engineering SDL capstone |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1139 class at the University of Massachusetts - Boston. Their |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1140 documentation is copied/adapted below. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1141 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1142 File Installation |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1143 ----------------- |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1144 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1145 There are three files to install in your tracker. You can |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1146 copy them from the template directory for the classic |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1147 tracker. The location of the template file can be obtained |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1148 by running: ``roundup-admin templates`` and looking for the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1149 path value of the classic template. If the path value is |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1150 ``/path/to/template``, copy:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1151 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1152 /path/to/template/html/classhelper.js |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1153 /path/to/template/html/classhelper.css |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1154 /path/to/template/html/_generic.translation |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1155 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1156 to your tracker's html directory. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1157 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1158 Wrapping the Classic Classhelper |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1159 -------------------------------- |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1160 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1161 To allow your users to select items in the web interface |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1162 using the new classhelper, you should edit the template files |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1163 in the ``html/`` subdirectory of your tracker. Where you see |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1164 code like:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1165 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1166 <th i18n:translate="">Superseder</th> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1167 <td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1168 <span tal:replace="structure |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1169 python:context.superseder.field(showid=1,size=20)" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1170 <span tal:condition="context/is_edit_ok" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1171 tal:replace="structure |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1172 python:db.issue.classhelp('id,title', |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1173 property='superseder', pagesize=100)" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1174 [...] |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1175 </td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1176 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1177 change it to wrap the classhelp span like this:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1178 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1179 <th i18n:translate="">Superseder</th> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1180 <td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1181 <span tal:replace="structure |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1182 python:context.superseder.field(showid=1,size=20)" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1183 <roundup-classhelper |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1184 data-popup-title="Superseder Classhelper - {itemDesignator}" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1185 data-search-with="title,status,keyword[]-name"> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1186 <span tal:condition="context/is_edit_ok" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1187 tal:replace="structure |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1188 python:db.issue.classhelp('id,title', |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1189 property='superseder', pagesize=100)" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1190 </roundup-classhelper> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1191 [...] |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1192 </td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1193 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1194 which displays a three part classhelper. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1195 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1196 1. the search pane includes a text search box for the `title` |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1197 and `status` properties and a dropdown for the keyword property, |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1198 sorted by name in descending order. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1199 2. the selection pane will show 100 search results per page. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1200 It also allows the user to move to the next or previous result |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1201 page. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1202 3. the accumulator at the bottom shows all the selected items. It |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1203 also has buttons to accept the items or cancel the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1204 classhelper, leaving the original page unchanged. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1205 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1206 Note that the user class is a little different because users without |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1207 an Admin role can't search for a user by Role. So we hide the Role |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1208 search element for non admin users. Starting with:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1209 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1210 <th i18n:translate="">Nosy List</th> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1211 <td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1212 <span tal:replace="structure context/nosy/field" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1213 <span tal:condition="context/is_edit_ok" tal:replace="structure |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1214 python:db.user.classhelp('username,realname,address', |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1215 property='nosy', width='600'" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1216 </td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1217 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1218 wrap the classhelp span with ``<roundup-classhelper>`` like:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1219 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1220 <th i18n:translate="">Nosy List</th> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1221 <td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1222 <span tal:replace="structure context/nosy/field" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1223 <roundup-classhelper tal:define="search string:name,phone,roles[]" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1224 tal:attributes="data-search-with python:search |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1225 if request.user.hasRole('Admin') else |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1226 ','.join(search.split(',')[:-1])"> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1227 <span tal:condition="context/is_edit_ok" tal:replace="structure |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1228 python:db.user.classhelp('username,realname,address', |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1229 property='nosy', width='600'" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1230 </roundup-classhelper> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1231 </td> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1232 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1233 The ``','.join(search.split(',')[:-1])`` removes the last element of |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1234 the search string (``roles[]``) if the user does not have the Admin |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1235 role. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1236 |
|
7981
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1237 Loading the <roundup-classhelper> Script |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1238 ---------------------------------------- |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1239 |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1240 To make the ``<roundup-classhelper>`` wrappers work, you |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1241 have to load the classhelper.js script. Add the following |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1242 html script tag in the head section of page.html:: |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1243 |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1244 <script type="text/javascript" src="@@file/classhelper.js"> |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1245 </script> |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1246 |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1247 You can place it anywhere before ``</head>``. This will make |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1248 it available on all pages. |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1249 |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1250 The script will also work if it is loaded at the end of the |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1251 body. It can also be added to the ``more-javascript`` slot |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1252 in one of the templates (see ``user.item.html`` for an |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1253 example) if you don't want the overhead of loading the script |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1254 on every page. |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1255 |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1256 You may want to minimize and precompress the file. Using |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1257 dynamic compression, the file is 10k when compressed with |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1258 gzip (8k with brotli). If you minimize the file first with |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1259 `rjsmin <https://pypi.org/project/rjsmin/>`_ and then |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1260 compress it, it's about 6k. See the information about using |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1261 precompressed files in the :ref:`section on compression |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1262 <configuring-compression>`. |
|
eae83a32f564
docs: add section on loading classhelper.js script.
John Rouillard <rouilj@ieee.org>
parents:
7979
diff
changeset
|
1263 |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1264 <roundup-classhelper> configuration |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1265 ----------------------------------- |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1266 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1267 There are two attributes used to configure the classhelper. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1268 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1269 data-popup-title: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1270 * this attribute is optional. A reasonable default is |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1271 provided if it is missing. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1272 * Adding ``data-popup-title`` changes the title of the popup |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1273 window with the value of the attribute. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1274 * ``{itemDesignator}`` can be used inside the attribute value |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1275 to replace it with the current classhelper usage context. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1276 E.G. ``data-popup-title="Nosy List Classhelper - {itemDesignator}"`` |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1277 will display the popup window title as ``Nosy List Classhelper - issue24`` |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1278 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1279 data-search-with: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1280 * this attribute is optional. If it is not set, a search |
| 7975 | 1281 panel is not created to allow the user to search within |
| 1282 the class. | |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1283 * Adding ``data-search-with`` specifies the fields that can |
| 7976 | 1284 be used for searching. For example when invoking the |
| 1285 classhelper for the issue class, using | |
| 1286 ``data-search-with="title,status,keyword"`` wil enable | |
| 1287 three search fields. | |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1288 * The search can be customized using the following syntax: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1289 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1290 * Adding ``[]`` at then end of a field (``"status[]"``) |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1291 will displays a dropdown for the "status" field |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1292 listing all the values the user can access. E.G.:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1293 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1294 <roundup-classhelper |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1295 data-search-with="title,status[],keyword[]"> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1296 <span tal:condition="context/is_edit_ok" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1297 tal:replace="structure |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1298 python:db.issue.classhelp('id,title', |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1299 property='superseder', pagesize=100)" /> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1300 </roundup-classhelper> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1301 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1302 will create a search pane with a text search for title |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1303 and dropdowns for status and keyword. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1304 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1305 * Adding a sort key after the ``[]`` allows you to |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1306 select the order of the elements in the dropdown. For |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1307 example ``keyword[]+name`` sorts the keyword |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1308 dropdown in ascending order by name. While |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1309 ``keyword[]-name`` sorts the keyword dropdown in |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1310 descending order by name. If the sort order is not |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1311 specified, the default order for the class is used. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1312 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1313 <roundup-classhelper> styling |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1314 ----------------------------- |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1315 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1316 The roundup-classhelper component uses minimal styling so it |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1317 can blend in with most trackers. If you want to change the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1318 styling, you can modify the classhelper.css file in the html |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1319 directory. Even though roundup-classhelper is a web |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1320 component, it doesn't use the shadow DOM. If you don't know |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1321 what this means, it just means that it's easy to style. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1322 |
|
7977
d3c0d3c9f5e7
docs: update cache updating for css file.
John Rouillard <rouilj@ieee.org>
parents:
7976
diff
changeset
|
1323 Getting the web component to load changes to the css file is |
|
d3c0d3c9f5e7
docs: update cache updating for css file.
John Rouillard <rouilj@ieee.org>
parents:
7976
diff
changeset
|
1324 a bit tricky. The browser caches the old file and you have |
|
d3c0d3c9f5e7
docs: update cache updating for css file.
John Rouillard <rouilj@ieee.org>
parents:
7976
diff
changeset
|
1325 to resort to tricks to make it get a new copy of the file. |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1326 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1327 One way to do this is to open to the ``classhelper.css`` |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1328 file in your browser and force refresh it. To do this: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1329 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1330 1. Open the home page for your Roundup issue tracker in a |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1331 web browser. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1332 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1333 2. In the address bar, append ``@@file/classhelper.css`` |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1334 to the end of your Roundup URL. For example, if your |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1335 Roundup URL is ``https://example.com/tracker/``, the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1336 URL you should visit would be |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1337 ``https://example.com/tracker/@@file/classhelper.css``. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1338 |
| 8015 | 1339 3. This will open the ``classhelper.css`` file in your browser. |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1340 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1341 4. Press ``Ctrl+Shift+R`` (on Windows and Linux) or |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1342 ``Cmd+Shift+R`` (on macOS). This triggers a hard |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1343 refresh of the page, which forces the browser to |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1344 reload the file and associated resources from the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1345 server. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1346 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1347 This should resolve any issues caused by cached or outdated |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1348 files. It is possible that you have to open devtools and set |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1349 the disable cache option in the network panel in extreme |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1350 cases. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1351 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1352 Also during development, you might want to `set a very low |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1353 cache time |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1354 <customizing.html#changing-cache-control-headers>`_ for |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1355 classhelper.css using something like:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1356 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1357 Client.Cache_Control['classhelper.css'] = "public, max-age=10" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1358 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1359 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1360 Translations |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1361 ------------ |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1362 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1363 To set up translations for the <roundup-classhelper> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1364 component, follow these steps. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1365 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1366 1. Create a ``messages.pot`` file by running |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1367 ``roundup-gettext <tracker_home_directory>``. This |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1368 creates ``locale/messages.pot`` in your tracker's home |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1369 directory. It extracts all translatable strings from |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1370 your tracker. We will use it as a base template for the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1371 new strings you want to translate. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1372 2. See if you already have a ``.po`` translation file for |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1373 your language in the tracker's locale/ directory. If you |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1374 don't, copy ``messages.pot`` to a .po file for the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1375 language you want to translate. For example German |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1376 would be at ``de.po`` English would be at ``en.po`` |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1377 (for example if you want to change the ``apply`` button |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1378 to say ``Do It``. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1379 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1380 3. Edit the new .po file. After the header, add the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1381 translation entries for the <roundup-classhelper> |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1382 component. For example `next` and `submit` are |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1383 displayed in English when the rest of the interface is |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1384 in German. Add:: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1385 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1386 msgid "submit" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1387 msgstr "gehen" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1388 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1389 msgid "next" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1390 msgstr "nächste" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1391 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1392 msgid "name" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1393 msgstr "name" |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1394 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1395 Note: the value for `msgid` is case sensitive. You can |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1396 see the msgid for static strings by looking for |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1397 ``CLASSHELPER_TRANSLATION_KEYWORDS`` in classhelper.js. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1398 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1399 4. Save the .po file. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1400 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1401 5. Restart your Roundup instance. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1402 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1403 This should display the missing translations, for more |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1404 details refer to the `translation (i18n) section of the |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1405 developers documentation |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1406 <developers.html#extracting-translatable-messages>`_. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1407 |
|
7974
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1408 The default title used for read only popups can be changed by using |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1409 the translation mechanism. Use the following:: |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1410 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1411 msgid "Info on {className} - {itemDesignator} - Classhelper" |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1412 msgstr "{itemDesignator} - info on {className}" |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1413 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1414 in ``en.po`` to reformat the title for the English language. Note that |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1415 ``{classname}`` is only supported in the default title. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1416 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1417 In addition to the default template you can translate a title set |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1418 using ``data-popup-title`` by matching the template as the msgid. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1419 Using an example above:: |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1420 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1421 msgid "Nosy List Classhelper - {itemDesignator}" |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1422 msgstr "Nosy List Klassenhelfer - {itemDesignator}" |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1423 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1424 placed in ``de.po`` will translate the title into German. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1425 |
|
7971
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1426 Troubleshooting |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1427 --------------- |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1428 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1429 The roundup-classhelper will fallback to using the classic |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1430 classhelper if: |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1431 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1432 * the user doesn't have REST access |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1433 * the browser doesn't support web components |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1434 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1435 It will display an alert modal dialog to the user before triggering |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1436 the classic classhelper as a fallback. A detailed error will be |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1437 printed to the browser console. The console is visible in devtools and |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1438 can be opened by pressing the ``F12`` key. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1439 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1440 You can disable the classhelper on a per URL basis by adding |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1441 ``#classhelper-wc-toggle`` to the end of the URL. This will prevent |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1442 the web component from starting up. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1443 |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1444 Also you can set ``DISABLE_CLASSHELP = true`` at the top of |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1445 classhelper.js to disable the classhelper without having to make any |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1446 changes to your templates. |
|
fe0348bbe45b
issue2551353 - Add roundup-classhelper for 2.4.0 release
John Rouillard <rouilj@ieee.org>
parents:
7962
diff
changeset
|
1447 |
|
7974
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1448 Advanced Configuration |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1449 ---------------------- |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1450 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1451 The classhelper.js file has a few tweakable options for use |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1452 by advanced users. The endpoint for the roles list requires |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1453 the user to have Admin rights. You can add your own roles |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1454 endpoint with a different authorization mechanism. The |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1455 following code can be added to your tracker's interfaces.py. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1456 You can create this file if it doesn't exist. This code |
| 7979 | 1457 creates a new REST endpoint at ``/rest/roles``:: |
|
7974
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1458 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1459 from roundup.rest import Routing, RestfulInstance, _data_decorator |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1460 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1461 class RestfulInstance: |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1462 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1463 @Routing.route("/roles", 'GET') |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1464 @_data_decorator |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1465 def get_roles(self, input): |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1466 """Return all defined roles. The User class property |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1467 roles is a string but simulate it as a MultiLink |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1468 to an actual Roles class. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1469 """ |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1470 return 200, {"collection": |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1471 [{"id": rolename,"name": rolename} |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1472 for rolename in list(self.db.security.role.keys())]} |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1473 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1474 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1475 See the `REST documentation <rest.html>`_ for details on |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1476 using ``interfaces.py`` to add new REST endpoints. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1477 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1478 The code above allows any user with REST access to see all |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1479 the roles defined in the tracker. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1480 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1481 To make classhelper.js use this new endpoint, look for:: |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1482 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1483 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1484 const ALTERNATIVE_DROPDOWN_PATHNAMES = { |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1485 "roles": "/rest/data/user/roles" |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1486 } |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1487 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1488 and change it to:: |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1489 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1490 const ALTERNATIVE_DROPDOWN_PATHNAMES = { |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1491 "roles": "/rest/roles" |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1492 } |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1493 |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1494 Users may have to perform a hard reload to cache this change |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1495 on their system. |
|
4dcc64d0138e
doc: classhelper translation, advanced config w/ roles endpoint
John Rouillard <rouilj@ieee.org>
parents:
7971
diff
changeset
|
1496 |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1497 Configuring native-fts Full Text Search |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1498 ======================================= |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1499 |
| 6612 | 1500 Roundup release 2.2.0 supports database-native full text search. |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1501 SQLite (minimum version 3.9.0) with FTS5 and PostgreSQL (minimum |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1502 version 11.0) with websearch_to_tsvector are supported. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1503 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1504 To enable this method, change the ``indexer`` setting in the tracker's |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1505 config.ini to ``native-fts``. Then reindex using ``roundup-admin -i |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1506 tracker_home reindex``. The amount of time it takes to reindex |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1507 depends on the amount of data in your tracker, the speed of your |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1508 disks, etc. It can take hours. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1509 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1510 SQLite details |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1511 -------------- |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1512 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1513 The SQLite native-fts changes the full text search query a little bit. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1514 For the other search methods, the search terms are split on white |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1515 space and each item in the index: a field (e.g. title), message |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1516 content and file content is searched for all the terms. If any term is |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1517 missing that item is ignored. Once the items are found they are mapped |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1518 to an issue and the normal issue index is displayed. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1519 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1520 When using FTS5, the search terms can use the full text search query |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1521 language described at: |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1522 https://www.sqlite.org/fts5.html#full_text_query_syntax. This |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1523 supports: |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1524 |
| 7593 | 1525 * plain word search (joined by 'and', similar to other search methods) |
| 7367 | 1526 * phrase search with terms enclosed in quotes (``"``) |
| 1527 * proximity search with varying distances using ``NEAR()`` | |
| 1528 * boolean operations by grouping with parentheses and using ``AND`` | |
| 1529 and ``OR`` | |
| 1530 * exclusion using ``NOT`` | |
| 1531 * prefix searching by prefixing the term with``^`` | |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1532 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1533 All of the data that is indexed is in a single column, so when column |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1534 specifiers are used they usually result in an error which is detected |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1535 and an enhanced error message is produced. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1536 |
|
6915
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1537 Unlike the native, xapian and whoosh indexers there is no |
|
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1538 limit to the length of terms that are indexed. Also |
|
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1539 stopwords are indexed but ignored when searching if they are |
|
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1540 the only word in the search. So a search for "the" will |
|
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1541 return no results but "the book" will return |
|
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1542 results. Pre-filtering the stopwords when indexing would |
|
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1543 break proximity and phrase searching. This may be helpful or |
|
9ff091537f43
postgresql native-fts; more indexer tests
John Rouillard <rouilj@ieee.org>
parents:
6835
diff
changeset
|
1544 problematic for your particular tracker. |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1545 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1546 To support the most languages available, the unicode61 tokenizer is |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1547 used without porter stemming. Using the ``indexer_language`` setting |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1548 to enable stemming for ``english`` is not available in this |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1549 implementation. Also ranking information is not used in this |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1550 implementation. These are areas for improvement. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1551 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1552 PostgreSQL info |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1553 --------------- |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1554 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1555 The PostgreSQL native-fts changes the full text search query a little |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1556 bit. When using PostgreSQL full text search, two different query |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1557 languages are supported. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1558 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1559 1. websearch - described at the end of |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1560 `Parsing Queries`_ under websearch_to_tsquery. This is the default. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1561 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1562 2. tsquery - described at the beginning of `Parsing Queries`_ with |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1563 to_tsquery. It is enabled by starting the search phrase with ``ts:``. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1564 |
|
8073
57ef20b6c003
docs: fix some missing/broken links.
John Rouillard <rouilj@ieee.org>
parents:
8055
diff
changeset
|
1565 .. _Parsing Queries: |
|
57ef20b6c003
docs: fix some missing/broken links.
John Rouillard <rouilj@ieee.org>
parents:
8055
diff
changeset
|
1566 https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1567 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1568 Websearch provides a more natural style of search and supports: |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1569 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1570 * plain word search (stemmed in most cases) |
|
6613
2eec7a500333
Doc updates for indexers.
John Rouillard <rouilj@ieee.org>
parents:
6612
diff
changeset
|
1571 * phrase search with terms enclosed in quotes (``"``) |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1572 * exclusion by prefixing a term/phrase with ``-`` |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1573 * alternative/or searching with ``or`` between terms |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1574 * ignores non-word characters including punctuation |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1575 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1576 Tsquery supports: |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1577 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1578 * a strict query syntax |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1579 * plain word search |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1580 * phrase search with the ``<->`` operator or enclosing the phrase in |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1581 ``'`` single quotes (note this will use a stemmer on the terms |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1582 in the phrase). |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1583 * proximity search with varying distances using ``<N>`` |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1584 * boolean operations by grouping with parentheses and using ``&`` |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1585 and ``|`` |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1586 * exclusion using ``!`` |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1587 * prefix searching using ``:*`` at the end of the prefix |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1588 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1589 All of the data that is indexed is in a single column and input |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1590 weighing is not used. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1591 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1592 Depending on the FTS configuration (determined by the |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1593 ``indexer_language`` setting), stopwords are supported. PostgreSQL |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1594 takes the stopwords into account when calculating the data needed for |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1595 proximity/near searches. Like SQLite FTS, there is no limit to the |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1596 length of terms that are indexed. Again this may be helpful or |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1597 problematic for your particular tracker. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1598 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1599 The config.ini ``indexer_language`` setting is used to define the |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1600 configuration used for indexing. For example with the default |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1601 ``english`` setting a snowball stemmer (english_stem) is used. So |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1602 words like 'drive' and 'driving' and 'drive-in' will all match a |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1603 search for 'drive' but will not match 'driver'. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1604 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1605 The indexer_language is used as the configuration name for every call |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1606 to the text search functions (to_tsvector, to_tsquery). Changing this |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1607 requires reindexing. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1608 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1609 The `configuration list can be obtained using using psql's`_ |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1610 ``\dF`` command. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1611 |
|
8073
57ef20b6c003
docs: fix some missing/broken links.
John Rouillard <rouilj@ieee.org>
parents:
8055
diff
changeset
|
1612 .. _configuration list can be obtained using using psql's: |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1613 https://www.postgresql.org/docs/current/textsearch-psql.html |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1614 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1615 Roundup includes a hardcoded list for all languages supported by |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1616 PostgreSQL 14.1. The list includes 5 custom "languages" |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1617 ``custom1`` ... ``custom5`` to allow you to set up your `own textsearch |
|
8073
57ef20b6c003
docs: fix some missing/broken links.
John Rouillard <rouilj@ieee.org>
parents:
8055
diff
changeset
|
1618 configuration`_ using one of the custom names. Depending on your |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1619 PostgreSQL version, we may allow an invalid language to be configured. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1620 You will see an error about ``text search configuration ... does not |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1621 exist``. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1622 |
|
8073
57ef20b6c003
docs: fix some missing/broken links.
John Rouillard <rouilj@ieee.org>
parents:
8055
diff
changeset
|
1623 .. _own textsearch configuration: |
|
57ef20b6c003
docs: fix some missing/broken links.
John Rouillard <rouilj@ieee.org>
parents:
8055
diff
changeset
|
1624 https://www.postgresql.org/docs/current/textsearch-configuration.html |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1625 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1626 It may be possible to append to this list using the tracker's |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1627 interfaces.py. For details, see ``test/test_indexer.py`` in the |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1628 roundup distribution and search for ``valid_langs``. If you succeed |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1629 please email roundup-users AT lists.sourceforge.net with a description |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1630 of your success. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1631 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1632 After changing the configuration language, you must reindex the |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1633 tracker since the index must match the configuration language used for |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1634 querying. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1635 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1636 Also there are various `dictionaries`_ that allow you to: |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1637 |
| 7367 | 1638 * add stopwords |
| 1639 * override stemming for a term | |
| 1640 * add synonyms (e.g. a search for "pg" can also match 'psql' | |
| 1641 "postgresql") | |
| 1642 * add terms that expand/contract the search space (Thesaurus | |
| 1643 dictionary) | |
| 1644 * additional transforms | |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1645 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1646 .. _dictionaries: https://www.postgresql.org/docs/14/textsearch-dictionaries.html |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1647 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1648 Use of these is beyond this documentation. Please visit the |
|
6606
328ad56e438a
postgresql database fts - add to CHANGES and add url to admin.
John Rouillard <rouilj@ieee.org>
parents:
6604
diff
changeset
|
1649 appropriate PostgreSQL documents. The following my also be helpful: |
|
328ad56e438a
postgresql database fts - add to CHANGES and add url to admin.
John Rouillard <rouilj@ieee.org>
parents:
6604
diff
changeset
|
1650 |
|
7257
16d6d81b4565
update http to https url.
John Rouillard <rouilj@ieee.org>
parents:
7238
diff
changeset
|
1651 * https://rachbelaid.com/postgres-full-text-search-is-good-enough/ |
|
6604
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1652 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1653 Ranking information is not used in this implementation. Also stop |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1654 words set in config.ini are ignored. These are areas for improvement. |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1655 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1656 Cleaning up old native indexes |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1657 ------------------------------ |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1658 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1659 If you are happy with the database fts indexing, you can save some space by |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1660 removing the data from the native text indexing tables. This requires |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1661 using the ``sqlite3`` or ``psql`` commands to execute SQL to delete the |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1662 rows in the ``__textids`` and ``__words`` tables. You can do this with |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1663 the following SQL commands:: |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1664 |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1665 delete from __words; |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1666 delete from __textids; |
|
0d99ae7c8de6
Allow Roundup to use PostgreSQL database native full text search
John Rouillard <rouilj@ieee.org>
parents:
6586
diff
changeset
|
1667 |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1668 Note this deletes data from the tables and does *not* delete |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1669 the table. This allows you to revert to Roundup's native |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1670 full text indexing on SQLite or Postgres. If you were to |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1671 delete the tables, Roundup will not recreate the |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1672 tables. Under PostgreSQL, you can use the ``truncate |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1673 <tablename>`` command if you wish. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1674 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1675 Configuring Session Databases |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1676 ============================= |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1677 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1678 The session and OTK (one time key) databases |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1679 store information about the operation of Roundup. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1680 This ephemeral data: |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1681 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1682 * web login session keys, |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1683 * CSRF tokens, |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1684 * email password recovery one time keys, |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1685 * rate limiting data, |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1686 * ... |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1687 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1688 can be a performance bottleneck. It usually happens with |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1689 anydbm or SQLite backends. PostgreSQL and MySQL are |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1690 sufficiently powerful that they can handle the higher |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1691 transaction rates. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1692 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1693 If you are using sqlite, you can choose to use the anydbm |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1694 database for session data. By default it will use additional |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1695 sqlite databases for storing the session and otk data. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1696 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1697 The following table shows which primary databases support |
|
7381
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1698 different session database backends: |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1699 |
|
7886
2946354d6ccd
doc: replace X by + to indicate compatible options.
John Rouillard <rouilj@ieee.org>
parents:
7853
diff
changeset
|
1700 .. table:: D - default if unconfigured, + - compatible choice |
|
7381
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1701 :class: captionbelow |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1702 |
|
7381
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1703 +---------------+--------+--------+-------+-------+------------+ |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1704 | | session db | |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1705 +---------------+--------+--------+-------+-------+------------+ |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1706 |primary db | anydbm | sqlite | redis | mysql | postgresql | |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1707 +===============+========+========+=======+=======+============+ |
|
8016
098ceff38349
docs: escape + in table, prevent it from starting an unordered list
John Rouillard <rouilj@ieee.org>
parents:
8015
diff
changeset
|
1708 |anydbm | D | | \+ | | | |
|
7381
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1709 +---------------+--------+--------+-------+-------+------------+ |
|
8016
098ceff38349
docs: escape + in table, prevent it from starting an unordered list
John Rouillard <rouilj@ieee.org>
parents:
8015
diff
changeset
|
1710 |sqlite | \+ | D | \+ | | | |
|
7381
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1711 +---------------+--------+--------+-------+-------+------------+ |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1712 |mysql | | | | D | | |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1713 +---------------+--------+--------+-------+-------+------------+ |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1714 |postgresql | | | | | D | |
|
2884ff18c944
Change primary/session db compatibility table from ascii to real table
John Rouillard <rouilj@ieee.org>
parents:
7367
diff
changeset
|
1715 +---------------+--------+--------+-------+-------+------------+ |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1716 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1717 The ``backend`` setting is in the tracker's ``config.ini`` |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1718 file under the ``sessiondb`` section. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1719 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1720 Using Redis for Session Databases |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1721 --------------------------------- |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1722 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1723 Redis is an in memory key/value data structure store. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1724 |
|
6819
1319ab13f286
redis works with python 2.7 too.
John Rouillard <rouilj@ieee.org>
parents:
6814
diff
changeset
|
1725 You need to install the redis-py_ module from pypi. Then |
|
1319ab13f286
redis works with python 2.7 too.
John Rouillard <rouilj@ieee.org>
parents:
6814
diff
changeset
|
1726 install Redis using your package manager or by downloading |
|
1319ab13f286
redis works with python 2.7 too.
John Rouillard <rouilj@ieee.org>
parents:
6814
diff
changeset
|
1727 it from the Redis_ website. |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1728 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1729 You need to secure your redis instance. The data that |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1730 Roundup stores includes session cookies and other |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1731 authentication tokens. At minimum you should require a |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1732 password to connect to your redis database. Set |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1733 ``requirepass`` in ``redis.conf``. Then change the |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1734 ``redis_url`` in ``config.ini`` to use the password. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1735 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1736 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1737 For example:: |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1738 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1739 redis://:mypassword@localhost:7200/10 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1740 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1741 will connect to the redis instance running on localhost at |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1742 port 7200 using the password ``mypassword`` to open database |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1743 10. The ``redis_url`` setting can load a file to better |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1744 secure the url. If you are using redis 6.0 or newer, you can |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1745 specify a username/password and access control lists to |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1746 improve the security of your data. Another good alternative |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1747 is to talk to redis using a Unix domain socket. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1748 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1749 If you are connecting to redis across the network rather |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1750 than on localhost, you should configure ssl/tls and use the |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1751 ``rediss`` scheme in the url along with the query |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1752 parameters:: |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1753 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1754 ssl_cert_reqs=required&ssl_ca_certs=/path/to/custom/ca-cert |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1755 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1756 where you specify the file that can be used to validate the |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1757 SSL certificate. `Securing Redis`_ has more details. |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1758 |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1759 .. _Redis: https://redis.io |
|
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1760 .. _redis-py: https://pypi.org/project/redis/ |
|
8055
335b8a40e355
docs: update link to redis.io security doc.
John Rouillard <rouilj@ieee.org>
parents:
8041
diff
changeset
|
1761 .. _Securing Redis: https://redis.io/docs/latest/operate/oss_and_stack/management/security/ |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
1762 |
|
6458
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
1763 |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1764 Users and Security |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1765 ================== |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1766 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1767 Roundup holds its own user database which primarily contains a username, |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1768 password and email address for the user. Roundup *must* have its own user |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1769 listing, in order to maintain internal consistency of its data. It is a |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1770 relatively simple exercise to update this listing on a regular basis, or on |
|
4891
ad3d628e73f2
docs: Link custom authentication examples in admin guide
anatoly techtonik <techtonik@gmail.com>
parents:
4890
diff
changeset
|
1771 demand, so that it matches an external listing (eg. |
|
ad3d628e73f2
docs: Link custom authentication examples in admin guide
anatoly techtonik <techtonik@gmail.com>
parents:
4890
diff
changeset
|
1772 :ref:`unix passwd file<external-authentication>`, |
|
6265
b2eb59ada444
Replace http:....roundup-tracker.org with https. Also fix wiki links.
John Rouillard <rouilj@ieee.org>
parents:
6227
diff
changeset
|
1773 `LDAP <https://wiki.roundup-tracker.org/LDAPLogin>`_, etc.) |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1774 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1775 Roundup identifies users in a number of ways: |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1776 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1777 1. Through the web, users may be identified by either HTTP Basic |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1778 Authentication or cookie authentication. If you are running the web |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1779 server (roundup-server) through another HTTP server (eg. apache or IIS) |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1780 then that server may require HTTP Basic Authentication, and it will pass |
|
6436
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1781 the ``REMOTE_USER`` variable (or variable defined using |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1782 http_auth_header) through to Roundup. If this variable is not |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1783 present, then Roundup defaults to using its own cookie-based login |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1784 mechanism. |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1785 2. In email messages handled by roundup-mailgw, users are identified by the |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1786 From address in the message. |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1787 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1788 In both cases, Roundup's behaviour when dealing with unknown users is |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1789 controlled by Permissions defined in the "SECURITY SETTINGS" section of the |
|
2983
9614a101b68f
Stuff from the train ride this morning:
Richard Jones <richard@users.sourceforge.net>
parents:
2921
diff
changeset
|
1790 tracker's ``schema.py`` module: |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1791 |
|
6751
2f7b653b7d6f
Replace old Web Registration/Email Registration with modern equiv.
John Rouillard <rouilj@ieee.org>
parents:
6727
diff
changeset
|
1792 Web Access and Register |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1793 If granted to the Anonymous Role, then anonymous users will be able to |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1794 register through the web. |
|
6751
2f7b653b7d6f
Replace old Web Registration/Email Registration with modern equiv.
John Rouillard <rouilj@ieee.org>
parents:
6727
diff
changeset
|
1795 Email Access and Register |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1796 If granted to the Anonymous Role, then email messages from unknown users |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1797 will result in those users being registered with the tracker. |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1798 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1799 More information about how to customise your tracker's security settings |
|
7354
692242b3effd
initial pass to change references to reference doc where needed.
John Rouillard <rouilj@ieee.org>
parents:
7335
diff
changeset
|
1800 may be found in the `reference documentation`_. |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1801 |
|
6436
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1802 Configuring Authentication Header/Variable |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1803 ------------------------------------------ |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1804 |
|
7238
98d7936d97a3
Add section on configuring Content Security Policy (CSP)
John Rouillard <rouilj@ieee.org>
parents:
7093
diff
changeset
|
1805 The front end server running Roundup can perform the user |
|
6436
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1806 authentication. It pass the authenticated username to the backend in a |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1807 variable. By default roundup looks for the ``REMOTE_USER`` variable |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1808 This can be changed by setting the parameter ``http_auth_header`` in the |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1809 ``[web]`` section of the tracker's ``config.ini`` file. If the value |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1810 is unset (the default) the REMOTE_USER variable is used. |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1811 |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1812 If you are running roundup using ``roundup-server`` behind a proxy |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1813 that authenticates the user you need to configure ``roundup-server`` to |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1814 pass the proper header to the tracker. By default ``roundup-server`` |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1815 looks for the ``REMOTE_USER`` header for the authenticated user. You |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1816 can copy an arbitrary header variable to the tracker using the ``-I`` |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1817 option to roundup-server (or the equivalent option in the |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1818 roundup-server config file). |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1819 |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1820 For example to use the ``uid_variable`` header, two configuration |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1821 changes are needed: First configure ``roundup-server`` to pass the |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1822 header to the tracker using:: |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1823 |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1824 roundup-server -I uid_variable .... |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1825 |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1826 note that the header is passed exactly as supplied by the upstream |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1827 server. It is **not** prefixed with ``HTTP_`` like other headers since |
|
7615
60fc16b6a1cc
doc: remove whitelist replace with allowing
John Rouillard <rouilj@ieee.org>
parents:
7594
diff
changeset
|
1828 you are explicitly allowing the header. Multiple comma separated |
|
6436
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1829 headers can be passed to the ``-I`` option. These could be used in a |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1830 detector or other tracker extensions, but only one header can be used |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1831 by the tracker as an authentication header. |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1832 |
| 7594 | 1833 To make the tracker honor the new variable, change the tracker's |
|
6436
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1834 ``config.ini`` to read:: |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1835 |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1836 [web] |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1837 ... |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1838 http_auth_header = uid_variable |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1839 |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1840 At the time this is written, support is experimental. If you use it |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1841 you should notify the roundup maintainers using the roundup-users |
|
1f2f7c0b8968
issue2550837 - New option for web auth (also http header passing)
John Rouillard <rouilj@ieee.org>
parents:
6344
diff
changeset
|
1842 mailing list. |
|
2572
d15b71b8a85a
more logging goodness
Richard Jones <richard@users.sourceforge.net>
parents:
2479
diff
changeset
|
1843 |
|
7306
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1844 |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1845 Securing Secrets |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1846 ================ |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1847 |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1848 Roundup can read secrets from a file that is referenced from any |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1849 of the config.ini files. If you use Docker, you can bind mount |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1850 the files from a secure location, or store them in a subdirectory |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1851 of the tracker home. |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1852 |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1853 You can also use a secrets management tool like Docker Swarm's |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1854 secrets management. This example config.ini configuration gets |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1855 the database password from a file populated by Swarm secrets:: |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1856 |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1857 [rdbms] |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1858 # Database user password. |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1859 # A string that starts with 'file://' is interpreted as a file |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1860 # path relative to the tracker home. Using 'file:///' defines |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1861 # an absolute path. The first line of the file will be used as |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1862 # the value. Any string that does not start with 'file://' is |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1863 # used as is. It removes any whitespace at the end of the |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1864 # line, so a newline can be put in the file. |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1865 # |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1866 # Default: roundup |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1867 password = file:///run/secrets/db_password |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1868 |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1869 assuming that Docker Swarm secrets has the key ``db_password`` |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1870 and the ``--secret db_password`` option is used when starting the |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1871 Roundup service. |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1872 |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1873 Because environment variables can be inadvertently exposed in |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1874 logs or process listings, Roundup does not currently support |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1875 loading secrets from environment variables. |
|
1aad478fc03f
Add section on Securing Secrets
John Rouillard <rouilj@ieee.org>
parents:
7279
diff
changeset
|
1876 |
|
8478
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1877 .. _pgpconfig: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1878 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1879 Configuring PGP Email Support |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1880 ============================= |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1881 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1882 .. note:: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1883 This section was written with the help of the Devin/DeepWiki AI. |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1884 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1885 You have to install the gpg module using pip. See :ref:`directions for |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1886 installing gpg <gpginstall>` |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1887 in the upgrading document for more information. |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1888 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1889 In your tracker's config.ini configure the following settings in the |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1890 ``[pgp]`` section:: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1891 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1892 enable = yes |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1893 homedir = /path/to/pgp/configdir |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1894 roles = admin |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1895 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1896 This will allow any user with the admin role to send signed pgp |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1897 email. If ``roles`` is not set, all users will need to use signed |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1898 emails. If it is not signed it will be rejected. Note that ``homedir`` |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1899 must be an absolute path. Unlike other path settings, a relative path |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1900 is not interpreted relative to the tracker home. See the documentation |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1901 in config.ini for more information and other settings (e.g. to send |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1902 encrypted emails from the tracker). |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1903 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1904 When PGP is enabled and a message is signed with a valid signature, |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1905 the database transaction source (db.tx_Source) is set to |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1906 ``email-sig-openpgp`` instead of ``email``. This allows you to |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1907 restrict certain operations (e.g. changing a private flag) to |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1908 authenticated/signed emails. |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1909 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1910 Creating GPG Keys for the Tracker |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1911 --------------------------------- |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1912 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1913 To generate a keypair use:: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1914 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1915 gpg --homedir /path/to/pgp/configdir --gen-key |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1916 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1917 where the homedir directory matches the one you set in |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1918 config.ini. Note the gpg homedir must be created before you run the |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1919 command. You will be prompted for the full name of your tracker and |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1920 the email address for your tracker. You also need to do with as the |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1921 user who runs roundup (aka the roundup user) and the roundup email |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1922 gateway. Do not encrypt the key. |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1923 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1924 Roundup has no mechanism for reading the private key if it is |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1925 encrypted. So make sure the permissions on the homedir only allow the |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1926 roundup user to read the files. |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1927 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1928 You can export the public key for use by clients using:: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1929 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1930 gpg --homedir /path/to/pgp/configdir --export -a tracker@example.com > tracker-public.key |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1931 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1932 with homedir and email matching the values used to generate the |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1933 key. This will allow users to import the public key and encrypt emails |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1934 to the tracker. |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1935 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1936 The public gpg key for each user's email address must be imported. To |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1937 do this, obtain the user's public key for their primary email address |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1938 and import it using:: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1939 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1940 gpg --homedir /path/to/tracker/gpg --import user-public-key.asc |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1941 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1942 While Roundup supports multiple addresses for each user, only the |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1943 primary address supports PGP signed or encrypted messages. |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1944 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1945 .. comment: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1946 Questions: |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1947 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1948 Can roundup send signed emails? (looks like no, why??) |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1949 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1950 Why are alternate addresses not supported for receiving PGP emails? |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1951 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1952 Does Roundup ever send an email to an alternate email address? |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1953 |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1954 Should there be some way for a user to upload their own public key? |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1955 If so what ui (paste armored asci cert in textbox, upload ascii |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1956 file from user page and process)? |
|
ed4ef394d5d6
doc: initial attempt to document setup of pgp support for email.
John Rouillard <rouilj@ieee.org>
parents:
8477
diff
changeset
|
1957 |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1958 Tasks |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1959 ===== |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1960 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1961 Maintenance of Roundup can involve one of the following: |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1962 |
|
3780
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
1963 1. `tracker backup`_ |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1964 2. `software upgrade`_ |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1965 3. `migrating backends`_ |
|
2005
fc52d57c6c3e
documentation cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
2003
diff
changeset
|
1966 4. `moving a tracker`_ |
| 3250 | 1967 5. `migrating from other software`_ |
|
3341
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
1968 6. `adding a user from the command-line`_ |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1969 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1970 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1971 Tracker Backup |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1972 -------------- |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1973 |
|
3959
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1974 The roundup-admin import and export commands are **not** recommended for |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1975 performing backup. |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1976 |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1977 Optionally stop the web and email frontends and to copy the contents of the |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1978 tracker home directory to some other place using standard backup tools. |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1979 This means using |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1980 *pg_dump* to take a snapshot of your Postgres backend database, for example. |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1981 A simple copy of the tracker home (and files storage area if you've configured |
|
f764931f2c67
more words about backing up
Richard Jones <richard@users.sourceforge.net>
parents:
3883
diff
changeset
|
1982 it to be elsewhere) will then complete the backup. |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1983 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1984 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1985 Software Upgrade |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1986 ---------------- |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1987 |
| 6781 | 1988 .. _make a backup: #tracker-backup |
| 1989 | |
| 1990 Always `make a backup`_ of your tracker before upgrading software. | |
| 1991 Steps you may take: | |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1992 |
|
6297
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
1993 1. Install pytest and ensure that the unit tests run on your system |
|
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
1994 (using your preferred python version):: |
| 2474 | 1995 |
|
6297
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
1996 pip2 install pytest |
|
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
1997 python2 -m pytest test/ |
|
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
1998 |
|
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
1999 |
|
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
2000 pip3 install pytest |
|
a635a60ffb84
Remove standalone pytest run_tests.py bundle
John Rouillard <rouilj@ieee.org>
parents:
6265
diff
changeset
|
2001 python3 -m pytest test/ |
| 2474 | 2002 |
|
2387
4962f99aaa27
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2203
diff
changeset
|
2003 2. If you're using an RDBMS backend, make a backup of its contents now. |
|
2478
3ab2b91cdd2c
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2474
diff
changeset
|
2004 3. Make a backup of the tracker home itself. |
|
8041
704757c71b84
docs: use virtual env for upgrade; stop cron jobs.
John Rouillard <rouilj@ieee.org>
parents:
8039
diff
changeset
|
2005 4. Stop the tracker web, email frontends and any scheduled |
|
704757c71b84
docs: use virtual env for upgrade; stop cron jobs.
John Rouillard <rouilj@ieee.org>
parents:
8039
diff
changeset
|
2006 (cron) jobs that access the tracker. |
|
704757c71b84
docs: use virtual env for upgrade; stop cron jobs.
John Rouillard <rouilj@ieee.org>
parents:
8039
diff
changeset
|
2007 5. Install the new version of the software in a new virtual |
|
704757c71b84
docs: use virtual env for upgrade; stop cron jobs.
John Rouillard <rouilj@ieee.org>
parents:
8039
diff
changeset
|
2008 environment:: |
|
4014
b80224c1f4e3
fix poor docs
Richard Jones <richard@users.sourceforge.net>
parents:
3963
diff
changeset
|
2009 |
|
8041
704757c71b84
docs: use virtual env for upgrade; stop cron jobs.
John Rouillard <rouilj@ieee.org>
parents:
8039
diff
changeset
|
2010 python3 -m venv /path/to/env |
|
704757c71b84
docs: use virtual env for upgrade; stop cron jobs.
John Rouillard <rouilj@ieee.org>
parents:
8039
diff
changeset
|
2011 . /path/to/env/bin/activate |
|
704757c71b84
docs: use virtual env for upgrade; stop cron jobs.
John Rouillard <rouilj@ieee.org>
parents:
8039
diff
changeset
|
2012 python3 pip install roundup |
|
4014
b80224c1f4e3
fix poor docs
Richard Jones <richard@users.sourceforge.net>
parents:
3963
diff
changeset
|
2013 |
| 6781 | 2014 6. Follow the steps in the `upgrading documentation`_ for all the |
|
6814
3f60a71b0812
Summary: Support selecion session/otk data store. Add redis as data store.
John Rouillard <rouilj@ieee.org>
parents:
6781
diff
changeset
|
2015 versions between your original version and the new version. |
|
3963
3230f9c88086
Fix race condition for key properties in rdbms backends [SF#1876683]
Richard Jones <richard@users.sourceforge.net>
parents:
3959
diff
changeset
|
2016 |
| 6781 | 2017 Usually you should run `roundup_admin -i <tracker_home> migrate` |
| 2018 on your tracker(s) before you allow users to start accessing the tracker. | |
|
3963
3230f9c88086
Fix race condition for key properties in rdbms backends [SF#1876683]
Richard Jones <richard@users.sourceforge.net>
parents:
3959
diff
changeset
|
2019 |
|
3230f9c88086
Fix race condition for key properties in rdbms backends [SF#1876683]
Richard Jones <richard@users.sourceforge.net>
parents:
3959
diff
changeset
|
2020 It's safe to run this even if it's not required, so just get into the |
|
3230f9c88086
Fix race condition for key properties in rdbms backends [SF#1876683]
Richard Jones <richard@users.sourceforge.net>
parents:
3959
diff
changeset
|
2021 habit. |
|
4014
b80224c1f4e3
fix poor docs
Richard Jones <richard@users.sourceforge.net>
parents:
3963
diff
changeset
|
2022 7. Restart your tracker web and email frontends. |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2023 |
| 2474 | 2024 If something bad happens, you may reinstate your backup of the tracker and |
| 2025 reinstall the older version of the sofware using the same install command:: | |
| 2026 | |
| 2027 python setup.py install | |
| 2028 | |
| 6163 | 2029 .. index:: database; convert from one database backend to another |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2030 single: roundup-admin; import and export |
| 6163 | 2031 |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2032 Migrating Backends |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2033 ------------------ |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2034 |
|
3781
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2035 1. Stop the existing tracker web and email frontends (preventing changes). |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2036 2. Use the roundup-admin tool "export" command to export the contents of |
|
5902
4f74b97dddcd
Doc how to export on windows.
John Rouillard <rouilj@ieee.org>
parents:
5300
diff
changeset
|
2037 your tracker to disk. (If you are running on windows see |
|
4f74b97dddcd
Doc how to export on windows.
John Rouillard <rouilj@ieee.org>
parents:
5300
diff
changeset
|
2038 `issue1441336 <https://issues.roundup-tracker.org/issue1441336>`_ |
|
4f74b97dddcd
Doc how to export on windows.
John Rouillard <rouilj@ieee.org>
parents:
5300
diff
changeset
|
2039 on how to use the command line rather than interactive mode to |
|
6227
5105df69145d
Fix typo in admin doc exprt -> export.
John Rouillard <rouilj@ieee.org>
parents:
6176
diff
changeset
|
2040 export data.) |
|
3781
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2041 3. Copy the tracker home to a new directory. |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2042 4. Delete the "db" directory from the new directory. |
|
5300
d8ed32b297e2
Update to migrating backend and tweak to install doc.
John Rouillard <rouilj@ieee.org>
parents:
5140
diff
changeset
|
2043 5. Set the value of the ``backend`` key under the ``[database]`` |
|
d8ed32b297e2
Update to migrating backend and tweak to install doc.
John Rouillard <rouilj@ieee.org>
parents:
5140
diff
changeset
|
2044 section of the tracker's ``config.ini`` file. |
|
3781
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2045 6. Use the roundup-admin "import" command to import the previous export with |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2046 the new tracker home. If non-interactively:: |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2047 |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2048 roundup-admin -i <tracker home> import <tracker export dir> |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2049 |
|
4567
32b24abfe98e
Documentation polishing.
Eric S. Raymond <esr@thyrsus.com>
parents:
4489
diff
changeset
|
2050 If interactively, enter 'commit' before exiting. |
|
3781
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2051 7. Test each of the admin tool, web interface and mail gateway using the new |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2052 backend. |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2053 8. Move the old tracker home out of the way (rename to "tracker.old") and |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2054 move the new tracker home into its place. |
|
e03014a96a95
doc improvement
Richard Jones <richard@users.sourceforge.net>
parents:
3780
diff
changeset
|
2055 9. Restart web and email frontends. |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2056 |
|
7668
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2057 If you are importing into PostgreSQL, it autocommits the data every |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2058 10000 objects/rows by default. This can slow down importing, but it |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2059 prevents an out of memory error caused by using a savepoint for each |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2060 object. You can control the commit frequency by using:: |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2061 |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2062 pragma savepoint_limit=20000 |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2063 |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2064 to set a higher or lower number in roundup-admin. In this example a |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2065 commit will be done every 20,000 objects/rows. The pragma can also be |
|
5b41018617f2
fix: out of memory error when importing under postgresql
John Rouillard <rouilj@ieee.org>
parents:
7667
diff
changeset
|
2066 set on the roundup-admin command line as described below. |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2067 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2068 Moving a Tracker |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2069 ---------------- |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2070 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2071 If you're moving the tracker to a similar machine, you should: |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2072 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2073 1. install Roundup on the new machine and test that it works there, |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2074 2. stop the existing tracker web and email frontends (preventing changes), |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2075 3. copy the tracker home directory over to the new machine, and |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2076 4. start the tracker web and email frontends on the new machine. |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2077 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2078 Most of the backends are actually portable across platforms (ie. from Unix to |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2079 Windows to Mac). If this isn't the case (ie. the tracker doesn't work when |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2080 moved using the above steps) then you'll need to: |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2081 |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2082 1. install Roundup on the new machine and test that it works there, |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2083 2. stop the existing tracker web and email frontends (preventing changes), |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2084 3. use the roundup-admin tool "export" command to export the contents of |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2085 the existing tracker, |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2086 4. copy the export to the new machine, |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2087 5. use the roundup-admin "import" command to import the tracker on the new |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2088 machine, and |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2089 6. start the tracker web and email frontends on the new machine. |
|
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2090 |
| 6163 | 2091 .. index:: |
| 2092 pair: roundup; migrate from other bugtracker software | |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2093 |
| 3250 | 2094 Migrating From Other Software |
| 2095 ----------------------------- | |
| 2096 | |
| 2097 You have a couple of choices. You can either use a CSV import into Roundup, | |
| 2098 or you can write a simple Python script which uses the Roundup API | |
| 2099 directly. The latter is almost always simpler -- see the "scripts" | |
| 2100 directory in the Roundup source for some example uses of the API. | |
| 2101 | |
|
3780
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
2102 "roundup-admin import" will import data into your tracker from a |
| 3250 | 2103 directory containing files with the following format: |
| 2104 | |
| 2105 - one colon-separated-values file per Class with columns for each property, | |
| 2106 named <classname>.csv | |
| 2107 - one colon-separated-values file per Class with journal information, | |
| 2108 named <classname>-journals.csv (this is required, even if it's empty) | |
|
3780
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
2109 - if the Class is a FileClass, you may have the "content" property |
| 3250 | 2110 stored in separate files from the csv files. This goes in a directory |
| 2111 structure:: | |
| 2112 | |
| 2113 <classname>-files/<N>/<designator> | |
| 2114 | |
| 2115 where ``<designator>`` is the item's ``<classname><id>`` combination. | |
| 2116 The ``<N>`` value is ``int(<id> / 1000)``. | |
| 2117 | |
| 2118 | |
| 6163 | 2119 .. index:: pair: roundup-admin; managing users |
| 2120 | |
|
3341
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2121 Adding A User From The Command-Line |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2122 ----------------------------------- |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2123 |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2124 The ``roundup-admin`` program can create any data you wish to in the |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2125 database. To create a new user, use:: |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2126 |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2127 roundup-admin create user |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2128 |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2129 To figure out what good values might be for some of the fields (eg. Roles) |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2130 you can just display another user:: |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2131 |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2132 roundup-admin list user |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2133 |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2134 (or if you know their username, and it happens to be "richard"):: |
|
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2135 |
|
6176
d25638d1826c
Add roundup-admin filter command; fix bad doc example; add tests
John Rouillard <rouilj@ieee.org>
parents:
6175
diff
changeset
|
2136 roundup-admin filter user username=richard |
|
3341
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2137 |
|
6176
d25638d1826c
Add roundup-admin filter command; fix bad doc example; add tests
John Rouillard <rouilj@ieee.org>
parents:
6175
diff
changeset
|
2138 then using the user id (e.g. 5) you get from one of the above |
|
d25638d1826c
Add roundup-admin filter command; fix bad doc example; add tests
John Rouillard <rouilj@ieee.org>
parents:
6175
diff
changeset
|
2139 commands, you may display the user's details:: |
|
3341
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2140 |
|
6176
d25638d1826c
Add roundup-admin filter command; fix bad doc example; add tests
John Rouillard <rouilj@ieee.org>
parents:
6175
diff
changeset
|
2141 roundup-admin display <designator> |
|
3341
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2142 |
|
6176
d25638d1826c
Add roundup-admin filter command; fix bad doc example; add tests
John Rouillard <rouilj@ieee.org>
parents:
6175
diff
changeset
|
2143 where designator is ``user5``. |
|
3341
df693c0aaba9
more admin guide goodness
Richard Jones <richard@users.sourceforge.net>
parents:
3282
diff
changeset
|
2144 |
|
2177
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2145 Running the Servers |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2146 =================== |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2147 |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2148 Unix |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2149 ---- |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2150 |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2151 On Unix systems, use the scripts/server-ctl script to control the |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2152 roundup-server server. Copy it somewhere and edit the variables at the top |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2153 to reflect your specific installation. |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2154 |
|
6344
c63df349f319
issue2551117 - add example systemd config
John Rouillard <rouilj@ieee.org>
parents:
6297
diff
changeset
|
2155 If you use systemd look at scripts/systemd.gunicorn. It is configured |
|
c63df349f319
issue2551117 - add example systemd config
John Rouillard <rouilj@ieee.org>
parents:
6297
diff
changeset
|
2156 for a wsgi deployment using gunicorn, but may be a good starting |
|
c63df349f319
issue2551117 - add example systemd config
John Rouillard <rouilj@ieee.org>
parents:
6297
diff
changeset
|
2157 point for your setup. |
|
2177
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2158 |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2159 Windows |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2160 ------- |
|
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2161 |
|
3780
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
2162 On Windows, the roundup-server program runs as a Windows Service, and |
|
5140
7ea6bbf4286c
update docs for windows installer: 32 bit version of python, must run nstaller as administrator, ned pywin32 to run as service. Encourage installation of pytz.
John Rouillard <rouilj@ieee.org>
parents:
5102
diff
changeset
|
2163 therefore may be controlled through the Services control panel. Note |
|
7ea6bbf4286c
update docs for windows installer: 32 bit version of python, must run nstaller as administrator, ned pywin32 to run as service. Encourage installation of pytz.
John Rouillard <rouilj@ieee.org>
parents:
5102
diff
changeset
|
2164 that you **must** install the pywin32 package to allow roundup to |
|
7ea6bbf4286c
update docs for windows installer: 32 bit version of python, must run nstaller as administrator, ned pywin32 to run as service. Encourage installation of pytz.
John Rouillard <rouilj@ieee.org>
parents:
5102
diff
changeset
|
2165 run as a service. The roundup-server program may also control the |
|
7ea6bbf4286c
update docs for windows installer: 32 bit version of python, must run nstaller as administrator, ned pywin32 to run as service. Encourage installation of pytz.
John Rouillard <rouilj@ieee.org>
parents:
5102
diff
changeset
|
2166 service directly: |
|
2177
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2167 |
|
2405
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2168 **install the service** |
|
3779
ee73abcc95d2
Sorry, another mega-patch:
Richard Jones <richard@users.sourceforge.net>
parents:
3465
diff
changeset
|
2169 ``roundup-server -C /path/to/my/roundup-server.ini -c install`` |
|
2405
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2170 **start the service** |
|
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2171 ``roundup-server -c start`` |
|
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2172 **stop the service** |
|
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2173 ``roundup-server -c stop`` |
|
2177
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2174 |
|
2405
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2175 To bring up the services panel: |
|
2177
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2176 |
|
2405
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2177 Windows 2000 and later |
|
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2178 Start/Control Panel/Administrative Tools/Services |
|
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2179 Windows NT4 |
|
1736886eefb3
more windows info
Richard Jones <richard@users.sourceforge.net>
parents:
2387
diff
changeset
|
2180 Start/Control Panel/Services |
|
2177
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2181 |
|
3780
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
2182 You will need a server configuration file (as described in |
|
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
2183 `Configuring roundup-server`_) for specifying tracker homes |
|
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
2184 and other roundup-server configuration. Specify the name of |
|
158e31bbf86a
recent patch had lines longer than 80 chars - rewrap; trim trailing spaces
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3779
diff
changeset
|
2185 this file using the ``-C`` switch when installing the service. |
|
3779
ee73abcc95d2
Sorry, another mega-patch:
Richard Jones <richard@users.sourceforge.net>
parents:
3465
diff
changeset
|
2186 |
|
2203
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2187 Running the Mail Gateway Script |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2188 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2189 |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2190 The mail gateway script should be scheduled to run regularly on your |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2191 Windows server. Normally this will result in a window popping up. The |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2192 solution to this is to: |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2193 |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2194 1. Create a new local account on the Roundup server |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2195 2. Set the scheduled task to run in the context of this user instead |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2196 of your normal login |
|
4a157c198585
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2177
diff
changeset
|
2197 |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2198 Mail gateway script command line |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2199 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2200 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2201 Usage:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2202 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2203 usage: roundup_mailgw.py [-h] [-v] [-c DEFAULT_CLASS] [-I OAUTH_CLIENT_ID] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2204 [-O OAUTH_DIRECTORY] [-S SET_VALUE] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2205 [-T OAUTH_TOKEN_ENDPOINT] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2206 [args ...] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2207 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2208 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2209 The roundup mail gateway may be called in one of three ways: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2210 |
| 7367 | 2211 - without arguments. Then the env var ROUNDUP_INSTANCE will be tried. |
| 2212 - with an instance home as the only argument, | |
| 2213 - with both an instance home and a mail spool file, or | |
| 2214 - with an instance home, a mail source type and its specification. | |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2215 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2216 It also supports optional ``-S`` (or ``--set-value``) arguments that allows you |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2217 to set fields for a class created by the roundup-mailgw. The format for |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2218 this option is [class.]property=value where class can be omitted and |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2219 defaults to msg. The ``-S`` options uses the same |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2220 property=value[;property=value] notation accepted by the command line |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2221 roundup command or the commands that can be given on the Subject line of |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2222 an email message (if you're using multiple properties delimited with a |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2223 semicolon the class must be specified only once in the beginning). |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2224 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2225 It can let you set the type of the message on a per e-mail address basis |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2226 by calling roundup-mailgw with different email addresses and other |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2227 settings. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2228 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2229 PIPE: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2230 If there is no mail source specified, the mail gateway reads a single |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2231 message from the standard input and submits the message to the |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2232 roundup.mailgw module. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2233 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2234 UNIX mailbox: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2235 In this case, the gateway reads all messages from the UNIX mail spool |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2236 file and submits each in turn to the roundup.mailgw module. The file is |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2237 emptied once all messages have been successfully handled. The file is |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2238 specified as:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2239 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2240 mailbox /path/to/mailbox |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2241 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2242 In all of the following mail source types, the username and password |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2243 can be stored in a ``~/.netrc`` file. If done so, only the server name |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2244 needs to be specified on the command-line. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2245 The username and/or password will be prompted for if not supplied on |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2246 the command-line or in ``~/.netrc``. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2247 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2248 POP: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2249 For the mail source "pop", the gateway reads all messages from the POP |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2250 server specified and submits each in turn to the roundup.mailgw module. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2251 The server is specified as:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2252 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2253 pop username:password@server |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2254 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2255 The username and password may be omitted:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2256 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2257 pop username@server |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2258 pop server |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2259 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2260 are both valid. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2261 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2262 POPS: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2263 Connect to a POP server over tls/ssl. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2264 This supports the same notation as POP:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2265 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2266 pops username:password@server |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2267 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2268 APOP: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2269 Same as POP, but using Authenticated POP:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2270 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2271 apop username:password@server |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2272 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2273 IMAP: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2274 Connect to an IMAP server. This supports the same notation as that of |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2275 POP mail:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2276 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2277 imap username:password@server |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2278 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2279 It also allows you to specify a specific mailbox other than INBOX using |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2280 this format:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2281 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2282 imap username:password@server mailbox |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2283 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2284 IMAPS: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2285 Connect to an IMAP server over tls/ssl. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2286 This supports the same notation as IMAP:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2287 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2288 imaps username:password@server [mailbox] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2289 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2290 IMAPS_CRAM: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2291 Connect to an IMAP server over tls/ssl using CRAM-MD5 authentication. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2292 This supports the same notation as IMAP:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2293 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2294 imaps_cram username:password@server [mailbox] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2295 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2296 IMAPS_OAUTH: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2297 Connect to an IMAP server over tls/ssl using OAUTH authentication. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2298 Note that this does not support a password in imaps URLs. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2299 Instead it uses only the user and server and a command-line option for |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2300 the directory with the files ``access_token``, ``refresh_token``, |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2301 ``client_secret``, and ``client_id``. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2302 By default this directory is ``oauth`` in your tracker home directory. The |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2303 access token is tried first and, if expired, the refresh token together |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2304 with the client secret is used to retrieve a new access token. Note that |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2305 both token files need to be *writeable*, the access token is |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2306 continuously replaced and some cloud providers may also renew the |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2307 refresh token from time to time:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2308 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2309 imaps_oauth username@server [mailbox] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2310 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2311 The refresh and access tokens (the latter can be left empty), the |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2312 client id and the client secret need to be retrieved via cloud provider |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2313 specific protocols or websites. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2314 |
|
7503
7b6278da3faa
Update roundup-mailgw install with other methods; formatting
John Rouillard <rouilj@ieee.org>
parents:
7499
diff
changeset
|
2315 You need the requests_ library installed to ue the IMAPS_OAUTH method. |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2316 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2317 .. _requests: https://requests.readthedocs.io/en/latest/ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2318 |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2319 .. index:: ! roundup-admin |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2320 single: roundup-admin; usage |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2321 single: roundup-admin; data formats |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2322 single: roundup-admin; man page reference |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2323 pair: roundup-admin; designator |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2324 |
|
8412
0663a7bcef6c
feat: finish reauth docs, enhance code.
John Rouillard <rouilj@ieee.org>
parents:
8352
diff
changeset
|
2325 .. _`roundup-admin templates`: |
|
0663a7bcef6c
feat: finish reauth docs, enhance code.
John Rouillard <rouilj@ieee.org>
parents:
8352
diff
changeset
|
2326 |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2327 Using roundup-admin |
|
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2328 =================== |
|
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2329 |
|
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2330 Part of the installation includes a man page for roundup-admin. Ypu |
| 6175 | 2331 should be able to read it using ``man roundup-admin``. As shown above, |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2332 it is a generic tool for manipulating the underlying database for you |
|
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2333 tracker. |
|
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2334 |
|
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2335 Examples above show how to use it to: |
|
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2336 |
| 7367 | 2337 * install and initialize a new tracker |
| 2338 * export/import tracker data for migrating between backends | |
| 7477 | 2339 * creating a new user from the command line |
| 7367 | 2340 * list/find users in the tracker |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2341 |
|
7797
8bdf0484215c
Summary: feat: roundup-admin history command has human interpretable output
John Rouillard <rouilj@ieee.org>
parents:
7795
diff
changeset
|
2342 The basic usage is: |
|
8bdf0484215c
Summary: feat: roundup-admin history command has human interpretable output
John Rouillard <rouilj@ieee.org>
parents:
7795
diff
changeset
|
2343 |
|
8bdf0484215c
Summary: feat: roundup-admin history command has human interpretable output
John Rouillard <rouilj@ieee.org>
parents:
7795
diff
changeset
|
2344 .. code-block:: text |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2345 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2346 Usage: roundup-admin [options] [<command> <arguments>] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2347 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2348 Options: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2349 -i instance home -- specify the issue tracker "home directory" to administer |
|
7395
312d52305583
- issue2551190 - Allow roundup-admin reindex to work in batches.
John Rouillard <rouilj@ieee.org>
parents:
7387
diff
changeset
|
2350 -u -- the user[:password] to use for commands (default admin) |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2351 -d -- print full designators not just class id numbers |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2352 -c -- when outputting lists of data, comma-separate them. |
|
7395
312d52305583
- issue2551190 - Allow roundup-admin reindex to work in batches.
John Rouillard <rouilj@ieee.org>
parents:
7387
diff
changeset
|
2353 Same as '-S ","'. |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2354 -S <string> -- when outputting lists of data, string-separate them |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2355 -s -- when outputting lists of data, space-separate them. |
|
7395
312d52305583
- issue2551190 - Allow roundup-admin reindex to work in batches.
John Rouillard <rouilj@ieee.org>
parents:
7387
diff
changeset
|
2356 Same as '-S " "'. |
|
7546
534f8bdb8f94
Add -P pragma=value command line option to roundup-admin.
John Rouillard <rouilj@ieee.org>
parents:
7503
diff
changeset
|
2357 -P pragma=value -- Set a pragma on command line rather than interactively. |
|
534f8bdb8f94
Add -P pragma=value command line option to roundup-admin.
John Rouillard <rouilj@ieee.org>
parents:
7503
diff
changeset
|
2358 Can be used multiple times. |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2359 -V -- be verbose when importing |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2360 -v -- report Roundup and Python versions (and quit) |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2361 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2362 Only one of -s, -c or -S can be specified. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2363 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2364 Help: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2365 roundup-admin -h |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2366 roundup-admin help -- this help |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2367 roundup-admin help <command> -- command-specific help |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2368 roundup-admin help all -- all available help |
|
6173
82f58ae89142
Add new section onroundup-admin. Ad indexing.
John Rouillard <rouilj@ieee.org>
parents:
6163
diff
changeset
|
2369 |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2370 Commands: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2371 commit |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2372 create classname property=value ... |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2373 display designator[,designator]* |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2374 export [[-]class[,class]] export_dir |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2375 exporttables [[-]class[,class]] export_dir |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2376 filter classname propname=value ... |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2377 find classname propname=value ... |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2378 genconfig <filename> |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2379 get property designator[,designator]* |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2380 help topic |
|
7797
8bdf0484215c
Summary: feat: roundup-admin history command has human interpretable output
John Rouillard <rouilj@ieee.org>
parents:
7795
diff
changeset
|
2381 history designator [skipquiet] [raw] |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2382 import import_dir |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2383 importtables export_dir |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2384 initialise [adminpw] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2385 install [template [backend [key=val[,key=val]]]] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2386 list classname [property] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2387 migrate |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2388 pack period | date |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2389 perftest [mode] [arguments]* |
|
7395
312d52305583
- issue2551190 - Allow roundup-admin reindex to work in batches.
John Rouillard <rouilj@ieee.org>
parents:
7387
diff
changeset
|
2390 pragma setting=value | 'list' |
|
312d52305583
- issue2551190 - Allow roundup-admin reindex to work in batches.
John Rouillard <rouilj@ieee.org>
parents:
7387
diff
changeset
|
2391 reindex [classname|classname:#-#|designator]* |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2392 restore designator[,designator]* |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2393 retire designator[,designator]* |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2394 rollback |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2395 security [Role name] |
|
7395
312d52305583
- issue2551190 - Allow roundup-admin reindex to work in batches.
John Rouillard <rouilj@ieee.org>
parents:
7387
diff
changeset
|
2396 set items property=value [property=value ...] |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2397 specification classname |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2398 table classname [property[,property]*] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2399 templates [trace_search] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2400 updateconfig <filename> |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2401 Commands may be abbreviated as long as the abbreviation |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2402 matches only one command, e.g. l == li == lis == list. |
|
2177
a276e2531321
info about running roundup-server... more needed :)
Richard Jones <richard@users.sourceforge.net>
parents:
2068
diff
changeset
|
2403 |
|
8435
1a93dc58f975
feat: add 'q' as alias to quit to exit interactive roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8433
diff
changeset
|
2404 In interactive mode entering: ``q``, ``quit``, or ``exit`` alone on a |
|
1a93dc58f975
feat: add 'q' as alias to quit to exit interactive roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8433
diff
changeset
|
2405 line will exit the program. |
|
1a93dc58f975
feat: add 'q' as alias to quit to exit interactive roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8433
diff
changeset
|
2406 |
|
7093
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2407 One thing to note, The ``-u user`` setting does not currently operate |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2408 like a user logging in via the web. The user running roundup-admin |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2409 must have read access to the tracker home directory. As a result the |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2410 user has access to the files and the database info contained in |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2411 config.ini. |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2412 |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2413 Using ``-u user`` sets the actor/user parameter in the |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2414 journal. Changes that are made are attributed to that |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2415 user. The password is ignored if provided. Any existing |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2416 username has full access to the data just like the admin |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2417 user. This is an area for further development so that |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2418 roundup-admin could be used with sudo to provide secure |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2419 command line access to a tracker. |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2420 |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2421 In general you should forget that there is a -u parameter. |
|
f72ce883e677
Mitigation for issue2551246 -u opton to roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
6915
diff
changeset
|
2422 |
|
7404
1642a7b501df
Add additional command that do not require a tracker home.
John Rouillard <rouilj@ieee.org>
parents:
7395
diff
changeset
|
2423 All commands (except help, genconfig, templates) require a tracker |
|
1642a7b501df
Add additional command that do not require a tracker home.
John Rouillard <rouilj@ieee.org>
parents:
7395
diff
changeset
|
2424 specifier. This is just the path to the roundup tracker you're working |
|
1642a7b501df
Add additional command that do not require a tracker home.
John Rouillard <rouilj@ieee.org>
parents:
7395
diff
changeset
|
2425 with. A roundup tracker is where roundup keeps the database and |
|
1642a7b501df
Add additional command that do not require a tracker home.
John Rouillard <rouilj@ieee.org>
parents:
7395
diff
changeset
|
2426 configuration file that defines an issue tracker. It may be thought of |
|
1642a7b501df
Add additional command that do not require a tracker home.
John Rouillard <rouilj@ieee.org>
parents:
7395
diff
changeset
|
2427 as the issue tracker's "home directory". It may be specified in the |
|
1642a7b501df
Add additional command that do not require a tracker home.
John Rouillard <rouilj@ieee.org>
parents:
7395
diff
changeset
|
2428 environment variable ``TRACKER_HOME`` or on the command line as "``-i |
|
1642a7b501df
Add additional command that do not require a tracker home.
John Rouillard <rouilj@ieee.org>
parents:
7395
diff
changeset
|
2429 tracker``". |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2430 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2431 A designator is a classname and an itemid concatenated, eg. bug1, |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2432 user10, ... Property values are represented as strings in command |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2433 arguments and in the printed results: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2434 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2435 - Strings are, well, strings. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2436 - Password values will display as their encoded value. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2437 - Date values are printed in the full date format in the local time |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2438 zone, and accepted in the full format or any of the partial formats |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2439 explained below.:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2440 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2441 Input of... Means... |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2442 "2000-04-17.03:45" 2000-04-17.03:45:00 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2443 "2000-04-17" 2000-04-17.00:00:00 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2444 "01-25" yyyy-01-25.00:00:00 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2445 "08-13.22:13" yyyy-08-13.22:13:00 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2446 "11-07.09:32:43" yyyy-11-07.09:32:43 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2447 "14:25" yyyy-mm-dd.14:25:00 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2448 "8:47:11" yyyy-mm-dd.08:47:11 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2449 "2003" 2003-01-01.00:00:00 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2450 "2003-04" 2003-04-01.00:00:00 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2451 "." "right now" |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2452 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2453 - Link values are printed as item designators. When given as an |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2454 argument, item designators and key strings are both accepted. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2455 - Multilink values are printed as lists of item designators joined by |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2456 commas. When given as an argument, item designators and key strings |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2457 are both accepted; an empty string, a single item, or a list of items |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2458 joined by commas is accepted. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2459 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2460 When multiple items are specified to the roundup get or roundup set |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2461 commands, the specified properties are retrieved or set on all the |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2462 listed items. When multiple results are returned by the roundup get or |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2463 roundup find commands, they are printed one per line (default) or joined |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2464 by commas (with the "``-c``" option). |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2465 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2466 Where the command changes data, a login name/password is required. The |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2467 login may be specified as either "``name``" or "``name:password``". |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2468 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2469 - ``ROUNDUP_LOGIN`` environment variable |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2470 - the "``-u``" command-line option |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2471 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2472 If either the name or password is not supplied, they are obtained from |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2473 the command-line. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2474 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2475 The ``-u user`` setting does not currently operate like a |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2476 user logging in via the web. The user running roundup-admin |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2477 must have read access to the tracker home directory. As a |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2478 result the user has access to the files and the database |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2479 info contained in config.ini. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2480 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2481 Using ``-u user`` sets the actor/user parameter in the |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2482 journal. Changes that are made are attributed to that |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2483 user. The password is ignored if provided. Any existing |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2484 username has full access to the data just like the admin |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2485 user. This is an area for further development so that |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2486 roundup-admin could be used with sudo to provide secure |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2487 command line access to a tracker. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2488 |
|
7454
76b2f3c95c03
Add anchor for init section.
John Rouillard <rouilj@ieee.org>
parents:
7404
diff
changeset
|
2489 .. _initpw: |
|
76b2f3c95c03
Add anchor for init section.
John Rouillard <rouilj@ieee.org>
parents:
7404
diff
changeset
|
2490 |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2491 When you initialise a new tracker instance you are prompted for the |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2492 admin password. If you want to initialise a tracker non-interactively |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2493 you can put the initialise command and password on the command |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2494 line. But this allows others on the host to see the password (using |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2495 the ps command). To initialise a tracker non-interactively without |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2496 exposing the password, create a file (e.g init_tracker) set to mode |
|
8432
7f7749d86da8
doc: add disable saving roundup-admin history file for password changes
John Rouillard <rouilj@ieee.org>
parents:
8423
diff
changeset
|
2497 600 (so only the owner can read it) with the contents:: |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2498 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2499 initialise admin_password |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2500 |
|
8432
7f7749d86da8
doc: add disable saving roundup-admin history file for password changes
John Rouillard <rouilj@ieee.org>
parents:
8423
diff
changeset
|
2501 and feed it to roundup-admin on standard input. E.G.:: |
|
7f7749d86da8
doc: add disable saving roundup-admin history file for password changes
John Rouillard <rouilj@ieee.org>
parents:
8423
diff
changeset
|
2502 |
|
7f7749d86da8
doc: add disable saving roundup-admin history file for password changes
John Rouillard <rouilj@ieee.org>
parents:
8423
diff
changeset
|
2503 cat init_tracker | roundup-admin -i tracker_dir -P history_features=2 |
|
7f7749d86da8
doc: add disable saving roundup-admin history file for password changes
John Rouillard <rouilj@ieee.org>
parents:
8423
diff
changeset
|
2504 |
|
7f7749d86da8
doc: add disable saving roundup-admin history file for password changes
John Rouillard <rouilj@ieee.org>
parents:
8423
diff
changeset
|
2505 setting the pragma ``history_features=2`` prevents storing the command |
|
7f7749d86da8
doc: add disable saving roundup-admin history file for password changes
John Rouillard <rouilj@ieee.org>
parents:
8423
diff
changeset
|
2506 in the user's history file. |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2507 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2508 (for more details see https://issues.roundup-tracker.org/issue2550789.) |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2509 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2510 .. index:: ! roundup-admin; usage in scripts |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2511 |
|
7795
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2512 Using Interactively |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2513 ------------------- |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2514 |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2515 You can edit the command line using left/right arrow keys to move the |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2516 cursor. Using the up/down arrow keys moves among commands. It will |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2517 save your commands between roundup-admin sessions. This is supported |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2518 on Unix/Linux and Mac's. On windows you should install the pyreadline3 |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2519 package (see `installation documentation`_). |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2520 |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2521 Using the ``history_length`` pragma you can set the saved history size |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2522 for just one session. |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2523 |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2524 You can add initialization commands to ``~/.roundup_admin_rlrc``. It |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2525 will be loaded when roundup-admin starts. This is the mechanism to |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2526 persistently set the number of history commands, change editing modes |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2527 (Vi vs. Emacs). Note that redefining the history file will not work. |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2528 |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2529 If you are using GNU readline, ``set history-size 10``. If your |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2530 installation uses libedit (macs), it should be possible to |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2531 persistently set the history size using ``history size |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2532 10``. Pyreadline3 can set history length using |
|
7962
828f79ae965b
doc: update links and docs on checking links
John Rouillard <rouilj@ieee.org>
parents:
7886
diff
changeset
|
2533 ``history_length(10)``. See the documentation for example syntax: |
|
828f79ae965b
doc: update links and docs on checking links
John Rouillard <rouilj@ieee.org>
parents:
7886
diff
changeset
|
2534 https://pythonhosted.org/pyreadline/usage.html#configuration-file. |
|
7795
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2535 |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2536 History is saved to the file ``.roundup_admin_history`` in your home |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2537 directory (for windows usually ``\Users\<username>``. |
|
d7d68da9878f
save roundup-admin history between sessions.
John Rouillard <rouilj@ieee.org>
parents:
7668
diff
changeset
|
2538 |
|
8439
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2539 In Roundup 2.6.0 and newer, you can use the ``readline`` command to |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2540 make changes on the fly. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2541 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2542 * ``readline vi`` - change input mode to use vi key binding when |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2543 editing. It starts in entry mode. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2544 * ``readline emacs`` - change input mode to emacs key bindings when |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2545 editing. This is also the default. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2546 * ``readline reload`` - reloads the ``~/.roundup_admin_rlrc`` file so |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2547 you can test and use changes. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2548 * ``readline history`` - dumps the history buffer and numbers all |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2549 commands. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2550 * ``readline .inputrc_command_line`` can be used to make on the fly |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2551 key and key sequence bindings to readline commands. It can also be |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2552 used to change the internal readline settings using a set |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2553 command. For example:: |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2554 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2555 readline set bell-style none |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2556 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2557 will turn off a ``visible`` or ``audible`` bell. Single character |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2558 keybindings:: |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2559 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2560 readline Control-o: dump-variables |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2561 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2562 to list all the variables that can be set are supported. As are |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2563 multi-character bindings:: |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2564 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2565 readline "\C-o1": "commit" |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2566 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2567 will put "commit" on the input line when you type Control-o followed |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2568 by 1. See the `readline manual for details |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2569 <https://tiswww.cwru.edu/php/chet/readline/rluserman.html#Readline-Init-File-Syntax-1>`_ |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2570 on the command lines that can be used. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2571 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2572 Also a limited form of ``!`` (bang) history reference was added. The |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2573 reference must be at the start of the line. Typing ``!23`` will rerun |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2574 command number 23 from your history. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2575 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2576 Typing ``!23:p`` will load command 23 into the buffer so you can edit |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2577 and submit it. Using the bang feature will append the command to the |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2578 end of the history list. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2579 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2580 Pyreadline3 users can use ``readline history`` and the |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2581 bang commands (including ``:p``). Single character bindings can be |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2582 done. For example:: |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2583 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2584 readline Control-w: history-search-backward |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2585 |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2586 The commands that are available are limited compared to Unix's |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2587 readline or libedit. Setting variables or entry mode (emacs, |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2588 vi) switching do not work in testing. |
|
3bdae15252c6
feat: add support for ! history and readline command in roundup-admin
John Rouillard <rouilj@ieee.org>
parents:
8435
diff
changeset
|
2589 |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2590 Using with the shell |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2591 -------------------- |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2592 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2593 With version 0.6.0 or newer of roundup (which introduced support for |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2594 multiple designators to display and the -d, -S and -s flags): |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2595 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2596 To find all messages regarding chatting issues that contain the word |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2597 "spam", for example, you could execute the following command from the |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2598 directory where the database dumps its files:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2599 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2600 shell% for issue in `roundup-admin -ds find issue status=chatting`; do |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2601 > grep -l spam `roundup-admin -ds ' ' get messages $issue` |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2602 > done |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2603 msg23 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2604 msg49 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2605 msg50 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2606 msg61 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2607 shell% |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2608 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2609 Or, using the -dc option, this can be written as a single command:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2610 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2611 shell% grep -l spam `roundup get messages \ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2612 \`roundup -dc find issue status=chatting\`` |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2613 msg23 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2614 msg49 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2615 msg50 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2616 msg61 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2617 shell% |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2618 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2619 You can also display issue contents:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2620 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2621 shell% roundup-admin display `roundup-admin -dc get messages \ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2622 issue3,issue1` |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2623 files: [] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2624 inreplyto: None |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2625 recipients: [] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2626 author: 1 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2627 date: 2003-02-16.21:23:03 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2628 messageid: None |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2629 summary: jkdskldjf |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2630 files: [] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2631 inreplyto: None |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2632 recipients: [] |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2633 author: 1 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2634 date: 2003-02-15.01:59:11 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2635 messageid: None |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2636 summary: jlkfjadsf |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2637 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2638 or status:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2639 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2640 shell% roundup-admin get name `/tools/roundup/bin/roundup-admin \ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2641 -dc -i /var/roundup/sysadmin get status issue3,issue1` |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2642 unread |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2643 deferred |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2644 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2645 or status on a single line:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2646 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2647 shell% echo `roundup-admin get name \`/tools/roundup/bin/roundup-admin \ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2648 -dc -i /var/roundup/sysadmin get status issue3,issue1\`` |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2649 unread deferred |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2650 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2651 which is the same as:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2652 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2653 shell% roundup-admin -s get name `/tools/roundup/bin/roundup-admin \ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2654 -dc -i /var/roundup/sysadmin get status issue3,issue1` |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2655 unread deferred |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2656 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2657 Also the tautological:: |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2658 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2659 shell% roundup-admin get name \ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2660 `roundup-admin -dc get status \`roundup-admin -dc find issue \ |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2661 status=chatting\`` |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2662 chatting |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2663 chatting |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2664 |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2665 Remember the roundup commands that accept multiple designators accept |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2666 them ',' separated so using '-dc' is almost always required. |
|
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2667 |
|
7667
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2668 A Note on Import and Export |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2669 --------------------------- |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2670 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2671 This is a little in the weeds, but I have noticed this and was asked |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2672 about it so I am documenting it for the future. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2673 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2674 Running ``roundup-admin`` with ``-V`` to get additional info when |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2675 importing/exporting the tracker generates three types of messages. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2676 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2677 For example:: |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2678 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2679 $ roundup-admin -i tracker -V export ./myExport |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2680 Exporting priority - 5 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2681 Exporting Journal for priority |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2682 Exporting status - 1 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2683 Exporting Journal for status |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2684 [...] |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2685 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2686 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2687 $ roundup-admin -i tracker -V import ./myExport |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2688 Importing priority - 7 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2689 setting priority 8 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2690 Importing status - 8 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2691 setting status 9 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2692 [...] |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2693 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2694 Note the numbers for status. Exported ends up at 1, Imported ends up |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2695 at 8 and setting chooses 9. These numbers are derived differently and |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2696 used differently. You can't directly compare them. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2697 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2698 ``Exporting issue - XXX``: |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2699 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2700 ``XXX`` is the id number of the node being exported/processed from |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2701 the database. The order is determined by sorting by the key of the |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2702 class (as set by sortkey). If the class key is 'id', then it's a |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2703 string sort so '9' comes before '1009'. You might notice if the |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2704 export is slow the numbers jumping around. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2705 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2706 It does not usually end up as the total number of nodes |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2707 exported. However if it crashes, you know what node it was |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2708 processing at the time. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2709 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2710 In the example above, the status node with id 1 was the last one |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2711 when sorted alphabetically by name. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2712 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2713 ``Importing <class> - XXX``: |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2714 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2715 ``XXX`` is the number of the node (not the node id) being |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2716 imported/currently processed at line XXX+1 in the file. It is an |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2717 incrementing number starting at 0 and never jumps around. Value 0 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2718 is consumed when reading the header and not displayed. The final |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2719 value is the same as the number of objects and one less then the |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2720 number of lines in the file. If it crashes, you were processing |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2721 the line at XXX+1. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2722 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2723 ``setting <class> XXX``: |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2724 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2725 ``XXX`` in the setting line should always be one more than the |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2726 number of imported objects. The setting value is the id for the |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2727 next created object of that type. So in theory the Importing |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2728 number should be one less than the setting number. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2729 |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2730 However under certain circumstances, Roundup can skip an id |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2731 number. This can lead to a difference of more than 1 between the |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2732 Importing and setting numbers. It's not a problem. However setting |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2733 can (and must) always be higher than the Importing number. |
|
08e4399c3ae4
doc: document the messages generated from import/export
John Rouillard <rouilj@ieee.org>
parents:
7615
diff
changeset
|
2734 |
|
8096
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2735 Interactive Help |
|
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2736 ---------------- |
|
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2737 |
|
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2738 The help command produces the following output for all the commands. |
|
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2739 |
|
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2740 |
|
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2741 .. raw:: html |
|
ea1f377c87d6
docs: add roundup-admin interactive help output to admin_guide.txt
John Rouillard <rouilj@ieee.org>
parents:
8073
diff
changeset
|
2742 :file: admin_help.html |
|
7279
0bf616cfa178
Move mail gateway and roundup-admin doc to admin guide from user guide
John Rouillard <rouilj@ieee.org>
parents:
7257
diff
changeset
|
2743 |
|
2003
a291bf753037
maintenance -> admin guide
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2744 .. _`customisation documentation`: customizing.html |
|
7354
692242b3effd
initial pass to change references to reference doc where needed.
John Rouillard <rouilj@ieee.org>
parents:
7335
diff
changeset
|
2745 .. _`reference documentation`: reference.html |
|
2387
4962f99aaa27
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
2203
diff
changeset
|
2746 .. _`upgrading documentation`: upgrading.html |
|
6458
8f1b91756457
issue2551147 - Enable compression of http responses in roundup.
John Rouillard <rouilj@ieee.org>
parents:
6436
diff
changeset
|
2747 .. _`installation documentation`: installation.html |
