-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-auth if a new nonce is received #3
base: main
Are you sure you want to change the base?
Conversation
@alexryd could you take a look at this, please? |
Is this project still alive? Many people are waiting for this fix here.... |
This issue persists. @wagnerand you did edit "src/rpc/auth.ts" which doesn't exist in the original code. Does it work if i insert your "auth.ts" in the latest release or do i need to do other adjustments? |
It does exist in the original code, as you can see from the patch view. I edited an existing file, no new files were added. |
Yes it does in node-shellies-ng but you did answer in an issue homebridge-shelly-ng that you fixed it. But the homebridge code doesnt contain the „auth.ts“ file. |
Please see the pull request diff view: https://github.com/alexryd/node-shellies-ng/pull/3/files. |
Sorry, now i get it and found it in the homebridge files. Thank you! |
Have you thought about opening a pull request on one of the active forks of the plugin like homebridge-shelly-ng-ul, homebridge-shelly-ng-infister, homebridge-linusne-shelly-ng or @lukyer/homebridge-shelly-ng, as none of them seem to have included the fix? It would be nice to be able to use the plugin with authentification. |
Gents, is anyone capable to fix this. Or did anyone find another project with this fix included? |
Well, I think for the time being you have 4 options:
For my part, I did the latter. My homebridge is running on my synology NAS, so I ssh-ed into it and updated the source by hand. This is quite dirty, but seemed to be the most viable option. As new versions of the plugin are not to be expected, and if so hopefully with this fix, overwriting of the change should not be a problem. But I see the point that this only works for me and doesn't solve it for the community and is problematic in its nature as I am tempering with my prod-environment, so I am not recommending it. It is just what I thought for me was the best short-time solution. EDIT: Oh, and I checked the other forks beforehand: None is including this fix. |
hi @7baumann, |
@nscheffer Sorry, but it is probably not feasable and/or wise for you to try to fix this by hand, if you do not know how to open a shell on the machine you are running homebridge on as well as update the file by hand. This is specific to your homebridge installation and so for you I think there is only one useful option: Remove the password of your shelly for the time being. Additionally, check if it is possible to block internet access for your shelly on your router. If your network is trustworthy, this might be a viable option. |
@7baumann , I don't set any password on my shelly-ng and they are on their own vlan, but if I am blocking internet access I will loose the Shelly Control, I got more than 60 Shelly devices.... |
First of all: If you don't have a password set for your shellys, this issue shouldn't concern you. The problem occurs only if you are connecting to your shellys with authentification. Nevertheless, I will try to give you and others some hints. Hopefully this sets you on the right path: homebridge plugins are npm packages, running on a nodejs server. Nodejs can execute Javascript, but this plugin is written in Typescript. Therefore, the source code you can find on your machine is a compiled version, you must look for a file called auth.js. This file is part of an npm package called shellies-ng, which is used by the node-shelly-ng plugin. Therefore, when you found your homebridge installation, there should be a Thankfully, there is nothing typescript-specific to the changes of this commit, so you can just copy-paste those new lines from the commit. Be aware that the whole file is typescript-specific, so you cannot overwrite the whole file. Find those lines and edit them by hand. I hope this helps a little. EDIT: Concerning the internet connection: I assumed that you are using homekit to remotly control your shellys, as I do. So no direct internet connection is needed (homekit connects locally in your network to your homebridge and then to your shellys). |
Can you please use a different communication channel? This PR contains more than enough off-topic "spam" already. Thanks! |
hi, |
Fix alexryd/homebridge-shelly-ng#37.
Fix alexryd/homebridge-shelly-ng#53.
Fix alexryd/homebridge-shelly-ng#59.
According to the documentation, auth for websockets should never expire, but it seems it does. This checks if a new nonce was returned by the server. If so, don't fail but re-generate the auth.