Commit graph

2694 commits

Author SHA1 Message Date
Juan Font
faa75f97ba Fix options signature 2022-11-28 16:28:14 +00:00
Juan Font
70611746cb Merge branch 'main' into rerouting 2022-11-28 16:13:37 +00:00
Juan Font
7d4fbe65ea Port routing CLI to v2 2022-11-28 15:54:23 +00:00
Juan Font
dd48d09812 Merge branch 'rerouting' of https://github.com/juanfont/headscale into rerouting 2022-11-26 11:06:23 +00:00
Kristoffer Dalby
eb072a1a74 mark some changes as more important
Signed-off-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-11-26 12:01:12 +01:00
Kristoffer Dalby
36b8862e7c Add notes about current ssh status
Signed-off-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-11-26 11:53:31 +01:00
Even Holthe
d4e3bf184b Add experimental flag to unit test 2022-11-26 11:53:31 +01:00
Even Holthe
c28ca27133 Add SSH ACL to changelog 2022-11-26 11:53:31 +01:00
Kristoffer Dalby
c02e105065 Mark the flag properly experimental
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
22da5bfc1d Enable SSH for tests
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
c6d31747f7 Add feature flag for SSH, and warning
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
91ed6e2197 Allow WithEnv to be passed multiple times
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
d71aef3b98 Mark all tests with Parallel
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
8a79c2e7ed Do not retry on permission denied in ssh
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
f34e7c341b Strip newline from hostname
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
e28d308796 Add negative tests
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Even Holthe
f610be632e SSH: add test between namespaces 2022-11-26 11:53:31 +01:00
Even Holthe
fd6d25b5c1 SSH: Lint and typos 2022-11-26 11:53:31 +01:00
Kristoffer Dalby
3695284286 Make simple initial test case
This commit makes the initial SSH test a bit simpler:

- Use the same pattern/functions for all clients as other tests
- Only test within _one_ namespace/user to confirm the base case
- Use retry function, same as taildrop, there is some funky going on
  there...

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
cfaa36e51a Add method to expose container id
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Kristoffer Dalby
d207c30949 Ensure we have ssh in container
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-11-26 11:53:31 +01:00
Even Holthe
519f22f9bf SSH integration test setup 2022-11-26 11:53:31 +01:00
Even Holthe
52a323b90d Add SSH capability advertisement
Advertises the SSH capability, and parses the SSH ACLs to pass to the
tailscale client. Doesn’t support ‘autogroup’ ACL functionality.

Co-authored-by: Daniel Brooks <db48x@headline.com>
2022-11-26 11:53:31 +01:00
Juan Font
a9e2179b9f Remove magic number (base10...) 2022-11-26 11:21:25 +01:00
Juan Font
b49e46a4c3 Remove unused function 2022-11-26 11:21:25 +01:00
Juan Font
635027038f Use new routes API in CLI 2022-11-26 11:21:25 +01:00
Juan Font
fad43760ef Refactored route grpc glue code 2022-11-26 11:21:25 +01:00
Juan Font
68d2eaaaa6 Update swagger 2022-11-26 11:21:25 +01:00
Juan Font
cd2d2ef7e5 Updated generated pb code 2022-11-26 11:21:25 +01:00
Juan Font
1ce3d95d95 Updated protos with new routes API 2022-11-26 11:21:25 +01:00
Juan Font
20d599ae34 Add more logging 2022-11-26 11:21:25 +01:00
Juan Font
347d4d0ca5 Add support methods for the API 2022-11-26 11:21:25 +01:00
Juan Font
1d9cd88053 Remove method no longer used 2022-11-26 11:21:25 +01:00
Juan Font
37a031d13e Another bunch of gosec/golint related fixes 2022-11-26 11:21:25 +01:00
Juan Font
b5f1ae3d90 A big bunch of golang-lint fixes 2022-11-26 11:21:25 +01:00
Juan Font
358ed64b98 Run handlePrimarySubnetFailover() with a ticker when Serve 2022-11-26 11:21:25 +01:00
Juan Font
d606b5a21e Added tests for subnet failover 2022-11-26 11:21:25 +01:00
Juan Font
091ade10cf Added method to perform subnet failover 2022-11-26 11:21:25 +01:00
Juan Font
de4e19017f Use helper methods in Machine 2022-11-26 11:21:25 +01:00
Juan Font
5e89794433 Mark as primary the first instance of subnet + tests
In preparation for subnet failover, mark the initial occurrence of a subnet as the primary one.
2022-11-26 11:21:25 +01:00
Juan Font
52ab2a8ffd Port routes tests to new model 2022-11-26 11:21:25 +01:00
Juan Font
cf35ae94d0 Remove EnabledRoutes from Machine and refactor to adapt to it 2022-11-26 11:21:25 +01:00
Juan Font
60be739a3b Call processMachineRoutes when a new Map is received 2022-11-26 11:21:25 +01:00
Juan Font
a76115b9e4 Cleanup route.go and add helper methods to process HostInfo 2022-11-26 11:21:25 +01:00
Juan Font
28ef3145c5 Add migration from Machine.EnabledRoutes to the new Route table 2022-11-26 11:21:25 +01:00
Juan Font
c78403691c Add Route DB model 2022-11-26 11:21:25 +01:00
Juan Font
4da462917c Remove magic number (base10...) 2022-11-26 10:14:48 +00:00
Juan Font
87bfb53c1c Remove unused function 2022-11-26 09:59:56 +00:00
Juan Font
e26e3303cd Use new routes API in CLI 2022-11-26 00:04:02 +00:00
Juan Font
123ace4fb0 Refactored route grpc glue code 2022-11-26 00:03:39 +00:00