http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/roundup/configuration.py Mercurial Repository: p/roundup/code: roundup/configuration.py history 2025-12-14T22:40:46-05:00 feat: support justhtml parsing library to convert email to plain text http://hg.code.sf.net:8000/p/roundup/code/#changeset-520075b29474aa5dd2586b2e9393ae95b47b0911 John Rouillard rouilj@ieee.org 2025-12-14T22:40:46-05:00 2025-12-14T22:40:46-05:00
changeset 520075b29474
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: support justhtml parsing library to convert email to plain text

justhtml is an pure python, fast, HTML5 compliant parser. It is now an
option for converting html only emails to plain text. Its output
format differs slightly from dehtml or beautifulsoup. Mostly by
removing extra blank lines.

dehtml.py:
Using the stream parser of justhtml. Unable to get the full
document parser to successfully strip script and style blocks.

If I can fix this and use the standard parser, I can in theory
generate markdown from the DOM tree generated by justhtml.

Updated test case to include inline elements that should not cause a
line break when they are encountered. Running dehtml as: `python
roundup/dehtml.py foo.html` will load foo.html and parse it using
all available parsers.

configuration.py: justhtml is available as an option.

docs: updated CHANGES.txt, doc/tracker_config.txt added beautifulsoup
and justhtml to the optional software section of doc/installtion.txt.

test_mailgw.py, .github/workflows/ci-test Updated tests and install
justhtml as part of CI.
files
merge heads: CHANGES.txt also whitespace fixups. http://hg.code.sf.net:8000/p/roundup/code/#changeset-7142740e6547acc933baab05a985441a2bce2f45 John Rouillard rouilj@ieee.org 2025-12-08T23:05:26-05:00 2025-12-08T23:05:26-05:00
changeset 7142740e6547
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description merge heads: CHANGES.txt also whitespace fixups.
files
feat: add nanoid pkg trace_id gen and decorator for setting processName http://hg.code.sf.net:8000/p/roundup/code/#changeset-b09ef85f0da62646efe031ee76934ee9b158ae07 John Rouillard rouilj@ieee.org 2025-12-08T00:23:14-05:00 2025-12-08T00:23:14-05:00
changeset b09ef85f0da6
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description 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.
files
take2: merge multiple fix: python < 3.12 returns ParsingError not RuntimeError; print exception http://hg.code.sf.net:8000/p/roundup/code/#changeset-f7fadbac5856a10a4b6eeea2edb4e1b4a5e4fa26 John Rouillard rouilj@ieee.org 2025-09-22T14:12:46-04:00 2025-09-22T14:12:46-04:00
changeset f7fadbac5856
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description take2: merge multiple fix: python < 3.12 returns ParsingError not RuntimeError; print exception
files
merge multiple fix: python < 3.12 returns ParsingError not RuntimeError; print exception http://hg.code.sf.net:8000/p/roundup/code/#changeset-9f7e863fd1cdcf71e6a7c3b6d490db53169ae446 John Rouillard rouilj@ieee.org 2025-09-22T14:08:36-04:00 2025-09-22T14:08:36-04:00
changeset 9f7e863fd1cd
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description merge multiple fix: python < 3.12 returns ParsingError not RuntimeError; print exception
files
fix: python < 3.12 returns ParsingError not RuntimeError; print exception http://hg.code.sf.net:8000/p/roundup/code/#changeset-6d6f689d3701791b0666cb74cfdcc6ea4619101c John Rouillard rouilj@ieee.org 2025-09-22T13:57:52-04:00 2025-09-22T13:57:52-04:00
changeset 6d6f689d3701
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: python < 3.12 returns ParsingError not RuntimeError; print exception

RuntimeError added in 3.12. Support older configparser.ParsingError.

Supporting older version also requires different test string for the
two versions.

Also use str(exception) rather than exception.args[0] for producing
message to user. Include exception name in output.
files
fix: python 3.{7,8,10} raise configfile.ParsingError not RuntimeError http://hg.code.sf.net:8000/p/roundup/code/#changeset-588ae856cd574a68a8a1137d856d18dfc1d1d12f John Rouillard rouilj@ieee.org 2025-09-22T13:09:49-04:00 2025-09-22T13:09:49-04:00
changeset 588ae856cd57
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: python 3.{7,8,10} raise configfile.ParsingError not RuntimeError

when adding broken syntax:

=foo

to logging config file.

These version failing in CI. 3.9 and 3.11 are also
affected. RuntimeError was added in 3.12.
files
bug: improve error reporting for errors for logging fileConfig. http://hg.code.sf.net:8000/p/roundup/code/#changeset-e91ff70e456374163f56e435d671eff185fb7117 John Rouillard rouilj@ieee.org 2025-09-20T16:49:38-04:00 2025-09-20T16:49:38-04:00
changeset e91ff70e4563
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description bug: improve error reporting for errors for logging fileConfig.
files
bug: fix json logging config file syntax exception/fix test for windows http://hg.code.sf.net:8000/p/roundup/code/#changeset-401c6f0be6c516cc2fd8358519ef17749bd0a0e0 John Rouillard rouilj@ieee.org 2025-09-17T19:58:08-04:00 2025-09-17T19:58:08-04:00
changeset 401c6f0be6c5
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description bug: fix json logging config file syntax exception/fix test for windows

If the json logging config file has mimatched {} or [], it raises
an IndexError. Handle that case and test it.

Also handle embedded filenames in tests when testsare run on
windows:(/ vs \ directory sep).
files
bug, test: fix tests for trace_id; readd import logging.config http://hg.code.sf.net:8000/p/roundup/code/#changeset-d06be9346c68beb5115e0fe9fadc67311a10ccc7 John Rouillard rouilj@ieee.org 2025-09-17T00:45:04-04:00 2025-09-17T00:45:04-04:00
changeset d06be9346c68
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description bug, test: fix tests for trace_id; readd import logging.config

Made save_restore_logging a test level fixture. It was a class level
which worked fine until I started using caplog for tests in the same
class. Due to loading config from dict, the roundup channel was set to
not propagate which broke the new formatting test used for trace_id.

Forgot to update some tests due to change in default format adding
%(trace_id).

Also re-added logging.config import which broke loading logging config
files in configuration.py.
files
feature: add thread local trace_id and trace_reason to logging. http://hg.code.sf.net:8000/p/roundup/code/#changeset-14c7c07b32d846e405260147a3112e8c8b15642a John Rouillard rouilj@ieee.org 2025-09-16T22:53:00-04:00 2025-09-16T22:53:00-04:00
changeset 14c7c07b32d8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feature: add thread local trace_id and trace_reason to logging.

Added trace_id to default logging so that all logs for a given request
share the same trace_id.

This allows correlation of logs across a request.

admin_guide.txt, upgrading.txt:
add docs
update sample configs to include trace_id.
rewrite logging docs in admin_guide. Hopefully they are clearer now.
clean up some stuff in the logging config file docs.

admin.py:

add decorators to run_command to enable trace_id.
change calls to db.commit() to use run_command to get trace_id.

configuration.py:

clean up imports.
update docstrings, comments and inline docs.
add trace_id to default log format.
add function for testing decorated with trace_id.
add support for dumping stack trace in logging.
add check for pytest in sys.modules to enable log propagation when
pytest is running. Otherwise tests fail as the caplog logger doesn't
see the roundup logs.

logcontext.py:

new file to handle thread local contextvar mangement.

mailgw.py:

add decorators for trace_id etc.

scripts/roundup_xlmrpc_server.py:

add decorators for trace_id etc.
fix encoding bug turning bytes into a string.
fix command line issue where we can't set encoding. (not sure if
changing encoding via command line even works)

cgi/client.py

decorate two entry points for trace_id etc.

cgi/wsgi_handler.py:

decorate entry point for trace_id etc.

test/test_config.py:

add test for trace_id in new log format.
test various cases for sinfo and errors in formating msg.
files
feat: allow admin to set logging format from config.ini http://hg.code.sf.net:8000/p/roundup/code/#changeset-39a6825d10ca01b1291dc124cd848708932054ee John Rouillard rouilj@ieee.org 2025-09-01T21:54:48-04:00 2025-09-01T21:54:48-04:00
changeset 39a6825d10ca
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: allow admin to set logging format from config.ini

This is prep work for adding a per thread logging variable that can be
used to tie all logs for a single request together.

This uses the same default logging format as before, just moves it to
config.ini.

Also because of configparser, the logging format has to have doubled %
signs. So use:

%%(asctime)s

not '%(asctime)s' as configparser tries to interpolate that string and
asctime is not defined in the configparser's scope. Using %%(asctime)s
is not interpolated by configparser and is passed into Roundup.
files
refactor: also error on missing file or invalid extension http://hg.code.sf.net:8000/p/roundup/code/#changeset-66284037142ea32cd76f62a914a510156a8b797c John Rouillard rouilj@ieee.org 2025-08-26T23:06:40-04:00 2025-08-26T23:06:40-04:00
changeset 66284037142e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description refactor: also error on missing file or invalid extension

Refactored the code to reuse check that logging config file is set and
that the file exists.

Now throws error and exits if file name does not end in .ini or .json.

Now throws error if file doesn't exist. Before it would just configure
default logging as though file wasn't specified.

Added tests for these two cases.
files
feat: change comment in dictConfig json file to // from # http://hg.code.sf.net:8000/p/roundup/code/#changeset-de1dac9abcb64889eb06281fcf1474ae44cb7e96 John Rouillard rouilj@ieee.org 2025-08-26T22:24:00-04:00 2025-08-26T22:24:00-04:00
changeset de1dac9abcb6
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: change comment in dictConfig json file to // from #

Emacs json mode at least will properly indent when using // as a
comment character and not #.
files
feat: add support for using dictConfig to configure logging. http://hg.code.sf.net:8000/p/roundup/code/#changeset-94eed885e9582203be3a66fa5d0c0c122cbaaa84 John Rouillard rouilj@ieee.org 2025-08-19T22:32:46-04:00 2025-08-19T22:32:46-04:00
changeset 94eed885e958
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: add support for using dictConfig to configure logging.

Basic logging config (one level and one output file non-rotating) was
always possible from config.ini. However the LOGGING_CONFIG setting
could be used to load an ini fileConfig style file to set various
channels (e.g. roundup.hyperdb) (also called qualname or tags) with
their own logging level, destination (rotating file, socket,
/dev/null) and log format.

This is now a deprecated method in newer logging modules. The
dictConfig format is preferred and allows disabiling other loggers as
well as invoking new loggers in local code. This commit adds support
for it reading the dict from a .json file. It also implements a
comment convention so you can document the dictConfig.

configuration.py:
new code

test_config.py:
test added for the new code.

admin_guide.txt, upgrading.txt CHANGES.txt:
docs added upgrading references the section in admin_guid.
files
issue2551398 - Browser number input http://hg.code.sf.net:8000/p/roundup/code/#changeset-7ff47307b4b1518a478ce3a3696e7dc454bc5d00 John Rouillard rouilj@ieee.org 2025-05-11T17:59:32-04:00 2025-05-11T17:59:32-04:00
changeset 7ff47307b4b1
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551398 - Browser number input

