bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
185 stars 30 forks source link

Docker issues #20

Closed zormond closed 3 years ago

zormond commented 3 years ago

I'm trying to run this in docker. I've tried just docker and docker-compose with the same result.

Sorry if I'm doing something obviously wrong. Thanks in advance. Let me know if I can provide any other details.

I'll run something like this: docker run -e USERNAME="username" -e PASSWORD="password" -v "/data:/data" -p "3000:3000" bropat/eufy-security-ws:latest

and I get invalid credentials everytime

2021-08-14 23:39:39.948  INFO Eufy Security server listening on port 3000
2021-08-14 23:39:40.818  ERROR Response code not ok
{
  code: 26006,
  msg: 'Email address or password incorrect.'
}
2021-08-14 23:39:40.832  ERROR Token error

What's interesting is that if I use the library straight like this:

eufy-security-server

I don't get an authentication error but something else.

2021-08-14 23:44:49.456  INFO Eufy Security server listening on port 3000
2021-08-14 23:44:55.041  ERROR Station T8510Q10202703D0 - Response code not ok
{
  code: 20028,
  msg: 'Failed to request.'
}
buffer.js:207
    throw new ERR_INVALID_ARG_TYPE(
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
    at Function.from (buffer.js:207:11)
    at stringWithLength (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:23:35)
    at p2pDidToBuffer (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:32:18)
    at Object.buildLookupWithKeyPayload (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:36:26)
    at P2PClientProtocol.lookupByAddress (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:188:33)
    at cloudAddresses.map (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:172:51)
    at Array.map (<anonymous>)
    at P2PClientProtocol.lookup (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:172:29)
    at Socket.socket.bind (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:247:26)
    at Object.onceWrapper (events.js:286:20)

I know that it is getting past authentication in this case because if I change the password in my config.json file, then I get this result:

eufy-security-server
2021-08-14 23:46:41.568  INFO Authentication properties changed, invalidate saved cloud token.
2021-08-14 23:46:41.701  INFO Eufy Security server listening on port 3000
2021-08-14 23:46:42.505  ERROR Response code not ok
{
  code: 26006,
  msg: 'Email address or password incorrect.'
}
2021-08-14 23:46:42.532  ERROR Token error
aymeric106 commented 3 years ago

here's my docker compose, if it's helping ...

services: eufy-security-ws: image: bropat/eufy-security-ws:latest environment:

  • TZ=Europe/Paris
  • USERNAME=eufyaccount
  • PASSWORD=eufypassword! ports:
  • "3000:3000" volumes:
  • /root/eufy/data:/data restart: always
zormond commented 3 years ago

Thanks! I figured my issue was that I had an & in my password.

That all being said, I'm still get this error once past authentication:

2021-08-14 23:44:49.456  INFO Eufy Security server listening on port 3000
2021-08-14 23:44:55.041  ERROR Station T8510Q10202703D0 - Response code not ok
{
  code: 20028,
  msg: 'Failed to request.'
}
buffer.js:207
    throw new ERR_INVALID_ARG_TYPE(
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
    at Function.from (buffer.js:207:11)
    at stringWithLength (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:23:35)
    at p2pDidToBuffer (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:32:18)
    at Object.buildLookupWithKeyPayload (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:36:26)
    at P2PClientProtocol.lookupByAddress (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:188:33)
    at cloudAddresses.map (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:172:51)
    at Array.map (<anonymous>)
    at P2PClientProtocol.lookup (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:172:29)
    at Socket.socket.bind (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:247:26)
    at Object.onceWrapper (events.js:286:20)
zormond commented 3 years ago

Seems to be an issue with trying to get the dsk keys for a door lock that is blue tooth only. Going to close this and open an issue in the eufy-security-client project