Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CONDITIONAL_DEBUG=true
CONDITIONAL_HOST_NAME="localhost:8080"
CONDITIONAL_SERVER_NAME="localhost:8080"
CONDITIONAL_IP="0.0.0.0"
CONDITIONAL_PORT=8080
CONDITIONAL_PROFILING=false # change this to true if you want to see function call times
CONDITIONAL_LDAP_BIND_DN="uid=<you>,cn=users,cn=accounts,dc=csh,dc=rit,dc=edu"
CONDITIONAL_LDAP_BIND_PW=
CONDITIONAL_OIDC_ISSUER="https://sso.csh.rit.edu/auth/realms/csh"
CONDITIONAL_OIDC_CLIENT_ID=develop
CONDITIONAL_OIDC_CLIENT_SECRET=
CONDITIONAL_OIDC_CLIENT_REDIRECT="http://localhost:8080/redirect_uri"
CONDITIONAL_OIDC_CLIENT_LOGOUT="http://localhost:8080/logout"
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ python -m gunicorn

## Config

You must create `config.py` in the top-level directory with the appropriate credentials for the application to run. See `config.env.py` for an example.
Either copy `.env.example` to `.env` or `config.env.py` to `config.py`, and change the variables in the newly copied file accordingly. The only two variables you should need to change are:
- LDAP_BIND_DN, replacing `<you>` for your username
- LDAP_BIND_PW, your password
- OIDC_CLIENT_SECRET, from the Wiki

### Add OIDC Config
Reach out to an RTP to get OIDC credentials that will allow you to develop locally behind OIDC auth
Expand Down
28 changes: 14 additions & 14 deletions config.env.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@

# 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')
HOST_NAME = env.get("CONDITIONAL_HOST_NAME", "localhost:8080")
SERVER_NAME = env.get("CONDITIONAL_SERVER_NAME", "localhost:8080")
APP_NAME = "conditional"
IP = env.get("CONDITIONAL_IP", "0.0.0.0")
PORT = env.get("CONDITIONAL_PORT", 6969)
PORT = env.get("CONDITIONAL_PORT", 8080)
# This is for Slack, it can safely be blank
WEBHOOK_URL = env.get("CONDITIONAL_WEBHOOK_URL", "INSERT URL HERE")
DEV_DISABLE_SLACK_PING = env.get("DEV_DISABLE_SLACK_PING", "false") == "true"
PROFILING = env.get("CONDITIONAL_PROFILING", "false").lower() == "true"
Expand All @@ -24,8 +25,8 @@

# 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", "")
LDAP_BIND_DN = env.get("CONDITIONAL_LDAP_BIND_DN", "uid=<you>,cn=users,cn=accounts,dc=csh,dc=rit,dc=edu")
LDAP_BIND_PW = env.get("CONDITIONAL_LDAP_BIND_PW", "<your password>")

# S3 information
S3_URI = env.get("S3_URI", "https://s3.csh.rit.edu") # URL for where the s3 bucket is hosted
Expand All @@ -36,27 +37,26 @@

# Sentry config
# Not required for local development, but if you set it, make sure the
# SENTRY_ENV is 'local-development'
# SENTRY_ENV is "local-development"
SENTRY_DSN = env.get("CONDITIONAL_SENTRY_DSN", "")
SENTRY_CONFIG = {
'dsn': env.get("CONDITIONAL_SENTRY_LEGACY_DSN", ""),
'release': VERSION,
"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:8080/logout")],
"client_id": env.get("CONDITIONAL_OIDC_CLIENT_ID", "develop"),
"client_secret": env.get("CONDITIONAL_OIDC_CLIENT_SECRET", ""),
"redirect_uri": env.get("CONDITIONAL_OIDC_CLIENT_REDIRECT", "http://localhost:8080/redirect_uri"),
"post_logout_redirect_uris": [env.get("CONDITIONAL_OIDC_CLIENT_LOGOUT", "http://localhost:8080/logout")],
}

OIDC_REDIRECT_URI = env.get("CONDITIONAL_OIDC_REDIRECT_URI", "http://localhost:8080/redirect_uri")

# Openshift secret
SECRET_KEY = env.get("CONDITIONAL_SECRET_KEY", default=''.join(secrets.token_hex(16)))
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)
Expand Down
Loading