Disable use of native browser number inputs. There are issues
including use of comma decimal separators.

More extensive remditaion/granularity is needed for this so disable
but leave available for people to test with for now.

Also moved the implentation of native date type from fixed area to
feature area because of the issues with the native date popup and it
defaulting to off. This means it's not a bugfix for the various bugs
lodged against the roundup date picker component.
files
Make native date and number elements configurable http://hg.code.sf.net:8000/p/roundup/code/#changeset-b99e76e764967599da7978a4d57365a155f8827e Ralf Schlatterbeck rsc@runtux.com 2025-02-19T12:38:06+01:00 2025-02-19T12:38:06+01:00
changeset b99e76e76496
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Make native date and number elements configurable

Now for Number() and Integer() properties the browser-native number
format can be configured with the use_browser_number_input config item
in seciont [web]. The default is 'yes'. For Date() properties the config
item is use_browser_date_input (also in section [web]) but the default
is 'no'.

In addition when defining Date() properties, these now have a parameter
'display_time' which defaults to 'yes' and a 'format' parameter which
defaults to None. These set defaults for the field() method of the
DateHTMLProperty which have the same parameters (but the display_time
parameter of field() takes a boolean, not 'yes'/'no').
files
issue2551253. default hash is PBKDF2-SHA512. http://hg.code.sf.net:8000/p/roundup/code/#changeset-6bd11a73f2ede6bbbfc34d18df864e916ec4330e John Rouillard rouilj@ieee.org 2024-12-30T02:57:46-05:00 2024-12-30T02:57:46-05:00
changeset 6bd11a73f2ed
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551253. default hash is PBKDF2-SHA512.

The default password hashing algorithm has been upgraded to
PBKDF2-SHA512 from PBKDF2-SHA1. The default pbkdf2 rounds in the
config file has been changed to 250000.

Doc updated.
files
[permission-performance] Make permission filter functions configurable http://hg.code.sf.net:8000/p/roundup/code/#changeset-5a2b9435a04d4b63c14ba8371d59af60c99f89d8 Ralf Schlatterbeck rsc@runtux.com 2024-10-23T17:46:05+02:00 2024-10-23T17:46:05+02:00
changeset 5a2b9435a04d
branch permission-performance
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Make permission filter functions configurable

For debugging and performance measurements it makes sense to allow
turning permission filter functions off.
files
doc: in description, replace field with header for csrf_* settings http://hg.code.sf.net:8000/p/roundup/code/#changeset-69629a4f7262ce1e7bbfedbc4b305d39ce34a23a John Rouillard rouilj@ieee.org 2024-06-25T12:10:14-04:00 2024-06-25T12:10:14-04:00
changeset 69629a4f7262
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description doc: in description, replace field with header for csrf_* settings

The doc for the csrf_* settings referered to "field is missing" when
referencing it as headers elsewhere in the doc. Change to use header
instead of field to reduce confusion.
files
fix: remove duplicate config option. http://hg.code.sf.net:8000/p/roundup/code/#changeset-9ba60ddafd2ac80f0a5bfcec2e7b3983c00fa7ef John Rouillard rouilj@ieee.org 2024-06-25T12:06:06-04:00 2024-06-25T12:06:06-04:00
changeset 9ba60ddafd2a
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: remove duplicate config option.

Had the same config setting twice in the structure.
files
issue2551323 - Remove XHTML support http://hg.code.sf.net:8000/p/roundup/code/#changeset-791b61ed11c989e2415016366537ac2004a3205d John Rouillard rouilj@ieee.org 2024-05-14T20:50:25-04:00 2024-05-14T20:50:25-04:00
changeset 791b61ed11c9
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551323 - Remove XHTML support

First step: raise error if xhtml used in config.ini. Back end code is
still present to allow an admin to re-enable xhtml as a temporary
measure.
files
doc: use generated config.ini in reference.txt http://hg.code.sf.net:8000/p/roundup/code/#changeset-6aa0525187cd1616f586a32a92fd1b3872cea637 John Rouillard rouilj@ieee.org 2024-04-29T04:17:10-04:00 2024-04-29T04:17:10-04:00
changeset 6aa0525187cd
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description doc: use generated config.ini in reference.txt

Deleted the manually maintained config.ini reference items.

Lost a few nice index references along the way but...

Updated configuration.py with longer descriptions from the manually
maintained items where appropriate.

Checking in the generated tracker_config.txt and the Makefile used
to generate the config and the man pages and then generate local
documentation using setup.py build_docs.
files
test - normalize path for MultiFilePathOptions http://hg.code.sf.net:8000/p/roundup/code/#changeset-82093eb944d668291b57b852d6ea79087466be51 John Rouillard rouilj@ieee.org 2024-04-28T09:55:15-04:00 2024-04-28T09:55:15-04:00
changeset 82093eb944d6
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description test - normalize path for MultiFilePathOptions

As part of work for

issue2551334 - get test suite running under windows

use os.path.normpath on absolute path processing to provide similar
processing to os.path.join on the relative codepath.
files
issue2551115/issue2551282 - utf8mb4 support in roundup http://hg.code.sf.net:8000/p/roundup/code/#changeset-8b31893f5930cbea37031d49bd08a631d1b6b654 John Rouillard rouilj@ieee.org 2024-04-06T22:47:25-04:00 2024-04-06T22:47:25-04:00
changeset 8b31893f5930
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551115/issue2551282 - utf8mb4 support in roundup

Fix issues with utf8 support in Roundup. By default using:

utf8mb4 charset
utf8mb4_unicode_ci collation (case insensitive)
utf8mb4_0900_ci collation (case sensitive)

