mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[enh] backport possibility to run with ssl
This commit is contained in:
parent
7fdd4276bb
commit
e9f2fba021
1 changed files with 11 additions and 2 deletions
13
run.py
13
run.py
|
@ -394,14 +394,23 @@ async def index(request):
|
|||
return {}
|
||||
|
||||
|
||||
def main(path_to_analyseCI):
|
||||
def main(path_to_analyseCI, ssl=False, keyfile_path="/etc/yunohost/certs/ci-apps.yunohost.org/key.pem", certfile_path="/etc/yunohost/certs/ci-apps.yunohost.org/crt.pem"):
|
||||
reset_pending_jobs()
|
||||
reset_busy_workers()
|
||||
|
||||
app.config.path_to_analyseCI = path_to_analyseCI
|
||||
app.add_task(monitor_apps_lists())
|
||||
app.add_task(jobs_dispatcher())
|
||||
app.run('localhost', port=4242, debug=True)
|
||||
|
||||
if not ssl:
|
||||
app.run('localhost', port=4242, debug=True)
|
||||
else:
|
||||
import ssl
|
||||
context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
|
||||
context.load_cert_chain(certfile_path, keyfile=keyfile_path)
|
||||
|
||||
app.run('0.0.0.0', port=4242, ssl=context, debug=True)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Reference in a new issue