nix: fix control discovery arg quoting in ec-node unit script
This commit is contained in:
parent
faec62f9ae
commit
74842eb25e
1 changed files with 10 additions and 2 deletions
|
|
@ -227,6 +227,8 @@ in
|
|||
"cmd+=(${lib.concatStringsSep " " (map lib.escapeShellArg cfg.extraArgs)})";
|
||||
explicitInputStr = if b.input == null then "" else b.input;
|
||||
channelStr = if b.channel == null then "" else b.channel;
|
||||
controlDiscoveryStr = if cfg.control.discovery == null then "" else cfg.control.discovery;
|
||||
controlIrohSecretStr = if cfg.control.irohSecret == null then "" else cfg.control.irohSecret;
|
||||
controlGossipPeerLines = lib.concatMapStrings (peer: "cmd+=(--gossip-peer ${lib.escapeShellArg peer})\n") cfg.control.gossipPeers;
|
||||
in
|
||||
''
|
||||
|
|
@ -346,8 +348,14 @@ in
|
|||
cmd+=(--control-announce)
|
||||
cmd+=(--control-ttl-ms ${toString cfg.control.ttlMs})
|
||||
cmd+=(--control-interval-ms ${toString cfg.control.intervalMs})
|
||||
${lib.optionalString (cfg.control.discovery != null) "cmd+=(--discovery ${lib.escapeShellArg cfg.control.discovery})"}
|
||||
${lib.optionalString (cfg.control.irohSecret != null) "cmd+=(--iroh-secret ${lib.escapeShellArg cfg.control.irohSecret})"}
|
||||
control_discovery=${lib.escapeShellArg controlDiscoveryStr}
|
||||
if [[ -n "$control_discovery" ]]; then
|
||||
cmd+=(--discovery "$control_discovery")
|
||||
fi
|
||||
control_iroh_secret=${lib.escapeShellArg controlIrohSecretStr}
|
||||
if [[ -n "$control_iroh_secret" ]]; then
|
||||
cmd+=(--iroh-secret "$control_iroh_secret")
|
||||
fi
|
||||
${controlGossipPeerLines}
|
||||
''}
|
||||
${extraArgsLine}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue