thunderhub icon indicating copy to clipboard operation
thunderhub copied to clipboard

Issues during installation - cannot find macaroon or cert

Open bensig opened this issue 3 years ago • 4 comments

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

  • logs report: 2021-07-01 19:24:50 error [THUB]: No admin.macaroon file found at path: <lndpath>/data/chain/bitcoin/mainnet/ 2021-07-01 19:24:50 error [THUB]: No file found at path: <lndpath>/tls.cert

Your environment

  • Version of ThunderHub: 0.12.20
  • Deployment method: git clone // npm
  • Other relevant environment details: node v14.15.5 on Ubuntu 20.04.2 LTS

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 avatar Jul 01 '21 19:07 bensig

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

bensig avatar Jul 01 '21 19:07 bensig

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

apotdevin avatar Jul 04 '21 16:07 apotdevin

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

bensig avatar Jul 06 '21 03:07 bensig

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

lastcron avatar Aug 20 '21 04:08 lastcron