The server for Open Course World
1#!/usr/bin/env bash
2
3# Default configs for the app. override these in .env or in your OS environment.
4#
5# DO NOT EDIT THIS FILE, you should override these variables in .env instead
6#
7# If you are changing or adding defaults *for everyone*, you can do it here,
8# but please make sure they are in sync with the defaults in docker-compose.yml.
9
10default() {
11 local __var="$1"; shift
12 local __val="$1"; shift
13
14 [[ -z "${!__var}" ]] && export "$__var"="$__val"
15}
16
17# Specify the port for ocw-web.
18default APP_PORT 9000
19
20# Specify the port for the database.
21default DB_PORT 5432
22default HTTP_PORT 6001
23default HTTPS_PORT 6000
24
25# note: for local dev, must be localhost for login to work
26default LISTEN_HOST localhost
27
28# variables for accessing cockroachdb.
29# Note: these are provided for overriding convenience only. Scripts and the app
30# should only rely on the value of $DYNA_URL.
31default DB_HOST localhost
32default DB_USER root
33default DB_NAME opencourseworld
34
35# General app configs
36default ENABLE_API_DEV_USER true
37default FORCE_HTTP false
38default DEBUG_LEVEL light
39default COURSE_IMPORT_REQUIRE_VERIFY false
40default COURSE_IMPORT_ENABLE_CACHE true
41default USE_DUMP_FOR_SEARCHES false
42default MIXED_DIFFICULTY false
43default DATA_VIEW_TYPE combined_dyna
44
45default DATA_DIR ./data
46
47# Location of dumps on your system, if in use. Note: if using docker,
48# these must live in ./data, and you should use a symbolic link if you
49# need them elsewhere.
50default DUMP_FILENAME ./data/dumps/dump.db
51default DUMP_THUMBS_FILENAME ./data/dumps/dump_thumbs.db
52
53# A secret to use for logins. Does not have to be secure in local dev.
54default JWT_SECRET localdev
55
56# can be overridden to cockroach or psql, depending on which interface
57# you prefer. by default we try to detect which is installed.
58default DB_CONSOLE_TYPE auto
59
60# can be overridden to cockroach or psql, depending on which interface
61# you prefer. by default we try to detect which is installed.
62default DB_CONSOLE_TYPE auto
63
64default TWITCH_CLIENT_ID ufm5q62qafbnkp3leizjli8z89xo9w
65default TWITCH_CLIENT_SECRET 'please set TWITCH_CLIENT_SECRET in .env'
66default DISCORD_CLIENT_ID 1080395755581349908
67default DISCORD_CLIENT_SECRET 'please set DISCORD_CLIENT_SECRET in .env'
68default DISCORD_REPORT_TOKEN 'please set DISCORD_REPORT_TOKEN in .env'
69
70default ENABLE_TAGS true
71default DB_SCHEMA_NAME smm2srv
72
73default AWS_ACCESS_KEY_ID 'please set AWS_ACCESS_KEY_ID in .env'
74default AWS_SECRET_ACCESS_KEY 'please set AWS_SECRET_ACCESS_KEY in .env'
75
76default APP_URLS "http://$LISTEN_HOST:$APP_PORT"
77default API_URLS "http://$LISTEN_HOST:$HTTP_PORT,https://$LISTEN_HOST:$HTTPS_PORT"
78default REDIRECT_URLS "http://$LISTEN_HOST:$HTTP_PORT/api/connect/discord/callback"
79default DYNA_URL "postgres://$DB_HOST:$DB_PORT/$DB_NAME?sslmode=disable&user=$DB_USER&options=-c%20search_path%3D$DB_SCHEMA_NAME,public"
80default LISTEN_ADDRESS "$LISTEN_HOST:$HTTPS_PORT"
81default LISTEN_ADDRESS_HTTP "$LISTEN_HOST:$HTTP_PORT"
82default DNS_WHITELIST "$LISTEN_HOST:$HTTPS_PORT,$LISTEN_HOST:$HTTP_PORT"