arr: add declarative api key
This commit is contained in:
parent
54d9be7783
commit
0d2a7c315f
2 changed files with 28 additions and 12 deletions
|
|
@ -144,6 +144,10 @@ let
|
||||||
description = "Log level.";
|
description = "Log level.";
|
||||||
default = "info";
|
default = "info";
|
||||||
};
|
};
|
||||||
|
ApiKey = lib.mkOption {
|
||||||
|
type = shb.secretFileType;
|
||||||
|
description = "Path to api key secret file.";
|
||||||
|
};
|
||||||
Port = lib.mkOption {
|
Port = lib.mkOption {
|
||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
description = "Port on which bazarr listens to incoming requests.";
|
description = "Port on which bazarr listens to incoming requests.";
|
||||||
|
|
@ -172,6 +176,10 @@ let
|
||||||
description = "Log level.";
|
description = "Log level.";
|
||||||
default = "info";
|
default = "info";
|
||||||
};
|
};
|
||||||
|
ApiKey = lib.mkOption {
|
||||||
|
type = shb.secretFileType;
|
||||||
|
description = "Path to api key secret file.";
|
||||||
|
};
|
||||||
Port = lib.mkOption {
|
Port = lib.mkOption {
|
||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
description = "Port on which readarr listens to incoming requests.";
|
description = "Port on which readarr listens to incoming requests.";
|
||||||
|
|
@ -199,6 +207,10 @@ let
|
||||||
description = "Log level.";
|
description = "Log level.";
|
||||||
default = "info";
|
default = "info";
|
||||||
};
|
};
|
||||||
|
ApiKey = lib.mkOption {
|
||||||
|
type = shb.secretFileType;
|
||||||
|
description = "Path to api key secret file.";
|
||||||
|
};
|
||||||
Port = lib.mkOption {
|
Port = lib.mkOption {
|
||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
description = "Port on which lidarr listens to incoming requests.";
|
description = "Port on which lidarr listens to incoming requests.";
|
||||||
|
|
@ -458,16 +470,20 @@ in
|
||||||
users.users.bazarr = {
|
users.users.bazarr = {
|
||||||
extraGroups = [ "media" ];
|
extraGroups = [ "media" ];
|
||||||
};
|
};
|
||||||
systemd.services.bazarr.preStart = shb.replaceSecrets {
|
# This is actually not working. Bazarr uses a config file in dataDir/config/config.yaml
|
||||||
userConfig =
|
# which includes all configuration so we must somehow merge our declarative config with it.
|
||||||
cfg'.settings
|
# It's doable but will take some time. Help is welcomed.
|
||||||
// (lib.optionalAttrs isSSOEnabled {
|
#
|
||||||
AuthenticationRequired = "DisabledForLocalAddresses";
|
# systemd.services.bazarr.preStart = shb.replaceSecrets {
|
||||||
AuthenticationMethod = "External";
|
# userConfig =
|
||||||
});
|
# cfg'.settings
|
||||||
resultPath = "${cfg'.dataDir}/config.xml";
|
# // (lib.optionalAttrs isSSOEnabled {
|
||||||
generator = apps.bazarr.settingsFormat.generate;
|
# AuthenticationRequired = "DisabledForLocalAddresses";
|
||||||
};
|
# AuthenticationMethod = "External";
|
||||||
|
# });
|
||||||
|
# resultPath = "${cfg'.dataDir}/config.xml";
|
||||||
|
# generator = apps.bazarr.settingsFormat.generate;
|
||||||
|
# };
|
||||||
|
|
||||||
shb.nginx.vhosts = [ (vhosts { } cfg') ];
|
shb.nginx.vhosts = [ (vhosts { } cfg') ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ let
|
||||||
if response['code'] != 200:
|
if response['code'] != 200:
|
||||||
raise Exception(f"Code is {response['code']}")
|
raise Exception(f"Code is {response['code']}")
|
||||||
''
|
''
|
||||||
+ lib.optionalString (apiKey != null) ''
|
+ lib.optionalString (apiKey != null && cfgPath != null) ''
|
||||||
|
|
||||||
with subtest("apikey"):
|
with subtest("apikey"):
|
||||||
config = server.succeed("cat ${cfgPath}")
|
config = server.succeed("cat ${cfgPath}")
|
||||||
|
|
@ -212,7 +212,7 @@ let
|
||||||
|
|
||||||
radarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
radarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
||||||
sonarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
sonarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
||||||
bazarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
bazarrCfgFn = cfg: null;
|
||||||
readarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
readarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
||||||
lidarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
lidarrCfgFn = cfg: "${cfg.dataDir}/config.xml";
|
||||||
jackettCfgFn = cfg: "${cfg.dataDir}/ServerConfig.json";
|
jackettCfgFn = cfg: "${cfg.dataDir}/ServerConfig.json";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue