comparison roundup/scripts/roundup_server.py @ 6638:e1588ae185dc issue2550923_computed_property

merge from default branch. Fix travis.ci so CI builds don't error out
author John Rouillard <rouilj@ieee.org>
date Thu, 21 Apr 2022 16:54:17 -0400
parents c3dfc4977ec6
children 98a9df71e24c
comparison
equal deleted inserted replaced
6508:85db90cc1705 6638:e1588ae185dc
319 if favicon_fileobj is None: 319 if favicon_fileobj is None:
320 favicon_fileobj = io.BytesIO(favico) 320 favicon_fileobj = io.BytesIO(favico)
321 321
322 self.send_response(200) 322 self.send_response(200)
323 self.send_header('Content-Type', 'image/x-icon') 323 self.send_header('Content-Type', 'image/x-icon')
324 self.send_header('Content-Length', len(favico))
325 self.send_header('Cache-Control', "public, max-age=86400")
324 self.end_headers() 326 self.end_headers()
325 327
326 # this bufsize is completely arbitrary, I picked 4K because 328 # this bufsize is completely arbitrary, I picked 4K because
327 # it sounded good. if someone knows of a better buffer size, 329 # it sounded good. if someone knows of a better buffer size,
328 # feel free to plug it in. 330 # feel free to plug it in.
633 "PEM file used for SSL. A temporary self-signed certificate\n" 635 "PEM file used for SSL. A temporary self-signed certificate\n"
634 "will be used if left blank."), 636 "will be used if left blank."),
635 (configuration.WordListOption, "include_headers", "", 637 (configuration.WordListOption, "include_headers", "",
636 "Comma separated list of extra headers that should\n" 638 "Comma separated list of extra headers that should\n"
637 "be copied into the CGI environment.\n" 639 "be copied into the CGI environment.\n"
638 "E.G. if you want to acces the REMOTE_USER and\n" 640 "E.G. if you want to access the REMOTE_USER and\n"
639 "X-Proxy-User headers in the back end,\n" 641 "X-Proxy-User headers in the back end,\n"
640 "set to the value REMOTE_USER,X-Proxy-User."), 642 "set to the value REMOTE_USER,X-Proxy-User."),
643 (configuration.HttpVersionOption, "http_version", "HTTP/1.1",
644 "Change to HTTP/1.0 if needed. This disables keepalive."),
645
641 )), 646 )),
642 ("trackers", (), "Roundup trackers to serve.\n" 647 ("trackers", (), "Roundup trackers to serve.\n"
643 "Each option in this section defines single Roundup tracker.\n" 648 "Each option in this section defines single Roundup tracker.\n"
644 "Option name identifies the tracker and will appear in the URL.\n" 649 "Option name identifies the tracker and will appear in the URL.\n"
645 "Option value is tracker home directory path.\n" 650 "Option value is tracker home directory path.\n"
661 "template": "i:", 666 "template": "i:",
662 "loghttpvialogger": 'L', 667 "loghttpvialogger": 'L',
663 "ssl": "s", 668 "ssl": "s",
664 "pem": "e:", 669 "pem": "e:",
665 "include_headers": "I:", 670 "include_headers": "I:",
671 "http_version": 'V:',
666 } 672 }
667 673
668 def __init__(self, config_file=None): 674 def __init__(self, config_file=None):
669 configuration.Config.__init__(self, config_file, self.SETTINGS) 675 configuration.Config.__init__(self, config_file, self.SETTINGS)
670 self.sections.append("trackers") 676 self.sections.append("trackers")
730 if self.CONFIG["SSL"]: 736 if self.CONFIG["SSL"]:
731 # perform initial ssl handshake. This will set 737 # perform initial ssl handshake. This will set
732 # internal state correctly so that later closing SSL 738 # internal state correctly so that later closing SSL
733 # socket works (with SSL end-handshake started) 739 # socket works (with SSL end-handshake started)
734 self.request.do_handshake() 740 self.request.do_handshake()
741 RoundupRequestHandler.protocol_version = \
742 self.CONFIG["HTTP_VERSION"]
735 RoundupRequestHandler.setup(self) 743 RoundupRequestHandler.setup(self)
736 744
737 def finish(self): 745 def finish(self):
738 RoundupRequestHandler.finish(self) 746 RoundupRequestHandler.finish(self)
739 if self.CONFIG["SSL"]: 747 if self.CONFIG["SSL"]:
862 -g <GID> runs the Roundup web server as this GID 870 -g <GID> runs the Roundup web server as this GID
863 -d <PIDfile> run the server in the background and write the server's PID 871 -d <PIDfile> run the server in the background and write the server's PID
864 to the file indicated by PIDfile. The -l option *must* be 872 to the file indicated by PIDfile. The -l option *must* be
865 specified if -d is used.''' 873 specified if -d is used.'''
866 if message: 874 if message:
867 message += '\n' 875 message += '\n\n'
868 print(_('''%(message)sUsage: roundup-server [options] [name=tracker home]* 876 print(_('''\n%(message)sUsage: roundup-server [options] [name=tracker home]*
869 877
870 Options: 878 Options:
871 -v print the Roundup version number and exit 879 -v print the Roundup version number and exit
872 -h print this text and exit 880 -h print this text and exit
873 -S create or update configuration file and exit 881 -S create or update configuration file and exit
884 -s enable SSL 892 -s enable SSL
885 -L http request logging uses python logging (roundup.http) 893 -L http request logging uses python logging (roundup.http)
886 -e <fname> PEM file containing SSL key and certificate 894 -e <fname> PEM file containing SSL key and certificate
887 -t <mode> multiprocess mode (default: %(mp_def)s). 895 -t <mode> multiprocess mode (default: %(mp_def)s).
888 Allowed values: %(mp_types)s. 896 Allowed values: %(mp_types)s.
897 -V <version> set HTTP version (default: HTTP/1.1).
898 Allowed values: HTTP/1.0, HTTP/1.1.
899
889 %(os_part)s 900 %(os_part)s
890 901
891 Long options: 902 Long options:
892 --version print the Roundup version number and exit 903 --version print the Roundup version number and exit
893 --help print this text and exit 904 --help print this text and exit

Roundup Issue Tracker: http://roundup-tracker.org/