Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: Use environment variables for agent authentication #1238

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

Merged
merged 3 commits into from
Apr 30, 2022
Merged

Conversation

kylecarbs
Copy link
Member

Using files led to situations where running "coder server --dev" would
break gitssh. This is applicable in a production environment too. Users
should be able to log into another Coder deployment from their workspace.

Users can still set "CODER_URL" if they'd like with agent env vars!

This was a mistake when adding the committer fields 🤦.
@kylecarbs kylecarbs requested review from coadler and code-asher April 30, 2022 02:53
@kylecarbs kylecarbs self-assigned this Apr 30, 2022
Using files led to situations where running "coder server --dev" would
break `gitssh`. This is applicable in a production environment too. Users
should be able to log into another Coder deployment from their workspace.

Users can still set "CODER_URL" if they'd like with agent env vars!
@codecov
Copy link

codecov bot commented Apr 30, 2022

Codecov Report

Merging #1238 (b52d56a) into main (eb60692) will decrease coverage by 0.10%.
The diff coverage is 70.66%.

@@            Coverage Diff             @@
##             main    #1238      +/-   ##
==========================================
- Coverage   65.84%   65.73%   -0.11%     
==========================================
  Files         272      270       -2     
  Lines       17875    17865      -10     
  Branches      192      192              
==========================================
- Hits        11770    11744      -26     
- Misses       4878     4885       +7     
- Partials     1227     1236       +9     
Flag Coverage Δ
unittest-go-macos-latest ?
unittest-go-postgres- 64.77% <69.33%> (+0.06%) ⬆️
unittest-go-ubuntu-latest 55.54% <69.33%> (-0.14%) ⬇️
unittest-go-windows-2022 52.84% <69.33%> (-0.02%) ⬇️
unittest-js 69.96% <ø> (ø)
Impacted Files Coverage Δ
cli/config/file.go 76.47% <ø> (-1.31%) ⬇️
provisionersdk/agent.go 100.00% <ø> (ø)
cli/gitssh.go 43.13% <50.00%> (-1.31%) ⬇️
agent/agent.go 65.62% <65.21%> (-1.47%) ⬇️
cli/agent.go 85.00% <69.23%> (+4.62%) ⬆️
cli/root.go 77.69% <70.00%> (+0.41%) ⬆️
cli/cliflag/cliflag.go 100.00% <100.00%> (ø)
provisioner/terraform/provision.go 70.96% <100.00%> (ø)
cli/cliui/agent.go 77.19% <0.00%> (-5.27%) ⬇️
peer/conn.go 74.68% <0.00%> (-4.97%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb60692...b52d56a. Read the comment docs.

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

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

I have not had a chance to test yet but the code looks great to me

@code-asher
Copy link
Member

code-asher commented Apr 30, 2022

My workspaces are not starting for some reason so I was not able to fully test but I was able to at least confirm that setting CODER_AGENT_URL and CODER_AGENT_TOKEN made the gitssh command work again.

One unexpected struggle I had was that I was running from a v1 workspace where CODER_URL is set making all my commands start failing so something to look out for if anyone is still developing v2 in v1. Sounds to me like that means it is time to migrate to v2 though!

@kylecarbs kylecarbs enabled auto-merge (squash) April 30, 2022 16:35
@kylecarbs kylecarbs merged commit b948f2d into main Apr 30, 2022
@kylecarbs kylecarbs deleted the fixgit branch April 30, 2022 16:40
kylecarbs added a commit that referenced this pull request Jun 10, 2022
* fix: Update GIT_COMMITTER_NAME to use username

This was a mistake when adding the committer fields 🤦.

* fix: Use environment variables for agent authentication

Using files led to situations where running "coder server --dev" would
break `gitssh`. This is applicable in a production environment too. Users
should be able to log into another Coder deployment from their workspace.

Users can still set "CODER_URL" if they'd like with agent env vars!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants