apotdevin / thunderhub

ThunderHub LND Lightning Node Manager in your Browser
https://www.thunderhub.io/
MIT License
418 stars 89 forks source link

Issues during installation - cannot find macaroon or cert #290

Open bensig opened 3 years ago

bensig commented 3 years ago

Describe the problem/bug

Pointed .env SSO to the LND directory - files are there and permissions appear to be ok, but THUB cannot find them

Your environment

To Reproduce Steps to reproduce the behavior:

  1. install on Ubuntu 20.04.2 LTS following GH instructions: npm install && npm run build && npm start -- -p 4000
  2. add lnd paths to .env SSO section

Expected behavior Expected to find files that exist

Actual behavior THUB reports that files do not exist

bensig commented 3 years ago

Contents of .env

# -----------
# SSO Account Configs
# -----------
SSO_SERVER_URL = '127.0.0.1:10009'; # i.e. '127.0.0.1:10009'
SSO_CERT_PATH = '<lndpath>/tls.cert'; # i.e. '\lnd\alice\tls.cert'
SSO_MACAROON_PATH = '<lndpath>/data/chain/bitcoin/mainnet/'; # i.e. '\lnd\alice\data\chain\bitcoin\regtest\'
DANGEROUS_NO_SSO_AUTH = 'true' # Default: false
apotdevin commented 3 years ago

Why do you add <lndpath>? Try specifying the complete path

bensig commented 3 years ago

I don't actually add that to my config.

I switched to a .env.local which looks like this

ACCOUNT_CONFIG_PATH = '/home/username/src/thunderhub/thubConfig.yaml'; # i.e. '/data/thubConfig.yaml'
LOG_LEVEL = 'error' | 'warn' | 'info' | 'http' | 'verbose' | 'debug' | 'silly' # Default: 'info'
THEME = 'dark' | 'light' | 'night' # Default: 'dark'
CURRENCY = 'sat' | 'btc' | 'fiat' # Default: 'sat'
FETCH_PRICES = true | false # Default: true
FETCH_FEES = true | false # Default: true
DISABLE_LINKS = true | false # Default: false
DISABLE_LNMARKETS = true | false # Default: false
NO_VERSION_CHECK = true | false # Default: false

thubConfig.yaml

masterPassword: 'mypass' # Default password unless defined in account
accounts:
  - name: 'username'
    serverUrl: '127.0.0.1:10009'
    lndDir: '/home/username/.lnd/'
    macaroonPath: '/home/username/.lnd/data/chain/bitcoin/mainnet/admin.macaroon'
    certificatePath: '/home/username/.lnd/tls.cert'

Then I am starting with npm start -- -p 4000

When I go to localhost:4000 I am getting this error image

lastcron commented 3 years ago

This line: lndDir: '/home/username/.lnd/' ... tells thunderhub to go and find the tls.cert and the admin.macaroon file from the default route that lnd uses. the macaroonPath and certificatePath are no longer needed.

Make sure the files exist in the default location