Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

normana10
Copy link
Contributor

(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):
image

With these changes the SSH button now looks like:
Now

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

I wasoriginally 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

@normana10normana10 requested a review froma team as acode ownerJanuary 17, 2023 05:16
@normana10normana10 requested review fromjsjoeio and removed request fora teamJanuary 17, 2023 05:16
@normana10normana10 changed the titleEnable users to download the Coder CLI form the SSH buttonEnable users to download the Coder CLI from the SSH buttonJan 17, 2023
@normana10normana10 changed the titleEnable users to download the Coder CLI from the SSH buttonfeat: Enable users to download the Coder CLI from the SSH buttonJan 17, 2023
@kylecarbs
Copy link
Member

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.

@mafredri
Copy link
Member

@kylecarbs@deansheather I recall there being a limitation with regard to signing the slim binaries in the build process. Was this arcodesign limitation and can we work around it?

So I have an idea but perhaps this can't work for some reason I'm not aware of:

  1. Build slim binary for darwin (like normal)
  2. Sign the binary
  3. Use Go(!) to create a zip (archive/zip) of the darwin binary
  4. Sign and notarize the zip file (+ store xattrs generated on the zip?)
  5. Delete the zip
  6. Zstd compress slim binaries (like normal)
  7. Allow requesting/bin/coder-darwin-arm64.zip which transparently compresses the binary (again, using Go for reproducible bitstream), if needed attach xattrs

Perhaps xattrs aren't needed, in which case that part can be ignored.

kylecarbs reacted with thumbs up emoji

@deansheather
Copy link
Member

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.

@deansheather
Copy link
Member

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:

  • hide theserver command on slim binaries
  • mention slim binary in the version command output
  • replace theserver command with a command that prints an error
Emyrk reacted with thumbs up emoji

@deansheather
Copy link
Member

Ideally though we should just separate the CLI binary from the server binary like I suggested in#3188

@jsjoeio
Copy link
Contributor

Deferring my review to either@kylecarbs@deansheather or@mafredri

@deansheatherdeansheather self-requested a reviewJanuary 17, 2023 16:46
@deansheather
Copy link
Member

I'll review this after I merge#5747

jsjoeio reacted with thumbs up emoji

@deansheatherdeansheather requested review froma team andBrunoQuaresma and removed request fora teamJanuary 17, 2023 20:01
Comment on lines +97 to +99
<ExpandMoreIcon className={styles.linkIcon} />
) : (
<ChevronRightIcon className={styles.linkIcon} />
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Comment on lines +110 to +130
<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>
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
ForMacOS(ARM)
ForMacOS(ARM64)

For Windows (AMD64)
</HelpTooltipLink>
<HelpTooltipLink href="/bin/coder-windows-arm64.exe">
For Windows (ARM)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
ForWindows(ARM)
ForWindows(ARM64)

<HelpTooltipLink href="/bin/coder-linux-arm64">
For Linux (ARM64)
</HelpTooltipLink>
<HelpTooltipLink href="/bin/coder-linux-arm64">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
<HelpTooltipLinkhref="/bin/coder-linux-arm64">
<HelpTooltipLinkhref="/bin/coder-linux-armv7">

@BrunoQuaresma
Copy link
Collaborator

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?

@normana10
Copy link
ContributorAuthor

@BrunoQuaresma

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?)

@BrunoQuaresma
Copy link
Collaborator

@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.

@normana10
Copy link
ContributorAuthor

Awkward becausemy 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 alifesaver in an air-gapped environment. Just an interesting thought)

Emyrk reacted with laugh emoji

@BrunoQuaresma
Copy link
Collaborator

@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.

@mafredri
Copy link
Member

@BrunoQuaresma how about when you click download, a modal is opened (or you're redirected to a page) where we describe:

We recommend downloading the fully-featured vX.X.X [1] release for your platform from GitHub:
[Click here to download from GitHub]

Alternatively, you can download a version of coder without the server functionality from this instance:

  • [coder-darwin-arm64]
  • ...
  • [1] Specifying version here because we should link to the same release the server is running.

(I spent literally 0 time trying to write good text, if this is implemented, do a better job than me. 😄)

@BrunoQuaresma
Copy link
Collaborator

@mafredri this looks good!

@normana10
Copy link
ContributorAuthor

Though hats off to the Coder team, Coder has been a breeze to setup in my air-gapped env and theOffline Deployment Docs arechef's kiss

And I say that having set upa bunch of other software that didn't like to play ball offline

(Back on topic)

I also think so long as it'svery obvious like the button saying "Download CoderCLI" I (as a user) wouldn't have any expectation that the binary I download would be able to run a Coderserver

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:
image

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):
image

(Assuming I apply Dean's changes and revert theSSHButton.tsx back to the way it was)

Thoughts?

Emyrk reacted with heart emoji

@BrunoQuaresma
Copy link
Collaborator

@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.

@mafredri
Copy link
Member

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").

Emyrk and kylecarbs reacted with thumbs up emoji

@BrunoQuaresma
Copy link
Collaborator

@normana10 please, let us know if you need any help/assistance from our side!

@github-actions
Copy link

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.

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelJan 31, 2023
@mafredrimafredri removed the staleThis issue is like stale bread. labelFeb 1, 2023
@github-actions
Copy link

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.

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelFeb 9, 2023
@BrunoQuaresmaBrunoQuaresma removed their request for reviewFebruary 10, 2023 15:37
@github-actionsgithub-actionsbot removed the staleThis issue is like stale bread. labelFeb 11, 2023
@github-actions
Copy link

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.

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelFeb 18, 2023
@github-actionsgithub-actionsbot deleted the ssh-button-coder-cli-download branchMay 17, 2024 00:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@deansheatherdeansheatherdeansheather left review comments

Assignees
No one assigned
Labels
staleThis issue is like stale bread.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

"Download Coder CLI" option
6 participants
@normana10@kylecarbs@mafredri@deansheather@jsjoeio@BrunoQuaresma

[8]ページ先頭

©2009-2025 Movatter.jp