From 8f601f12b1cb6e7e017b74c58894f0b2889b6ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Rodrigues?= Date: Wed, 26 Jul 2023 14:06:11 +0100 Subject: [PATCH] [OGE-4982] Don't append random suffixes to hostname (#17) --- .github/workflows/build.yml | 3 +- .github/workflows/release.yml | 3 +- .github/workflows/test-integration-cli.yml | 6 +- ...st-integration-v2-TestACLAllowStarDst.yaml | 8 ++- ...-integration-v2-TestACLAllowUser80Dst.yaml | 8 ++- ...st-integration-v2-TestACLAllowUserDst.yaml | 8 ++- .../test-integration-v2-TestACLCommand.yaml | 8 ++- ...t-integration-v2-TestACLDenyAllPort80.yaml | 8 ++- ...ion-v2-TestACLDevice1CanAccessDevice2.yaml | 8 ++- ...egration-v2-TestACLHostsInNetMapTable.yaml | 8 ++- ...egration-v2-TestACLNamedHostsCanReach.yaml | 8 ++- ...-v2-TestACLNamedHostsCanReachBySubnet.yaml | 8 ++- ...ration-v2-TestAuthKeyLogoutAndRelogin.yaml | 8 ++- ...-TestAuthWebFlowAuthenticationPingAll.yaml | 8 ++- ...on-v2-TestAuthWebFlowLogoutAndRelogin.yaml | 8 ++- ...st-integration-v2-TestCreateTailscale.yaml | 8 ++- ...integration-v2-TestDERPServerScenario.yaml | 8 ++- ...est-integration-v2-TestEnablingRoutes.yaml | 8 ++- .../test-integration-v2-TestEphemeral.yaml | 8 ++- .../test-integration-v2-TestExpireNode.yaml | 8 ++- .../test-integration-v2-TestHeadscale.yaml | 8 ++- ...tion-v2-TestOIDCAuthenticationPingAll.yaml | 8 ++- ...TestOIDCExpireNodesBasedOnTokenExpiry.yaml | 8 ++- ...-integration-v2-TestPingAllByHostname.yaml | 8 ++- .../test-integration-v2-TestPingAllByIP.yaml | 8 ++- ...-integration-v2-TestPreAuthKeyCommand.yaml | 8 ++- ...estPreAuthKeyCommandReusableEphemeral.yaml | 8 ++- ...v2-TestPreAuthKeyCommandWithoutExpiry.yaml | 8 ++- ...st-integration-v2-TestResolveMagicDNS.yaml | 8 ++- ...-integration-v2-TestSSHIsBlockedInACL.yaml | 8 ++- ...ation-v2-TestSSHMultipleUsersAllToAll.yaml | 8 ++- ...integration-v2-TestSSHNoSSHConfigured.yaml | 8 ++- ...integration-v2-TestSSHOneUserAllToAll.yaml | 8 ++- ...ntegration-v2-TestSSUserOnlyIsolation.yaml | 8 ++- .../test-integration-v2-TestTaildrop.yaml | 8 ++- ...-v2-TestTailscaleNodesJoiningHeadcale.yaml | 8 ++- .../test-integration-v2-TestUserCommand.yaml | 8 ++- .github/workflows/test.yml | 3 +- api_common.go | 1 - cmd/gh-action-integration-generator/main.go | 8 ++- machine.go | 14 ++--- machine_test.go | 56 ------------------- templates/apple.html | 2 +- templates/windows.html | 2 +- 44 files changed, 194 insertions(+), 176 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1ba65a47b..9da4864748 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,8 +33,9 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v16 + - uses: DeterminateSystems/nix-installer-action@main if: steps.changed-files.outputs.any_changed == 'true' + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Run build id: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b048a3271..72eddbcbc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,8 @@ jobs: with: fetch-depth: 0 - - uses: cachix/install-nix-action@v16 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Run goreleaser run: nix develop --command -- goreleaser release --clean diff --git a/.github/workflows/test-integration-cli.yml b/.github/workflows/test-integration-cli.yml index 72cf31aac2..ba25afe0a1 100644 --- a/.github/workflows/test-integration-cli.yml +++ b/.github/workflows/test-integration-cli.yml @@ -27,8 +27,10 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v16 - if: steps.changed-files.outputs.any_changed == 'true' + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true - name: Run CLI integration tests if: steps.changed-files.outputs.any_changed == 'true' diff --git a/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml b/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml index 47a1b60d55..81877ce6ff 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml index 2e6c3c2efd..fdfd1a1d2f 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml b/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml index d745e87175..bed3064af7 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLCommand.yaml b/.github/workflows/test-integration-v2-TestACLCommand.yaml index fbca5d6285..0fe6493c13 100644 --- a/.github/workflows/test-integration-v2-TestACLCommand.yaml +++ b/.github/workflows/test-integration-v2-TestACLCommand.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml b/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml index 767aa213e2..82a2539a38 100644 --- a/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml +++ b/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml index d25f774f05..2eb4efcf6a 100644 --- a/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml +++ b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml index 70b7b94384..b44f153b87 100644 --- a/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml +++ b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml index 2d62422832..89edf935b3 100644 --- a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml index 039512392f..8a911b1a72 100644 --- a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml index 8df6f22a72..be7753a2ca 100644 --- a/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml +++ b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml index acf473d795..cd8f136b64 100644 --- a/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml index 6d70750c5c..16cccbd898 100644 --- a/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestCreateTailscale.yaml b/.github/workflows/test-integration-v2-TestCreateTailscale.yaml index 0ab32477f1..bb71371d73 100644 --- a/.github/workflows/test-integration-v2-TestCreateTailscale.yaml +++ b/.github/workflows/test-integration-v2-TestCreateTailscale.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml b/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml index 610794e8e1..bd0503fbd7 100644 --- a/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml +++ b/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml b/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml index 6063741563..a5d1307415 100644 --- a/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml +++ b/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestEphemeral.yaml b/.github/workflows/test-integration-v2-TestEphemeral.yaml index 068c028d7a..0c29669a22 100644 --- a/.github/workflows/test-integration-v2-TestEphemeral.yaml +++ b/.github/workflows/test-integration-v2-TestEphemeral.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestExpireNode.yaml b/.github/workflows/test-integration-v2-TestExpireNode.yaml index bfa4faa730..60bc5318f6 100644 --- a/.github/workflows/test-integration-v2-TestExpireNode.yaml +++ b/.github/workflows/test-integration-v2-TestExpireNode.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestHeadscale.yaml b/.github/workflows/test-integration-v2-TestHeadscale.yaml index b7849ae4ad..abeb885ecb 100644 --- a/.github/workflows/test-integration-v2-TestHeadscale.yaml +++ b/.github/workflows/test-integration-v2-TestHeadscale.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml index 86dcd8f6a0..42a5022f92 100644 --- a/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml +++ b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml index 7380c4e875..ac87dc55b8 100644 --- a/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml +++ b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml b/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml index 691b306c4f..a6fce7da24 100644 --- a/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml +++ b/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPingAllByIP.yaml b/.github/workflows/test-integration-v2-TestPingAllByIP.yaml index 96172998f9..c2d49d235a 100644 --- a/.github/workflows/test-integration-v2-TestPingAllByIP.yaml +++ b/.github/workflows/test-integration-v2-TestPingAllByIP.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml index 32843253c3..b182a98585 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml index bbcb3f67d4..3b0f4f4de3 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml index a3dac5c514..504b9d09eb 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml b/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml index 98c0563d90..1b204143a5 100644 --- a/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml +++ b/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml index 509e45ea03..595fc158b7 100644 --- a/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml +++ b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml index 71d5533b54..aedeba8e4c 100644 --- a/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml +++ b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml index 0707fdadee..f5522bbeca 100644 --- a/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml +++ b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml b/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml index 6ab4f083ae..d637766f70 100644 --- a/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml +++ b/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml b/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml index b3ddf2511a..471dbdf95d 100644 --- a/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml +++ b/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestTaildrop.yaml b/.github/workflows/test-integration-v2-TestTaildrop.yaml index b10723daca..921ac75cea 100644 --- a/.github/workflows/test-integration-v2-TestTaildrop.yaml +++ b/.github/workflows/test-integration-v2-TestTaildrop.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml index fc685836c6..8c4043792a 100644 --- a/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml +++ b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestUserCommand.yaml b/.github/workflows/test-integration-v2-TestUserCommand.yaml index 7a4c911927..e1fda35b55 100644 --- a/.github/workflows/test-integration-v2-TestUserCommand.yaml +++ b/.github/workflows/test-integration-v2-TestUserCommand.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17ee71586f..143a341492 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,8 +26,9 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v16 + - uses: DeterminateSystems/nix-installer-action@main if: steps.changed-files.outputs.any_changed == 'true' + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Run tests if: steps.changed-files.outputs.any_changed == 'true' diff --git a/api_common.go b/api_common.go index 410f5a9ac4..d9d467ad24 100644 --- a/api_common.go +++ b/api_common.go @@ -114,7 +114,6 @@ func (h *Headscale) generateMapResponse( log.Trace(). Str("func", "generateMapResponse"). Str("machine", mapRequest.Hostinfo.Hostname). - // Interface("payload", resp). Msgf("Generated map response: %s", tailMapResponseToString(resp)) return &resp, nil diff --git a/cmd/gh-action-integration-generator/main.go b/cmd/gh-action-integration-generator/main.go index a524815d90..12eabc246c 100644 --- a/cmd/gh-action-integration-generator/main.go +++ b/cmd/gh-action-integration-generator/main.go @@ -39,6 +39,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -50,9 +55,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: {{ "${{ env.ACT }}" }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/machine.go b/machine.go index e2ac2cc705..bb57eda6c4 100644 --- a/machine.go +++ b/machine.go @@ -1253,13 +1253,13 @@ func (h *Headscale) GenerateGivenName( } for _, machine := range machines { - if machine.MachineKey != machineKey && machine.GivenName == givenName { - postfixedName, err := h.generateGivenName(suppliedName, true) - if err != nil { - return "", err - } - - givenName = postfixedName + if machine.MachineKey != machineKey && machine.GivenName == givenName && + !machine.isExpired() { + log.Info(). + Caller(). + Str("machineKey", machineKey). + Str("name", givenName). + Msg("Hostname collision found") } } diff --git a/machine_test.go b/machine_test.go index 44017de389..41ddb21d8a 100644 --- a/machine_test.go +++ b/machine_test.go @@ -359,62 +359,6 @@ func (s *Suite) TestSerdeAddressStrignSlice(c *check.C) { } } -func (s *Suite) TestGenerateGivenName(c *check.C) { - user1, err := app.CreateUser("user-1") - c.Assert(err, check.IsNil) - - pak, err := app.CreatePreAuthKey(user1.Name, false, false, nil, nil) - c.Assert(err, check.IsNil) - - _, err = app.GetMachine("user-1", "testmachine") - c.Assert(err, check.NotNil) - - machine := &Machine{ - ID: 0, - MachineKey: "machine-key-1", - NodeKey: "node-key-1", - DiscoKey: "disco-key-1", - Hostname: "hostname-1", - GivenName: "hostname-1", - UserID: user1.ID, - RegisterMethod: RegisterMethodAuthKey, - AuthKeyID: uint(pak.ID), - } - app.db.Save(machine) - - givenName, err := app.GenerateGivenName("machine-key-2", "hostname-2") - comment := check.Commentf( - "Same user, unique machines, unique hostnames, no conflict", - ) - c.Assert(err, check.IsNil, comment) - c.Assert(givenName, check.Equals, "hostname-2", comment) - - givenName, err = app.GenerateGivenName("machine-key-1", "hostname-1") - comment = check.Commentf("Same user, same machine, same hostname, no conflict") - c.Assert(err, check.IsNil, comment) - c.Assert(givenName, check.Equals, "hostname-1", comment) - - givenName, err = app.GenerateGivenName("machine-key-2", "hostname-1") - comment = check.Commentf("Same user, unique machines, same hostname, conflict") - c.Assert(err, check.IsNil, comment) - c.Assert( - givenName, - check.Matches, - fmt.Sprintf("^hostname-1-[a-z0-9]{%d}$", MachineGivenNameHashLength), - comment, - ) - - givenName, err = app.GenerateGivenName("machine-key-2", "hostname-1") - comment = check.Commentf("Unique users, unique machines, same hostname, conflict") - c.Assert(err, check.IsNil, comment) - c.Assert( - givenName, - check.Matches, - fmt.Sprintf("^hostname-1-[a-z0-9]{%d}$", MachineGivenNameHashLength), - comment, - ) -} - func (s *Suite) TestSetTags(c *check.C) { user, err := app.CreateUser("test") c.Assert(err, check.IsNil) diff --git a/templates/apple.html b/templates/apple.html index 3643e5fb77..4064dced7f 100644 --- a/templates/apple.html +++ b/templates/apple.html @@ -1,4 +1,4 @@ - + diff --git a/templates/windows.html b/templates/windows.html index db9315efe9..c590494f9c 100644 --- a/templates/windows.html +++ b/templates/windows.html @@ -1,4 +1,4 @@ - +