-
Notifications
You must be signed in to change notification settings - Fork 30
/
config.env.py
54 lines (45 loc) · 1.99 KB
/
config.env.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import json
import secrets
import os
from os import environ as env
# Fetch the version number from the npm package file
with open(os.path.join(os.getcwd(), "package.json")) as package_file:
VERSION = json.load(package_file)["version"]
# Flask config
DEBUG = env.get("CONDITIONAL_DEBUG", "false").lower() == "true"
HOST_NAME = env.get("CONDITIONAL_HOST_NAME", "conditional.csh.rit.edu")
SERVER_NAME = env.get('CONDITIONAL_SERVER_NAME', 'conditional.csh.rit.edu')
APP_NAME = "conditional"
IP = env.get("CONDITIONAL_IP", "0.0.0.0")
PORT = env.get("CONDITIONAL_PORT", 6969)
WEBHOOK_URL = env.get("CONDITIONAL_WEBHOOK_URL", "INSERT URL HERE")
# DB Info
SQLALCHEMY_DATABASE_URI = env.get("SQLALCHEMY_DATABASE_URI", "")
SQLALCHEMY_TRACK_MODIFICATIONS = False
# LDAP config
LDAP_RO = env.get("CONDITIONAL_LDAP_RO", "true").lower() == "true"
LDAP_BIND_DN = env.get("CONDITIONAL_LDAP_BIND_DN", "cn=conditional,ou=Apps,dc=csh,dc=rit,dc=edu")
LDAP_BIND_PW = env.get("CONDITIONAL_LDAP_BIND_PW", "")
# S3 information
AWS_ACCESS_KEY_ID = env.get("AWS_ACCESS_KEY_ID", "")
AWS_SECRET_ACCESS_KEY = env.get("AWS_SECRET_ACCESS_KEY", "")
# Sentry config
# Not required for local development, but if you set it, make sure the
# SENTRY_ENV is 'local-development'
SENTRY_DSN = env.get("CONDITIONAL_SENTRY_DSN", "")
SENTRY_CONFIG = {
'dsn': env.get("CONDITIONAL_SENTRY_LEGACY_DSN", ""),
'release': VERSION,
}
SENTRY_ENV = env.get("CONDITIONAL_SENTRY_ENV", "local-development")
# OIDC Config
OIDC_ISSUER = env.get("CONDITIONAL_OIDC_ISSUER", "https://sso.csh.rit.edu/auth/realms/csh")
OIDC_CLIENT_CONFIG = {
'client_id': env.get("CONDITIONAL_OIDC_CLIENT_ID", "conditional"),
'client_secret': env.get("CONDITIONAL_OIDC_CLIENT_SECRET", ""),
'post_logout_redirect_uris': [env.get("CONDITIONAL_OIDC_CLIENT_LOGOUT", "http://0.0.0.0:6969/logout")]
}
# Openshift secret
SECRET_KEY = env.get("CONDITIONAL_SECRET_KEY", default=''.join(secrets.token_hex(16)))
# General config
DUES_PER_SEMESTER = env.get("CONDITIONAL_DUES_PER_SEMESTER", 80)