Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Auth, wallet unlock separation, container updates #12

Merged
merged 7 commits into from
May 28, 2020

Conversation

mayankchhabra
Copy link
Member

@mayankchhabra mayankchhabra commented May 21, 2020

Changlog

  • Remove lnd-unlock container
  • Add umbrel-manager container
  • Create directory structure for umbrel-manager
  • Add umbrel-dashboard container
  • Update Nginx configuration w.r.t umbrel-manager and umbrel-dashboard

Should be merged after:

Should be tested with:

  • getumbrel/umbrel-manager:v0.1.0.3
  • getumbrel/umbrel-middleware:v0.1.0.5
  • getumbrel/umbrel-dashboard:v0.2.0.3

Closes lncm#9, resolves lncm#10 and fixes lncm#11.

@nolim1t
Copy link

nolim1t commented May 21, 2020

is this ready to be tested?

@nolim1t
Copy link

nolim1t commented May 21, 2020

or do we need to release the other versions

Copy link

@nolim1t nolim1t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mayankchhabra
Copy link
Member Author

Not yet, just finishing up other containers. I'll update docker-compose.yml with test versions w.x.y.z for testing once all of them are up

@mayankchhabra
Copy link
Member Author

mayankchhabra commented May 21, 2020

Ok we're ready to test! I've updated docker-compose.yml with the latest w.x.y.z images and will revert back to x.y.z releases after we test it out.

Deployed on https://testnet.getumbrel.com and no issues so far. I'll try it on my hardware node too.

Side note: If you're going to test on an existing umbrel node, don't forget to remove the existing lnd wallet because umbrel-manager will set up a new wallet.

@nolim1t
Copy link

nolim1t commented May 22, 2020

I get "Unknown authentication strategy \"jwt\""

@nolim1t
Copy link

nolim1t commented May 22, 2020

versions

CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS               NAMES
24253f01f7a8        getumbrel/middleware:v0.1.0.4       "docker-entrypoint.s…"   3 hours ago         Up 2 minutes                            umbrel_middleware_1
a01dcacbdfde        lncm/lnd:v0.9.2-root-experimental   "lnd"                    3 hours ago         Up 14 minutes                           umbrel_lnd_1
673c097af1c3        getumbrel/dashboard:v0.2.0.3        "docker-entrypoint.s…"   3 hours ago         Up 14 minutes                           umbrel_dashboard_1
2d81272cc9dd        lncm/bitcoind:v0.19.1               "bitcoind -zmqpubraw…"   3 hours ago         Up 9 minutes                            umbrel_bitcoin_1
7580652ff0c7        nginx:1.17.10                       "nginx -g 'daemon of…"   3 hours ago         Up 10 minutes                           umbrel_web_1
92d86f6e3332        getumbrel/manager:v0.1.0.3          "docker-entrypoint.s…"   3 hours ago         Up 14 minutes                           umbrel_manager_1

@nolim1t
Copy link

nolim1t commented May 22, 2020

in your docker-compose file you have image: getumbrel/dashboard:v0.2.0.3 defined which I used however the original PR says test with getumbrel/umbrel-dashboard:v0.2.0.2

@nolim1t
Copy link

nolim1t commented May 22, 2020

getumbrel/umbrel-dashboard:v0.2.0.2 also doesnt work

@mayankchhabra
Copy link
Member Author

mayankchhabra commented May 22, 2020

"Unknown authentication strategy "jwt""

Which container throws that error?

Updated PR comment, should be tested with getumbrel/umbrel-dashboard:v0.2.0.3

@nolim1t
Copy link

nolim1t commented May 23, 2020

"Unknown authentication strategy "jwt""

Which container throws that error?

Error from browser.. but most likely dashboard container

@nolim1t
Copy link

nolim1t commented May 24, 2020

Logfile trace from middleware logs after trying to log in

Error: Unknown authentication strategy "jwt"
    at attempt (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:190:39)
    at authenticate (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:367:7)
    at jwt (/usr/src/app/middlewares/auth.js:47:5)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)

Screenshot from dashboard (private browsing window)

screenshot

@nolim1t
Copy link

nolim1t commented May 24, 2020

Ok i think I found the issue. I'll retry again

@nolim1t
Copy link

nolim1t commented May 24, 2020

/v1/lnd/wallet/unlock
NodeError: Invalid JWT
    at /usr/src/app/middlewares/auth.js:38:19
    at allFailed (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:107:18)
    at attempt (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:180:28)
    at JwtStrategy.strategy.fail (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:302:9)
    at /usr/src/app/node_modules/passport-jwt/lib/strategy.js:106:33
    at /usr/src/app/node_modules/jsonwebtoken/verify.js:133:14
    at getSecret (/usr/src/app/node_modules/jsonwebtoken/verify.js:90:14)
    at Object.module.exports [as verify] (/usr/src/app/node_modules/jsonwebtoken/verify.js:94:10)
    at Function.module.exports [as JwtVerifier] (/usr/src/app/node_modules/passport-jwt/lib/verify_jwt.js:4:16)
    at /usr/src/app/node_modules/passport-jwt/lib/strategy.js:104:25

@nolim1t
Copy link

nolim1t commented May 24, 2020

Ok it seems to be working but have to restart the middleware container every time docker is restarted, which isn't really ideal

@nolim1t
Copy link

nolim1t commented May 24, 2020

Some changes to the middleware container might be needed

getumbrel/umbrel-middleware#20 (comment)

We will also need to add some HTTP libraries for it to query the manager container

@nolim1t
Copy link

nolim1t commented May 24, 2020

Pushed a tag with a command we can use in getumbrel/middleware:v0.1.0.5

@nolim1t
Copy link

nolim1t commented May 24, 2020

Update the docker-compose file with

        middleware:
                image: "getumbrel/middleware:v0.1.0.5"
                command: ["./wait-for-node-manager.sh", "localhost", "npm", "start"]

and this should fix any issues

@mayankchhabra
Copy link
Member Author

mayankchhabra commented May 24, 2020

Great! If you haven't encountered any other issues, then we're ready to merge getumbrel/umbrel-manager#1 and release umbrel-manager 0.1.0.

After that, we can merge getumbrel/umbrel-middleware#21 and release umbrel-middleware 0.1.0.

Then we can proceed to merge getumbrel/umbrel-dashboard#60 and release umbrel-dashboard 0.2.0.

And then finally we'll be ready to merge this current PR #12 lol! 😅

@mayankchhabra mayankchhabra marked this pull request as ready for review May 27, 2020 12:00
@mayankchhabra
Copy link
Member Author

mayankchhabra commented May 27, 2020

Released

  • umbrel-manager v0.1.0
  • umbrel-middleware v0.1.0
  • umbrel-dashboard v0.2.0

Also deployed the new containers on testnet and everything looks OK.

@nolim1t can you also please test them? If all's OK, we're ready to merge 🚀

@nolim1t
Copy link

nolim1t commented May 28, 2020

LGTM.. installed on my umbrel box

@mayankchhabra
Copy link
Member Author

Ready to rock and roll! We should probably tag this as a v0.1.0 release for umbrel-compose too. What do you think?

@mayankchhabra mayankchhabra merged commit 8aa86ba into getumbrel:master May 28, 2020
@mayankchhabra mayankchhabra deleted the auth branch May 28, 2020 11:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add umbrel-manager service Create database directories for umbrel-manager Remove lnd-unlock service
2 participants