redis password and CORS

This commit is contained in:
msramalho
2023-02-25 14:54:41 +01:00
parent 06a553065b
commit a00f3ff8d7
2 changed files with 12 additions and 12 deletions

View File

@@ -11,8 +11,8 @@ services:
volumes: volumes:
- ./src:/usr/src/app - ./src:/usr/src/app
environment: environment:
- CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0
depends_on: depends_on:
- redis - redis
@@ -23,33 +23,33 @@ services:
volumes: volumes:
- ./src:/usr/src/app - ./src:/usr/src/app
environment: environment:
- CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0
depends_on: depends_on:
- web - web
- redis - redis
redis: redis:
image: redis:6-alpine image: redis:6-alpine
command: redis-server /conf/redis.conf command: redis-server /conf/redis.conf --requirepass ${REDIS_PASSWORD}
volumes: volumes:
- "./redis/data:/data" - "./redis/data:/data"
- "./redis/config:/conf" - "./redis/config:/conf"
restart: always restart: always
# DEV ONLY # DEV ONLY
ports: # ports:
- 6379:6379 # - 6379:6379
dashboard: dashboard:
build: ./src build: ./src
restart: always restart: always
command: flower --app=worker.celery --port=5555 --broker=redis://redis:6379/0 --basic_auth=${FLOWER_USERNAME}:${FLOWER_PASSWORD} command: flower --app=worker.celery --port=5555 --broker=redis://:${REDIS_PASSWORD}@redis:6379/0 --basic_auth=${FLOWER_USERNAME}:${FLOWER_PASSWORD}
ports: ports:
- 5556:5555 - 5556:5555
environment: environment:
- CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0
depends_on: depends_on:
- web - web
- redis - redis
# - worker - worker

View File

@@ -25,7 +25,7 @@ GOOGLE_CHROME_APP_ID = os.environ.get("GOOGLE_CHROME_APP_ID")
assert len(GOOGLE_CHROME_APP_ID)>10, "GOOGLE_CHROME_APP_ID env variable not set" assert len(GOOGLE_CHROME_APP_ID)>10, "GOOGLE_CHROME_APP_ID env variable not set"
ALLOWED_EMAILS = set(os.environ.get("ALLOWED_EMAILS", "").split(",")) ALLOWED_EMAILS = set(os.environ.get("ALLOWED_EMAILS", "").split(","))
assert len(GOOGLE_CHROME_APP_ID)>=1, "at least one ALLOWED_EMAILS is required from the env variable" assert len(GOOGLE_CHROME_APP_ID)>=1, "at least one ALLOWED_EMAILS is required from the env variable"
ALLOWED_ORIGINS = os.environ.get("ALLOWED_ORIGINS", "chrome-extension://ondkcheoicfckabcnkdgbepofpjmjcmb").split(",") ALLOWED_ORIGINS = os.environ.get("ALLOWED_ORIGINS", "chrome-extension://ondkcheoicfckabcnkdgbepofpjmjcmb,chrome-extension://ojcimmjndnlmmlgnjaeojoebaceokpdp").split(",")
VERSION = "0.1.1" VERSION = "0.1.1"
app = FastAPI() app = FastAPI()