Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.15k stars 557 forks source link

[Bug] "altmessenging": Long URLs are not opening on the remote side #3574

Open jacotec opened 2 years ago

jacotec commented 2 years ago

Hi,

I've tried to add my Jitsi Server as a button as described in #2253 :

      "altmessenging": {
        "name": "Jitsi",
        "url": "https://jitsi.myserver.de/Support-{0}?jwt=eyJhbxxxxx..."
      },

The button appears:

image

But it works only one-way:

My local browser opens the link perfectly. But on the remote side nothing happens. When I click the built-in chat button next to my Jitsi button, all is fine and the browser also opens on the remote side.

What can be wrong? Server is 0.9.76

Ylianst commented 2 years ago

Weird. I just tried it and it worked for me. I used this in the config.json:

"altmessenging": { "name": "Jitsi", "url": "https://meet.jit.si/myserver-{0}" }

Can you try this config and see if that opens the window on the remote side? If so, there must be something about the URL that is not being handled correctly.

jacotec commented 2 years ago

I'll retest straight tomorrow with the "One-liner", but that's just a different syntax.

Other customized links (Nextcloud public links) show the same one-side-only behavior as well.

jacotec commented 2 years ago

@Ylianst It's the length of the URL which kills it. My Jitsi URL with JWT token has a length of 359 characters. A link with this length does not seem to make it to the remote computer.

I'll change the subject of the issue accordingly.

Ylianst commented 2 years ago

Ok, that new information helps a lot! Taking a look now.

Ylianst commented 2 years ago

Indeed, if I go in the agent console and type this, it works:

openurl https://jitsi.myserver.de/Support-{0}-aaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbb

If I type this, it does not work:

openurl https://jitsi.myserver.de/Support-node--EeTThn@HIRVsD23@FKP7ixi4FAELQpccBJHeDixGuKNntFOzx8s5J9Hn5KJdt6N2-aaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbb

Looks like the MeshAgent has a limitation on the URL length. Bryan will need to look into this.

Ylianst commented 2 years ago

Talked with Bryan about this. He has a good idea what is going on and looking at fixing the next agent release to support longer URL's. A server update will not fix this. Hopefully next week when we release the new MeshAgent, we will have the fix included.

krayon007 commented 2 years ago

Ok, so I found the issue and fixed it. Doesn't look like it will need an agent update, it should only require a server update. The bug was how I was creating the task. Previously I was using SCHTASKS, but in order to support UTF8, I was using an environment variable to pass the url, but there is an OS limitation on the max length of that... A while back, I had added COM support into the agent, so I wrote a new module to use that to create tasks... I just modified the meshcore, to try to use that module if its there, and verified that it fixed this issue. That COM module was included in the agent a couple updates ago.

Ylianst commented 2 years ago

Nice! I will be releasing a new version with this update shortly!!