onion-addresses: mirror nix-bitcoin.onionAddresses.access behavior

This commit fixes an issue with LND, in which if both
nix-bitcoin.onionServices.lnd.public &
services.lnd.restOnionService.enable were enabled, one would try to
create a file named `lnd` and the other would try to create a directory
named `lnd` with a file named `lnd-rest` inside it. This would obiously
cause an error and fail the LND service.
This commit is contained in:
nixbitcoin
2021-02-17 11:50:47 +00:00
parent e873326bfe
commit ecc601a6d6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ in {
${concatMapStrings (service: '' ${concatMapStrings (service: ''
onionFile=/var/lib/tor/onion/${service}/hostname onionFile=/var/lib/tor/onion/${service}/hostname
if [[ -e $onionFile ]]; then if [[ -e $onionFile ]]; then
install -o ${config.systemd.services.${service}.serviceConfig.User} -m 400 $onionFile ${service} install -D -o ${config.systemd.services.${service}.serviceConfig.User} -m 400 $onionFile services/${service}
fi fi
'') cfg.services} '') cfg.services}
''; '';
+1 -1
View File
@@ -94,7 +94,7 @@ in {
in srv.public && srv.enable in srv.public && srv.enable
) services; ) services;
in genAttrs publicServices' (service: { in genAttrs publicServices' (service: {
getPublicAddressCmd = "cat ${config.nix-bitcoin.onionAddresses.dataDir}/${service}"; getPublicAddressCmd = "cat ${config.nix-bitcoin.onionAddresses.dataDir}/services/${service}";
}); });
} }