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
OpenEdx
configuration
Commits
9852155c
Commit
9852155c
authored
Feb 11, 2016
by
Zubair Afzal
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2771 from edx/zub/ecom-3694-credentials-add-media-config
add static and media files basic django configuration
parents
186bf9cc
0b12c014
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
playbooks/roles/credentials/defaults/main.yml
+11
-1
playbooks/roles/credentials/tasks/main.yml
+11
-0
playbooks/roles/credentials/templates/edx/app/nginx/sites-available/credentials.j2
+8
-3
No files found.
playbooks/roles/credentials/defaults/main.yml
View file @
9852155c
...
...
@@ -54,6 +54,12 @@ CREDENTIALS_DJANGO_SETTINGS_MODULE: "credentials.settings.production"
CREDENTIALS_URL_ROOT
:
'
http://credentials:18150'
CREDENTIALS_OAUTH_URL_ROOT
:
'
http://127.0.0.1:8000'
CREDENTIALS_DATA_DIR
:
'
{{
COMMON_DATA_DIR
}}/{{
credentials_service_name
}}'
CREDENTIALS_MEDIA_ROOT
:
'
{{
CREDENTIALS_DATA_DIR
}}/media'
CREDENTIALS_MEDIA_URL
:
'
/media/'
CREDENTIALS_STATIC_ROOT
:
'
{{
CREDENTIALS_DATA_DIR
}}/staticfiles'
CREDENTIALS_STATIC_URL
:
'
/static/'
CREDENTIALS_SECRET_KEY
:
'
Your
secret
key
here'
CREDENTIALS_TIME_ZONE
:
'
UTC'
CREDENTIALS_LANGUAGE_CODE
:
'
en_US.UTF-8'
...
...
@@ -94,7 +100,11 @@ CREDENTIALS_SERVICE_CONFIG:
SOCIAL_AUTH_EDX_OIDC_URL_ROOT
:
'
{{
CREDENTIALS_OAUTH_URL_ROOT
}}/oauth2'
SOCIAL_AUTH_REDIRECT_IS_HTTPS
:
'
{{
CREDENTIALS_SOCIAL_AUTH_REDIRECT_IS_HTTPS
}}'
STATIC_ROOT
:
"
{{
COMMON_DATA_DIR
}}/{{
credentials_service_name
}}/staticfiles"
MEDIA_ROOT
:
'
{{
CREDENTIALS_MEDIA_ROOT
}}'
MEDIA_URL
:
'
{{
CREDENTIALS_MEDIA_URL
}}'
STATIC_ROOT
:
'
{{
CREDENTIALS_STATIC_ROOT
}}'
STATIC_URL
:
'
{{
CREDENTIALS_STATIC_URL
}}'
# db config
DATABASE_OPTIONS
:
connect_timeout
:
10
...
...
playbooks/roles/credentials/tasks/main.yml
View file @
9852155c
...
...
@@ -119,6 +119,17 @@
-
migrate
-
migrate:db
# var should have more permissive permissions than the rest
-
name
:
create credentials var dirs
file
:
>
path="{{ item }}" state=directory mode=0775
owner="{{ credentials_user }}" group="{{ common_web_group }}"
with_items
:
-
"
{{
CREDENTIALS_MEDIA_ROOT
}}"
tags
:
-
install
-
install:base
-
name
:
write out the supervisor wrapper
template
:
src
:
"
edx/app/credentials/credentials.sh.j2"
...
...
playbooks/roles/credentials/templates/edx/app/nginx/sites-available/credentials.j2
View file @
9852155c
...
...
@@ -32,9 +32,14 @@ server {
listen {{ CREDENTIALS_NGINX_PORT }} {{ default_site }};
{% endif %}
location ~ ^/static/(?P<file>.*) {
root {{ COMMON_DATA_DIR }}/{{ credentials_service_name }};
try_files /staticfiles/$file =404;
location ~ ^{{ CREDENTIALS_MEDIA_URL }}(?P<file>.*) {
root {{ CREDENTIALS_MEDIA_ROOT }};
try_files /$file =404;
}
location ~ ^{{ CREDENTIALS_STATIC_URL }}(?P<file>.*) {
root {{ CREDENTIALS_STATIC_ROOT }};
try_files /$file =404;
}
location / {
...
...
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