mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-17 02:12:00 +00:00
Nix: handle klipy api key path
This commit is contained in:
+9
-2
@@ -66,6 +66,11 @@
|
||||
default = null;
|
||||
description = "Path to the secret";
|
||||
};
|
||||
klipyApiKeyPath = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "Path to the secret";
|
||||
};
|
||||
};
|
||||
|
||||
systemdLoadCredentials =
|
||||
@@ -81,7 +86,8 @@
|
||||
++ (if cfg.captchaSecretKeyPath != null then [ "captchaSecretKey:${cfg.captchaSecretKeyPath}" ] else [ ])
|
||||
++ (if cfg.captchaSiteKeyPath != null then [ "captchaSiteKey:${cfg.captchaSiteKeyPath}" ] else [ ])
|
||||
++ (if cfg.ipdataApiKeyPath != null then [ "ipdataApiKey:${cfg.ipdataApiKeyPath}" ] else [ ])
|
||||
++ (if cfg.requestSignaturePath != null then [ "requestSignature:${cfg.requestSignaturePath}" ] else [ ]);
|
||||
++ (if cfg.requestSignaturePath != null then [ "requestSignature:${cfg.requestSignaturePath}" ] else [ ])
|
||||
++ (if cfg.klipyApiKeyPath != null then [ "klipyApiKey:${cfg.klipyApiKeyPath}" ] else [ ]);
|
||||
|
||||
systemdEnvironment =
|
||||
{ }
|
||||
@@ -96,5 +102,6 @@
|
||||
// (if cfg.captchaSecretKeyPath != null then { CAPTCHA_SECRET_KEY_PATH = "%d/captchaSecretKey"; } else { })
|
||||
// (if cfg.captchaSiteKeyPath != null then { CAPTCHA_SITE_KEY_PATH = "%d/captchaSiteKey"; } else { })
|
||||
// (if cfg.ipdataApiKeyPath != null then { IPDATA_API_KEY_PATH = "%d/ipdataApiKey"; } else { })
|
||||
// (if cfg.requestSignaturePath != null then { REQUEST_SIGNATURE_PATH = "%d/requestSignature"; } else { });
|
||||
// (if cfg.requestSignaturePath != null then { REQUEST_SIGNATURE_PATH = "%d/requestSignature"; } else { })
|
||||
// (if cfg.klipyApiKeyPath != null then { KLIPY_API_KEY_PATH = "%d/klipyApiKey"; } else { });
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ export class Config {
|
||||
if (process.env.CAPTCHA_SITE_KEY_PATH) config.security.captcha.sitekey = await Config.readSecret("CAPTCHA_SITE_KEY_PATH");
|
||||
if (process.env.IPDATA_API_KEY_PATH) config.security.ipdataApiKey = await Config.readSecret("IPDATA_API_KEY_PATH");
|
||||
if (process.env.REQUEST_SIGNATURE_PATH) config.security.requestSignature = await Config.readSecret("REQUEST_SIGNATURE_PATH");
|
||||
if (process.env.KLIPY_API_KEY_PATH) config.integrations.gifs.klipy.apiKeyPath = process.env.KLIPY_API_KEY_PATH;
|
||||
|
||||
await this.set(config);
|
||||
validateFinalConfig(config);
|
||||
|
||||
Reference in New Issue
Block a user