which are settable from config.ini. Sadly I couldn't come up with a way
to mange these from one parameter. Doing a compatibility lookup table
would have increased the maintenance burden and have me chasing MySQL
changes. So I opted for the easy path and have the admins (with more
MySQL experience) make the choices.

Conversion directions added to upgrading.txt. I don't have any good
testing for this. I was able to generate utf8/utf8mb3 tables and load
a little data and convert. However this is a poor substitute for a
conversion on a working tracker 8-(.
files
chore(lint): change class props from mutable lists to tuples http://hg.code.sf.net:8000/p/roundup/code/#changeset-0c71ac9cdcd02eba283d9460e3f603bccdff72b4 John Rouillard rouilj@ieee.org 2024-03-30T21:48:17-04:00 2024-03-30T21:48:17-04:00
changeset 0c71ac9cdcd0
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore(lint): change class props from mutable lists to tuples

A number of class props were lists [] which are mutable. Change them
to tuples. Better performance and no change of getting the contents
changed.
files
chore(lint): whitespace fixes, double space between class stanzas http://hg.code.sf.net:8000/p/roundup/code/#changeset-b95474b2344016333dc8f4b6dbd3890fbe251942 John Rouillard rouilj@ieee.org 2024-03-30T21:40:02-04:00 2024-03-30T21:40:02-04:00
changeset b95474b23440
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore(lint): whitespace fixes, double space between class stanzas
files
chore(refactor): multiple changes/cleanups http://hg.code.sf.net:8000/p/roundup/code/#changeset-ecc34b7917e2b3e42035dcbe81ee5f670bf22c4f John Rouillard rouilj@ieee.org 2024-03-16T21:08:16-04:00 2024-03-16T21:08:16-04:00
changeset ecc34b7917e2
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore(refactor): multiple changes/cleanups

Simplify 'for x in [list val]; alist.append(x)' to 'alist = list([list
val])'. Easier to read as copy of list. Also twice as fast although
speed not an issue.

Remove unneeded list() wrappers. Replace set(list comprehension) with
set comprehension.

Also add trailing ,'s to last element in tuples/lists.

Add some noqa items for acceptable operations in context.

Switch " ... \" ...\" ..." to: ' ... " ... " ...' to remove need to
escape internal '"'.

Change 'not x in y' to 'x not in y'.
files
chore(refactor): use 'with open'; if ternarys; unnested if statements http://hg.code.sf.net:8000/p/roundup/code/#changeset-a4b71f16c2642367af71e6a5eadf59559a3a5da8 John Rouillard rouilj@ieee.org 2024-03-16T20:03:16-04:00 2024-03-16T20:03:16-04:00
changeset a4b71f16c264
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore(refactor): use 'with open'; if ternarys; unnested if statements
files
chore(ruff): sort imports http://hg.code.sf.net:8000/p/roundup/code/#changeset-890097bc4cd0a32223a01a593a79e289b52af343 John Rouillard rouilj@ieee.org 2024-03-16T19:41:36-04:00 2024-03-16T19:41:36-04:00
changeset 890097bc4cd0
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore(ruff): sort imports
files
feat: add support for rotating jwt keys http://hg.code.sf.net:8000/p/roundup/code/#changeset-be6cb2e0d47124399ccfc3326690c7c2049713c6 John Rouillard rouilj@ieee.org 2024-03-14T19:04:19-04:00 2024-03-14T19:04:19-04:00
changeset be6cb2e0d471
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: add support for rotating jwt keys

This allows jwt_secret to have multiple ',' separated secrets. The
first/leftmost should be used to sign new JWTs. All of them are used
(starting from left/newest) to try to verify a JWT.

If the first secret is < 32 chars in length JWTs are disabled. If any
of the other secrets are < 32 chars, the configuration code causes the
software to exit. This prevents insecure (too short) secrets from
being used.

Updated doc examples and tests.
files
Add configurable logging for REST http://hg.code.sf.net:8000/p/roundup/code/#changeset-6f66d74d37f33289c7b15875e0f2439cdd81ca19 Ralf Schlatterbeck rsc@runtux.com 2024-01-17T17:07:23+01:00 2024-01-17T17:07:23+01:00
changeset 6f66d74d37f3
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Add configurable logging for REST

We now log status code and error message for failing REST requests.
Introduces new config item rest_logging in section [web].
Fixes (part of) issue2551274.
files
feat: issue2550852 - support using a specified PostgreSQL db schema http://hg.code.sf.net:8000/p/roundup/code/#changeset-3071db43bfb6d957b2dab43ae0f9df0e98f86002 John Rouillard rouilj@ieee.org 2023-12-27T22:52:14-05:00 2023-12-27T22:52:14-05:00
changeset 3071db43bfb6
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: issue2550852 - support using a specified PostgreSQL db schema

Finally after 7 years this is closed.

roundup/backends/back_postgresql.py:
Support use of schema when specified in RDBMS_NAME. Stuart McGraws
code is finally merged 8-).

test/test_postgresql.py, test/conftest.py:
Run all postgresql tests in the schema db as well.
Also make sure that db_nuke raises an error when trying to delete
the schema test database. Conftest defines pg_schema mark that can
be used to exclude schema tests with pytest -m "not pg_schema".

roundup/configuration.py:
change doc on RDBMS_NAME to include db.schema form.

.travis.yml, .github/workflows/ci-test.yml:
create schema test db; add user for testing with schema; grant new
user create privs for schema.

doc/installation.txt:
Reference to roundup-admin init deleting schema added.

doc/mysql.txt doc/postgresql.txt:
New documentation on psql/mysql commands to set up a production db.

doc/upgrading.txt:
mention schema support, also document service setting for
selecting connection from pg_service.conf.

doc/reference.txt:
update config.ini documentation for RDBMS_NAME.
files
feat(db): support using postgresql service connection file http://hg.code.sf.net:8000/p/roundup/code/#changeset-4af0d235b5709fef74ad266a14fe243260d48199 John Rouillard rouilj@ieee.org 2023-11-07T12:11:37-05:00 2023-11-07T12:11:37-05:00
changeset 4af0d235b570
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat(db): support using postgresql service connection file

Add new service rdbms config option to set the service name to be used
with a postgresql service connection file.

This can be done using the PGSERVICE environment variable for a single
instance tracker server. For a multi-instance server this per-tracker
config option is needed.

Note that settings (host, user, (db)name...) in config.ini file will
override the service connection file setting. Also setting PGSERVICE
and service will use the service setting.
files
clarify doc on dispatcher_email config setting. http://hg.code.sf.net:8000/p/roundup/code/#changeset-d30e534b078aafaf5d497a4e5f14ad84f07ed087 John Rouillard rouilj@ieee.org 2023-10-10T20:33:22-04:00 2023-10-10T20:33:22-04:00
changeset d30e534b078a
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description clarify doc on dispatcher_email config setting.

An issue was brought up on the mailing list.

https://sourceforge.net/p/roundup/mailman/message/43383465/

The description of dispatcher_email sounds like it should be sent
email on issue creation. That's not it's role. Try to make it's role
more obvious.

Fix config.ini and reference.txt description.

Add the newissuecopy.py detector to send email on the creation of an
issue
files
flake8: add extra blank lines http://hg.code.sf.net:8000/p/roundup/code/#changeset-5e118944ef75adf472dc88fdbf1cc04d5a11df81 John Rouillard rouilj@ieee.org 2023-07-23T23:19:03-04:00 2023-07-23T23:19:03-04:00
changeset 5e118944ef75
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8: add extra blank lines
files
fix(api): - issue2551063 - Rest/Xmlrpc interfaces needs failed login protection. http://hg.code.sf.net:8000/p/roundup/code/#changeset-273c8c2b504245a937efbd42604f77cb2d3d0d9d John Rouillard rouilj@ieee.org 2023-07-19T20:37:45-04:00 2023-07-19T20:37:45-04:00
changeset 273c8c2b5042
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix(api): - issue2551063 - Rest/Xmlrpc interfaces needs failed login protection.

Failed API login rate limiting with expiring lockout added.
files
Add xhtml deprecation notice. http://hg.code.sf.net:8000/p/roundup/code/#changeset-bed28b64c58193c150f0579b987784d01c6706e8 John Rouillard rouilj@ieee.org 2023-06-05T12:11:49-04:00 2023-06-05T12:11:49-04:00
changeset bed28b64c581
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add xhtml deprecation notice.

xhtml is dead. Plan on removing it in next release along with the code
that supports it.
files
Incomplete work to generate config doc from config.ini http://hg.code.sf.net:8000/p/roundup/code/#changeset-a210f4437b49548b399f115d93d12e288b4d08cf John Rouillard rouilj@ieee.org 2023-05-17T13:34:36-04:00 2023-05-17T13:34:36-04:00
changeset a210f4437b49
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Incomplete work to generate config doc from config.ini

This is an incomplete attempt to allow generation of the config.ini
documentation in reference.txt. It reformats the output of
'roundup_admin.py genconfig'. So it now includes all of the
settings. Using a Makefile rule like:

tracker_config.txt: ../roundup/configuration.py
python3 ../roundup/scripts/roundup_admin.py \
genconfig _temp_config.txt
sed -e '1,8d' \
-e 's/^\[\([a-z]*\)\]/\n.. index:: config.ini; sections \1\n\n.. code:: ini\n\n [\1]/' \
-e 's/^\([^[]\)/ \1/' \
_temp_config.txt > tracker_config.txt
rm -f _temp_config.txt

results in the config.ini split by section and index links being put
in place. However some sections have a comment before the [section]
marker. This comment is orphaned at the end of the prior section
rather than starting the new section. A simple sed won't allow the
lookahead needed to target the [section] marker and include the prior
comment block. Also there are still have some long lines generated (>
65 characters). Maybe a python script can import configuration.py and
output proper restructured text output?


reference.txt:
add a commented out include:: tracker_config.txt directive

roundup/admin.py:
don't require a tracker home for genconfig. So user can generate a
clean config.ini on demand. Tracker home is still required for
updateconfig.

roundup/configuration.py:
wrap lines better. A number of them are generating comments > 65
characters which is the targeted line length. This cleans up
config.ini too, so is a good thing.

website/www/conf.py:
ignore doc/tracker_config.ini when processing.
files
fix initialization of option_validator http://hg.code.sf.net:8000/p/roundup/code/#changeset-ab0ea9f038661ef06401383b832db4e4a059e224 John Rouillard rouilj@ieee.org 2023-04-12T11:20:14-04:00 2023-04-12T11:20:14-04:00
changeset ab0ea9f03866
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix initialization of option_validator

When using option_validator to validate config.ini entries for
detectors or extensions, the list of validators was not reset when the
tracker was re-opened.

This led to the second command run in roundup-admin crashing when the
main config.ini file was read. On second tracker open/read
option_validator lists an extension/detector option that doesn't exist
in the main config.ini. When it tried to validate, the missing option
caused a crash.

This only happens if a validator is added in an extension/detector.
If the only validators ae ones for the main config.ini everything
works fine across multiple tracker opens.
files
fix typo http://hg.code.sf.net:8000/p/roundup/code/#changeset-5c71b27aa68ef39fc8e2505c13b341eb787a4d5f John Rouillard rouilj@ieee.org 2023-03-06T22:30:41-05:00 2023-03-06T22:30:41-05:00
changeset 5c71b27aa68e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix typo
files
Production PBKDF rounds back to 2M, test 1k; fix empty_form (python2) http://hg.code.sf.net:8000/p/roundup/code/#changeset-2de72f75f2f8da0d414197b5304d374d96d7e42b John Rouillard rouilj@ieee.org 2023-02-26T15:38:49-05:00 2023-02-26T15:38:49-05:00
changeset 2de72f75f2f8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Production PBKDF rounds back to 2M, test 1k; fix empty_form (python2)
files
revert increase in PBKDF2 rounds to get baseline perf. http://hg.code.sf.net:8000/p/roundup/code/#changeset-e3f3f859256ca3817906a33c6631c82019d4a6dd John Rouillard rouilj@ieee.org 2023-02-26T12:01:53-05:00 2023-02-26T12:01:53-05:00
changeset e3f3f859256c
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description revert increase in PBKDF2 rounds to get baseline perf.
files
issue2551252 - increase PBKFD2 default rounds to 2,000,000. http://hg.code.sf.net:8000/p/roundup/code/#changeset-be7849588372a25d0d3549795fde5e417ec37fae John Rouillard rouilj@ieee.org 2023-02-23T19:17:42-05:00 2023-02-23T19:17:42-05:00
changeset be7849588372
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551252 - increase PBKFD2 default rounds to 2,000,000.

Current
https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2

for SHA1 recommends 1,300,000 so 2,000,000.
files
improve REST interface security http://hg.code.sf.net:8000/p/roundup/code/#changeset-89a59e46b3af7bb327ebf079c34e22bbbff8bbf2 John Rouillard rouilj@ieee.org 2023-02-23T12:01:33-05:00 2023-02-23T12:01:33-05:00
changeset 89a59e46b3af
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description improve REST interface security

When using REST, we reflect the client's origin. If the wildcard '*'
is used in allowed_api_origins all origins are allowed. When this is
done, it also added an 'Access-Control-Allow-Credentials: true'
header.

This Credentials header should not be added if the site is matched
only by '*'. This header should be provided only for explicit origins
(e.g. https://example.org) not for the wildcard.

This is now fixed for CORS preflight OPTIONS request as well as normal
GET, PUT, DELETE, POST, PATCH and OPTIONS requests.

A missing Access-Control-Allow-Credentials will prevent the tracker
from being accessed using credentials. This prevents an unauthorized
third party web site from using a user's credentials to access
information in the tracker that is not publicly available.

Added test for this specific case.

In addition, allowed_api_origins can include explicit origins in
addition to '*'. '*' must be first in the list.

Also adapted numerous tests to work with these changes.

Doc updates.
files
clarify help text for * in allowed_api-origins http://hg.code.sf.net:8000/p/roundup/code/#changeset-563f5327c5b5c6a3a74d78f3c52b57905d8a92ae John Rouillard rouilj@ieee.org 2023-02-15T12:03:35-05:00 2023-02-15T12:03:35-05:00
changeset 563f5327c5b5
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description clarify help text for * in allowed_api-origins
files
Improve documention on access to templates and static_files. http://hg.code.sf.net:8000/p/roundup/code/#changeset-570abc4c6548faede0766261efab55c9daa5fe0f John Rouillard rouilj@ieee.org 2022-11-30T02:22:21-05:00 2022-11-30T02:22:21-05:00
changeset 570abc4c6548
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Improve documention on access to templates and static_files.
files
flake8 fixes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-8733aa2a8e4070a7235e864a6361b89a457df771 John Rouillard rouilj@ieee.org 2022-09-13T16:35:32-04:00 2022-09-13T16:35:32-04:00
changeset 8733aa2a8e40
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8 fixes.
files
postgresql native-fts; more indexer tests http://hg.code.sf.net:8000/p/roundup/code/#changeset-9ff091537f43346776e45c325be77f43beb43970 John Rouillard rouilj@ieee.org 2022-09-05T16:25:20-04:00 2022-09-05T16:25:20-04:00
changeset 9ff091537f43
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description postgresql native-fts; more indexer tests

1) Make postgresql native-fts actually work.
2) Add simple stopword filtering to sqlite native-fts indexer.
3) Add more tests for indexer_common get_indexer


Details:

1) roundup/backends/indexer_postgresql_fts.py:

ignore ValueError raised if we try to index a string with a null
character in it. This could happen due to an incorrect text/ mime
type on a file that has nulls in it.

Replace ValueError raised by postgresql with customized
IndexerQueryError if a search string has a null in it.

roundup/backends/rdbms_common.py:

Make postgresql native-fts work. When specified it was using using
whatever was returned from get_indexer(). However loading the
native-fts indexer backend failed because there was no connection to
the postgresql database when this call was made.

Simple solution, move the call after the open_connection call in
Database::__init__().

However the open_connection call creates the schema for the
database if it is not there. The schema builds tables for
indexer=native type indexing. As part of the build it looks at the
indexer to see the min/max size of the indexed tokens. No indexer
define, we get a crash.

So it's a a chicken/egg issue. I solved it by setting the indexer
to the Indexer from indexer_common which has the min/max token size
info. I also added a no-op save_indexer to this Indexer class. I
claim save_indexer() isn't needed as a commit() on the db does all
the saving required. Then after open_connection is called, I call
get_indexer to retrieve the correct indexer and
indexer_postgresql_fts woks since the conn connection property is
defined.

