Skip to content

Commit c52a057

Browse files
committed
test2
1 parent 38100b5 commit c52a057

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

backend/src/app.module.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ import dockerSecrets from './config/docker-secrets';
2121

2222
@Module({
2323
imports: [
24-
ConfigModule.forRoot({ isGlobal: true, load: [
25-
dockerSecrets({
26-
'MONGO_SECRET': 'mongoSecret',
27-
'AUTH_JWT_KEY': 'authJwtKey',
28-
'SEARCH_KEY': 'searchKey',
29-
})
30-
] }),
24+
ConfigModule.forRoot({
25+
isGlobal: true,
26+
load: [
27+
dockerSecrets({
28+
MONGO_SECRET: 'mongoSecret',
29+
AUTH_JWT_KEY: 'authJwtKey',
30+
SEARCH_KEY: 'searchKey',
31+
}),
32+
],
33+
}),
3134

3235
MongooseModule.forRootAsync({
3336
imports: [ConfigModule],
@@ -36,15 +39,17 @@ import dockerSecrets from './config/docker-secrets';
3639
let uri = await config
3740
.getOrThrow('DATABASE')
3841
.replace(/(^\"|\"$)/g, ''); // WHY IS THIS NEEDED???
39-
40-
const secret = config.get('DATABASE_SECRET');
42+
43+
const secret = config.get('MONGO_SECRET');
4144
if (secret) {
4245
const url = new URL(uri);
43-
console.log("Using MongoDB secret from Docker secrets");
46+
console.log('Using MongoDB secret from Docker secrets');
4447
url.password = secret;
4548
uri = url.toString();
4649
}
4750

51+
console.log('resolved', { uri });
52+
4853
return { uri };
4954
},
5055
}),

media/src/services/config.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export class ConfigService {
5454
const url = new URL(this._vars.MONGO);
5555
url.password = this._vars.MONGO_SECRET;
5656

57+
console.log('resolved', { mongoUrl: url.toString() });
58+
5759
return url.toString();
5860
}
5961
}

media/src/util/env.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,8 @@ export function envVars<T extends EnvVarsDefiniton>(
7272
}
7373
}
7474
}
75+
76+
console.log('resolved', result);
77+
7578
return result;
7679
}

0 commit comments

Comments
 (0)