Allow SSL cert for the database to be configured

This change adds a field for the SSL cert for the database in the setup tool. Fixes #89
This commit is contained in:
Joseph Schorr 2015-06-29 08:08:10 +03:00
parent 4ec2143d47
commit bb07d0965f
8 changed files with 45 additions and 12 deletions

View file

@ -20,7 +20,7 @@ from app import app, CONFIG_PROVIDER, get_app_url, OVERRIDE_CONFIG_DIRECTORY
logger = logging.getLogger(__name__)
SSL_FILENAMES = ['ssl.cert', 'ssl.key']
SSL_FILENAMES = ['ssl.cert', 'ssl.key', 'database.pem']
JWT_FILENAMES = ['jwt-authn.cert']
CONFIG_FILENAMES = SSL_FILENAMES + JWT_FILENAMES
@ -54,7 +54,7 @@ def validate_service_for_config(service, config, password=None):
def _validate_database(config, _):
""" Validates connecting to the database. """
try:
validate_database_url(config['DB_URI'])
validate_database_url(config['DB_URI'], config.get('DB_CONNECTION_ARGS', {}))
except peewee.OperationalError as ex:
if ex.args and len(ex.args) > 1:
raise Exception(ex.args[1])