diff options
| author | MohamedBassem <me@mbassem.com> | 2024-05-15 07:30:01 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-05-15 07:30:01 +0100 |
| commit | f64a5f3237c41b600f7047c477fbf9e79eae4297 (patch) | |
| tree | ee44134c6167c945ae26b6c824dfe393ccec334a | |
| parent | 9b5ef3a70e0e7300124076939587a038b10cb577 (diff) | |
| download | karakeep-f64a5f3237c41b600f7047c477fbf9e79eae4297.tar.zst | |
feature(worker): Allow configuring redis with a password
| -rw-r--r-- | docs/docs/03-configuration.md | 1 | ||||
| -rw-r--r-- | packages/shared/config.ts | 2 | ||||
| -rw-r--r-- | packages/shared/queues.ts | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/docs/docs/03-configuration.md b/docs/docs/03-configuration.md index 47bd115a..83546ec8 100644 --- a/docs/docs/03-configuration.md +++ b/docs/docs/03-configuration.md @@ -10,6 +10,7 @@ The app is mainly configured by environment variables. All the used environment | REDIS_HOST | Yes | localhost | The address of redis used by background jobs | | REDIS_PORT | Yes | 6379 | The port of redis used by background jobs | | REDIS_DB_IDX | No | Not set | The db idx to use with redis. It defaults to 0 (in the client) so you don't usually need to set it unless you explicitly want another db. | +| REDIS_PASSWORD | No | Not set | The password used for redis authentication. It's not required if your redis instance doesn't require AUTH. | | MEILI_ADDR | No | Not set | The address of meilisearch. If not set, Search will be disabled. E.g. (`http://meilisearch:7700`) | | MEILI_MASTER_KEY | Only in Prod and if search is enabled | Not set | The master key configured for meilisearch. Not needed in development environment. Generate one with `openssl rand -base64 36` | | DISABLE_SIGNUPS | No | false | If enabled, no new signups will be allowed and the signup button will be disabled in the UI | diff --git a/packages/shared/config.ts b/packages/shared/config.ts index aae14a07..664ad7d9 100644 --- a/packages/shared/config.ts +++ b/packages/shared/config.ts @@ -18,6 +18,7 @@ const allEnv = z.object({ REDIS_HOST: z.string().default("localhost"), REDIS_PORT: z.coerce.number().default(6379), REDIS_DB_IDX: z.coerce.number().optional(), + REDIS_PASSWORD: z.string().optional(), CRAWLER_HEADLESS_BROWSER: stringBool("true"), BROWSER_WEB_URL: z.string().url().optional(), CRAWLER_JOB_TIMEOUT_SEC: z.coerce.number().default(60), @@ -58,6 +59,7 @@ const serverConfigSchema = allEnv.transform((val) => { redisHost: val.REDIS_HOST, redisPort: val.REDIS_PORT, redisDBIdx: val.REDIS_DB_IDX, + redisPassword: val.REDIS_PASSWORD, }, crawler: { numWorkers: val.CRAWLER_NUM_WORKERS, diff --git a/packages/shared/queues.ts b/packages/shared/queues.ts index 6ea89f5e..86ca32c5 100644 --- a/packages/shared/queues.ts +++ b/packages/shared/queues.ts @@ -7,6 +7,7 @@ export const queueConnectionDetails = { host: serverConfig.bullMQ.redisHost, port: serverConfig.bullMQ.redisPort, db: serverConfig.bullMQ.redisDBIdx, + password: serverConfig.bullMQ.redisPassword, }; // Link Crawler |
