<commit_before>---
#
# edX Configuration
#
# github:     https://github.com/edx/configuration
# wiki:       https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license:    https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role programs
# 
PROGRAMS_GIT_IDENTITY: !!null

# depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC
# and a key being provided via NEWRELIC_LICENSE_KEY
PROGRAMS_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ programs_service_name }}"
PROGRAMS_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}"
PROGRAMS_NGINX_PORT: 18140
PROGRAMS_SSL_NGINX_PORT: 48140

PROGRAMS_DEFAULT_DB_NAME: 'programs'

PROGRAMS_DATABASES:
  # rw user
  default:
    ENGINE: 'django.db.backends.mysql'
    NAME: '{{ PROGRAMS_DEFAULT_DB_NAME }}'
    USER: 'programs001'
    PASSWORD: 'password'
    HOST: 'localhost'
    PORT: '3306'
    ATOMIC_REQUESTS: true
    CONN_MAX_AGE: 60

PROGRAMS_VERSION: "master"
PROGRAMS_DJANGO_SETTINGS_MODULE: "programs.settings.production"
PROGRAMS_URL_ROOT: 'http://localhost:8004'
PROGRAMS_LOGOUT_URL: '{{ PROGRAMS_URL_ROOT }}/accounts/logout/'
PROGRAMS_LMS_URL_ROOT: 'http://127.0.0.1:8000'
PROGRAMS_ORGANIZATIONS_API_URL_ROOT: '{{ PROGRAMS_LMS_URL_ROOT }}/api/organizations/v0/'

PROGRAMS_SECRET_KEY: 'Your secret key here'
PROGRAMS_TIME_ZONE: 'UTC'
PROGRAMS_LANGUAGE_CODE: 'en-us'

# Used to automatically configure OAuth2 Client
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_KEY : 'programs-key'
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_SECRET : 'programs-secret'
PROGRAMS_SOCIAL_AUTH_REDIRECT_IS_HTTPS: false
PROGRAMS_OAUTH_URL_ROOT: '{{ PROGRAMS_LMS_URL_ROOT }}/oauth2'
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL: '{{ PROGRAMS_LMS_URL_ROOT }}/logout'

PROGRAMS_JWT_AUDIENCE: '{{ EDXAPP_JWT_AUDIENCE | default("SET-ME-PLEASE") }}'
PROGRAMS_JWT_ISSUER: '{{ PROGRAMS_OAUTH_URL_ROOT }}'
PROGRAMS_JWT_SECRET_KEY: '{{ EDXAPP_JWT_SECRET_KEY | default("lms-secret") }}'

PROGRAMS_JWT_AUTH: 
  JWT_ISSUERS:
    - AUDIENCE: '{{ PROGRAMS_JWT_AUDIENCE }}'
      ISSUER: '{{ PROGRAMS_JWT_ISSUER }}'
      SECRET_KEY: '{{ PROGRAMS_JWT_SECRET_KEY }}'

PROGRAMS_PLATFORM_NAME: 'Your Platform Name Here'

# CORS
# See: https://github.com/ottoyiu/django-cors-headers/.
# the whitelist should always contain the public hostname for Studio in the given environment.
PROGRAMS_CORS_ORIGIN_WHITELIST:
  - '127.0.0.1:8001'

PROGRAMS_DATA_DIR: '{{ COMMON_DATA_DIR }}/{{ programs_service_name }}'
PROGRAMS_MEDIA_ROOT: '{{ PROGRAMS_DATA_DIR }}/media'
PROGRAMS_MEDIA_URL: '/media/'

# Example settings to use Amazon S3 as a storage backend for user-uploaded files
# https://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#amazon-s3
#
# This is only for user-uploaded files and does not cover static assets that ship
# with the code.
#
# Note, AWS_S3_CUSTOM_DOMAIN is required, otherwise boto will generate non-working
# querystring URLs for assets (see https://github.com/boto/boto/issues/1477)
#
# Note, set AWS_S3_CUSTOM_DOMAIN to the cloudfront domain instead, when that is in use.
#
# PROGRAMS_BUCKET: mybucket
# programs_s3_domain: s3.amazonaws.com
# PROGRAMS_MEDIA_ROOT: 'media'   # NOTE use '$source_ip/media' for an edx sandbox
#
# PROGRAMS_MEDIA_STORAGE_BACKEND:
#   DEFAULT_FILE_STORAGE: 'programs.apps.core.s3utils.MediaS3BotoStorage'
#   MEDIA_ROOT: '{{ PROGRAMS_MEDIA_ROOT }}'
#   MEDIA_URL: 'https://{{ PROGRAMS_BUCKET }}.{{ programs_s3_domain }}/{{ PROGRAMS_MEDIA_ROOT }}/'
#   AWS_STORAGE_BUCKET_NAME: '{{ PROGRAMS_BUCKET }}'
#   AWS_S3_CUSTOM_DOMAIN: '{{ PROGRAMS_BUCKET }}.{{ programs_s3_domain }}'
#   AWS_QUERYSTRING_AUTH: false
#   AWS_QUERYSTRING_EXPIRE: false
#   AWS_DEFAULT_ACL: ''
#   AWS_HEADERS:
#     Cache-Control: max-age=31536000
#
#
PROGRAMS_MEDIA_STORAGE_BACKEND:
  DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage'
  MEDIA_ROOT: '{{ PROGRAMS_MEDIA_ROOT }}'
  MEDIA_URL: '{{ PROGRAMS_MEDIA_URL }}'

PROGRAMS_SERVICE_CONFIG:
  SECRET_KEY: '{{ PROGRAMS_SECRET_KEY }}'
  TIME_ZONE: '{{ PROGRAMS_TIME_ZONE }}'
  LANGUAGE_CODE: '{{ PROGRAMS_LANGUAGE_CODE }}'

  SOCIAL_AUTH_EDX_OIDC_KEY: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_KEY }}'
  SOCIAL_AUTH_EDX_OIDC_SECRET: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_SECRET }}'
  SOCIAL_AUTH_EDX_OIDC_ID_TOKEN_DECRYPTION_KEY: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_SECRET }}'
  SOCIAL_AUTH_EDX_OIDC_URL_ROOT: '{{ PROGRAMS_OAUTH_URL_ROOT }}'
  SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL }}'
  SOCIAL_AUTH_REDIRECT_IS_HTTPS: '{{ PROGRAMS_SOCIAL_AUTH_REDIRECT_IS_HTTPS }}'

  STATIC_ROOT: '{{ PROGRAMS_DATA_DIR }}/staticfiles'
  # db config
  DATABASE_OPTIONS:
    connect_timeout: 10
  DATABASES: '{{ PROGRAMS_DATABASES }}'

  PLATFORM_NAME: '{{ PROGRAMS_PLATFORM_NAME }}'

  CORS_ORIGIN_WHITELIST: '{{ PROGRAMS_CORS_ORIGIN_WHITELIST }}'

  PUBLIC_URL_ROOT: '{{ PROGRAMS_URL_ROOT }}'
  ORGANIZATIONS_API_URL_ROOT: '{{ PROGRAMS_ORGANIZATIONS_API_URL_ROOT }}'
  
  MEDIA_STORAGE_BACKEND: '{{ PROGRAMS_MEDIA_STORAGE_BACKEND }}'
  
  JWT_AUTH: '{{ PROGRAMS_JWT_AUTH }}'

PROGRAMS_REPOS:
  - PROTOCOL: "{{ COMMON_GIT_PROTOCOL }}"
    DOMAIN: "{{ COMMON_GIT_MIRROR }}"
    PATH: "{{ COMMON_GIT_PATH }}"
    REPO: programs.git
    VERSION: "{{ PROGRAMS_VERSION }}"
    DESTINATION: "{{ programs_code_dir }}"
    SSH_KEY: "{{ PROGRAMS_GIT_IDENTITY }}"


PROGRAMS_GUNICORN_WORKERS: "2"
PROGRAMS_GUNICORN_EXTRA: ""
PROGRAMS_GUNICORN_EXTRA_CONF: ""
PROGRAMS_GUNICORN_WORKER_CLASS: "gevent"

#
# vars are namespace with the module name.
#
programs_role_name: programs
programs_venv_dir: "{{ programs_home }}/venvs/{{ programs_service_name }}"

programs_service_name: "programs"
programs_user: "{{ programs_service_name }}"
programs_home: "{{ COMMON_APP_DIR }}/{{ programs_service_name }}"
programs_code_dir: "{{ programs_home }}/{{ programs_service_name }}"

programs_node_version: "4.4.7"
programs_nodeenv_dir: "{{ programs_home }}/nodeenvs/{{ programs_service_name }}"
programs_nodeenv_bin: "{{ programs_nodeenv_dir }}/bin"
programs_node_modules_dir: "{{ programs_code_dir }}/node_modules"
programs_node_bin: "{{ programs_node_modules_dir }}/.bin"

programs_environment:
  DJANGO_SETTINGS_MODULE: "{{ PROGRAMS_DJANGO_SETTINGS_MODULE }}"
  PROGRAMS_CFG: "{{ COMMON_CFG_DIR }}/{{ programs_service_name }}.yml"
  PATH: "{{ programs_nodeenv_bin }}:{{ programs_venv_dir }}/bin:{{ ansible_env.PATH }}"

programs_gunicorn_host: "127.0.0.1"
programs_gunicorn_port: 8140
programs_gunicorn_timeout: 300

programs_log_dir: "{{ COMMON_LOG_DIR }}/{{ programs_service_name }}"

programs_requirements_base: "{{ programs_code_dir }}/requirements"
programs_requirements:
  - production.txt
  - optional.txt

#
# OS packages
#

programs_debian_pkgs:
  - libjpeg-dev
  - libmysqlclient-dev
  - libssl-dev

programs_redhat_pkgs: []
<commit_msg>Added additional JWT issuer for programs (#3225)<commit_after>---
#
# edX Configuration
#
# github:     https://github.com/edx/configuration
# wiki:       https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license:    https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role programs
# 
PROGRAMS_GIT_IDENTITY: !!null

# depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC
# and a key being provided via NEWRELIC_LICENSE_KEY
PROGRAMS_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ programs_service_name }}"
PROGRAMS_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}"
PROGRAMS_NGINX_PORT: 18140
PROGRAMS_SSL_NGINX_PORT: 48140

PROGRAMS_DEFAULT_DB_NAME: 'programs'

PROGRAMS_DATABASES:
  # rw user
  default:
    ENGINE: 'django.db.backends.mysql'
    NAME: '{{ PROGRAMS_DEFAULT_DB_NAME }}'
    USER: 'programs001'
    PASSWORD: 'password'
    HOST: 'localhost'
    PORT: '3306'
    ATOMIC_REQUESTS: true
    CONN_MAX_AGE: 60

PROGRAMS_VERSION: "master"
PROGRAMS_DJANGO_SETTINGS_MODULE: "programs.settings.production"
PROGRAMS_URL_ROOT: 'http://localhost:8004'
PROGRAMS_LOGOUT_URL: '{{ PROGRAMS_URL_ROOT }}/accounts/logout/'
PROGRAMS_LMS_URL_ROOT: 'http://127.0.0.1:8000'
PROGRAMS_ORGANIZATIONS_API_URL_ROOT: '{{ PROGRAMS_LMS_URL_ROOT }}/api/organizations/v0/'

PROGRAMS_SECRET_KEY: 'Your secret key here'
PROGRAMS_TIME_ZONE: 'UTC'
PROGRAMS_LANGUAGE_CODE: 'en-us'

# Used to automatically configure OAuth2 Client
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_KEY : 'programs-key'
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_SECRET : 'programs-secret'
PROGRAMS_SOCIAL_AUTH_REDIRECT_IS_HTTPS: false
PROGRAMS_OAUTH_URL_ROOT: '{{ PROGRAMS_LMS_URL_ROOT }}/oauth2'
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL: '{{ PROGRAMS_LMS_URL_ROOT }}/logout'

