thunderhub icon indicating copy to clipboard operation
thunderhub copied to clipboard

Starting Thunderhub with start:secure throws an error.

Open pcwd opened this issue 3 years ago • 2 comments

When starting Thunderhub with npm run start:secure I get the error 'Running a secure server can only be done in production'.

Your environment

  • Version of ThunderHub: 0.12.17
  • Deployment method: Ubuntu 20.04 direct install (not docker)
  • Other relevant environment details: LND v0.12.1-beta "build_tags": [ "autopilotrpc", "signrpc", "walletrpc", "chainrpc", "invoicesrpc", "watchtowerrpc"

To Reproduce Steps to reproduce the behaviour:

  1. npm run start:secure

Expected behavior

Request a certificate from ZeroSSL for the given PUBLIC_URL and serve the HTTP challenge via the Certificate Validation server. Once the certificate is verified and issued, Thunderhub downloads the certificate and shuts down the Certificate Validation server. Then it will bring up the Thunderhub web server and use the newly provisioned SSL certificates.

Actual behavior

Tell us what happens instead.

[email protected] start:secure node server/utils/secure-server.js

/home/lightning/thunderhub/server/utils/secure-server.js:12 throw new Error('Running a secure server can only be done in production'); ^

Error: Running a secure server can only be done in production at Object. (/home/lightning/thunderhub/server/utils/secure-server.js:12:9) at Module._compile (node:internal/modules/cjs/loader:1109:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10) at Module.load (node:internal/modules/cjs/loader:989:32) at Function.Module._load (node:internal/modules/cjs/loader:829:14) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17:47

pcwd avatar May 13 '21 01:05 pcwd

Did you find a solution?

emretezel avatar May 14 '21 23:05 emretezel

You need to add NODE_ENV=production so that it runs with production settings. Apart from that, this setup is very specific to the implementation on Voltage so can't help much here

apotdevin avatar May 16 '21 10:05 apotdevin