Make bundled tsh available outside of Connect#1445
Conversation
| # Is TSH_SYMLINK_TARGET a link that points at a file which doesn't exist? | ||
| if [ -L "$TSH_SYMLINK_TARGET" ] && [ ! -e "$TSH_SYMLINK_TARGET" ]; then | ||
| rm -f "$TSH_SYMLINK_TARGET" | ||
| fi |
There was a problem hiding this comment.
The RFD says:
If Connect decides not to create or remove the symlink, it should echo a message explaining the reason.
Here I've decided to not echo a message if Connect doesn't remove the symlink. Idk, it doesn't seem like a necessary thing to me and we already emit a message regarding symlinks during installation.
I'm not even sure if I should emit a message during an upgrade. But I wanted to be able to tell what happened if someone sends logs from an upgrade. OTOH I don't think Linux packages echo stuff from within those scripts?
| OLD_SYMLINK=/usr/bin/teleport-connect | ||
| if [ -e "$OLD_SYMLINK" ]; then | ||
| rm $OLD_SYMLINK | ||
| fi |
There was a problem hiding this comment.
I changed the location from /usr/bin to /usr/local/bin since this is where our teleport package places the binaries as well.
0aecec5 to
c18d2d2
Compare
| # Create $BIN if it doesn't exist. | ||
| [ ! -d "$BIN" ] && mkdir -p "$BIN" |
There was a problem hiding this comment.
Here I'm just following what tsh.pkg does already.
|
I have no experience with scripts, but the code looks pro :) |
|
This looks great! I'm excited for this. |
|
I just promoted |
|
Just to make sure: should I see the following message if I remove Connect on Fedora? I tested the app also on Ubuntu and Windows, everything works fine! |
I think that's correct because the shell within which you removed tsh still had tsh resolved to /usr/local/bin/tsh but now that file is gone. If you open a new shell and try to run |
Ah, right |
|
Working great on win 10/11 |
It turns out you need that for deb packages too.
526ece2 to
324a842
Compare
This makes it easier to tell when one suggestion ends and another starts.
* Rename assets to build_resources * Add resources\bin to Path during installation on Windows * Adjust docs related to USE_SYSTEM_FPM It turns out you need that for deb packages too. * Create symlink to bundled tsh on Linux targets * after-install: Get rid of old symlink removal * Expand story for QuickInput * Make command suggestions stay in place * Align suggestion icons to the top rather than center This makes it easier to tell when one suggestion ends and another starts. * Add install & uninstall cmds to command bar * Exclude new commands from OSes other than macOS * Implement commands for symlinking tsh
This PR implements RFD 99 (gravitational/teleport#19284).
TODO:
I'm yet to add macOS support but I figured I'll submit the other changes for review already and then submit the macOS ones as another PR to this PR. macOS support will involve more changes in the application code.
So far there wasn't any substantial changes compared to the RFD but I'll add comments under some of the minor differences.
On Windows I ended up just adding a path to an env var, as I mentioned in the RFD. On Linux, I had to copy the install/uninstall scripts as there's no way to extend the default ones.