~forest/capsul-flask

3f6491f35905319bf8831b72d7f0022920ffceb8 — forest 6 days ago 6a82e6d master
add support for postgres sslmode
2 files changed, 6 insertions(+), 1 deletions(-)

M capsulflask/__init__.py
M capsulflask/db.py
M capsulflask/__init__.py => capsulflask/__init__.py +4 -0
@@ 27,6 27,10 @@ app.config.from_mapping(
  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"),

  # 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"),

  MAIL_SERVER=os.environ.get("MAIL_SERVER", default="m1.nullhex.com"),

M capsulflask/db.py => capsulflask/db.py +2 -1
@@ 20,7 20,8 @@ def init_app(app):
    password = databaseUrl.password,
    host = databaseUrl.hostname,
    port = databaseUrl.port,
    database = databaseUrl.path[1:]
    database = databaseUrl.path[1:],
    sslmode = app.config['DATABASE_SSLMODE']
  )

  schemaMigrations = {}