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

Skip to content

feat: Add TURN proxying to enable offline deployments #1000

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 7 commits into from
Apr 18, 2022
Merged

feat: Add TURN proxying to enable offline deployments #1000

merged 7 commits into from
Apr 18, 2022

Conversation

kylecarbs
Copy link
Member

This adds a configuration option for ICEServers when initializing Coder.

TURN proxying cannot be disabled right now, but using the current abstraction clients could force P2P.

@kylecarbs kylecarbs self-assigned this Apr 14, 2022
@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #1000 (1f3f912) into main (e5a1c30) will decrease coverage by 0.32%.
The diff coverage is 71.04%.

@@            Coverage Diff             @@
##             main    #1000      +/-   ##
==========================================
- Coverage   67.44%   67.11%   -0.33%     
==========================================
  Files         259      260       +1     
  Lines       15161    15374     +213     
  Branches      152      152              
==========================================
+ Hits        10225    10318      +93     
- Misses       3910     4003      +93     
- Partials     1026     1053      +27     
Flag Coverage Ξ”
unittest-go-macos-latest 53.68% <71.04%> (+0.01%) ⬆️
unittest-go-postgres- 66.52% <71.04%> (-0.15%) ⬇️
unittest-go-ubuntu-latest 56.39% <71.04%> (+0.12%) ⬆️
unittest-go-windows-2022 53.24% <71.04%> (+0.17%) ⬆️
unittest-js 67.96% <ΓΈ> (ΓΈ)
Impacted Files Coverage Ξ”
coderd/httpmw/workspaceagent.go 47.36% <0.00%> (ΓΈ)
agent/agent.go 64.42% <52.94%> (-0.18%) ⬇️
coderd/workspaceagents.go 59.62% <58.69%> (-0.20%) ⬇️
codersdk/workspaceagents.go 53.04% <60.00%> (+0.44%) ⬆️
cli/start.go 64.00% <75.00%> (+0.30%) ⬆️
coderd/turnconn/turnconn.go 81.91% <81.91%> (ΓΈ)
peerbroker/listen.go 84.03% <87.50%> (-3.47%) ⬇️
cli/agent.go 77.77% <100.00%> (-0.49%) ⬇️
cli/ssh.go 39.37% <100.00%> (-0.94%) ⬇️
coderd/coderd.go 97.29% <100.00%> (+0.05%) ⬆️
... and 13 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 e5a1c30...1f3f912. Read the comment docs.

@kylecarbs kylecarbs force-pushed the turn branch 23 times, most recently from 53b6677 to b081562 Compare April 17, 2022 14:14
@kylecarbs kylecarbs force-pushed the turn branch 4 times, most recently from 180ed3f to 3d1ea08 Compare April 17, 2022 15:25
// for proxying via Coder. We don't proxy all TURN connections,
// because that'd exclude the possibility of a customer using
// their own TURN server.
reservedAddress = "127.0.0.1:12345"
Copy link
Member

Choose a reason for hiding this comment

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

(question): Do we have to hard-code port 12345? Can we just ask for whatever port is free and advertise that port?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll clarify that it doesn't actually use port 12345. This is just used for detection. It'd technically block a customer from using 127.0.0.1:12345 though, which maybe is an issue.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha. If we get to that point, we could maybe just probe a few times or allow specifying this in config.

go.mod Outdated
@@ -17,6 +17,9 @@ replace github.com/chzyer/readline => github.com/kylecarbs/readline v0.0.0-20220
// Required until https://github.com/briandowns/spinner/pull/136 is merged.
replace github.com/briandowns/spinner => github.com/kylecarbs/spinner v1.18.2-0.20220329160715-20702b5af89e

// Required until https://github.com/pion/ice/pull/444 is merged.
replace github.com/pion/ice/v2 => github.com/kylecarbs/ice/v2 v2.1.8-0.20220414143940-b5b2f89c4a4f
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove this! v2.2.4 just got tagged!

Copy link
Member Author

Choose a reason for hiding this comment

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

I shall fix!

@johnstcn
Copy link
Member

πŸŽ‰ Happy 1000th PR πŸŽ‰

@kylecarbs kylecarbs enabled auto-merge (squash) April 18, 2022 22:33
@kylecarbs kylecarbs merged commit d202f20 into main Apr 18, 2022
@kylecarbs kylecarbs deleted the turn branch April 18, 2022 22:40
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