Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
43e4b8b3
Commit
43e4b8b3
authored
Sep 13, 2017
by
wajeeha-khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
used edxapp vars for cors whitelist and scorm xblock settings
parent
028b2019
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
29 deletions
+15
-29
CHANGELOG.md
+3
-4
playbooks/roles/edxapp/defaults/main.yml
+4
-0
playbooks/roles/nginx/defaults/main.yml
+0
-17
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/extra_locations_lms.j2
+3
-3
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files-extra.j2
+3
-3
No files found.
CHANGELOG.md
View file @
43e4b8b3
...
...
@@ -398,7 +398,6 @@
-
Added
`EDXAPP_VIDEO_TRANSCRIPTS_SETTINGS`
to configure S3-backed video transcripts.
-
Removed unused
`EDXAPP_BOOK_URL`
setting
-
Role: nginx
-
Added
`EDXAPP_ENV_EXTRA`
, with default value as it was in the server template.
-
Added
`SCORM_PKG_STORAGE_DIR`
, with default value as it was in the server template.
-
Added
`NGINX_EDXAPP_LMS_APP_EXTRA`
, with default value as it was in the server template.
-
Role: edxapp
-
Added
`EDXAPP_SCORM_PKG_STORAGE_DIR`
, with default value as it was in the server template.
-
Added
`EDXAPP_SCORM_PLAYER_LOCAL_STORAGE_ROOT`
, with default value as it was in the server template.
playbooks/roles/edxapp/defaults/main.yml
View file @
43e4b8b3
...
...
@@ -741,6 +741,10 @@ EDXAPP_PASSWORD_MAX_LENGTH: 75
# The age at which a learner no longer requires parental consent, or None
EDXAPP_PARENTAL_CONSENT_AGE_LIMIT
:
13
# Scorm Xblock configurations
EDXAPP_SCORM_PKG_STORAGE_DIR
:
"
"
EDXAPP_SCORM_PLAYER_LOCAL_STORAGE_ROOT
:
"
"
#-------- Everything below this line is internal to the role ------------
#Use YAML references (& and *) and hash merge <<: to factor out shared settings
...
...
playbooks/roles/nginx/defaults/main.yml
View file @
43e4b8b3
...
...
@@ -176,20 +176,3 @@ NGINX_CREATE_HTPASSWD_FILE: >
NGINX_EDXAPP_CMS_APP_EXTRA
:
"
"
# Extra settings to add to site configuration for LMS
NGINX_EDXAPP_LMS_APP_EXTRA
:
"
"
NGINX_EDXAPP_LMS_APP_EXTRA
:
"
"
EDXAPP_ENV_EXTRA
:
XBLOCK_SETTINGS
:
ScormXBlock
:
SCORM_PLAYER_LOCAL_STORAGE_ROOT
:
"
"
SCORM_PLAYER_BACKENDS
:
ssla
:
name
:
"
"
location
:
"
"
configuration
:
{}
SCORM_PKG_STORAGE_DIR
:
"
"
CORS_ORIGIN_WHITELIST
:
[]
# Scorm Xblock configurations
SCORM_PKG_STORAGE_DIR
:
"
scorms"
SCORM_PLAYER_LOCAL_STORAGE_ROOT
:
"
scormplayers"
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/extra_locations_lms.j2
View file @
43e4b8b3
{% if EDXAPP_
ENV_EXTRA.XBLOCK_SETTINGS.ScormXBlock
%}
location ~ ^/{{ EDXAPP_MEDIA_URL }}/{{ EDXAPP_
ENV_EXTRA.XBLOCK_SETTINGS.ScormXBlock.SCORM_PKG_STORAGE_DIR
}}/(?P<file>.*) {
{% if EDXAPP_
SCORM_PKG_STORAGE_DIR
%}
location ~ ^/{{ EDXAPP_MEDIA_URL }}/{{ EDXAPP_
XBLOCK_SETTINGS.ScormXBlock.SCORM_PKG_STORAGE_DIR or EDXAPP_SCORM_PKG_STORAGE_DIR
}}/(?P<file>.*) {
add_header 'Access-Control-Allow-Origin' $cors_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
root {{ edxapp_media_dir }}/{{ EDXAPP_
ENV_EXTRA.XBLOCK_SETTINGS.ScormXBlock.SCORM_PKG_STORAGE_DIR or
SCORM_PKG_STORAGE_DIR}};
root {{ edxapp_media_dir }}/{{ EDXAPP_
XBLOCK_SETTINGS.ScormXBlock.SCORM_PKG_STORAGE_DIR or EDXAPP_
SCORM_PKG_STORAGE_DIR}};
try_files /$file =404;
expires 31536000s;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
43e4b8b3
...
...
@@ -44,7 +44,7 @@ geo $http_x_forwarded_for $embargo {
{%- endif %}
{% if EDXAPP_
ENV_EXTRA.XBLOCK_SETTINGS.ScormXBlock
%}
{% if EDXAPP_
CORS_ORIGIN_WHITELIST
%}
# The Origin request header indicates where a fetch originates from. It doesn't include any path information,
# but only the server name (e.g. https://www.example.com).
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin for details.
...
...
@@ -53,7 +53,7 @@ geo $http_x_forwarded_for $embargo {
# of our known hosts--served via HTTP or HTTPS--we allow for CORS. Otherwise, we set the "null" value, disallowing CORS.
map $http_origin $cors_origin {
default "null";
{% for host in EDXAPP_
ENV_EXTRA.
CORS_ORIGIN_WHITELIST %}
{% for host in EDXAPP_CORS_ORIGIN_WHITELIST %}
"~*^https?:\/\/{{ host|replace('.', '\.') }}$" $http_origin;
{% endfor %}
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files-extra.j2
View file @
43e4b8b3
{% if EDXAPP_
ENV_EXTRA.XBLOCK_SETTINGS.ScormXBlock
%}
{% if EDXAPP_
SCORM_PLAYER_LOCAL_STORAGE_ROOT
%}
# w/in scorm/, override default return 403 for these file types
location ~ ^/static/scorm/(?:.*)(?:\.xml|\.json) {
try_files /{{ EDXAPP_
ENV_EXTRA.XBLOCK_SETTINGS.ScormXBlock.SCORM_PLAYER_LOCAL_STORAGE_ROOT
}}/$file =404;
try_files /{{ EDXAPP_
XBLOCK_SETTINGS.ScormXBlock.SCORM_PLAYER_LOCAL_STORAGE_ROOT or EDXAPP_SCORM_PLAYER_LOCAL_STORAGE_ROOT
}}/$file =404;
}
location ~ "/scorm/(?P<file>.*)" {
add_header 'Access-Control-Allow-Origin' $cors_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
try_files /{{ EDXAPP_
ENV_EXTRA.XBLOCK_SETTINGS.ScormXBlock.SCORM_PLAYER_LOCAL_STORAGE_ROOT or
SCORM_PLAYER_LOCAL_STORAGE_ROOT}}/$file =404;
try_files /{{ EDXAPP_
XBLOCK_SETTINGS.ScormXBlock.SCORM_PLAYER_LOCAL_STORAGE_ROOT or EDXAPP_
SCORM_PLAYER_LOCAL_STORAGE_ROOT}}/$file =404;
}
{% endif %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment