http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/roundup/scripts/roundup_server.py Mercurial Repository: p/roundup/code: roundup/scripts/roundup_server.py history 2026-04-08T21:39:40-04:00 chore: remove __future print_funcion from code. http://hg.code.sf.net:8000/p/roundup/code/#changeset-9c3ec0a5c7fc88acb8a65632ecc13b2d52380314 John Rouillard rouilj@ieee.org 2026-04-08T21:39:40-04:00 2026-04-08T21:39:40-04:00
changeset 9c3ec0a5c7fc
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore: remove __future print_funcion from code.

Not needed as of Python 3.
files
bug: harden header/environment values for roundup-server and cgi http://hg.code.sf.net:8000/p/roundup/code/#changeset-5fbf6451a782cefeda7f886e01847fd51b2585f4 John Rouillard rouilj@ieee.org 2026-04-08T00:35:34-04:00 2026-04-08T00:35:34-04:00
changeset 5fbf6451a782
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description bug: harden header/environment values for roundup-server and cgi

If the environment (cgi) or header variables (server) have values with
characters outside of the printable ascii range (chr(32-126)), return
HTTP 400 error. This is overly strict but nothing that Roundup looks
at requires a larger range.

When deploying with wsgi and Zope, server software should verify
proper values.

This fix was riggered by the waitress wsgi server bug:

https://github.com/Pylons/waitress/security/advisories/GHSA-m5ff-3wj3-8ph4

which was caused by incorrect validation of header values resulting in
a the proxy and waitress having different interpretations of what the
header meant.

My testing of the roundup.cgi script is to use a cgi->wsgi wrapper and
run it under wsgi (using waitress). I need to try it under a real
server that can run cgi. It looks like python http.server --cgi is
missing definitions of HTTP_HOST and other required CGI
variables. That's probably why the --cgi option was removed, but it
leaves me without a good way to test.

Maybe https://github.com/mdklatt/pytest-cgi could be used to test that
front end? Arguably CGI is old, but cheap hosting still allows it.
files
fix: fix possible HTTP Response Splitting in roundup-server http://hg.code.sf.net:8000/p/roundup/code/#changeset-a2c376d0f1103cf488431a19166d36190e5ad8ef John Rouillard rouilj@ieee.org 2025-06-03T22:23:10-04:00 2025-06-03T22:23:10-04:00
changeset a2c376d0f110
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: fix possible HTTP Response Splitting in roundup-server

CodeQL flagged a possible HTTP Response Splitting in the Location
header's URL.

The AI suggested cleaning the Host value, except the URL also includes
the query parameters in the URL so they could potentially trigger the
issue. Th host header probably doesn;t have a newline or cr in it
otherwise it wouldn't have been recognized by the server as a valid
host.

In any case strip all \n or \r from the url before use.

Also update CHANGES.txt with fixing the gpg install.
files
fix: issue2551238 - roundup-server should exit with error ... http://hg.code.sf.net:8000/p/roundup/code/#changeset-03513f5066f3d0c1900adaf0eee050dd73796822 John Rouillard rouilj@ieee.org 2025-01-20T15:51:53-05:00 2025-01-20T15:51:53-05:00
changeset 03513f5066f3
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: issue2551238 - roundup-server should exit with error ...

if -d <pidfile> is used without -l <logfile>.

Now exits with error if -l or -L are not specified with -d.

This exposed a problem with relative paths when using a logging
config file. -d enables deamon mode by default. This changes the
current direcory to /. So relative paths in a logging config file
are opened in / and fail.

Added documentation to dmin guide noting the problem.
files
Handle timeout exception in roundup-server better. http://hg.code.sf.net:8000/p/roundup/code/#changeset-341841a9edc56808dc8a148b83864e19620d9d4b John Rouillard rouilj@ieee.org 2025-01-12T12:59:41-05:00 2025-01-12T12:59:41-05:00
changeset 341841a9edc5
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Handle timeout exception in roundup-server better.

A timeout in roundup-server used to generate another exception:

OSError: cannot read from timed out object

when it tried to reuse the socket that timed out.

Now return status 408, a brief message and trigger closing of the
socket.

Manual testing, no CI.

To test used curl -X POST with no --data defined.
files
fix: crash when logging ip if roundup-server times out http://hg.code.sf.net:8000/p/roundup/code/#changeset-3a04ff6f1004b4ec5729021dc0db0b10719f83c6 John Rouillard rouilj@ieee.org 2025-01-01T17:51:05-05:00 2025-01-01T17:51:05-05:00
changeset 3a04ff6f1004
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: crash when logging ip if roundup-server times out

Under some conditions (seen in production, no reproducer), if
connection timed out, there is no headers attribute
RoundupRequestHandler.

Check for headers attr before accessing self.headers.
files
fix(web): issue2551381 - roundup-server parses multiple '?" incorrectly. http://hg.code.sf.net:8000/p/roundup/code/#changeset-4ed886dc2558d69a3ef5356568939bdfeab1a586 John Rouillard rouilj@ieee.org 2024-12-15T00:36:19-05:00 2024-12-15T00:36:19-05:00
changeset 4ed886dc2558
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix(web): issue2551381 - roundup-server parses multiple '?" incorrectly.

Change 'rfind()' to 'find()' to locate the first unencoded/unescaped '?'
in a URL. End the path component of the url at that point.

This matches https://www.rfc-editor.org/rfc/rfc3986#section-3.4.
files
fix formatting of config.ini help text for roundup-server. http://hg.code.sf.net:8000/p/roundup/code/#changeset-bf4a5bd5aa9f1b7afa9209f300b47ffea06c3e52 John Rouillard rouilj@ieee.org 2024-12-01T18:29:20-05:00 2024-12-01T18:29:20-05:00
changeset bf4a5bd5aa9f
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix formatting of config.ini help text for roundup-server.

all lines < 80 characters, try to fill to 65 or so characters.
files
allow roundup-server to log real client IP behind reverse proxy http://hg.code.sf.net:8000/p/roundup/code/#changeset-627c5d6a0551aa663b80f0c6f58284c0edf7c5b9 John Rouillard rouilj@ieee.org 2024-12-01T17:38:15-05:00 2024-12-01T17:38:15-05:00
changeset 627c5d6a0551
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description allow roundup-server to log real client IP behind reverse proxy

added -P flag to roundup-server to log client address from
X-Forwarded-For reverse proxy header rather than connecting
address. This logs the actual client address when roundup-server is
run behind a reverse proxy. It also appends a '+' sign to the logged
address/name.

This makes correlating reverse proxy logs to roundup logs much easier
by propagating the IP address.

Also added documentation for -D flag that was undocumented.
files
fix: roundup-server Content-Length when generating index http://hg.code.sf.net:8000/p/roundup/code/#changeset-5a122373641a265845f0e37cc90d718869b4d122 John Rouillard rouilj@ieee.org 2024-06-17T23:18:37-04:00 2024-06-17T23:18:37-04:00
changeset 5a122373641a
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: roundup-server Content-Length when generating index

Cleanup tracker index generation by roundup-server. Send correct
Content-Length headers so HTTP/1.1 connections don't hang.

Also added charset to the Content-Type header.
files
issue2551219 - use of PEM file with roundup-server http://hg.code.sf.net:8000/p/roundup/code/#changeset-0f5d31be5418b49953f8e272924c0e0bee47951c John Rouillard rouilj@ieee.org 2024-06-08T04:52:59-04:00 2024-06-08T04:52:59-04:00
changeset 0f5d31be5418
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551219 - use of PEM file with roundup-server

Document requirements of PEM file when using roundup-server in SSL/TLS
mode in the config.ini generated by roundup-server --save-config.

Trap errors produced by missing cert or key when reading a pem file
and try to produce a more useful error.

Man page already had correct documentation. However because man pages
are justified, the marker lines get additional internal spacing. Use
example macros to prevent this spacing in case somebody cuts/pastes
the marker lines.
files
fix: add content-length to 301 response http://hg.code.sf.net:8000/p/roundup/code/#changeset-683af7c57ce5fa8a724094799f215d300f366789 John Rouillard rouilj@ieee.org 2024-05-26T11:28:55-04:00 2024-05-26T11:28:55-04:00
changeset 683af7c57ce5
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: add content-length to 301 response

If the root URL is missing the trailing /, roundup-server returns a
301 redirect with the trailing /. However it was missing the
content-length that allows the client to handle the response and
redirect and reuse the connection (for http 1.1).
files
fix(i18n): fix incorrect lookup of some translations http://hg.code.sf.net:8000/p/roundup/code/#changeset-216662fbaaee8fcda219c91784d2d4cbcee3240d John Rouillard rouilj@ieee.org 2024-03-01T14:04:05-05:00 2024-03-01T14:04:05-05:00
changeset 216662fbaaee
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix(i18n): fix incorrect lookup of some translations

The code had:

_("some term %s here" % term)

this extracts the template, but looks up the string with %s replaced.
So the translation is broken. Changed to:

_("some term %s here") % term

which looks up the template and substitutes in the translation of the
template.

