From 6b19fd3e5c806f34dd12115dde98fe22fbe19ca4 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 8 Jul 2026 02:07:12 +0200 Subject: [PATCH] Nix: handle klipy api key path --- nix/lib/secrets.nix | 11 +++++++++-- src/util/util/Config.ts | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nix/lib/secrets.nix b/nix/lib/secrets.nix index 71381e490..a78e5995b 100644 --- a/nix/lib/secrets.nix +++ b/nix/lib/secrets.nix @@ -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 { }); } diff --git a/src/util/util/Config.ts b/src/util/util/Config.ts index 46c5a1681..53cb5367d 100644 --- a/src/util/util/Config.ts +++ b/src/util/util/Config.ts @@ -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);