Skip to content

Commit 9c4c9ab

Browse files
committed
change: Allow detection of credentials in config loader
detectCredentials: `store.detectCredentials` is a config key that can now be specified as a boolean. If undefined, it will default to true.
1 parent cabd788 commit 9c4c9ab

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

libs/server/config.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ export type BasicAuthConfiguration = { type: 'basic' } & (
1818
export type AuthConfiguration = { type: 'none' } | BasicAuthConfiguration;
1919

2020
export interface S3StoreConfiguration {
21-
accessKey: string;
22-
secretKey: string;
21+
detectCredentials: boolean;
22+
accessKey?: string;
23+
secretKey?: string;
2324
bucket: string;
2425
endpoint: string;
2526
region: string;
@@ -93,16 +94,17 @@ export function loadConfig() {
9394
}
9495
// for now, this works
9596
{
97+
store.detectCredentials ??= true;
9698
store.accessKey = getEnv<string>(
9799
'STORE_ACCESS_KEY',
98100
store.accessKey,
99-
!store.accessKey
100-
).toString();
101+
!store.detectCredentials
102+
)?.toString();
101103
store.secretKey = getEnv<string>(
102104
'STORE_SECRET_KEY',
103105
store.secretKey,
104-
!store.secretKey
105-
).toString();
106+
!store.detectCredentials
107+
)?.toString();
106108
store.bucket = getEnv<string>(
107109
'STORE_BUCKET',
108110
store.bucket ?? 'notea',

0 commit comments

Comments
 (0)