Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jovuit
funkwhale
Commits
498aa113
Verified
Commit
498aa113
authored
Feb 25, 2018
by
Eliot Berriot
Browse files
Initial channels integration
parent
63620ede
Changes
5
Hide whitespace changes
Inline
Side-by-side
api/config/settings/common.py
View file @
498aa113
...
...
@@ -30,6 +30,7 @@ ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS')
# APP CONFIGURATION
# ------------------------------------------------------------------------------
DJANGO_APPS
=
(
'channels'
,
# Default Django apps:
'django.contrib.auth'
,
'django.contrib.contenttypes'
,
...
...
@@ -253,9 +254,9 @@ MEDIA_URL = env("MEDIA_URL", default='/media/')
# URL Configuration
# ------------------------------------------------------------------------------
ROOT_URLCONF
=
'config.urls'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application
WSGI_APPLICATION
=
'config.wsgi.application'
ASGI_APPLICATION
=
"config.routing.application"
# AUTHENTICATION CONFIGURATION
# ------------------------------------------------------------------------------
...
...
@@ -284,6 +285,17 @@ CACHES = {
}
CACHES
[
"default"
][
"BACKEND"
]
=
"django_redis.cache.RedisCache"
from
urllib.parse
import
urlparse
cache_url
=
urlparse
(
CACHES
[
'default'
][
'LOCATION'
])
CHANNEL_LAYERS
=
{
"default"
:
{
"BACKEND"
:
"channels_redis.core.RedisChannelLayer"
,
"CONFIG"
:
{
"hosts"
:
[(
cache_url
.
hostname
,
cache_url
.
port
)],
},
},
}
CACHES
[
"default"
][
"OPTIONS"
]
=
{
"CLIENT_CLASS"
:
"django_redis.client.DefaultClient"
,
"IGNORE_EXCEPTIONS"
:
True
,
# mimics memcache behavior.
...
...
api/requirements/base.txt
View file @
498aa113
...
...
@@ -59,3 +59,5 @@ pyacoustid>=1.1.5,<1.2
raven>=6.5,<7
python-magic==0.4.15
ffmpeg-python==0.1.10
channels>=2,<2.1
channels_redis>=2.1,<2.2
docker/nginx/conf.dev
View file @
498aa113
...
...
@@ -28,6 +28,11 @@ http {
#gzip on;
proxy_cache_path /tmp/funkwhale-transcode levels=1:2 keys_zone=transcode:10m max_size=1g inactive=24h use_temp_path=off;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 6001;
charset utf-8;
...
...
@@ -40,6 +45,9 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host localhost:8080;
proxy_set_header X-Forwarded-Port 8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_redirect off;
location /_protected/media {
...
...
front/config/index.js
View file @
498aa113
...
...
@@ -32,6 +32,7 @@ module.exports = {
'
/api
'
:
{
target
:
'
http://nginx:6001
'
,
changeOrigin
:
true
,
ws
:
true
},
'
/media
'
:
{
target
:
'
http://nginx:6001
'
,
...
...
front/package.json
View file @
498aa113
...
...
@@ -17,6 +17,7 @@
"dependencies"
:
{
"axios"
:
"^0.17.1"
,
"dateformat"
:
"^2.0.0"
,
"django-channels"
:
"^1.1.6"
,
"js-logger"
:
"^1.3.0"
,
"jwt-decode"
:
"^2.2.0"
,
"lodash"
:
"^4.17.4"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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