Skip to content

Commit 62163a4

Browse files
Support loading http antispam token from file (#833)
* Support loading http antispam token from file * Empty commit for signoff Signed-off-by: Rory& <[email protected]> --------- Signed-off-by: Rory& <[email protected]>
1 parent 0bad7b2 commit 62163a4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export interface IConfig {
183183

184184
isAccessTokenPathOptionUsed: boolean;
185185
isPasswordPathOptionUsed: boolean;
186+
isHttpAntispamAuthorizationPathOptionUsed: boolean;
186187
}
187188
| undefined;
188189
}
@@ -320,6 +321,10 @@ function getConfigMeta(): NonNullable<IConfig["configMeta"]> {
320321
process.argv,
321322
"--pantalaimon-password-path"
322323
),
324+
isHttpAntispamAuthorizationPathOptionUsed: isCommandLineOptionPresent(
325+
process.argv,
326+
"--http-antispam-authorization-path"
327+
),
323328
};
324329
}
325330

@@ -368,6 +373,10 @@ export function configRead(): IConfig {
368373
process.argv,
369374
"--pantalaimon-password-path"
370375
);
376+
const explicitHttpAntispamAuthorizationPath = getCommandLineOption(
377+
process.argv,
378+
"--http-antispam-authorization-path"
379+
);
371380
if (explicitAccessTokenPath !== undefined) {
372381
config.accessToken = readSecretFromPath(explicitAccessTokenPath);
373382
}
@@ -376,6 +385,11 @@ export function configRead(): IConfig {
376385
explicitPantalaimonPasswordPath
377386
);
378387
}
388+
if (explicitHttpAntispamAuthorizationPath) {
389+
config.web.synapseHTTPAntispam.authorization = readSecretFromPath(
390+
explicitHttpAntispamAuthorizationPath
391+
);
392+
}
379393
return config;
380394
}
381395

0 commit comments

Comments
 (0)