gismo141 / homebridge-server

Server plugin for homebridge
https://gismo141.github.io/configure-your-homebridge-2/
152 stars 20 forks source link

Crash on Backup #18

Closed Fonta closed 7 years ago

Fonta commented 7 years ago

As soon as i click the Backup option it crashes the site. All other options work. http://i.imgur.com/3eSmrkI.png

Maybe this error which I got by email has something to do with it? raspberrypi : Dec 31 02:25:10 : homebridge : user NOT in sudoers ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/reboot

Here's my config.json: http://i.imgur.com/eLvkBN8.png

Also one more small thing: you might want to include jquery because bootstrap needs it: http://i.imgur.com/XS4Epmz.png

Fonta commented 7 years ago

This explains a little bit i guess: http://i.imgur.com/tNhZHM1.png My config file is located at /var/homebridge/config.json

gismo141 commented 7 years ago

Oh yes, I thinks I know the problem.

It seems I've forgotten one line when I changed the way of using the config-file - I'll push an update asap!

Fonta commented 7 years ago

Thanks in advance! 👍

johnypony3 commented 7 years ago

Can confirm this issue, here's the log. Thank you for this awesome plugin.

├─┬ homebridge-server@1.0.19 │ └─┬ homebridge@0.4.16

/usr/local/lib/node_modules/homebridge-server/index.js:315 fs.writeFile(configPath + '/config.json.bak', newConfig, "utf8", function(err, data) { ^ ReferenceError: configPath is not defined at saveConfig (/usr/local/lib/node_modules/homebridge-server/index.js:315:26) at Server.handleRequest (/usr/local/lib/node_modules/homebridge-server/index.js:430:17) at emitTwo (events.js:106:13) at Server.emit (events.js:191:7) at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:547:12) at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)

@f0nt4: i would suggest that for text based postings, you do not use images, because sometimes they contain terms that the dev might need to search for and it would be helpful to have the ability of copying text. furthermore, there are better ways of posting images where they will come up in the request/post. im not knocking you, you def provided all the proper data, these are just observations/suggestions

gismo141 commented 7 years ago

Sorry for the late fix - it should work now without crashing :) If not, just reopen that issue.

Fonta commented 7 years ago

1.0.20 is the version with the fix. I just gave the following command and it updated. sudo npm install -g homebridge-server --unsafe-perm

johnypony3 commented 7 years ago

Confirmed, this fixes the issue. Thanks @gismo141 My earlier comment was due to latency on npmjs.com's site, it did not update to .20 until i posted here.

Fonta commented 7 years ago

Nice! Indeed thanks @gismo141 for the fix!

gismo141 commented 7 years ago

Thanks @f0nt4 and @johnypony3 for the feedback!

johnypony3 commented 7 years ago

@f0nt4 re: missing jquery pull request made, follow here: https://github.com/gismo141/homebridge-server/pull/19