Skip to content

Commit 6b19fd3

Browse files
Nix: handle klipy api key path
1 parent 4bb0f39 commit 6b19fd3

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

nix/lib/secrets.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
default = null;
6767
description = "Path to the secret";
6868
};
69+
klipyApiKeyPath = lib.mkOption {
70+
type = lib.types.nullOr lib.types.str;
71+
default = null;
72+
description = "Path to the secret";
73+
};
6974
};
7075

7176
systemdLoadCredentials =
@@ -81,7 +86,8 @@
8186
++ (if cfg.captchaSecretKeyPath != null then [ "captchaSecretKey:${cfg.captchaSecretKeyPath}" ] else [ ])
8287
++ (if cfg.captchaSiteKeyPath != null then [ "captchaSiteKey:${cfg.captchaSiteKeyPath}" ] else [ ])
8388
++ (if cfg.ipdataApiKeyPath != null then [ "ipdataApiKey:${cfg.ipdataApiKeyPath}" ] else [ ])
84-
++ (if cfg.requestSignaturePath != null then [ "requestSignature:${cfg.requestSignaturePath}" ] else [ ]);
89+
++ (if cfg.requestSignaturePath != null then [ "requestSignature:${cfg.requestSignaturePath}" ] else [ ])
90+
++ (if cfg.klipyApiKeyPath != null then [ "klipyApiKey:${cfg.klipyApiKeyPath}" ] else [ ]);
8591

8692
systemdEnvironment =
8793
{ }
@@ -96,5 +102,6 @@
96102
// (if cfg.captchaSecretKeyPath != null then { CAPTCHA_SECRET_KEY_PATH = "%d/captchaSecretKey"; } else { })
97103
// (if cfg.captchaSiteKeyPath != null then { CAPTCHA_SITE_KEY_PATH = "%d/captchaSiteKey"; } else { })
98104
// (if cfg.ipdataApiKeyPath != null then { IPDATA_API_KEY_PATH = "%d/ipdataApiKey"; } else { })
99-
// (if cfg.requestSignaturePath != null then { REQUEST_SIGNATURE_PATH = "%d/requestSignature"; } else { });
105+
// (if cfg.requestSignaturePath != null then { REQUEST_SIGNATURE_PATH = "%d/requestSignature"; } else { })
106+
// (if cfg.klipyApiKeyPath != null then { KLIPY_API_KEY_PATH = "%d/klipyApiKey"; } else { });
100107
}

src/util/util/Config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export class Config {
7676
if (process.env.CAPTCHA_SITE_KEY_PATH) config.security.captcha.sitekey = await Config.readSecret("CAPTCHA_SITE_KEY_PATH");
7777
if (process.env.IPDATA_API_KEY_PATH) config.security.ipdataApiKey = await Config.readSecret("IPDATA_API_KEY_PATH");
7878
if (process.env.REQUEST_SIGNATURE_PATH) config.security.requestSignature = await Config.readSecret("REQUEST_SIGNATURE_PATH");
79+
if (process.env.KLIPY_API_KEY_PATH) config.integrations.gifs.klipy.apiKeyPath = process.env.KLIPY_API_KEY_PATH;
7980

8081
await this.set(config);
8182
validateFinalConfig(config);

0 commit comments

Comments
 (0)