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
2ba3a592
Commit
2ba3a592
authored
Mar 17, 2016
by
jsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
programs: defaults and overrides for media storage
ECOM-3196
parent
d6667399
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
+8
-1
playbooks/roles/programs/defaults/main.yml
+40
-1
playbooks/roles/programs/tasks/main.yml
+8
-0
No files found.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
View file @
2ba3a592
...
...
@@ -58,7 +58,7 @@ server {
{% endif %}
location ~ ^/static/(?P<file>.*) {
root {{
COMMON_DATA_DIR }}/{{ programs_service_name
}};
root {{
PROGRAMS_DATA_DIR
}};
try_files /staticfiles/$file =404;
# Request that the browser use SSL for these connections. Repeated here
...
...
@@ -71,6 +71,13 @@ server {
add_header Cache-Control "public; max-age=3600";
}
location ~ ^/media/(?P<file>.*) {
root {{ PROGRAMS_DATA_DIR }};
try_files /media/$file =404;
# django / app always assigns new filenames so these can be cached forever.
add_header Cache-Control "public; max-age=31536000";
}
location / {
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/programs/defaults/main.yml
View file @
2ba3a592
...
...
@@ -55,6 +55,43 @@ PROGRAMS_PLATFORM_NAME: 'Your Platform Name Here'
# See: https://github.com/ottoyiu/django-cors-headers/.
PROGRAMS_CORS_ORIGIN_WHITELIST
:
[]
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
}}'
...
...
@@ -66,7 +103,7 @@ PROGRAMS_SERVICE_CONFIG:
SOCIAL_AUTH_EDX_OIDC_URL_ROOT
:
'
{{
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_URL_ROOT
}}'
SOCIAL_AUTH_REDIRECT_IS_HTTPS
:
'
{{
PROGRAMS_SOCIAL_AUTH_REDIRECT_IS_HTTPS
}}'
STATIC_ROOT
:
"
{{
COMMON_DATA_DIR
}}/{{
programs_service_name
}}/staticfiles"
STATIC_ROOT
:
'
{{
PROGRAMS_DATA_DIR
}}/staticfiles'
# db config
DATABASE_OPTIONS
:
connect_timeout
:
10
...
...
@@ -77,6 +114,8 @@ PROGRAMS_SERVICE_CONFIG:
CORS_ORIGIN_WHITELIST
:
'
{{
PROGRAMS_CORS_ORIGIN_WHITELIST
}}'
ORGANIZATIONS_API_URL_ROOT
:
'
{{
PROGRAMS_ORGANIZATIONS_API_URL_ROOT
}}'
MEDIA_STORAGE_BACKEND
:
'
{{
PROGRAMS_MEDIA_STORAGE_BACKEND
}}'
PROGRAMS_REPOS
:
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
...
...
playbooks/roles/programs/tasks/main.yml
View file @
2ba3a592
...
...
@@ -88,6 +88,14 @@
-
"
compress"
when
:
not devstack
# NOTE this isn't used or needed when s3 is used for PROGRAMS_MEDIA_STORAGE_BACKEND
-
name
:
create programs media dir
file
:
>
path="{{ item }}" state=directory mode=0775
owner="{{ programs_user }}" group="{{ common_web_group }}"
with_items
:
-
"
{{
PROGRAMS_MEDIA_ROOT
}}"
-
name
:
write out the supervisor wrapper
template
:
src
:
"
edx/app/programs/programs.sh.j2"
...
...
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