Fix macaroon permission error by copying with root script
Some checks failed
nix-bitcoin tests / build_test_drivers (push) Has been cancelled
nix-bitcoin tests / check_flake (push) Has been cancelled
nix-bitcoin tests / test_scenario (default) (push) Has been cancelled
nix-bitcoin tests / test_scenario (joinmarket-bitcoind-29) (push) Has been cancelled
nix-bitcoin tests / test_scenario (netns) (push) Has been cancelled
nix-bitcoin tests / test_scenario (netnsRegtest) (push) Has been cancelled
Some checks failed
nix-bitcoin tests / build_test_drivers (push) Has been cancelled
nix-bitcoin tests / check_flake (push) Has been cancelled
nix-bitcoin tests / test_scenario (default) (push) Has been cancelled
nix-bitcoin tests / test_scenario (joinmarket-bitcoind-29) (push) Has been cancelled
nix-bitcoin tests / test_scenario (netns) (push) Has been cancelled
nix-bitcoin tests / test_scenario (netnsRegtest) (push) Has been cancelled
The LND admin macaroon is only readable by the lnd user, not the lnd group. Copy it to the lightning-pub data dir via ExecStartPre root script, matching the pattern used by RTL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dd399773da
commit
966d668f4d
1 changed files with 8 additions and 1 deletions
|
|
@ -198,10 +198,17 @@ in {
|
||||||
WATCHDOG_MAX_DIFF_SATS = toString cfg.watchdogMaxDiffSats;
|
WATCHDOG_MAX_DIFF_SATS = toString cfg.watchdogMaxDiffSats;
|
||||||
LND_ADDRESS = "${lnd.rpcAddress}:${toString lnd.rpcPort}";
|
LND_ADDRESS = "${lnd.rpcAddress}:${toString lnd.rpcPort}";
|
||||||
LND_CERT_PATH = lnd.certPath;
|
LND_CERT_PATH = lnd.certPath;
|
||||||
LND_MACAROON_PATH = "${lnd.networkDir}/admin.macaroon";
|
LND_MACAROON_PATH = "${cfg.dataDir}/admin.macaroon";
|
||||||
} // cfg.extraEnv;
|
} // cfg.extraEnv;
|
||||||
|
|
||||||
serviceConfig = nbLib.defaultHardening // {
|
serviceConfig = nbLib.defaultHardening // {
|
||||||
|
# Copy the admin macaroon (only readable by lnd user, not group)
|
||||||
|
ExecStartPre = [
|
||||||
|
(nbLib.rootScript "lightning-pub-copy-macaroon" ''
|
||||||
|
install --compare -m 640 -o ${cfg.user} -g ${cfg.group} \
|
||||||
|
${lnd.networkDir}/admin.macaroon '${cfg.dataDir}/admin.macaroon'
|
||||||
|
'')
|
||||||
|
];
|
||||||
ExecStart = "${lightningPubEnv} ${pkgs.nodejs_22}/bin/node build/src/index.js";
|
ExecStart = "${lightningPubEnv} ${pkgs.nodejs_22}/bin/node build/src/index.js";
|
||||||
SyslogIdentifier = "lightning-pub";
|
SyslogIdentifier = "lightning-pub";
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue