Skip to content
Snippets Groups Projects
Commit ba89cc64 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '640-redis-password-channels' into 'develop'

Resolve "Password-protected redis connection seems to not be respected"

Closes #640

See merge request funkwhale/funkwhale!503
parents 4b4bb851 d27ea30b
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ from __future__ import absolute_import, unicode_literals ...@@ -13,7 +13,7 @@ from __future__ import absolute_import, unicode_literals
import datetime import datetime
import logging import logging
from urllib.parse import urlparse, urlsplit from urllib.parse import urlsplit
import environ import environ
from celery.schedules import crontab from celery.schedules import crontab
...@@ -420,11 +420,10 @@ CACHES = { ...@@ -420,11 +420,10 @@ CACHES = {
CACHES["default"]["BACKEND"] = "django_redis.cache.RedisCache" CACHES["default"]["BACKEND"] = "django_redis.cache.RedisCache"
cache_url = urlparse(CACHES["default"]["LOCATION"])
CHANNEL_LAYERS = { CHANNEL_LAYERS = {
"default": { "default": {
"BACKEND": "channels_redis.core.RedisChannelLayer", "BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {"hosts": [(cache_url.hostname, cache_url.port)]}, "CONFIG": {"hosts": [CACHES["default"]["LOCATION"]]},
} }
} }
......
Officially support connecting to a password protected redis server, with
the redis://:password@localhost:6379/0 scheme (#640)
...@@ -70,7 +70,10 @@ REVERSE_PROXY_TYPE=nginx ...@@ -70,7 +70,10 @@ REVERSE_PROXY_TYPE=nginx
# Cache configuration # Cache configuration
# Examples: # Examples:
# CACHE_URL=redis://<host>:<port>/<database> # CACHE_URL=redis://<host>:<port>/<database>
# CACHE_URL=redis://localhost:6379/0 # CACHE_URL=redis://localhost:6379/0c
# With a password:
# CACHE_URL=redis://:password@localhost:6379/0
# (the extra semicolon is important)
# Use the next one if you followed Debian installation guide # Use the next one if you followed Debian installation guide
# CACHE_URL=redis://127.0.0.1:6379/0 # CACHE_URL=redis://127.0.0.1:6379/0
......
...@@ -99,7 +99,7 @@ services: ...@@ -99,7 +99,7 @@ services:
- "FUNKWHALE_FRONT_PORT=${VUE_PORT-8080}" - "FUNKWHALE_FRONT_PORT=${VUE_PORT-8080}"
- "COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME- }" - "COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME- }"
- "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-localhost}" - "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-localhost}"
links: depends_on:
- api - api
- front - front
volumes: volumes:
......
...@@ -37,7 +37,6 @@ module.exports = { ...@@ -37,7 +37,6 @@ module.exports = {
}, },
chainWebpack: config => { chainWebpack: config => {
config.optimization.delete('splitChunks') config.optimization.delete('splitChunks')
console.log(config.plugins)
config.plugins.delete('prefetch-embed') config.plugins.delete('prefetch-embed')
config.plugins.delete('prefetch-index') config.plugins.delete('prefetch-index')
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment