2019-12-18 19:02:17 +00:00
|
|
|
import os
|
2020-04-15 15:49:45 +00:00
|
|
|
from os import environ
|
2020-02-20 20:35:07 +00:00
|
|
|
|
2019-12-18 19:02:17 +00:00
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
2019-11-21 16:36:32 +00:00
|
|
|
NAME = "CR Connect Workflow"
|
|
|
|
CORS_ENABLED = False
|
2020-04-15 20:49:03 +00:00
|
|
|
DEVELOPMENT = environ.get('DEVELOPMENT', default="true") == "true"
|
|
|
|
TESTING = environ.get('TESTING', default="false") == "true"
|
2020-04-15 21:22:41 +00:00
|
|
|
PRODUCTION = (environ.get('PRODUCTION', default="false") == "true") or (not DEVELOPMENT and not TESTING)
|
2020-04-15 15:49:45 +00:00
|
|
|
|
|
|
|
DB_HOST = environ.get('DB_HOST', default="localhost")
|
|
|
|
DB_PORT = environ.get('DB_PORT', default="5432")
|
|
|
|
DB_NAME = environ.get('DB_NAME', default="crc_dev")
|
|
|
|
DB_USER = environ.get('DB_USER', default="crc_user")
|
|
|
|
DB_PASSWORD = environ.get('DB_PASSWORD', default="crc_pass")
|
2020-04-15 17:25:12 +00:00
|
|
|
SQLALCHEMY_DATABASE_URI = environ.get(
|
|
|
|
'SQLALCHEMY_DATABASE_URI',
|
|
|
|
default="postgresql://%s:%s@%s:%s/%s" % (DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)
|
|
|
|
)
|
2020-04-21 15:03:35 +00:00
|
|
|
TOKEN_AUTH_TTL_HOURS = environ.get('TOKEN_AUTH_TTL_HOURS', default=4)
|
2020-04-15 15:49:45 +00:00
|
|
|
TOKEN_AUTH_SECRET_KEY = environ.get('TOKEN_AUTH_SECRET_KEY', default="Shhhh!!! This is secret! And better darn well not show up in prod.")
|
|
|
|
FRONTEND_AUTH_CALLBACK = environ.get('FRONTEND_AUTH_CALLBACK', default="http://localhost:4200/session")
|
|
|
|
SWAGGER_AUTH_KEY = environ.get('SWAGGER_AUTH_KEY', default="SWAGGER")
|
2020-02-18 21:38:56 +00:00
|
|
|
|
|
|
|
#: Default attribute map for single signon.
|
|
|
|
SSO_ATTRIBUTE_MAP = {
|
|
|
|
'eppn': (False, 'eppn'), # dhf8r@virginia.edu
|
|
|
|
'uid': (True, 'uid'), # dhf8r
|
2020-02-20 20:35:07 +00:00
|
|
|
'givenName': (False, 'first_name'), # Daniel
|
|
|
|
'mail': (False, 'email_address'), # dhf8r@Virginia.EDU
|
|
|
|
'sn': (False, 'last_name'), # Funk
|
|
|
|
'affiliation': (False, 'affiliation'), # 'staff@virginia.edu;member@virginia.edu'
|
|
|
|
'displayName': (False, 'display_name'), # Daniel Harold Funk
|
2020-02-18 21:38:56 +00:00
|
|
|
'title': (False, 'title') # SOFTWARE ENGINEER V
|
|
|
|
}
|
2020-02-20 18:30:48 +00:00
|
|
|
|
|
|
|
# %s/%i placeholders expected for uva_id and study_id in various calls.
|
2020-04-15 15:49:45 +00:00
|
|
|
PB_BASE_URL = environ.get('PB_BASE_URL', default="http://localhost:5001/pb/")
|
|
|
|
PB_USER_STUDIES_URL = environ.get('PB_USER_STUDIES_URL', default=PB_BASE_URL + "user_studies?uva_id=%s")
|
|
|
|
PB_INVESTIGATORS_URL = environ.get('PB_INVESTIGATORS_URL', default=PB_BASE_URL + "investigators?studyid=%i")
|
|
|
|
PB_REQUIRED_DOCS_URL = environ.get('PB_REQUIRED_DOCS_URL', default=PB_BASE_URL + "required_docs?studyid=%i")
|
|
|
|
PB_STUDY_DETAILS_URL = environ.get('PB_STUDY_DETAILS_URL', default=PB_BASE_URL + "study?studyid=%i")
|
2020-04-15 17:49:32 +00:00
|
|
|
|
2020-04-20 19:16:33 +00:00
|
|
|
LDAP_URL = environ.get('LDAP_URL', default="ldap.virginia.edu")
|
2020-04-20 20:02:13 +00:00
|
|
|
LDAP_TIMEOUT_SEC = environ.get('LDAP_TIMEOUT_SEC', default=3)
|
2020-04-15 17:49:32 +00:00
|
|
|
print('=== USING DEFAULT CONFIG: ===')
|
|
|
|
print('DB_HOST = ', DB_HOST)
|
|
|
|
print('DEVELOPMENT = ', DEVELOPMENT)
|
|
|
|
print('TESTING = ', TESTING)
|
2020-04-20 16:04:10 +00:00
|
|
|
print('PRODUCTION = ', PRODUCTION)
|
2020-04-15 17:49:32 +00:00
|
|
|
print('PB_BASE_URL = ', PB_BASE_URL)
|