Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Send readonly macaroon along with lndconnect urls #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions logic/disk.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ function readLndAdminMacaroon() {
return diskService.readFile(constants.LND_ADMIN_MACAROON_FILE);
}

function readLndReadonlyMacaroon() {
return diskService.readFile(constants.LND_READONLY_MACAROON_FILE);
}

function readUmbrelVersionFile() {
return diskService.readJsonFile(constants.UMBREL_VERSION_FILE);
}
Expand Down
11 changes: 10 additions & 1 deletion logic/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ async function getLndConnectUrls() {
throw new NodeError('Unable to read lnd macaroon file');
}

let macaroonReadonly;
try {
macaroonReadonly = await diskLogic.readLndReadonlyMacaroon();
} catch (error) {
throw new NodeError('Unable to read lnd readonly.macaroon file');
}

let restTorHost;
try {
restTorHost = await diskLogic.readLndRestHiddenService();
Expand Down Expand Up @@ -251,7 +258,9 @@ async function getLndConnectUrls() {
restTor,
restLocal,
grpcTor,
grpcLocal
grpcLocal,
adminMacaroonHex: macaroon.toString('hex'),
readonlyMacaroonHex: macaroonReadonly.toString('hex')
};

}
Expand Down
1 change: 1 addition & 0 deletions utils/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
LND_GRPC_HIDDEN_SERVICE_FILE: process.env.LND_GRPC_HIDDEN_SERVICE_FILE || '/var/lib/tor/lnd-grpc/hostname',
LND_CERT_FILE: process.env.LND_CERT_FILE || '/lnd/tls.cert',
LND_ADMIN_MACAROON_FILE: process.env.LND_ADMIN_MACAROON_FILE || '/lnd/data/chain/bitcoin/mainnet/admin.macaroon',
LND_READONLY_MACAROON_FILE: process.env.LND_READONLY_MACAROON_FILE || '/lnd/data/chain/bitcoin/mainnet/readonly.macaroon',
GITHUB_REPO: process.env.GITHUB_REPO || 'getumbrel/umbrel',
UMBREL_VERSION_FILE: process.env.UMBREL_VERSION_FILE || '/info.json',
UPDATE_STATUS_FILE: process.env.UPDATE_STATUS_FILE || '/statuses/update-status.json',
Expand Down