diff --git a/.env.ci b/.env.ci index 1305e70f..bd5f404b 100644 --- a/.env.ci +++ b/.env.ci @@ -18,6 +18,8 @@ CELLULOID_PG_IDLE_TIMEOUT=30000 # Cookie secret key. Generate something random and long. CELLULOID_COOKIE_SECRET=cisecret3 +CELLULOID_REDIS_URL=redis://localhost + # email params. Check with your SMTP provider CELLULOID_SMTP_HOST= CELLULOID_SMTP_USER= diff --git a/.github/workflows/dockerfile-ci.yml b/.github/workflows/dockerfile-ci.yml index 15532619..2ac9ecda 100644 --- a/.github/workflows/dockerfile-ci.yml +++ b/.github/workflows/dockerfile-ci.yml @@ -46,7 +46,7 @@ jobs: run: "ifconfig -a" - name: "Start docker server" run: - docker run --rm -d --init -p 5678:5678 --env-file .env -e NODE_ENV=production -e CELLULOID_PG_HOST=172.17.0.1 + docker run --rm -d --init -p 5678:5678 --env-file .env -e NODE_ENV=production -e CELLULOID_PG_HOST=172.17.0.1 -e CELLULOID_PG_HOST=redis://172.17.0.1 --name celluloid-server celluloid-server - name: "Test docker" run: node .github/workflows/test-docker.js diff --git a/.github/workflows/test-docker.js b/.github/workflows/test-docker.js index 2d5c38ec..e6d094c7 100644 --- a/.github/workflows/test-docker.js +++ b/.github/workflows/test-docker.js @@ -14,7 +14,7 @@ async function main() { controller.abort(); }, 3000); try { - response = await fetch("http://localhost:5678", { + response = await fetch("http://localhost:3001", { signal: controller.signal, }); } finally { diff --git a/packages/server/src/http/SessionStore.ts b/packages/server/src/http/SessionStore.ts index a61a61cd..ff82f347 100644 --- a/packages/server/src/http/SessionStore.ts +++ b/packages/server/src/http/SessionStore.ts @@ -10,7 +10,7 @@ import { logger } from "../backends/Logger"; const log = logger("http/Session"); export function createSession() { - let client = createClient({ legacyMode: true }); + let client = createClient({ legacyMode: true, url: process.env.CELLULOID_REDIS_URL || "redis://localhost" }); client.connect().catch((e) => log.error(`redis error : ${e.message}`)); log.info("redis connected"); diff --git a/sample.env b/sample.env index a83d637a..7e3cf430 100644 --- a/sample.env +++ b/sample.env @@ -14,6 +14,9 @@ CELLULOID_PG_PASSWORD=USE_A_STRONGER_PASSWORD # Postgres connection pool config. Change at your own risk. CELLULOID_PG_MAX_POOL_SIZE=20 CELLULOID_PG_IDLE_TIMEOUT=30000 + +# Redis URL +CELLULOID_REDIS_URL= # Cookie secret key. Generate something random and long. CELLULOID_COOKIE_SECRET=c7gGEvPZfke5aDN626E13Voo8NmUoxix # email params. Check with your SMTP provider