bropat / eufy-security-ws

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

[Bug]: Docker run.sh cannot generate config file with spaces in environment variables #198

Closed patrickli closed 1 year ago

patrickli commented 1 year ago

Version

1.3.2

Node version

v16.19.1

Operating System type

Docker

Operating system version

Container

Describe the bug

Upgraded from 1.3.0 to 1.3.2. Container failed to start with no changes to configuration. The error in Docker log is

jq: error: Assistant/0 is not defined at <top-level>, line 1:

Dug a bit further and it is because I have a space in the TRUSTED_DEVICE_NAME environment variable. The resulting jq command in run.sh is like the following:

jq -n --arg username user@email.com --arg password 'mypassword' --arg country NZ --arg trusted_device_name Home Assistant --arg accept_invitations true '{
    username: $username,
    password: $password,
    persistentDir: "/data",
    country: $country,

    trustedDeviceName: $trusted_device_name,
    acceptInvitations: $accept_invitations,

  }'

The word Home Assistant is not quoted so jq failed to generate the config file.

I tried to fix it but my bash skill is limited.

To reproduce

See description.

Screenshots & Logfiles

No response

Additional context

No response

bropat commented 1 year ago

Fixed in version 1.3.3. To be published now.