Closed TheRemote closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/wangyihanger/platypus/EurskafRdbbJQ1qt6k1aTeh4pEHR
✅ Preview: https://platypus-git-fork-theremote-master-wangyihanger.vercel.app
So I'm not sure how to make the bot completely recheck the PR but I fixed the issue it found a couple of commits ago here (I chose to leave the API alone and keep it simple / leave that to you in case you want to change how some of it works).
Hello again! I apologize for this being submitted to the main branch but it's a direct fix to the PR I recently submitted. I'll try to get merged into the "dev" branch for future submissions as I noticed some of the other recent ones have been getting pulled into there.
I've been using it further and it turns out if a command gets "stuck" on a Termite client the entire Platypus server gets stuck basically forever. You can still hit Ctrl+C and press "Y" twice to exit but that's about it.
This PR adds a simple go channel timeout and changes the termite DataDispatcher section (the original one is left alone, that seems to have different ways to handle timeouts as the Termite stuff seems more event driven/websocket).
result := client.System(command) <-----Stuck forever if something goes wrong
to this:
The PR also adds the ShellPath configuration option. It's completely optional to have in your config file and will default to /bin/bash if it isn't.
You guys are probably better go programmers than me (I'm just copying your style and trying to stay as consistent as I can, literally never used it before but it's getting to the point where the language hardly matters and they seem to change every few years as to what is popular) so feel free to tweak them. I wasn't sure if there was anything I needed to do with the templates but since a lot of them have a mix of /bin/bash and /bin/sh already the templates are probably fine.
Thanks!