mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 09:31:08 +00:00
URL-Encode password in broker_url
Needed to prevent connection errors if the password contains non-urlsafe characters. Dockerfile change because all the services using it are mirroring ./ in /app now anyway. Flower needs because it needs bookwyrm in order to read the celerywyrm config (because flower only allows overwriting broker_url from the command line and we want to do it in Python so we have access to a urlencode function).
This commit is contained in:
parent
2e7d84d53c
commit
31deb36c85
6 changed files with 12 additions and 14 deletions
|
@ -34,10 +34,8 @@ REDIS_ACTIVITY_PORT=6379
|
||||||
#REDIS_ACTIVITY_PASSWORD=redispassword345
|
#REDIS_ACTIVITY_PASSWORD=redispassword345
|
||||||
|
|
||||||
# Redis as celery broker
|
# Redis as celery broker
|
||||||
#REDIS_BROKER_PORT=6379
|
REDIS_BROKER_PORT=6379
|
||||||
#REDIS_BROKER_PASSWORD=redispassword123
|
#REDIS_BROKER_PASSWORD=redispassword123
|
||||||
CELERY_BROKER=redis://redis_broker:6379/0
|
|
||||||
CELERY_RESULT_BACKEND=redis://redis_broker:6379/0
|
|
||||||
|
|
||||||
FLOWER_PORT=8888
|
FLOWER_PORT=8888
|
||||||
#FLOWER_USER=mouse
|
#FLOWER_USER=mouse
|
||||||
|
|
|
@ -36,8 +36,6 @@ REDIS_ACTIVITY_PASSWORD=redispassword345
|
||||||
# Redis as celery broker
|
# Redis as celery broker
|
||||||
REDIS_BROKER_PORT=6379
|
REDIS_BROKER_PORT=6379
|
||||||
REDIS_BROKER_PASSWORD=redispassword123
|
REDIS_BROKER_PASSWORD=redispassword123
|
||||||
CELERY_BROKER=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0
|
|
||||||
CELERY_RESULT_BACKEND=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0
|
|
||||||
|
|
||||||
FLOWER_PORT=8888
|
FLOWER_PORT=8888
|
||||||
FLOWER_USER=mouse
|
FLOWER_USER=mouse
|
||||||
|
|
|
@ -9,5 +9,3 @@ WORKDIR /app
|
||||||
COPY requirements.txt /app/
|
COPY requirements.txt /app/
|
||||||
RUN pip install -r requirements.txt --no-cache-dir
|
RUN pip install -r requirements.txt --no-cache-dir
|
||||||
RUN apt-get update && apt-get install -y gettext libgettextpo-dev && apt-get clean
|
RUN apt-get update && apt-get install -y gettext libgettextpo-dev && apt-get clean
|
||||||
|
|
||||||
COPY ./bookwyrm ./celerywyrm /app/
|
|
||||||
|
|
|
@ -14,8 +14,12 @@ PAGE_LENGTH = env("PAGE_LENGTH", 15)
|
||||||
DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
|
DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
|
||||||
|
|
||||||
# celery
|
# celery
|
||||||
CELERY_BROKER = env("CELERY_BROKER")
|
CELERY_BROKER = "redis://:{}@redis_broker:{}/0".format(
|
||||||
CELERY_RESULT_BACKEND = env("CELERY_RESULT_BACKEND")
|
requests.utils.quote(env("REDIS_BROKER_PASSWORD", "")), env("REDIS_BROKER_PORT")
|
||||||
|
)
|
||||||
|
CELERY_RESULT_BACKEND = "redis://:{}@redis_broker:{}/0".format(
|
||||||
|
requests.utils.quote(env("REDIS_BROKER_PASSWORD", "")), env("REDIS_BROKER_PORT")
|
||||||
|
)
|
||||||
CELERY_ACCEPT_CONTENT = ["application/json"]
|
CELERY_ACCEPT_CONTENT = ["application/json"]
|
||||||
CELERY_TASK_SERIALIZER = "json"
|
CELERY_TASK_SERIALIZER = "json"
|
||||||
CELERY_RESULT_SERIALIZER = "json"
|
CELERY_RESULT_SERIALIZER = "json"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
""" bookwyrm settings and configuration """
|
""" bookwyrm settings and configuration """
|
||||||
from bookwyrm.settings import *
|
from bookwyrm.settings import *
|
||||||
|
|
||||||
CELERY_BROKER_URL = env("CELERY_BROKER")
|
CELERY_BROKER_URL = CELERY_BROKER
|
||||||
CELERY_ACCEPT_CONTENT = ["json"]
|
CELERY_ACCEPT_CONTENT = ["json"]
|
||||||
CELERY_TASK_SERIALIZER = "json"
|
CELERY_TASK_SERIALIZER = "json"
|
||||||
CELERY_RESULT_BACKEND = "redis"
|
FLOWER_PORT = env("FLOWER_PORT")
|
||||||
|
|
||||||
INSTALLED_APPS = INSTALLED_APPS + [
|
INSTALLED_APPS = INSTALLED_APPS + [
|
||||||
"celerywyrm",
|
"celerywyrm",
|
||||||
|
|
|
@ -74,10 +74,10 @@ services:
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
flower:
|
flower:
|
||||||
build: .
|
build: .
|
||||||
command: flower --port=${FLOWER_PORT}
|
command: flower -A celerywyrm
|
||||||
env_file: .env
|
env_file: .env
|
||||||
environment:
|
volumes:
|
||||||
- CELERY_BROKER_URL=${CELERY_BROKER}
|
- .:/app
|
||||||
networks:
|
networks:
|
||||||
- main
|
- main
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
Loading…
Reference in a new issue