roundup/backends/indexer_common.py:

add save_index() method for indexer. It does nothing but is needed
in rdbms backends during schema initialization.

2) roundup/backends/indexer_sqlite_fts.py:

when this indexer is used, the indexer test in DBTest on the word
"the" fail. This is due to missing stopword filtering. Implement
basic stopword filtering for bare stopwords (like 'the') to make the
test pass. Note: this indexer is not currently automatically run by
the CI suite, it was found during manual testing. However there is a
FIXME to extract the indexer tests from DBTest and run it using this
backend.

roundup/configuration.py, roundup/doc/admin_guide.txt:

update doc on stopword use for sqlite native-fts.

test/db_test_base.py:

DBTest::testStringBinary creates a file with nulls in it. It was
breaking postgresql with native-fts indexer. Changed test to assign
mime type application/octet-stream that prevents it from being
processed by any text search indexer.

add test to exclude indexer searching in specific props. This code
path was untested before.


test/test_indexer.py:

add test to call find with no words. Untested code path.

add test to index and find a string with a null \x00 byte. it was
tested inadvertently by testStringBinary but this makes it explicit
and moves it to indexer testing. (one version each for: generic,
postgresql and mysql)

Renamed Get_IndexerAutoSelectTest to Get_IndexerTest and renamed
autoselect tests to include autoselect. Added tests for an invalid
indexer and using native-fts with anydbm (unsupported combo) to make
sure the code does something useful if the validation in
configuration.py is broken.

test/test_liveserver.py:

add test to load an issue

add test using text search (fts) to find the issue

add tests to find issue using postgresql native-fts

test/test_postgresql.py, test/test_sqlite.py:

added explanation on how to setup integration test using native-fts.

added code to clean up test environment if native-fts test is run.
files
Summary: Support selecion session/otk data store. Add redis as data store. http://hg.code.sf.net:8000/p/roundup/code/#changeset-3f60a71b081240cebcb1c0e96d760e7a9c790612 John Rouillard rouilj@ieee.org 2022-08-04T14:41:58-04:00 2022-08-04T14:41:58-04:00
changeset 3f60a71b0812
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Summary: Support selecion session/otk data store. Add redis as data store.

Allow admin to select the backend data store. Compatibility matrix:

main\/ session>| anydbm | sqlite | redis | mysql | postgresql |
anydbm | D | | X | | |
sqlite | X | D | X | | |
mysql | | | | D | |
postgresql | | | | | D |
--------------------------------------------------------------+
D - default if unconfigured, X - compatible choice

DETAILS

roundup/configuration.py:
add config.ini section sessiondb with settings: backend and redis_url.

CHANGES.txt, doc/admin_guide.txt, doc/installation.txt, doc/upgrading.txt:
doc on config of session db and redis. Plus some other fixes:

admin - clarified why we do not drop __words and __testids
table in native-fts conversion. TYpo fix.

upgrading - doc how you can keep using anydbm for session data with
sqlite. Fix dupe sentence in an upgrading config.ini
section.

roundup/backends/back_anydbm.py, roundup/backends/back_sqlite.py:
code to support redis, redis/anydbm backends respectively.

roundup/backends/sessions_redis.py
new storage backend for redis.

roundup/rest.py, roundup/cgi/actions.py, roundup/cgi/templating.py
redis uses a different way of calculating lifetime/timestamp.
Since expiration of an item occurred if its timestamp was more
than 1 week old, code would calculate:
now - 1 week + lifetime.
But this results in faster expiration in redis if used for
lifetime/timestamp.
Convert code to use the lifetime() method in BasicDatabase
that generates the right timestamp for each backend.

test/session_common.py:
added tests for more cases, get without default, getall non-existing
key etc. timestamp test changed to use new self.get_ts which is
overridden in other tests. Test that datatypes survive storage.

test/test_redis_session.py:
test redis session store with sqlite and anydbm primary databases

test/test_anydbm.py, test/test_sqlite.py
add test to make sure the databases are properly set up

sqlite - add test cases where anydbm is used as datastore
anydbm - remove updateTimestamp override add get_ts().

test/test_config.py
tests on redis_url and compatibility on choice of sessiondb backend

.travis.yml:
add redis db and redis-py
files
document jinja2 as valid setting for template_engine in config.ini http://hg.code.sf.net:8000/p/roundup/code/#changeset-031996eb9bb5030f641d8042173c749fcf9eec23 John Rouillard rouilj@ieee.org 2022-06-27T00:33:31-04:00 2022-06-27T00:33:31-04:00
changeset 031996eb9bb5
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description document jinja2 as valid setting for template_engine in config.ini

Also try to import jinja2 and report unavailable/available.
files
Add allowed_api_origins to upgrading doc http://hg.code.sf.net:8000/p/roundup/code/#changeset-f1f2d59dab8b39b43a491b1f227b23fc13462bb5 John Rouillard rouilj@ieee.org 2022-05-29T22:37:36-04:00 2022-05-29T22:37:36-04:00
changeset f1f2d59dab8b
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add allowed_api_origins to upgrading doc

In upgrading doc, also make upgrading config.ini a separate step.
Fix spelling error.

Also document * in allowed_api_origins in configuration.py.
files
Switch off using blank passwords for login http://hg.code.sf.net:8000/p/roundup/code/#changeset-9ca5cbffa0c42d000ec261faf1bed9d6b04d9255 John Rouillard rouilj@ieee.org 2022-05-23T17:31:50-04:00 2022-05-23T17:31:50-04:00
changeset 9ca5cbffa0c4
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Switch off using blank passwords for login

There is now a config.ini setting [web] login_empty_passwords to
enable logins for users without a password set. By default it's off
and every user must have a password.
files
issue2551205 bugfix missing _value2str http://hg.code.sf.net:8000/p/roundup/code/#changeset-0b8d34b649308f32d24c3e38b64b7b1f49097321 John Rouillard rouilj@ieee.org 2022-05-17T18:05:45-04:00 2022-05-17T18:05:45-04:00
changeset 0b8d34b64930
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551205 bugfix missing _value2str
files
issue2551205: Add support for specifying valid origins for api: xmlrpc/rest http://hg.code.sf.net:8000/p/roundup/code/#changeset-ab2ed11c021eec91ca1a624ee4ee259e2282741d John Rouillard rouilj@ieee.org 2022-05-17T17:18:51-04:00 2022-05-17T17:18:51-04:00
changeset ab2ed11c021e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551205: Add support for specifying valid origins for api: xmlrpc/rest

We now have an allow list to filter the hosts allowed to do api
requests. An element of this allow list must match the http ORIGIN
header exactly or the rest/xmlrpc CORS request will result in an
error.

The tracker host is always allowed to do a request.
files
Add i18n object to roundupdb.Database http://hg.code.sf.net:8000/p/roundup/code/#changeset-408fd477761fa40fd7dfa13c4a25be572cd46dd9 Ralf Schlatterbeck rsc@runtux.com 2022-05-03T14:51:59+02:00 2022-05-03T14:51:59+02:00
changeset 408fd477761f
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Add i18n object to roundupdb.Database

This makes the i18n object accessible everywhere (including in detectors
where localized error messages were impossible). See issue2551184
files
Allow Roundup to use PostgreSQL database native full text search http://hg.code.sf.net:8000/p/roundup/code/#changeset-0d99ae7c8de62fdc4561e7f0a8a6b38da86e34cd John Rouillard rouilj@ieee.org 2022-01-27T19:48:48-05:00 2022-01-27T19:48:48-05:00
changeset 0d99ae7c8de6
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Allow Roundup to use PostgreSQL database native full text search

back_postgreql.py - schema version changes for schema version 7.

configuration.py - added indexer_language checks for postgresql. Hardcoded
list for now.

Docs admin_guide and upgrading

Tests.


This also restructures the version upgrade tests for the rdbms
backends. They can run all of them now as the proper cascade is
developed to roll back changes to version 6.
files
Summary: Add test cases for sqlite fts http://hg.code.sf.net:8000/p/roundup/code/#changeset-91ab3e0ffcd0d5550274ffda207241843ee6a545 John Rouillard rouilj@ieee.org 2022-01-23T18:57:45-05:00 2022-01-23T18:57:45-05:00
changeset 91ab3e0ffcd0
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Summary: Add test cases for sqlite fts

Add support for using the FTS5 full text query engine for sqlite.

Also stubbed out some sections for adding postgresql FTS support as
well.

Added nee indexer type native-fts. It is not selected by default. The
indexer=native is used if no indexer is set. This prevents an upgrade
from seeming to wipe out the native index if upgraded and
indexer=native is not explicitly set.

Docs updated. Also changed section headers to sentence case for the
current release notes.

Indexing backend can control if the full text search phrase is broken
into a list of words or passed intact. For backends with query
languages (sqlite and can be enabled for whoosh and xapian) we do not
want the phrase "tokenized" on whitespace.

This also updates the rdbms database version to version 7 to add FTS
table. I will be using the same version when I add postgresql. If
somebody runs this version on postgresql, they will have to manually
add the fts tables for postgresql if they want to use it.

Added a new renderError method to client. This allows errors to be
reported still using page.html rather than raw html. It also supports
templates for any error code. If no template for the error code
(e.g. 400) is found, the error in raw html with no page frame is
shown.

New IndexerQueryError exception to pass back message about query syntax
errors.
files
Validate SecretOption and support validate method http://hg.code.sf.net:8000/p/roundup/code/#changeset-770503bd211eaf1eb341da789b6d1b6050df28e5 John Rouillard rouilj@ieee.org 2022-01-06T21:22:26-05:00 2022-01-06T21:22:26-05:00
changeset 770503bd211e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Validate SecretOption and support validate method

Needed to validate SecretOption and verify that file is readable
and valid.

validator() now calls the validate method for each Option subclass.

To add post config load validation, just define a method
validate(self, options) for the Option subclass.
files
issue2551182 - ... allow loading values from external file. flake8 cleanups http://hg.code.sf.net:8000/p/roundup/code/#changeset-b1f1539c6a31d172e1b4366184069f0f96b36747 John Rouillard rouilj@ieee.org 2022-01-03T22:18:57-05:00 2022-01-03T22:18:57-05:00
changeset b1f1539c6a31
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551182 - ... allow loading values from external file. flake8 cleanups

Secrets (passwords, secrets) can specify a file using file:// or
file:///. The first line of the file is used as the secret. This
allows committing config.ini to a VCS.

Following settings are changed:

[tracker] secret_key
[tracker] jwt_secret
[rdbms] password
[mail] password

details:

in roundup/configuration.py:

Defined SecretMandatoryOptions and SecretNullableOptions. Converted
all secret keys and password to one of the above.

Also if [mail] username is defined but [mail] password is not it
throws an error at load.

Cleaned up a couple of methods whose call signature included:

def ...(..., settings={}):

settings=None and it is set to empty dict inside the method.

Also replace exception.message with str(exception) for python3
compatibility.

in test/test_config:

changed munge_configini to support changing only within a section,
replacing keyword text.
files