add ssl support to webserver#1408
Conversation
|
Ah! this has been on the todo list for a while.. I think we should support the generation of a self signed certificate? |
| 'bind': {'type': 'string', 'format': 'ipv4', 'default': '0.0.0.0'}, | ||
| 'port': {'type': 'integer', 'default': 3539}, | ||
| 'ssl_certificate': {'type': 'string', 'format': 'string', 'default': ''}, | ||
| 'ssl_private_key': {'type': 'string', 'format': 'string', 'default': ''}, |
There was a problem hiding this comment.
I believe in schema you can tell that both of these are required or neither.
There was a problem hiding this comment.
they are not required, if you don't set them, the webserver starts without ssl.
|
|
|
What I believe @stevezau meant is provide a way to the user that allows Flexget to create self-signed certificates |
|
@stevezau if that is what you meant, allow flexget to create the ssl, I don't think we need that. I believe @paranoidi meant json schema dependencies: https://spacetelescope.github.io/understanding-json-schema/reference/object.html#dependencies Specifically bidirectional dependencies. |
flexget/webserver.py
Outdated
|
|
||
| log.info('Web interface available at http://%s:%s' % (host, self.port)) | ||
| if self.ssl_certificate and self.ssl_private_key: | ||
| log.info('Web interface available at https://%s:%s' % (host, self.port)) |
There was a problem hiding this comment.
Let the logger handle string formatting ie. log.info('Web interface available at https://%s:%s' , host, self.port)
|
Please set the schema to reflect a bidirectional dependency: |
|
dependencies was added |
flexget/webserver.py
Outdated
|
|
||
| if self.ssl_certificate and self.ssl_private_key: | ||
| log.info('Web interface available at https://%s:%s' % (host, self.port)) | ||
| proto = 'https' |
There was a problem hiding this comment.
Might as well call it protocol.
flexget/webserver.py
Outdated
| log.info('Web interface available at http://%s:%s' % (host, self.port)) | ||
| proto = 'http' | ||
|
|
||
| log.info('Web interface available at %s://%s:%s' % (proto, host, self.port)) |
There was a problem hiding this comment.
Let the logger handle the string formatting here as well
|
You forgot to change the logger formatting, that's the only thing left |
|
i does not understand what you mean?! |
|
Change: |
|
ah, okay. i just used the original line and add the protocol parameter; |
|
yeah, it wasn't right before 😉 |
|
finally done :) |
|
thanks for this |

Motivation for changes:
Detailed changes:
Config usage if relevant (new plugin or updated schema):