Skip to content

Commit 1976b30

Browse files
committed
PEER-220: Add DB Auth
Signed-off-by: SeeuSim <[email protected]>
1 parent 4b53d8d commit 1976b30

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

backend/matching/.env.local

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ EXPRESS_PORT=9004
55
MATCHING_DB_HOSTNAME="localhost"
66
MATCHING_DB_PORT=6379
77

8-
# MATCHING_DB_USERNAME="peerprep-match-express"
9-
# MATCHING_DB_PASSWORD="G7jBgyz9wGAFQ5LQ"
10-
# REDIS_ARGS="--requirepass ${MATCHING_DB_PASSWORD} --user ${MATCHING_DB_USERNAME} on >password ~* allcommands --user default off nopass nocommands"
8+
MATCHING_DB_USERNAME="peerprep-match-express"
9+
MATCHING_DB_PASSWORD="G7jBgyz9wGAFQ5La"
10+
REDIS_ARGS="--requirepass G7jBgyz9wGAFQ5La --user ${MATCHING_DB_USERNAME} on >G7jBgyz9wGAFQ5La ~* allcommands --user default off nopass nocommands"

backend/matching/src/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ export const UI_HOST = process.env.PEERPREP_UI_HOST!;
44

55
export const EXPRESS_PORT = process.env.EXPRESS_PORT;
66

7-
// const DB_USERNAME = process.env.MATCHING_DB_USERNAME;
8-
// const DB_PASSWORD = process.env.MATCHING_DB_PASSWORD;
7+
const DB_USERNAME = process.env.MATCHING_DB_USERNAME;
8+
const DB_PASSWORD = process.env.MATCHING_DB_PASSWORD;
99
const DB_HOSTNAME = process.env.MATCHING_DB_HOSTNAME;
1010
const DB_PORT = Number.parseInt(process.env.MATCHING_DB_PORT ?? '6379');
11-
// export const DB_URL = `redis://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}`;
12-
export const DB_URL = `redis://${DB_HOSTNAME}:${DB_PORT}`;
11+
export const DB_URL = `redis://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}`;
12+
// export const DB_URL = `redis://${DB_HOSTNAME}:${DB_PORT}`;
1313

1414
export const NODE_ENV = process.env.NODE_ENV;

docker-compose.local.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ services:
3434
hostname: "match-db"
3535
image: redis/redis-stack
3636
container_name: "match-db"
37-
# env_file:
38-
# - ./backend/matching/.env.local
37+
env_file:
38+
- ./backend/matching/.env.local
3939
volumes:
4040
- "match-db-docker:/data"
4141
ports:

0 commit comments

Comments
 (0)