Found by ruff INT ruleset.
files
doc: use 'TEST-NET' IPv4 or IPv6 IP address ranges from RFC 6890 http://hg.code.sf.net:8000/p/roundup/code/#changeset-5a35cfee727a89f10a18463f278e6382a434abcc John Rouillard rouilj@ieee.org 2023-11-14T16:53:56-05:00 2023-11-14T16:53:56-05:00
changeset 5a35cfee727a
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description doc: use 'TEST-NET' IPv4 or IPv6 IP address ranges from RFC 6890

Replace ip examples with test doc ip addresses for any address not in
127.0.0.1 or 0.0.0.0.
files
fix: exit quickly on keyboard interrupt http://hg.code.sf.net:8000/p/roundup/code/#changeset-91fad2d2c4b3360455a462ff75efb85197011fa9 John Rouillard rouilj@ieee.org 2023-10-06T21:43:56-04:00 2023-10-06T21:43:56-04:00
changeset 91fad2d2c4b3
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: exit quickly on keyboard interrupt

When exiting roundup_server (issue was seen in use of roundup_demo)
using ^C, the keyboard interrupt message is generated but the
application didn't exit until the 60 second socket timeout is
complete.

This seems to be more of an issue with Windows.

With this change the socket is explicitly shut down telling the client
what's happening. Then the file descriptor is closed.
files
flake8: add space between del and ( http://hg.code.sf.net:8000/p/roundup/code/#changeset-dba4b1b25528abb125d96772f5b443821709cea7 John Rouillard rouilj@ieee.org 2023-07-23T23:28:12-04:00 2023-07-23T23:28:12-04:00
changeset dba4b1b25528
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8: add space between del and (
files
- issue2551275 - Allow configuring max_children in roundup-server. http://hg.code.sf.net:8000/p/roundup/code/#changeset-46f92ac4e170835d7232e3f94726812d0013e782 John Rouillard rouilj@ieee.org 2023-05-23T23:34:06-04:00 2023-05-23T23:34:06-04:00
changeset 46f92ac4e170
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description - issue2551275 - Allow configuring max_children in roundup-server.

new -m and --max_children command line arguments and max_children
config file setting for roundup_server.py/roundup-server.

CHANGES.txt, admin_guide.txt, roundup-server.1 updated.
files
Fix: Send Content-Length header to client from top Exception handler http://hg.code.sf.net:8000/p/roundup/code/#changeset-c0d030bd472e9f0ddee8609c135186e3c5864f96 John Rouillard rouilj@ieee.org 2022-12-11T18:47:24-05:00 2022-12-11T18:47:24-05:00
changeset c0d030bd472e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Fix: Send Content-Length header to client from top Exception handler

The top exception handler in run_cgi wasn't sending the Content-Length
header for the error message. This resulted in a hung client.

Probably wasn't an issue with http 1.0, but when using 1.1 it's
required.
files
flake8 fixes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-8e4028669d2afd17da81f4b7f572627e5e5e1297 John Rouillard rouilj@ieee.org 2022-09-13T21:12:00-04:00 2022-09-13T21:12:00-04:00
changeset 8e4028669d2a
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8 fixes.
files
issue2551137, 2551138 - roundup-server SSL issues. http://hg.code.sf.net:8000/p/roundup/code/#changeset-5129fc03dc1f41f013cbbcae872b1ba97e1340cb John Rouillard rouilj@ieee.org 2022-08-18T14:44:16-04:00 2022-08-18T14:44:16-04:00
changeset 5129fc03dc1f
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551137, 2551138 - roundup-server SSL issues.

Python3 no longer supports socket._fileobject, so fake it using
SocketIO and layering io.BufferedReader as in:

https://bugs.launchpad.net/python-glanceclient/+bug/1812525

Also handle SSL.ZeroReturnError exception by ignoring it. This
exception is thrown when the SSL layer has been closed and a read
happens. There is a warning in openssl as well as python docs that the
underlying (unencrypted) socket may not be closed. In manual testing,
netstat -anp didn't show any unclosed socket so.... Could it leak a fd
still, unknown.

This also seesm to have fixed an error when running under python2
where socket shutdown throws an error. Maybe ignoring ZeroErrorREturn
handled that case?

Also added doc to man page recommending not using -s and using a real
web server instead. Also added doc on format of pem file passed to -e.

No automated testing on this, so no test updates 8-(.
files
Make roundup-server EACCES errors clearer http://hg.code.sf.net:8000/p/roundup/code/#changeset-d659cfa8439c448a8a06f6968ea2e5c340a633d1 John Rouillard rouilj@ieee.org 2022-06-30T16:26:53-04:00 2022-06-30T16:26:53-04:00
changeset d659cfa8439c
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Make roundup-server EACCES errors clearer

If roundup-server is run on a priv port without privs (i.e. non root)
it just returns:

[Errno 13] Permission denied

make this case clearer by reporting:

Unable to bind to port 70, access not allowed, errno: 13 Permission denied

so it points to the port bind operation as failing.
files
Fix ResourceWarning error due to unclosed socket on exit from roundup_server. http://hg.code.sf.net:8000/p/roundup/code/#changeset-06d750efbc50f657bc9043ba872aa59ca6c96476 John Rouillard rouilj@ieee.org 2022-06-22T15:38:25-04:00 2022-06-22T15:38:25-04:00
changeset 06d750efbc50
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Fix ResourceWarning error due to unclosed socket on exit from roundup_server.

The warning adds clutter that I don't need to parse through.
files
If-Range doesn't work with roundup-server. http://hg.code.sf.net:8000/p/roundup/code/#changeset-98a9df71e24c1c8c268846f192d068abfa4eb0c0 John Rouillard rouilj@ieee.org 2022-04-28T18:03:02-04:00 2022-04-28T18:03:02-04:00
changeset 98a9df71e24c
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description If-Range doesn't work with roundup-server.

Found while debugging test case for test_liveserver(via wsgi) using
roundup-server. roundup-server wasn't passing If-Range header.
files
Cache /favicon.ico http://hg.code.sf.net:8000/p/roundup/code/#changeset-c3dfc4977ec6b16df240f218c69c79c78b86d739 John Rouillard rouilj@ieee.org 2021-11-07T13:18:39-05:00 2021-11-07T13:18:39-05:00
changeset c3dfc4977ec6
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Cache /favicon.ico
files
Send content-length for /favico.ico http://hg.code.sf.net:8000/p/roundup/code/#changeset-6cf050b43eaf8318af1a2510933e51bdb5883fc7 John Rouillard rouilj@ieee.org 2021-11-07T12:42:49-05:00 2021-11-07T12:42:49-05:00
changeset 6cf050b43eaf
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Send content-length for /favico.ico

Browser was stuck trying to download and server was reporting
connection timeout after a minute.
files
Enable HTTP/1.1 support for roundup-server http://hg.code.sf.net:8000/p/roundup/code/#changeset-a036712c96f47e6d917cb2474522d569900309f8 John Rouillard rouilj@ieee.org 2021-10-18T20:12:09-04:00 2021-10-18T20:12:09-04:00
changeset a036712c96f4
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Enable HTTP/1.1 support for roundup-server

This enables keepalives and seems to prevent a lot of hangs/slowness
in my configuration.

configuration.py: add new HttpVersionOption. This is used by the
command line/config in roundup-server. Validates http version
string.

roundup-server.py: enable HTTP 1.1 by default. use -V to set HTTP/1.0
on command line or set http_version in config file.

Fix typo in config description for option include_headers.

Add more vertical spacing for error report and usage display.

roundup-server.1: add doc on -V also doc -I which was missing. Remove
uneeded "to" from a sentence on ssl.
files
roundup-server native SSL support only TLS 1.2. http://hg.code.sf.net:8000/p/roundup/code/#changeset-7fb13dc67a41ca24185c3f85f387c34196f2c401 John Rouillard rouilj@ieee.org 2021-09-30T19:17:56-04:00 2021-09-30T19:17:56-04:00
changeset 7fb13dc67a41
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description roundup-server native SSL support only TLS 1.2.

1.1 was suported but is deprecated.
files
issue2550837 - New option for web auth (also http header passing) http://hg.code.sf.net:8000/p/roundup/code/#changeset-1f2f7c0b89687c80aae52a0a4b0068384d7309b1 John Rouillard rouilj@ieee.org 2021-06-14T19:33:27-04:00 2021-06-14T19:33:27-04:00
changeset 1f2f7c0b8968
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2550837 - New option for web auth (also http header passing)

Implement experimental support to allow tracker to use an alternate
authentication variable replacing ROUNDUP_USER. Also add -I option to
roundup-server to whitelist HTTP headers that should be passed through
to the tracker.
files
Upgrade SSL params for roundup-server http://hg.code.sf.net:8000/p/roundup/code/#changeset-5d6b6e948e17351c372f9eb1737d5df04efabed8 John Rouillard rouilj@ieee.org 2021-05-23T17:41:23-04:00 2021-05-23T17:41:23-04:00
changeset 5d6b6e948e17
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Upgrade SSL params for roundup-server

Params were still using md5, a key size of 768 and allowed SSL 2 and 3.

Now using sha512, key size of 2048 and TLS 1.1 or newer.

This still doesn't fix the use of SSL in roundup-server. It has
problems under both 2.7 and 3.x. Tickets in tracker opened for both,
files
Remove import of reload from imp (deprecated module), use importlib http://hg.code.sf.net:8000/p/roundup/code/#changeset-ff6580ee3882c2c43bbb53a964751f2dca1ee163 John Rouillard rouilj@ieee.org 2021-02-04T22:34:54-05:00 2021-02-04T22:34:54-05:00
changeset ff6580ee3882
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Remove import of reload from imp (deprecated module), use importlib
files
Replace depricated base64.decodestring with base64.b64decode. http://hg.code.sf.net:8000/p/roundup/code/#changeset-bc2b00afa9808f7dde241f983614861f0cf281fb John Rouillard rouilj@ieee.org 2020-12-14T09:52:58-05:00 2020-12-14T09:52:58-05:00
changeset bc2b00afa980
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Replace depricated base64.decodestring with base64.b64decode.
files
Make format strings use named placeholders rather than %s/%r http://hg.code.sf.net:8000/p/roundup/code/#changeset-e7cb0147e6fe1b2286d8efb0f6cbe2e72c6affd8 John Rouillard rouilj@ieee.org 2020-04-04T11:22:06-04:00 2020-04-04T11:22:06-04:00
changeset e7cb0147e6fe
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Make format strings use named placeholders rather than %s/%r

Fixing some issues reported while updating roundup.pot to prep for
2.0.0 beta releases. Still more to do but....
files
there is no thread module in Python 3 any more, so need to check for threading http://hg.code.sf.net:8000/p/roundup/code/#changeset-5f275158cfa9d890147c2bf6569253a384cd085c Christof Meerwald cmeerw@cmeerw.org 2020-02-06T19:03:00+00:00 2020-02-06T19:03:00+00:00
changeset 5f275158cfa9
branch
bookmark
tag
user Christof Meerwald <cmeerw@cmeerw.org>
description there is no thread module in Python 3 any more, so need to check for threading
instead
files
flake8 whitespace format fixes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-d5c51d1ef09c622ed4f2a1913b9ee7f239da09c0 John Rouillard rouilj@ieee.org 2020-01-07T21:26:43-05:00 2020-01-07T21:26:43-05:00
changeset d5c51d1ef09c
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8 whitespace format fixes.
files
Better error message running with -c and pywin32 is not importable. http://hg.code.sf.net:8000/p/roundup/code/#changeset-f822a91b37781792ba6e722e47326b5de94acdfa John Rouillard rouilj@ieee.org 2019-10-24T20:47:46-04:00 2019-10-24T20:47:46-04:00
changeset f822a91b3778
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Better error message running with -c and pywin32 is not importable.

Atempting to do this. It should work on windows, but I can't test.
files
Fix problem with cgi.escape being depricated a different way. This way http://hg.code.sf.net:8000/p/roundup/code/#changeset-883c9e90b4031a477a710c08c8686e18ba47fdbc John Rouillard rouilj@ieee.org 2019-07-06T13:12:58-04:00 2019-07-06T13:12:58-04:00
changeset 883c9e90b403
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Fix problem with cgi.escape being depricated a different way. This way
uses anypy and is cleaner. Also fixes incorrect/incomplete change that
resulted in escaped in TAL generated by TALInterpreter.py. The escaped
quotes break javascript etc. defined using tal string: values.

TODO: add test cases for TAL. This wouldn't have snuck through for a
month if we had good coverage of that library.
files
Call cgi.escape only on python 2. Replace with html.escapeif it can be http://hg.code.sf.net:8000/p/roundup/code/#changeset-1a835db4167402cc9a2fdf5eb4345b83b9e64607 John Rouillard rouilj@ieee.org 2019-06-11T21:29:24-04:00 2019-06-11T21:29:24-04:00
changeset 1a835db41674
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Call cgi.escape only on python 2. Replace with html.escapeif it can be
found.
files
Fix exception handling code for case where port already in use. http://hg.code.sf.net:8000/p/roundup/code/#changeset-320a1692a473810828f148f645711cecadbd0426 John Rouillard rouilj@ieee.org 2019-04-17T20:35:56-04:00 2019-04-17T20:35:56-04:00
changeset 320a1692a473
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Fix exception handling code for case where port already in use.
Change e[0] to e.args[0] (old style to new style reference??) Also
wrap call to config.get_server in try/except block and print any
exception to disable traceback.
files
Prevent env['CONTENT_TYPE'] from being None. FieldStorage's content http://hg.code.sf.net:8000/p/roundup/code/#changeset-5ad31de777a8d8bf999c5ee30703fcc1b9ecca19 John Rouillard rouilj@ieee.org 2019-03-23T00:02:03-04:00 2019-03-23T00:02:03-04:00
changeset 5ad31de777a8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Prevent env['CONTENT_TYPE'] from being None. FieldStorage's content
header parser can handle empty string or missing value but can't
handle None.
files
[maint-1.6] issue2551023: Fix CSRF headers for use with wsgi and cgi. The http://hg.code.sf.net:8000/p/roundup/code/#changeset-8e3df461d316944b1ab0eafc431307ecc4973b3f John Rouillard rouilj@ieee.org 2019-02-27T21:47:39-05:00 2019-02-27T21:47:39-05:00
changeset 8e3df461d316
branch maint-1.6
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551023: Fix CSRF headers for use with wsgi and cgi. The
env variable array used - separators rather than _. Compare:
HTTP_X-REQUESTED-WITH to HTTP_X_REQUESTED_WITH. The last is
correct. Also fix roundup-server to produce the latter form. (Patch
by Cédric Krier)
files
issue2551023: Fix CSRF headers for use with wsgi and cgi. The http://hg.code.sf.net:8000/p/roundup/code/#changeset-b3618882f9063f761c6df2ca6f31e164350314ef John Rouillard rouilj@ieee.org 2019-02-27T21:47:39-05:00 2019-02-27T21:47:39-05:00
changeset b3618882f906
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551023: Fix CSRF headers for use with wsgi and cgi. The
env variable array used - separators rather than _. Compare:
HTTP_X-REQUESTED-WITH to HTTP_X_REQUESTED_WITH. The last is
correct. Also fix roundup-server to produce the latter form. (Patch
by Cédric Krier)
files
Path to support OPTIONS verb when using rest interface via http://hg.code.sf.net:8000/p/roundup/code/#changeset-5df309febe49e37ebef369270dd780b925557950 John Rouillard rouilj@ieee.org 2019-02-08T19:39:17-05:00 2019-02-08T19:39:17-05:00
changeset 5df309febe49
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Path to support OPTIONS verb when using rest interface via
roundup-server. Also make sure rest interface doesn't hang when
processing OPTIONS, DELETE, PATCH which don't have a payload by
creating a CONTENT_LENGTH of 0 if these verbs are used and
CONTENT_LENGTH is missing.
files
[REST-rebased] Added POST and DELETE http://hg.code.sf.net:8000/p/roundup/code/#changeset-3d80e775278352ca2870f995a6ef3c9cb9ec7fe0 Chau Nguyen dangchau1991@yahoo.com 2019-01-30T10:25:12+01:00 2019-01-30T10:25:12+01:00
changeset 3d80e7752783
branch REST-rebased
bookmark
tag
user Chau Nguyen <dangchau1991@yahoo.com>
description Added POST and DELETE

[[Ralf Schlatterbeck: Add *all* http methods in roundup_server.py as
done on the bugs.python.org branch]]

committer: Ralf Schlatterbeck <rsc@runtux.com>
files
Fix roundup-server logging for Python 3. http://hg.code.sf.net:8000/p/roundup/code/#changeset-fb9abb842f36970427ca52ef780690b1a95aa013 Joseph Myers jsm@polyomino.org.uk 2018-09-02T14:18:12+00:00 2018-09-02T14:18:12+00:00
changeset fb9abb842f36
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Fix roundup-server logging for Python 3.

Using the roundup-server support for redirecting output to a log file
fails with Python 3:

sys.stdout = sys.stderr = open(self["LOGFILE"], 'a', 0)
ValueError: can't have unbuffered text I/O

Thus, this patch switches that redirection to use line-buffered output
(1 as third argument to open), which works with both Python 2 and
Python 3.
files
Python 3 preparation: HTTP headers handling in roundup_server.py. http://hg.code.sf.net:8000/p/roundup/code/#changeset-fec18298ae02fa45ed98667ea04a88822764d79d Joseph Myers jsm@polyomino.org.uk 2018-07-25T10:41:32+00:00 2018-07-25T10:41:32+00:00
changeset fec18298ae02
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: HTTP headers handling in roundup_server.py.

HTTP headers are handled differently in Python 3 (where they use
email.message.Message) compared to Python 2 (where they use
mimetools.Message). In some places the code needs to check which
version of the interface is available. For the common case of getting
a single header, ".get" is available in both versions, and is an alias
of ".getheader" in Python 2. (Note that the Python 3 semantics of
".get" are slightly different from those in Python 2 if there is more
than one of a given header - it returns an arbitrary one, when in
Python 2 it's specified to return the last one. Hopefully the places
using this interface rather than explicitly allowing for multiple
headers with the same name are OK with that and it shouldn't actually
occur with well-behaved clients.)
files
Python 3 preparation: write bytes to socket in roundup_server.py. http://hg.code.sf.net:8000/p/roundup/code/#changeset-4c724ad7b849169a4d16e2b571575348fce2225d Joseph Myers jsm@polyomino.org.uk 2018-07-25T10:40:38+00:00 2018-07-25T10:40:38+00:00
changeset 4c724ad7b849
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: write bytes to socket in roundup_server.py.
files
Python 3 preparation: use byte-string argument to base64.decodestring for favicon. http://hg.code.sf.net:8000/p/roundup/code/#changeset-5dc27422f3ece48a601b24c14729f88731887891 Joseph Myers jsm@polyomino.org.uk 2018-07-25T09:53:21+00:00 2018-07-25T09:53:21+00:00
changeset 5dc27422f3ec
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: use byte-string argument to base64.decodestring for favicon.
files
Python 3 preparation: StringIO. http://hg.code.sf.net:8000/p/roundup/code/#changeset-55f09ca366c484e1c06dd34a4efead3f1634d7d7 Joseph Myers jsm@polyomino.org.uk 2018-07-25T09:08:29+00:00 2018-07-25T09:08:29+00:00
changeset 55f09ca366c4
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: StringIO.

This generally arranges for StringIO and cStringIO references to use
io.StringIO for Python 3 but io.BytesIO for Python 2, consistent with
the string representations generally used in Roundup. A special
FasterStringIO in the TAL code, which referenced internals of the old
Python 2 StringIO module, is cut down so it doesn't actually do
anything beyond the StringIO class it inherits from (it would also be
reasonable to remove FasterStringIO completely). One place in
roundup_server.py clearly needing binary I/O is made to use io.BytesIO
unconditionally.
files
Python 3 preparation: update SocketServer import. http://hg.code.sf.net:8000/p/roundup/code/#changeset-d0816d50ee8fcebe58e65190bb0f2ed261845f84 Joseph Myers jsm@polyomino.org.uk 2018-07-25T00:17:56+00:00 2018-07-25T00:17:56+00:00
changeset d0816d50ee8f
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: update SocketServer import.

Manual patch.
files
Python 3 preparation: update BaseHTTPServer imports. http://hg.code.sf.net:8000/p/roundup/code/#changeset-277e91bf79362587cf409ed0baf37f33c999fcd4 Joseph Myers jsm@polyomino.org.uk 2018-07-25T00:17:07+00:00 2018-07-25T00:17:07+00:00
changeset 277e91bf7936
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: update BaseHTTPServer imports.

roundup/anypy/http_.py extended and used in more places. Manual
patch.
files
Python 3 preparation: use imp.reload instead of reload as needed. http://hg.code.sf.net:8000/p/roundup/code/#changeset-56cc58d20adde911c44f79342096d00e77a6e3bb Joseph Myers jsm@polyomino.org.uk 2018-07-24T23:51:41+00:00 2018-07-24T23:51:41+00:00
changeset 56cc58d20add
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: use imp.reload instead of reload as needed.

Manual patch.
files
Python 3 preparation: remove unused ConfigParser import. http://hg.code.sf.net:8000/p/roundup/code/#changeset-7f6afc7477e8f710589c4dc2bed6fde97e3c3601 Joseph Myers jsm@polyomino.org.uk 2018-07-24T23:49:13+00:00 2018-07-24T23:49:13+00:00
changeset 7f6afc7477e8
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: remove unused ConfigParser import.

Manual patch (trivial, removing an unused import of a module that's
changed its name in Python 3).
files
Python 3 preparation: update urllib / urllib2 / urlparse imports. http://hg.code.sf.net:8000/p/roundup/code/#changeset-88dbacd11cd104e041ebecf9fe2285b1b2021df8 Joseph Myers jsm@polyomino.org.uk 2018-07-24T23:48:30+00:00 2018-07-24T23:48:30+00:00
changeset 88dbacd11cd1
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: update urllib / urllib2 / urlparse imports.

The existing roundup/anypy/urllib_.py is extended to cover more
imports and used in more places. Manual patch.
files
Python 3 preparation: use list() around filter() as needed. http://hg.code.sf.net:8000/p/roundup/code/#changeset-99667a0cbd2ddc47b63b49a1f3467f2fbfb610cb Joseph Myers jsm@polyomino.org.uk 2018-07-24T23:14:04+00:00 2018-07-24T23:14:04+00:00
changeset 99667a0cbd2d
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: use list() around filter() as needed.

Tool-assisted patch.
files
Python 3 preparation: update calls to dict methods. http://hg.code.sf.net:8000/p/roundup/code/#changeset-23b8e6067f7cdf5ff451f0a99cac4fb288e56859 Joseph Myers jsm@polyomino.org.uk 2018-07-24T23:04:42+00:00 2018-07-24T23:04:42+00:00
changeset 23b8e6067f7c
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: update calls to dict methods.

Tool-assisted patch. Changes of iterkeys / itervalues / iteritems to
keys / values / items are fully automated, but may make things less
efficient in Python 2. Automated tools want to add list() around many
calls to keys / values / items, but I thought most such list()
additions were unnecessary because it seemed the result of keys /
values / items was just iterated over while the set of dict keys
remained unchanged, rather than used in a way requiring an actual
list, or used while the set of keys in the dict could change. It's
quite possible I missed some cases where list() was really needed, or
left in some unnecessary list() calls.

In cases where list() was only needed because the resulting list was
then sorted in-place, I changed the code to use calls to sorted().
files
Python 3 preparation: use sys.maxsize instead of sys.maxint. http://hg.code.sf.net:8000/p/roundup/code/#changeset-fc97f1f4a7e3b2c0f1036b5352ea92abeb0a03d5 Joseph Myers jsm@polyomino.org.uk 2018-07-24T22:20:20+00:00 2018-07-24T22:20:20+00:00
changeset fc97f1f4a7e3
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: use sys.maxsize instead of sys.maxint.

Tool-generated patch.
files
Python 3 preparation: change "x.has_key(y)" to "y in x". http://hg.code.sf.net:8000/p/roundup/code/#changeset-0942fe89e82e3e84d95a3d0ca5d8d15502f57348 Joseph Myers jsm@polyomino.org.uk 2018-07-24T22:08:17+00:00 2018-07-24T22:08:17+00:00
changeset 0942fe89e82e
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: change "x.has_key(y)" to "y in x".

(Also likewise "not in" where appropriate.) Tool-generated patch.
files
Python 3 preparation: "raise" syntax. http://hg.code.sf.net:8000/p/roundup/code/#changeset-35ea9b1efc1494f29fb07690e7087686de58e0f3 Joseph Myers jsm@polyomino.org.uk 2018-07-24T21:39:58+00:00 2018-07-24T21:39:58+00:00
changeset 35ea9b1efc14
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: "raise" syntax.

Changing "raise Exception, value" to "raise Exception(value)".
Tool-assisted patch. Particular cases to check carefully are the one
place in frontends/ZRoundup/ZRoundup.py where a string exception
needed to be fixed, and the one in roundup/cgi/client.py involving
raising an exception with a traceback (requires three-argument form of
raise in Python 2, which as I understand it requires exec() to avoid a
Python 3 syntax error).
files
Python 3 preparation: convert print to a function. http://hg.code.sf.net:8000/p/roundup/code/#changeset-64b05e24dbd889f52bf8f773d3456bd0135baa27 Joseph Myers jsm@polyomino.org.uk 2018-07-24T09:54:52+00:00 2018-07-24T09:54:52+00:00
changeset 64b05e24dbd8
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: convert print to a function.

Tool-assisted patch. It is possible that some "from __future__ import
print_function" are not in fact needed, if a file only uses print()
with a single string as an argument and so would work fine in Python 2
without that import.
files
A real fix for the problem where: http://hg.code.sf.net:8000/p/roundup/code/#changeset-91954be46a66ab9f301cfbabf6cfb9a269d324dd John Rouillard rouilj@ieee.org 2018-07-08T11:34:42-04:00 2018-07-08T11:34:42-04:00
changeset 91954be46a66
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description A real fix for the problem where:

import random

would result in every call to random() returning the same value
in the web interface.

While cgi/client.py:Client::__init.py__ was calling random.seed(),
on most systems random was SystemRandom and not the default random.

As a result the random as you would get from:

import random

was never being seeded. I added a function to access and seed the
random bound instance of random.Random that is called during init.

This fixes all three places where I saw the broken randomness.
It should also fix:

http://psf.upfronthosting.co.za/roundup/meta/issue644

I also removed the prior code that would bail if systemRandom was not
available.
files