PROGRAMS_JWT_AUDIENCE: '{{ EDXAPP_JWT_AUDIENCE | default("SET-ME-PLEASE") }}'
PROGRAMS_JWT_ISSUER: '{{ PROGRAMS_OAUTH_URL_ROOT }}'
PROGRAMS_JWT_SECRET_KEY: '{{ EDXAPP_JWT_SECRET_KEY | default("lms-secret") }}'

PROGRAMS_JWT_AUTH: 
  JWT_ISSUERS:
    - AUDIENCE: '{{ PROGRAMS_JWT_AUDIENCE }}'
      ISSUER: '{{ PROGRAMS_JWT_ISSUER }}'
      SECRET_KEY: '{{ PROGRAMS_JWT_SECRET_KEY }}'
    - AUDIENCE: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_KEY }}'
      ISSUER: '{{ PROGRAMS_OAUTH_URL_ROOT }}'
      SECRET_KEY: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_SECRET }}'

PROGRAMS_PLATFORM_NAME: 'Your Platform Name Here'

# CORS
# See: https://github.com/ottoyiu/django-cors-headers/.
# the whitelist should always contain the public hostname for Studio in the given environment.
PROGRAMS_CORS_ORIGIN_WHITELIST:
  - '127.0.0.1:8001'

PROGRAMS_DATA_DIR: '{{ COMMON_DATA_DIR }}/{{ programs_service_name }}'
PROGRAMS_MEDIA_ROOT: '{{ PROGRAMS_DATA_DIR }}/media'
PROGRAMS_MEDIA_URL: '/media/'

# Example settings to use Amazon S3 as a storage backend for user-uploaded files
# https://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#amazon-s3
#
# This is only for user-uploaded files and does not cover static assets that ship
# with the code.
#
# Note, AWS_S3_CUSTOM_DOMAIN is required, otherwise boto will generate non-working
# querystring URLs for assets (see https://github.com/boto/boto/issues/1477)
#
# Note, set AWS_S3_CUSTOM_DOMAIN to the cloudfront domain instead, when that is in use.
#
# PROGRAMS_BUCKET: mybucket
# programs_s3_domain: s3.amazonaws.com
# PROGRAMS_MEDIA_ROOT: 'media'   # NOTE use '$source_ip/media' for an edx sandbox
#
# PROGRAMS_MEDIA_STORAGE_BACKEND:
#   DEFAULT_FILE_STORAGE: 'programs.apps.core.s3utils.MediaS3BotoStorage'
#   MEDIA_ROOT: '{{ PROGRAMS_MEDIA_ROOT }}'
#   MEDIA_URL: 'https://{{ PROGRAMS_BUCKET }}.{{ programs_s3_domain }}/{{ PROGRAMS_MEDIA_ROOT }}/'
#   AWS_STORAGE_BUCKET_NAME: '{{ PROGRAMS_BUCKET }}'
#   AWS_S3_CUSTOM_DOMAIN: '{{ PROGRAMS_BUCKET }}.{{ programs_s3_domain }}'
#   AWS_QUERYSTRING_AUTH: false
#   AWS_QUERYSTRING_EXPIRE: false
#   AWS_DEFAULT_ACL: ''
#   AWS_HEADERS:
#     Cache-Control: max-age=31536000
#
#
PROGRAMS_MEDIA_STORAGE_BACKEND:
  DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage'
  MEDIA_ROOT: '{{ PROGRAMS_MEDIA_ROOT }}'
  MEDIA_URL: '{{ PROGRAMS_MEDIA_URL }}'

