diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-11 21:01:20 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-11 21:01:20 +0000 |
| commit | c89d3b6b3646b707b53146226bb7afd21cca11fa (patch) | |
| tree | 6fb25cd987e7026c9add5494feef44f0db5c76a6 /nix | |
| parent | 73648864e126bb62e5c0bfdea1a22b4b3f6cb9a6 (diff) | |
fix(nix): strip trailing newline from relay-owner-nsec file
When reading the nsec from a file, strip any trailing newline
characters that would invalidate the nsec string. Use tr -d to
remove all newline characters from the file content before passing
to ngit-grasp.
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/module.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nix/module.nix b/nix/module.nix index d820b67..60b8d5f 100644 --- a/nix/module.nix +++ b/nix/module.nix | |||
| @@ -245,7 +245,8 @@ let | |||
| 245 | # Command to run | 245 | # Command to run |
| 246 | ExecStart = if cfg.relayOwnerNsecFile != null then | 246 | ExecStart = if cfg.relayOwnerNsecFile != null then |
| 247 | # Use nsec from file - need to use shell to read the file | 247 | # Use nsec from file - need to use shell to read the file |
| 248 | "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile})\"'" | 248 | # Use tr to remove trailing newline which would invalidate the nsec |
| 249 | "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile} | tr -d \"\\n\")\"'" | ||
| 249 | else | 250 | else |
| 250 | # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir | 251 | # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir |
| 251 | "${ngit-grasp}/bin/ngit-grasp"; | 252 | "${ngit-grasp}/bin/ngit-grasp"; |