From b2cafa81ac86e2bd901f5f0d72c9f0a406f1cd0a Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Fri, 11 Sep 2020 18:21:24 +0200 Subject: [PATCH] [core] Add ssl options --- kibicara/config.py | 10 ++++++---- kibicara/kibicara.py | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kibicara/config.py b/kibicara/config.py index e3f674f..ae81933 100644 --- a/kibicara/config.py +++ b/kibicara/config.py @@ -24,13 +24,15 @@ from sys import argv config = { 'database_connection': 'sqlite:////tmp/kibicara.sqlite', - 'frontend_url': 'http://127.0.0.1:4200', # dev default - 'behind_proxy': False, + 'frontend_url': 'http://127.0.0.1:4200', # url of frontend, change in prod # production params - 'frontend_path': None, + 'frontend_path': None, # required, path to frontend html/css/js files 'production': True, + 'behind_proxy': False, + 'keyfile': None, # optional for ssl + 'certfile': None, # optional for ssl # dev params - 'root_url': 'http://localhost:8000', + 'root_url': 'http://localhost:8000', # url of backend 'cors_allow_origin': 'http://127.0.0.1:4200', } """ Default configuration. diff --git a/kibicara/kibicara.py b/kibicara/kibicara.py index b06201c..b4d9b38 100644 --- a/kibicara/kibicara.py +++ b/kibicara/kibicara.py @@ -58,6 +58,8 @@ class Main: server_config = Config() server_config.accesslog = '-' server_config.behind_proxy = config['behind_proxy'] + server_config.keyfile = config['keyfile'] + server_config.certfile = config['certfile'] if config['production']: server_config.bind = ['0.0.0.0:8000', '[::]:8000'] api = FastAPI()