Merge pull request #204560 from jcumming/resilio_config_passthru

passthrough config if there are no secrets defined (address #204559)
This commit is contained in:
K900 2022-12-11 17:50:37 +03:00 committed by GitHub
commit a95574fd2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,8 @@ let
runConfigPath = "/run/rslsync/config.json"; runConfigPath = "/run/rslsync/config.json";
createConfig = pkgs.writeShellScriptBin "create-resilio-config" '' createConfig = pkgs.writeShellScriptBin "create-resilio-config" (
if cfg.sharedFolders != [ ] then ''
${pkgs.jq}/bin/jq \ ${pkgs.jq}/bin/jq \
'.shared_folders |= map(.secret = $ARGS.named[.dir])' \ '.shared_folders |= map(.secret = $ARGS.named[.dir])' \
${ ${
@ -62,7 +63,11 @@ let
} \ } \
<${configFile} \ <${configFile} \
>${runConfigPath} >${runConfigPath}
''; '' else ''
# no secrets, passing through config
cp ${configFile} ${runConfigPath};
''
);
in in
{ {