support enabling clightning and lnd simultaneously

Needed for testing.
This commit is contained in:
Erik Arvstedt 2019-11-27 14:04:47 +01:00
parent ad7a519284
commit 10d6b04ac8
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
2 changed files with 9 additions and 11 deletions

View File

@ -103,15 +103,13 @@ in {
# Unfortunately c-lightning doesn't allow setting the permissions of the rpc socket # Unfortunately c-lightning doesn't allow setting the permissions of the rpc socket
# https://github.com/ElementsProject/lightning/issues/1366 # https://github.com/ElementsProject/lightning/issues/1366
security.sudo.configFile = ( security.sudo.configFile =
if config.services.clightning.enable then '' (optionalString config.services.clightning.enable ''
operator ALL=(clightning) NOPASSWD: ALL operator ALL=(clightning) NOPASSWD: ALL
'' '') +
else if config.services.lnd.enable then '' (optionalString config.services.lnd.enable ''
operator ALL=(lnd) NOPASSWD: ALL operator ALL=(lnd) NOPASSWD: ALL
'' '');
else ""
);
# Give root ssh access to the operator account # Give root ssh access to the operator account
systemd.services.copy-root-authorized-keys = { systemd.services.copy-root-authorized-keys = {

View File

@ -4,7 +4,7 @@ set -o pipefail
BITCOIND_ONION="$(cat /var/lib/onion-chef/operator/bitcoind)" BITCOIND_ONION="$(cat /var/lib/onion-chef/operator/bitcoind)"
echo BITCOIND_ONION="$BITCOIND_ONION" echo BITCOIND_ONION="$BITCOIND_ONION"
if [ -x "$(command -v lightning-cli)" ]; then if systemctl is-active --quiet clightning; then
CLIGHTNING_NODEID=$(lightning-cli getinfo | jq -r '.id') CLIGHTNING_NODEID=$(lightning-cli getinfo | jq -r '.id')
CLIGHTNING_ONION="$(cat /var/lib/onion-chef/operator/clightning)" CLIGHTNING_ONION="$(cat /var/lib/onion-chef/operator/clightning)"
CLIGHTNING_ID="$CLIGHTNING_NODEID@$CLIGHTNING_ONION:9735" CLIGHTNING_ID="$CLIGHTNING_NODEID@$CLIGHTNING_ONION:9735"
@ -13,7 +13,7 @@ if [ -x "$(command -v lightning-cli)" ]; then
echo CLIGHTNING_ID="$CLIGHTNING_ID" echo CLIGHTNING_ID="$CLIGHTNING_ID"
fi fi
if [ -x "$(command -v lncli)" ]; then if systemctl is-active --quiet lnd; then
LND_NODEID=$(lncli getinfo | jq -r '.uris[0]') LND_NODEID=$(lncli getinfo | jq -r '.uris[0]')
echo LND_NODEID="$LND_NODEID" echo LND_NODEID="$LND_NODEID"
fi fi