add support for postgres sslmode

This commit is contained in:
forest 2021-01-20 16:43:10 -06:00
parent 6a82e6df01
commit 3f6491f359
2 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,10 @@ app.config.from_mapping(
ADMIN_EMAIL_ADDRESSES=os.environ.get("ADMIN_EMAIL_ADDRESSES", default="ops@cyberia.club"), ADMIN_EMAIL_ADDRESSES=os.environ.get("ADMIN_EMAIL_ADDRESSES", default="ops@cyberia.club"),
DATABASE_URL=os.environ.get("DATABASE_URL", default="sql://postgres:dev@localhost:5432/postgres"), DATABASE_URL=os.environ.get("DATABASE_URL", default="sql://postgres:dev@localhost:5432/postgres"),
# https://www.postgresql.org/docs/9.1/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
DATABASE_SSLMODE=os.environ.get("DATABASE_SSLMODE", default="prefer"),
DATABASE_SCHEMA=os.environ.get("DATABASE_SCHEMA", default="public"), DATABASE_SCHEMA=os.environ.get("DATABASE_SCHEMA", default="public"),
MAIL_SERVER=os.environ.get("MAIL_SERVER", default="m1.nullhex.com"), MAIL_SERVER=os.environ.get("MAIL_SERVER", default="m1.nullhex.com"),

View File

@ -20,7 +20,8 @@ def init_app(app):
password = databaseUrl.password, password = databaseUrl.password,
host = databaseUrl.hostname, host = databaseUrl.hostname,
port = databaseUrl.port, port = databaseUrl.port,
database = databaseUrl.path[1:] database = databaseUrl.path[1:],
sslmode = app.config['DATABASE_SSLMODE']
) )
schemaMigrations = {} schemaMigrations = {}