======================================
Upgrading to newer versions of Roundup
======================================
Please read each section carefully and edit your tracker home files
accordingly. Note that there is information about upgrade procedures in the
`administration guide`_.
If a specific version transition isn't mentioned here (eg. 0.6.7 to 0.6.8)
then you don't need to do anything. If you're upgrading from 0.5.6 to
0.6.8 though, you'll need to check the "0.5 to 0.6" and "0.6.x to 0.6.3"
steps.
**IMPORTANT** The v1.5.x releases of Roundup were the last to support
Python v2.5 and v2.6. Starting with the v1.6 releases of Roundup
v2.7.2 is required to run newer releases of Roundup.
Contents:
.. contents::
:local:
Migrating from 1.6.X to 2.0.0
=============================
Upgrade tracker's config.ini file
--------------------------------------
Once you have installed the new roundup, use:
roundup-admin -i /path/to/tracker updateconfig newconfig.ini
to generate a new ini file preserving all your settings. You can then
merge any local comments from the tracker's ``config.ini`` into
``newconfig.ini``. Compare the old and new files and configure any new
settings as you want. Then replace ``config.ini`` with the
``newconfig.ini`` file.
Python 3 support
----------------
Many of the ``.html`` and ``.py`` files from Roundup that are copied
into tracker directories have changed for Python 3 support. If you
wish to move an existing tracker to Python 3, you need to merge in
those changes. If your tracker uses the ``anydbm`` or ``mysql``
backends, you also need to export the tracker contents using
``roundup-admin export`` running under Python 2, and them import them
using ``roundup-admin import`` running under Python 3, as for a
migration to a different backend. If using the ``sqlite`` backend,
you do not need to export and import, but need to delete the
``db/otks`` and ``db/sessions`` files when changing Python version.
If using the ``postgresql`` backend, you do not need to export and
import and no other special database-related steps are needed.
If you use the whoosh indexer, you will need to reindex. It looks like
a database created with Python 2 leads to Unicode decode errors when
accessed by Python 3. Reindexing can take a while (see details below
look for "reindexing").
Octal values in config.ini change from the Python 2 representation
with a leading ``0`` (``022``). They now use a leading ``0o``
(``0o22``). Note that the ``0o`` format is properly handled under
python 2. You can use the ``newconfig.ini`` generated using ``python3
roundup-admin -i ... updateconfig newconfig.ini`` if you want to go
back to using python 2. (Note going back to Python 2 will require
the same steps as moving from 2 to 3 except using Python 3 to perform
the export.)
PGP mail processing
-------------------
Roundup now uses the ``gpg`` module instead of ``pyme`` to process PGP
mail. If you have PGP processing enabled, make sure the ``gpg``
module is installed.
MySQL client module
-------------------
Although the ``MySQLdb`` module from
https://pypi.org/project/MySQL-python/ is still supported, it is
recommended to switch to the updated module from
https://pypi.org/project/mysqlclient/.
XMLRPC Access Role
------------------
A new permission has been added to control access to the XMLRPC
endpoint. If the user doesn't have the new "Xmlrpc Access" permission,
they will not be able to log in using the /xmlrpc end point. To add
this new permission to the "User" role you should change your
tracker's schema.py and add::
db.security.addPermissionToRole('User', 'Xmlrpc Access')
This is usually included near where other permissions like "Web Access"
or "Email Access" are assigned.
New values for db.tx_Source
---------------------------
The database attribute tx_Source reports "xmlrpc" and "rest" when the
/xmlrpc and /rest web endpoints are used. Check all code (extensions,
detectors, lib) in trackers looking for tx_Source. If you have code
like::
if db.tx_Source == "web":
or::
if db.tx_Source in ['web', 'email-sig-openpgp', 'cli' ]:
you may need to change these to include matches to "rest" and
"xmlrpc". For example::
if db.tx_Source in [ "web", "rest", "xmlrpc" ]
or::
if db.tx_Source in ['web', 'rest', 'xmlrpc', 'email-sig-openpgp', 'cli' ]:
Update userauditor.py to restrict usernames
-------------------------------------------
A username can be created with embedded commas and < and >
characters. Even though the < and > are usually escaped when
displayed, the embedded comma makes it difficult to edit lists of
users as they are comma separated.
If you have not modified your tracker's userauditor.py, you can just
copy the userauditor.py from the classic template into your tracker's
detectors directory. Otherwise merge the changes from the template
userauditor.py. https://issues.roundup-tracker.org/issue2550921 may be
helpful.
Consider reindexing if you use European languages
-------------------------------------------------
A couple of bugs dealing with incorrect indexing of European languages
(Russian and German were reported) have been fixed. Note reindexing
all your data may take a long time. See:
https://issues.roundup-tracker.org/issue1195739 and
https://issues.roundup-tracker.org/issue1344046 for a description of
the problem. If you determine that this a problem for your tracker,
you can use::
roundup-admin -i /path/to/tracker reindex
to rewrite your full text indexes. The tracker used for reindex timing
had 140MB of file/message data and 2500 issues with a slow 5400RPM
SATA drive. Using native indexing with sqlite took about 45
minutes. Using whoosh took about 2 hours. Using xapian took about 6
hours. All examples were with Python 2. Anecdotal evidence shows
Python 3 is faster, but YMMV.
Merge improvements in statusauditor.py
--------------------------------------
By default the detector statusauditor.py will change the status from
"unread" to "chatting" when a second message is added to an issue.
The distributed classic and jinja templates implement this feature in
their copies of ``detectors/statusauditor.py``.
This can be a problem. Consider a person sending email to create an
issue. Then the person sends a followup message to add some additional
information to the issue. The followup message will trigger the status
change from "unread" to "chatting". This is misleading since the
person is "chatting" with themselves.
Statusauditor.py has been enhanced to prevent the status from changing
to "chatting" until a second user (person) adds a message. If you
want this functionality, you need to merge the distributed
statusauditor.py with your tracker's statusauditor.py. If you have not
customized your tracker's statusauditor.py, copy the one from the
distibuted template. In addition to the python file, you also must
copy/merge the distributed ``detectors/config.ini`` into your
tracker's detectors directory. Most people can copy
``detectors/config.ini`` from the distributed templates as they won't
have a ``detectors/config.ini`` file. (Note this is
``detectors/config.ini`` do not confuse it with the main
``config.ini`` file at the root of the tracker home.)
This enhancement is disabled by default. Enable it by changing the
value in ``detectors/config.ini`` from:
chatting_requires_two_users = False
to
chatting_requires_two_users = True
(the values ``no`` and ``yes`` can also be used). Restart the tracker
to enable the change.
If you don't do this quite right you will see one of two error
messages in the web interface when you try to update an issue with a
message::
Edit Error: Unsupported configuration option: Option
STATUSAUDITOR_CHATTING_REQUIRES_TWO_USERS not found in
detectors/config.ini.
Contact tracker admin to fix.
This happens if detectors/config.ini is not found or is missing the
``chatting_requires_two_users`` option in the ``statusauditor``
section.
If you have an incorrect value (say you use ``T`` rather than
``True``) you see a different error::
Edit Error: Invalid value for
DETECTOR::STATUSAUDITOR_CHATTING_REQUIRES_TWO_USERS: 'T'
Allowed values: yes, no
to fix this set the value to ``yes`` (True) or ``no`` (False).
Migrating from 1.5.1 to 1.6.0
=============================
Update tracker config file
--------------------------
After installing the new version of roundup, you should
update the ``config.ini`` file for your tracker. To do this:
1. backup your existing ``config.ini`` file
2. using the newly installed code, run::
roundup-admin -i /path/to/tracker updateconfig config.ini.new
to create the file config.ini.new. Replace
``/path/to/tracker`` with the path to your tracker.
3. replace your tracker's config.ini with config.ini.new
Using updateconfig keeps all the settings from your
tracker's config.ini file and adds settings for all the new
options.
If you have added comments to your original config.ini file,
merge the added comments into the config.ini.new file. Then
replace your tracker's config.ini with config.ini.new.
Read the new config.ini and configure it to enable new
features. Details on using these features can be found in
this section.
Make sure that user can view labelprop on classes (REQUIRED)
------------------------------------------------------------
If you have View permissions that use ```properties=...```,
make sure that the labelprop for the class is listed in the
properties list.
The first one of these that exists must must be in the list:
1. the property set by a call to setlabelprop for the class
2. the key of the class (as set by setkey())
3. the "name" property (if it exists)
4. the "title" property (if it exists)
if none of those apply, you must allow
* the "id" property
E.G. If your class does a setlabelprop("foo") you must include "foo"
in the properties list even if the class has name or title properties.
See:
http://www.roundup-tracker.org/docs/customizing.html#setlabelprop-property
for further details on the labelprop.
If you don't do this, you will find that multilinks (and possibly
links) may not be displayed properly. E.G. templates that iterate over
a mutlilink field (with tal:repeat for example) may not show any
content.
See: https://sourceforge.net/p/roundup/mailman/message/35763294/
for the initial discussion of the issue.
Cross Site Request Forgery Detection Added
------------------------------------------
Roundup 1.6. supports a number of defenses against CSRF.
Http header verification against the tracker's ``web``
setting in the ``[tracker]`` section of config.ini for the
following headers:
1. Analyze the ``Referer`` HTTP header to make sure it
includes the web setting.
2. Analyze the ``Origin`` HTTP header to make sure the
schema://host matches the web setting.
3. Analyze the ``X-Forwarded-Host`` header set by a proxy
running in front of roundup to make sure it agrees with
the host part of the web setting.
4. Analyze the ``Host`` header to make sure it agrees with
the host part of the web setting. This is not done if
``X-Forwarded-Host`` is set.
By default roundup 1.6 does not require any specific header
to be present. However at least one of the headers above
*must* pass validation checks (usually ``Host`` or
``Referer``) or the submission is rejected with an error.
If any header fails validation, the submission is
rejected. (Note the user's form keeps all the data they
entered if it was rejected.)
Also the admin can include unique csrf tokens for all forms
submitted using the POST method. (Delete and put methods are also
included, but not currently used by roundup.) The csrf
token (nonce) is tied to the user's session. When the user
submits the form and nonce, the nonce is checked to make
sure it was issued to the user and the same session. If this
is not true the post is rejected and the user is notified.
The standard context/submit templating item creates CSRF tokens by
default. If you have forms using the POST method that are not using
the standard submit routine, you should add the following field to all
forms:
A unique random token is generated by every call to
utils.anti_csrf_nonce() and is put in a database to be
retreived if the token is used. Token lifetimes are 2 weeks
by default but can be configured in config.ini. Roundup will
automatically prune old tokens. Calling anti_csrf_nonce with
an integer lifetime, for example:
sets the lifetime of that nonce to 10 minutes.
If you want to change the default settings, you have to
update the web section in your tracker's config.ini file. Follow the
section above to generate an updated config.ini file. Then
look for settings that start with csrf. The updated config.ini
file includes detailed descriptions of the settings.
In general one of four values can be set for these
settings. The default is ``yes``, which validates the header
or nonce and blocks access if the validation fails. If the
field/header is missing it allows access. Setting these
fields to ``required`` blocks access if the header/nonce is
missing.
It is recommended that you change your templates so every form
that is not submitted via GET has an @csrf field. Then change
the csrf_enforce_token setting to 'required'.
Errors and Troubleshooting - @csrf in url
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you see the @csrf nonce in the URL, you have added the value to a
form that uses the GET method. You should remove the @csrf token from
these forms as it is not needed.
Errors and Troubleshooting - AttributeError list object no attribute value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get an error:
AttributeError: 'list' object has no attribute 'value'
in handle_csrf, you have more than one @csrf token for the form. This
usually occurs because the form uses the standard context/submit
element but you also added an explicit @csrf statement. Simply remove
the @csrf element for that form.
Errors and Troubleshooting - xmlrpc Required Header Missing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When performing and xmlrpc call, if you see something like:
xmlrpclib.Fault: :Required Header Missing">
change the setting of csrf_enforce_header_x-requested-with in
config.ini to no. So it looks like:
csrf_enforce_header_x-requested-with = no
Alternatively change your xmlrpc client to add appropriate headers to
the request including the:
X-Requested-With:
header as well as any other required csrf headers (e.g. referer, origin)
configured in config.ini. See the advanced python client at the end of
the `xmlrpc guide`_.
Support for SameSite cookie option for session cookie
-----------------------------------------------------
Support for serving the session cookie using the SameSite cookie option
has been added. By default it is set to lax to provide a better user
experience. But this can be changes to strict or the option can be
removed entirely.
Using the process for merging config.ini changes described in
`Cross Site Request Forgery Detection Added`_ you can add the
``samesite_cookie_setting`` to the ``[web]`` section of the config
file.
Fix for path traversal changes template resolution
--------------------------------------------------
The templates in the tracker's html subdirectory must not be
symbolic links that lead outside of the html directory.
If you don't use symbolic links for templates in your html
subdirectory you don't have to make any changes. Otherwise you need to
replace the symbolic links with hard links to the files or replace the
symbolic links with the files.
This is a side effect of fixing a path traversal security issue. The
security issue required a directory with a specific unusual name. This
made it difficult to exploit. However allowing the use of
subdirectories to organize the templates required that it be fixed.
Database back end specified in config.ini (REQUIRED)
----------------------------------------------------
The ``db/backend_name`` file is no longer used to configure the database
backend being used for a tracker. The backend is now configured in the
``config.ini`` file using the ``backend`` option located in the ``[rdbms]``
section. For example if ``db/backend_name`` file contains ``sqlite``, a new
entry in the tracker's ``config.ini`` will need to be created::
[rdbms]
...
# Database backend.
# Default:
backend = sqlite
Once the ``config.ini`` file has been updated with the new ``backend`` option,
you can safely delete the ``db/backend_name`` file.
Note: the ``backend_name`` file may be located in a directory other than
``db/`` if you have configured the ``database`` option in the ``[main]``
section of the ``config.ini`` file to be something other than ``db``.
Note 2: if you are using the anydbm back end, you still set
it using the backend option in the rdbms section of the
config.ini file.
New config file option 'indexer' added
--------------------------------------
This release added support for the Whoosh indexer, so a new
config file option has been
added. You can force Roundup to use a particular text indexer by
setting this value in the [main] section of the tracker's
``config.ini`` file (usually placed right before indexer_stopwords)::
[main]
...
# Force Roundup to use a particular text indexer.
# If no indexer is supplied, the first available indexer
# will be used in the following order:
# Possible values: xapian, whoosh, native (internal).
indexer =
Errors and Troubleshooting - Full text searching not working
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If after the upgrade full text searching is not working try changing
the indexer value. If this is failing most likely you need to set
'''indexer = native''' to use the rdbms or db text indexing systems.
Alternatively you can do a
'''roundup-admin -i /path/to/tracker reindex'''
to generate a new index using roundup's preferred indexer from the
list above.
Xapian error with flint when reindexing
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you reindex and are using xapian, you may get the error that
"flint" is not supported (looks like flint was removed after xapian
1.2.x). To fix this, you can delete the full text search database
located in the tracker home directory in the file '''db/text-index'''
and then perform a reindex.
Stemming improved in Xapian Indexer
-----------------------------------
Stemming allows a search for "silent" also match silently. The Porter
stemmer in Xapian works with lowercase English text. In this release we
lowercase the documents as they are put into the indexer.
This means capitalization is not preserved, but produces more hits by
using the stemmer.
You will need to do a roundup-admin reindex if you are using the
Xapian full text indexer on your tracker.
New config file option 'replyto_address' added
----------------------------------------------
A new config file option has been added to let you control the
Reply-To header on nosy messages.
Edit your tracker's ``config.ini`` and place the following after
the email entry in the tracker section::
[tracker]
...
# Controls the reply-to header address used when sending
# nosy messages.
# If the value is unset (default) the roundup tracker's
# email address (above) is used.
# If set to "AUTHOR" then the primary email address of the
# author of the change will be used as the reply-to
# address. This allows email exchanges to occur outside of
# the view of roundup and exposes the address of the person
# who updated the issue, but it could be useful in some
# unusual circumstances.
# If set to some other value, the value is used as the reply-to
# address. It must be a valid RFC2822 address or people will not be
# able to reply.
# Default:
replyto_address =
Login from a search or after logout works better (REQUIRED)
-----------------------------------------------------------
The login form has been improved to work with some back end code
changes. Now when a user logs in they stay on the same page where they
started the login. To make this work, you must change the tal that is
used to set the ``__came_from`` form variable. Note that the url
assigned to __came_from must be url encoded/quoted and be under the
tracker's base url. If the base_url uses http, you can set the url to
https.
Replace the existing code in the tracker's html/page.html page that
looks similar to (look for name="__came_from")::
with the following::
Now search backwards for the nearest form statement before the code
that sets __came_from. If it looks like::