SSH connection fails with empty webhook environment variables #3051
-
In the Lines 76 to 79 in ca2f81e Lines 15 to 17 in ca2f81e It seems that these are used to awake the device agent via webhook before making an SSH remote connection to the shellhub's SSH server. However, in the example code, all of these are left blank. If executed with these blank values, it causes a panic during the SSH connection operation.
I'm questioning whether a webhook is really necessary before an SSH remote connection. Moreover, there's no way to optionally bypass this webhook call. This has been causing me difficulties. I suspect there might be a bug in the codebase. shellhub/ssh/server/handler/ssh.go Lines 97 to 110 in ca2f81e shellhub/pkg/api/webhook/webhook.go Lines 46 to 48 in ca2f81e I'd appreciate an explanation on this.
There's no explanation about this in the documentation. I'm doubting if the community code is really executable. I sincerely hope for some assistance. Thank you. Repro (Go Playground)Related |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I found that by entering |
Beta Was this translation helpful? Give feedback.
-
Correct.
No, a webhook is not really necessary, and yes, there's a way to disable it.
This feature was originally designed for a specific use case within the ShellHub Enterprise Edition. That's why it wasn't included in the documentation.
The community edition is indeed fully functional within the environment it was designed for, which is Docker Compose. It seems that you might be attempting to deploy the containers on Kubernetes, which can indeed be challenging. However, it's worth noting that we do not support this functionality in the community edition. This limitation exists because Kubernetes deployment is often associated with enterprise-level usage, for which we offer the ShellHub Cloud and Enterprise editions. However, we are committed to providing clarity the questions you've raised. |
Beta Was this translation helpful? Give feedback.
-
There's an unexpected behavior in the package we utilize to read environment variables (https://github.com/kelseyhightower/envconfig). In this package, a non-existing variable is treated differently from a variable with a empty value. This behavior might not align with the common assumption that empty values and non-existing variables should have the same effect. To bypass the webhook, you need to define a empty value for the |
Beta Was this translation helpful? Give feedback.
There's an unexpected behavior in the package we utilize to read environment variables (https://github.com/kelseyhightower/envconfig). In this package, a non-existing variable is treated differently from a variable with a empty value. This behavior might not align with the common assumption that empty values and non-existing variables should have the same effect.
To bypass the webhook, you need to define a empty value for the
WEBHOOK_ *
variables.