Skip to content
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

[v16] Client tools autoupdates #48645

Merged
merged 12 commits into from
Dec 4, 2024
Merged

Conversation

vapopov
Copy link
Contributor

@vapopov vapopov commented Nov 8, 2024

Backports:
#46785
#47532
#47060
#47466
#47815
#48218
#49159
#49247
#49180

changelog: Client tools {tctl,tsh} auto-updates controlled by cluster configuration

* Expose client tools auto update for find endpoint

* Group auto update settings in find response
Log error instead returning error
Add tests auto update settings in find endpoint
Add check for not implemented error

* Add more test cases
* Update client autoupdate proto structure

* Replace with reserved

* Fix unit tests

* Add more info in proto

* Rename proto to be aligned RFD namings

* Replace enum type for ToolsMode to string
* Add packaging utility for client tools auto updates

* Add error handling for close functions

* Move archive to existing utils package

* Move archive helpers to integration/helper
CR changes

* CR changes

* CR changes

* CR changes
Replace creating directory with extract path as argument

* CR changes

* Validate full size before un-archive
Extract files to extractDir with ignore dir structure

* Change compressing with relative paths
Add test for cleanup and fix skip logic

* CR changes

* CR changes

* Fix linter
* Add client tools auto update

* Replace fork for posix platform for re-exec
Move integration tests to client tools specific dir
Use context cancellation with SIGTERM, SIGINT
Remove cancelable tee reader with context replacement
Renaming

* Fix syscall path execution
Fix archive cleanup if hash is not valid
Limit the archive write bytes

* Cover the case with single package for darwin platform after v17

* Move updater logic to tools package

* Move context out from the library
Base URL renaming

* Add more context in comments

* Changes in find endpoint

* Replace test http server with `httptest`
Replace hash for bytes matching
Proper temp file close for archive download

* Add more context to comments

* Move feature flag to main package to be reused

* Constant rename

* Replace build tag with lib/modules to identify enterprise build

* Replace fips tag with modules flag
* Client auto updates integration for tctl/tsh

* Add version validation
Fix recursive version check for darwin platform
Fix cleanup for multi-package support

* Fix identifying tools removal from home directory

* Replace ToolsMode with ToolsAutoUpdate

* Reuse insecure flag for tests

* Fix CheckRemote with login

* Fix windows administrative access requirement
Update must be able to be canceled, re-execute with latest version or last updated
Show progress bar before request is made

* Fix update cancellation for login action
Address review comments

* Add signal handler with stack context cancellation

* Use copy instead of hard link for windows
Fix progress bar if we can't receive size of package

* Replace with list in order to support manual cancel

* Download archive package to temp directory

* Decrease timeout for client tools proxy call
@vapopov vapopov requested review from sclevine and hugoShaka November 8, 2024 00:21
@github-actions github-actions bot requested a review from rosstimothy November 8, 2024 00:22
@github-actions github-actions bot added audit-log Issues related to Teleports Audit Log size/xl tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Nov 8, 2024
@public-teleport-github-review-bot

@vapopov - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-48645.d212ksyjt6y4yg.amplifyapp.com

@vapopov vapopov force-pushed the vapopv/client-tools-autoupdates-v16 branch from d7d516f to 7ac53c9 Compare November 8, 2024 01:14
@vapopov vapopov force-pushed the vapopv/client-tools-autoupdates-v16 branch from 7ac53c9 to 34a9b14 Compare November 8, 2024 02:01
@ravicious
Copy link
Member

ravicious commented Nov 19, 2024

Could we wait with merging this until I have a PR ready that sets TELEPORT_TOOLS_VERSION=off when calling tsh from Connect? I'll push it today.

Edit: #49180

* Add dir for code shared between Node.js processes

* Connect: Make sure tsh auto-updates are turned off

* Pass TELEPORT_TOOLS_VERSION=off to tsh vnet-daemon
@ravicious
Copy link
Member

ravicious commented Nov 19, 2024

I allowed myself to add a backport of #49180 to both backport PRs of client tools autoupdates.

Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

Bot.

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from rosstimothy December 3, 2024 19:24
@vapopov vapopov enabled auto-merge December 4, 2024 20:10
@vapopov vapopov added this pull request to the merge queue Dec 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 4, 2024
@vapopov vapopov added this pull request to the merge queue Dec 4, 2024
Merged via the queue into branch/v16 with commit 8ec7063 Dec 4, 2024
44 of 45 checks passed
@vapopov vapopov deleted the vapopv/client-tools-autoupdates-v16 branch December 4, 2024 20:57
@camscale camscale mentioned this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-log Issues related to Teleports Audit Log backport size/xl tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants