comparison twisted/plugins/libervia_server.py @ 1366:f61e95438050

server: don't encode options help messages, this is not needed anymore since we moved to Python 3
author Goffi <goffi@goffi.org>
date Fri, 20 Nov 2020 17:55:21 +0100
parents 10517a8698ca
children ce5cfe004d4e
comparison
equal deleted inserted replaced
1365:10517a8698ca 1366:f61e95438050
102 # prefix used for environment variables 102 # prefix used for environment variables
103 ENV_PREFIX = "LIBERVIA_" 103 ENV_PREFIX = "LIBERVIA_"
104 # options which are in sat.conf and on command line, 104 # options which are in sat.conf and on command line,
105 # see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html 105 # see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html
106 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _("'http', 'https' or 'both' " 106 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _("'http', 'https' or 'both' "
107 "(to launch both servers).").encode('utf-8'), 107 "(to launch both servers)."),
108 coerceConnectionType], 108 coerceConnectionType],
109 ['port', 'p', 8080, 109 ['port', 'p', 8080,
110 _('The port number to listen HTTP on.').encode('utf-8'), int], 110 _('The port number to listen HTTP on.'), int],
111 ['port_https', 's', 8443, 111 ['port_https', 's', 8443,
112 _('The port number to listen HTTPS on.').encode('utf-8'), int], 112 _('The port number to listen HTTPS on.'), int],
113 ['port_https_ext', 'e', 0, _('The external port number used for ' 113 ['port_https_ext', 'e', 0, _('The external port number used for '
114 'HTTPS (0 means port_https value).').encode('utf-8'), int], 114 'HTTPS (0 means port_https value).'), int],
115 ['tls_private_key', '', '', _('TLS certificate private key (PEM ' 115 ['tls_private_key', '', '', _('TLS certificate private key (PEM '
116 'format)').encode('utf-8'), coerceUnicode], 116 'format)'), coerceUnicode],
117 ['tls_certificate', 'c', 'libervia.pem', _('TLS public ' 117 ['tls_certificate', 'c', 'libervia.pem', _('TLS public '
118 'certificate or private key and public certificate combined ' 118 'certificate or private key and public certificate combined '
119 '(PEM format)').encode('utf-8'), coerceUnicode], 119 '(PEM format)'), coerceUnicode],
120 ['tls_chain', '', '', _('TLS certificate intermediate chain (PEM ' 120 ['tls_chain', '', '', _('TLS certificate intermediate chain (PEM '
121 'format)').encode('utf-8'), coerceUnicode], 121 'format)'), coerceUnicode],
122 ['redirect_to_https', 'r', True, _('Automatically redirect from ' 122 ['redirect_to_https', 'r', True, _('Automatically redirect from '
123 'HTTP to HTTPS.').encode('utf-8'), coerceBool], 123 'HTTP to HTTPS.'), coerceBool],
124 ['security_warning', 'w', True, _('Warn user that he is about to ' 124 ['security_warning', 'w', True, _('Warn user that he is about to '
125 'connect on HTTP.').encode('utf-8'), coerceBool], 125 'connect on HTTP.'), coerceBool],
126 ['passphrase', 'k', '', (_("Passphrase for the SàT profile " 126 ['passphrase', 'k', '', (_("Passphrase for the SàT profile "
127 "named '%s'") % C.SERVICE_PROFILE).encode('utf-8'), 127 "named '%s'") % C.SERVICE_PROFILE),
128 coerceUnicode], 128 coerceUnicode],
129 ['allow_registration', '', True, _('Allow user to register new ' 129 ['allow_registration', '', True, _('Allow user to register new '
130 'account').encode('utf-8'), coerceBool], 130 'account'), coerceBool],
131 ['base_url_ext', '', '', 131 ['base_url_ext', '', '',
132 _('The external URL to use as base URL').encode('utf-8'), 132 _('The external URL to use as base URL'),
133 coerceUnicode], 133 coerceUnicode],
134 ] 134 ]
135
135 # Options which are in sat.conf only 136 # Options which are in sat.conf only
136 OPT_PARAMETERS_CFG = [ 137 OPT_PARAMETERS_CFG = [
137 ["empty_password_allowed_warning_dangerous_list", None, "", None], 138 ["empty_password_allowed_warning_dangerous_list", None, "", None],
138 ["vhosts_dict", None, {}, None], 139 ["vhosts_dict", None, {}, None],
139 ["url_redirections_dict", None, {}, None], 140 ["url_redirections_dict", None, {}, None],