-
Notifications
You must be signed in to change notification settings - Fork 883
feat: Enable users to download the Coder CLI from the SSH button #5738
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
Conversation
It's a bit odd because these binaries are different than what you get from our releases. These binaries don't embed the site (which isn't a biggie), but more importantly, aren't signed. This is particularly terrible for macOS users, who will get a warning that pops up essentially claiming this is a virus. |
@kylecarbs @deansheather I recall there being a limitation with regard to signing the slim binaries in the build process. Was this a So I have an idea but perhaps this can't work for some reason I'm not aware of:
Perhaps xattrs aren't needed, in which case that part can be ignored. |
That sounds pretty complicated. We should just link to the GitHub release page instead and hide this link if it's a dev build. Users shouldn't be using the binaries we include in the server as they are not fully featured. |
I've read your linked issue and agree that this is a good usecase for this, but I don't think this should be merged without changes to slim binaries to differentiate them from full server binaries. I will open a PR today to:
|
Ideally though we should just separate the CLI binary from the server binary like I suggested in #3188 |
Deferring my review to either @kylecarbs @deansheather or @mafredri |
I'll review this after I merge #5747 |
<ExpandMoreIcon className={styles.linkIcon} /> | ||
) : ( | ||
<ChevronRightIcon className={styles.linkIcon} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good, but I think maybe it should open a popup or something instead with some more details as to how to install the CLI. We should recommend GitHub releases by default, and only recommend this for airgapped users.
We also have other ways of installing Coder like the install script, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<HelpTooltipLink href="/bin/coder-windows-amd64.exe"> | ||
For Windows (AMD64) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-windows-arm64.exe"> | ||
For Windows (ARM) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-darwin-amd64"> | ||
For Mac OS (Intel) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-darwin-arm64"> | ||
For Mac OS (ARM) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-linux-amd64"> | ||
For Linux (AMD64) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-linux-arm64"> | ||
For Linux (ARM64) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-linux-arm64"> | ||
For Linux (ARMv7) | ||
</HelpTooltipLink> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should come from some typed constant array like:
interface CoderSlimBin {
os: "windows" | "linux" | "darwin"
arch: "amd64" | "arm64" | "armv7"
}
const SlimBins: CoderSlimBin[] = [
...
]
Then use a function to generate the filename and the text.
For Mac OS (Intel) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-darwin-arm64"> | ||
For Mac OS (ARM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Mac OS (ARM) | |
For Mac OS (ARM64) |
For Windows (AMD64) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-windows-arm64.exe"> | ||
For Windows (ARM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Windows (ARM) | |
For Windows (ARM64) |
<HelpTooltipLink href="/bin/coder-linux-arm64"> | ||
For Linux (ARM64) | ||
</HelpTooltipLink> | ||
<HelpTooltipLink href="/bin/coder-linux-arm64"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<HelpTooltipLink href="/bin/coder-linux-arm64"> | |
<HelpTooltipLink href="/bin/coder-linux-armv7"> |
I liked the idea, but maybe, we could simplify it by adding a "Download" menu item in the User Dropdown Menu at the topbar and the download menu item redirect the user to the GitHub releases page. Thoughts? |
A link in the user dropdown menu makes sense to me Any preferences in how I determine whether we're in an airgapped environment? (With the goal of linking to the current page that "Install Coder CLI" does if not airgapped and linking to the binaries directly if airgapped?) |
@normana10 I think we don't have a way for that rn, so I think you can just ignore the air-gapped network use case for now since other parts of the app rely on the user having network access like the documentation links. But I appreciate your concern. |
Awkward because my use-case is the air-gapped use-case I can throw a flag/environment variable into the backend if we think that is a decent solution? (As a side note, GitLab having offline/air-gapped docs hosted locally is sometimes a lifesaver in an air-gapped environment. Just an interesting thought) |
@normana10 that is good to know. We have an open issue to offline docs #5466. I think we can use an option as we do for the other deployment settings. |
@BrunoQuaresma how about when you click download, a modal is opened (or you're redirected to a page) where we describe:
(I spent literally 0 time trying to write good text, if this is implemented, do a better job than me. 😄) |
@mafredri this looks good! |
Though hats off to the Coder team, Coder has been a breeze to setup in my air-gapped env and the Offline Deployment Docs are chef's kiss And I say that having set up a bunch of other software that didn't like to play ball offline (Back on topic) I also think so long as it's very obvious like the button saying "Download Coder CLI" I (as a user) wouldn't have any expectation that the binary I download would be able to run a Coder server My main goal is just easing new devs into getting port forwarding setup so they can VNC using a client like TigerVNC (NoVNC doesn't serve the use-case well enough due to the cumbersome copy/pasting) Do we think something like this: Where "Download Coder Server" links to the GitHub release for the corresponding version and "Coder CLI" opens something like this (where we allow you to download the bundled binary): (Assuming I apply Dean's changes and revert the Thoughts? |
@normana10 it is looking good! I would make a few changes to make it look a tiny better like using a single button with a Download icon and opening a dialog/modal as @mafredri suggested here #5738 (comment). I think with the dialog we can explain better why to use from an instance or from Git Hub. As a user, I would question why downloading the server doesn't show the OS list as the download CLI does. |
Thanks for thinking about this @normana10 and coming up with new ideas. One issue with having a "download server" and "download CLI" is that we're currently not promoting the use of the non-GitHub release binary and we don't have a game-plan for how we wish to do it. Internally we're calling it slim (non-GitHub) and fat (GitHub) binary, but it's more like slim and normal. We'd prefer for the GitHub release to be used and calling it "server" is kind of misleading and directs people towards using slim binary instead (because of "oh I don't want the server"). |
@normana10 please, let us know if you need any help/assistance from our side! |
This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity. |
This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity. |
This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity. |
(Copied my use-case from: #5722)
I work with Coder in an offline environment, so when I noticed that the Coder agent downloads the CLI binary from https://<CODER_ACCESS_URL>/bin/coder-linux-amd64 I was ecstatic because I didn't need to import that to my offline environment separately or jump through hoops to extract the binary out of the Docker image and then host it somewhere for new devs to download
Though my first thought was why this was never displayed anywhere in the UI?
I know there's a "Install Coder CLI" line when you click on "SSH" in a workspace, which directs you off to the internet (which I don't have offline)
In this PR I change the "Download Coder CLI" link on the "SSH" button to just link to the locally hosted binaries
Currently looks like (before changes, for context):

With these changes the SSH button now looks like:

Clicking on the "Download Coder CLI" link expands it to look like:

I was originally going to try and do some browser OS/Arch detection and just download the correct binary, but after a bit of reading I couldn't find a good solution to reliably detect OS/Arch so I thought I may as well display all the binaries 🤷♂️
Closes #5722