PROGRAMS_SERVICE_CONFIG:
  SECRET_KEY: '{{ PROGRAMS_SECRET_KEY }}'
  TIME_ZONE: '{{ PROGRAMS_TIME_ZONE }}'
  LANGUAGE_CODE: '{{ PROGRAMS_LANGUAGE_CODE }}'

  SOCIAL_AUTH_EDX_OIDC_KEY: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_KEY }}'
  SOCIAL_AUTH_EDX_OIDC_SECRET: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_SECRET }}'
  SOCIAL_AUTH_EDX_OIDC_ID_TOKEN_DECRYPTION_KEY: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_SECRET }}'
  SOCIAL_AUTH_EDX_OIDC_URL_ROOT: '{{ PROGRAMS_OAUTH_URL_ROOT }}'
  SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL: '{{ PROGRAMS_SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL }}'
  SOCIAL_AUTH_REDIRECT_IS_HTTPS: '{{ PROGRAMS_SOCIAL_AUTH_REDIRECT_IS_HTTPS }}'

  STATIC_ROOT: '{{ PROGRAMS_DATA_DIR }}/staticfiles'
  # db config
  DATABASE_OPTIONS:
    connect_timeout: 10
  DATABASES: '{{ PROGRAMS_DATABASES }}'

  PLATFORM_NAME: '{{ PROGRAMS_PLATFORM_NAME }}'

  CORS_ORIGIN_WHITELIST: '{{ PROGRAMS_CORS_ORIGIN_WHITELIST }}'

  PUBLIC_URL_ROOT: '{{ PROGRAMS_URL_ROOT }}'
  ORGANIZATIONS_API_URL_ROOT: '{{ PROGRAMS_ORGANIZATIONS_API_URL_ROOT }}'
  
  MEDIA_STORAGE_BACKEND: '{{ PROGRAMS_MEDIA_STORAGE_BACKEND }}'
  
  JWT_AUTH: '{{ PROGRAMS_JWT_AUTH }}'

PROGRAMS_REPOS:
  - PROTOCOL: "{{ COMMON_GIT_PROTOCOL }}"
    DOMAIN: "{{ COMMON_GIT_MIRROR }}"
    PATH: "{{ COMMON_GIT_PATH }}"
    REPO: programs.git
    VERSION: "{{ PROGRAMS_VERSION }}"
    DESTINATION: "{{ programs_code_dir }}"
    SSH_KEY: "{{ PROGRAMS_GIT_IDENTITY }}"


PROGRAMS_GUNICORN_WORKERS: "2"
PROGRAMS_GUNICORN_EXTRA: ""
PROGRAMS_GUNICORN_EXTRA_CONF: ""
PROGRAMS_GUNICORN_WORKER_CLASS: "gevent"

#
# vars are namespace with the module name.
#
programs_role_name: programs
programs_venv_dir: "{{ programs_home }}/venvs/{{ programs_service_name }}"

programs_service_name: "programs"
programs_user: "{{ programs_service_name }}"
programs_home: "{{ COMMON_APP_DIR }}/{{ programs_service_name }}"
programs_code_dir: "{{ programs_home }}/{{ programs_service_name }}"

programs_node_version: "4.4.7"
programs_nodeenv_dir: "{{ programs_home }}/nodeenvs/{{ programs_service_name }}"
programs_nodeenv_bin: "{{ programs_nodeenv_dir }}/bin"
programs_node_modules_dir: "{{ programs_code_dir }}/node_modules"
programs_node_bin: "{{ programs_node_modules_dir }}/.bin"

programs_environment:
  DJANGO_SETTINGS_MODULE: "{{ PROGRAMS_DJANGO_SETTINGS_MODULE }}"
  PROGRAMS_CFG: "{{ COMMON_CFG_DIR }}/{{ programs_service_name }}.yml"
  PATH: "{{ programs_nodeenv_bin }}:{{ programs_venv_dir }}/bin:{{ ansible_env.PATH }}"

programs_gunicorn_host: "127.0.0.1"
programs_gunicorn_port: 8140
programs_gunicorn_timeout: 300

programs_log_dir: "{{ COMMON_LOG_DIR }}/{{ programs_service_name }}"

programs_requirements_base: "{{ programs_code_dir }}/requirements"
programs_requirements:
  - production.txt
  - optional.txt

#
# OS packages
#

programs_debian_pkgs:
  - libjpeg-dev
  - libmysqlclient-dev
  - libssl-dev

programs_redhat_pkgs: []

{'fraction_non_alphanumeric': 0.12173601147776184, 'fraction_numerical': 0.013055954088952654, 'mean_word_length': 6.167609254498714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3095108', 'n_tokens_mistral': 6074, 'n_tokens_neox': 5720, 'n_words': 792}