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
5ef742db
Commit
5ef742db
authored
Mar 18, 2016
by
Jim Abramson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2874 from edx/jsa/ecom-3196
programs: defaults and overrides for media storage
parents
58a95c55
eedd96d7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
2 deletions
+57
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
+8
-1
playbooks/roles/programs/defaults/main.yml
+41
-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 @
5ef742db
...
@@ -58,7 +58,7 @@ server {
...
@@ -58,7 +58,7 @@ server {
{% endif %}
{% endif %}
location ~ ^/static/(?P<file>.*) {
location ~ ^/static/(?P<file>.*) {
root {{
COMMON_DATA_DIR }}/{{ programs_service_name
}};
root {{
PROGRAMS_DATA_DIR
}};
try_files /staticfiles/$file =404;
try_files /staticfiles/$file =404;
# Request that the browser use SSL for these connections. Repeated here
# Request that the browser use SSL for these connections. Repeated here
...
@@ -71,6 +71,13 @@ server {
...
@@ -71,6 +71,13 @@ server {
add_header Cache-Control "public; max-age=3600";
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 / {
location / {
try_files $uri @proxy_to_app;
try_files $uri @proxy_to_app;
}
}
...
...
playbooks/roles/programs/defaults/main.yml
View file @
5ef742db
...
@@ -55,6 +55,43 @@ PROGRAMS_PLATFORM_NAME: 'Your Platform Name Here'
...
@@ -55,6 +55,43 @@ PROGRAMS_PLATFORM_NAME: 'Your Platform Name Here'
# See: https://github.com/ottoyiu/django-cors-headers/.
# See: https://github.com/ottoyiu/django-cors-headers/.
PROGRAMS_CORS_ORIGIN_WHITELIST
:
[]
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
:
PROGRAMS_SERVICE_CONFIG
:
SECRET_KEY
:
'
{{
PROGRAMS_SECRET_KEY
}}'
SECRET_KEY
:
'
{{
PROGRAMS_SECRET_KEY
}}'
TIME_ZONE
:
'
{{
PROGRAMS_TIME_ZONE
}}'
TIME_ZONE
:
'
{{
PROGRAMS_TIME_ZONE
}}'
...
@@ -66,7 +103,7 @@ PROGRAMS_SERVICE_CONFIG:
...
@@ -66,7 +103,7 @@ PROGRAMS_SERVICE_CONFIG:
SOCIAL_AUTH_EDX_OIDC_URL_ROOT
:
'
{{
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_URL_ROOT
}}'
SOCIAL_AUTH_EDX_OIDC_URL_ROOT
:
'
{{
PROGRAMS_SOCIAL_AUTH_EDX_OIDC_URL_ROOT
}}'
SOCIAL_AUTH_REDIRECT_IS_HTTPS
:
'
{{
PROGRAMS_SOCIAL_AUTH_REDIRECT_IS_HTTPS
}}'
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
# db config
DATABASE_OPTIONS
:
DATABASE_OPTIONS
:
connect_timeout
:
10
connect_timeout
:
10
...
@@ -76,8 +113,11 @@ PROGRAMS_SERVICE_CONFIG:
...
@@ -76,8 +113,11 @@ PROGRAMS_SERVICE_CONFIG:
CORS_ORIGIN_WHITELIST
:
'
{{
PROGRAMS_CORS_ORIGIN_WHITELIST
}}'
CORS_ORIGIN_WHITELIST
:
'
{{
PROGRAMS_CORS_ORIGIN_WHITELIST
}}'
PUBLIC_URL_ROOT
:
'
{{
PROGRAMS_URL_ROOT
}}'
ORGANIZATIONS_API_URL_ROOT
:
'
{{
PROGRAMS_ORGANIZATIONS_API_URL_ROOT
}}'
ORGANIZATIONS_API_URL_ROOT
:
'
{{
PROGRAMS_ORGANIZATIONS_API_URL_ROOT
}}'
MEDIA_STORAGE_BACKEND
:
'
{{
PROGRAMS_MEDIA_STORAGE_BACKEND
}}'
PROGRAMS_REPOS
:
PROGRAMS_REPOS
:
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
...
...
playbooks/roles/programs/tasks/main.yml
View file @
5ef742db
...
@@ -88,6 +88,14 @@
...
@@ -88,6 +88,14 @@
-
"
compress"
-
"
compress"
when
:
not devstack
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
-
name
:
write out the supervisor wrapper
template
:
template
:
src
:
"
edx/app/programs/programs.sh.j2"
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