comparison src/twisted/plugins/libervia_server.py @ 813:6e27604ec95a

server: added --tls_private_key and --tls_chain options. --tls_certificate .pem file will be used for private_key if --tls_private_key is not specified.
author Goffi <goffi@goffi.org>
date Sun, 20 Dec 2015 20:01:42 +0100
parents b1826adbeeff
children e8c0c2b5e2d5
comparison
equal deleted inserted replaced
812:fd6965c16e7e 813:6e27604ec95a
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # -*- coding: utf-8 -*- 2 # -*- coding: utf-8 -*-
3 3
4 # Libervia: a Salut à Toi frontend 4 # Libervia: a Salut à Toi frontend
5 # Copyright (C) 2013, 2014, 2015 Jérôme Poisson <goffi@goffi.org>
6 # Copyright (C) 2013, 2014, 2015 Adrien Cossa <souliane@mailoo.org>
5 # Copyright (C) 2013 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> 7 # Copyright (C) 2013 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
6 8
7 # This program is free software: you can redistribute it and/or modify 9 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by 10 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or 11 # the Free Software Foundation, either version 3 of the License, or
64 DATA_DIR_DEFAULT = '' 66 DATA_DIR_DEFAULT = ''
65 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers).").encode('utf-8'), coerceConnectionType], 67 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers).").encode('utf-8'), coerceConnectionType],
66 ['port', 'p', 8080, _(u'The port number to listen HTTP on.').encode('utf-8'), int], 68 ['port', 'p', 8080, _(u'The port number to listen HTTP on.').encode('utf-8'), int],
67 ['port_https', 's', 8443, _(u'The port number to listen HTTPS on.').encode('utf-8'), int], 69 ['port_https', 's', 8443, _(u'The port number to listen HTTPS on.').encode('utf-8'), int],
68 ['port_https_ext', 'e', 0, _(u'The external port number used for HTTPS (0 means port_https value).').encode('utf-8'), int], 70 ['port_https_ext', 'e', 0, _(u'The external port number used for HTTPS (0 means port_https value).').encode('utf-8'), int],
71 ['tls_private_key', '', '', _(u'TLS certificate private key (PEM format)').encode('utf-8'), str],
69 ['tls_certificate', 'c', 'libervia.pem', _(u'TLS certificate public certificate or private key and public certificate combined (PEM format)').encode('utf-8'), str], 72 ['tls_certificate', 'c', 'libervia.pem', _(u'TLS certificate public certificate or private key and public certificate combined (PEM format)').encode('utf-8'), str],
73 ['tls_chain', '', '', _(u'TLS certificate intermediate chain (PEM format)').encode('utf-8'), str],
70 ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.').encode('utf-8'), int], 74 ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.').encode('utf-8'), int],
71 ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.').encode('utf-8'), int], 75 ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.').encode('utf-8'), int],
72 ['passphrase', 'k', '', (_(u"Passphrase for the SàT profile named '%s'") % C.SERVICE_PROFILE).encode('utf-8'), str], 76 ['passphrase', 'k', '', (_(u"Passphrase for the SàT profile named '%s'") % C.SERVICE_PROFILE).encode('utf-8'), str],
73 ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia').encode('utf-8'), coerceDataDir], 77 ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia').encode('utf-8'), coerceDataDir],
74 ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html 78 ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html