Skip to content

Connect: read automatic updates configuration from Windows registry #63281

Merged
gzdunek merged 12 commits intomasterfrom
gzdunek/windows-registry-updates-config
Feb 5, 2026
Merged

Connect: read automatic updates configuration from Windows registry #63281
gzdunek merged 12 commits intomasterfrom
gzdunek/windows-registry-updates-config

Conversation

@gzdunek
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek commented Jan 29, 2026

Contributes to #59295
RFD #62545

This PR moves Windows configuration from the TELEPORT_CDN_BASE_URL and TELEPORT_TOOLS_VERSION environment variables to registry policies:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Teleport\TeleportConnect (Machine Policy): Takes precedence over any user-level policy.
  • HKEY_CURRENT_USER\SOFTWARE\Policies\Teleport\TeleportConnect (User Policy): Applies only to per-user installations when no machine policy is defined. Ignored in per-machine installations.

Note

The registry keys differ slightly from what was described in the RFD. Previously, the path was Policies\TeleportConnect, but it is now Policies\Teleport\TeleportConnect. I made this adjustment because registry policies are typically structured as <company-name>\<app-name>.

To do this, I replaced the GetDownloadBaseUrl RPC with a new GetConfig RPC that returns both the CDN base URL and the tools version. This required some other, minor changes:

  • Previously, GetDownloadBaseUrl would throw an error in OSS builds when TELEPORT_CDN_BASE_URL was not set. Since auto-updates may be disabled in this case (TELEPORT_TOOLS_VERSION=off), we should first check whether updates are enabled and only require the CDN base URL if they are. However, since GetConfig must return both values together, I chose to return an empty cdnBaseUrl and let the client infer the cause (OSS build). This also improves local development: Connect no longer shows an auto-update error when cdnBaseUrl is missing, auto-updates are now disabled instead.

  • After finishing the implementation, I noticed that GetConfig always returned toolsVersion: 'off'. This happens because when tsh runs as a daemon, auto-updates must be disabled, and we enforce that by launching it with TELEPORT_TOOLS_VERSION=off. To work around this (and ensure consistent behavior for GetConfig across platforms), I introduced FORWARDED_TELEPORT_TOOLS_VERSION, which passes through the real TELEPORT_TOOLS_VERSION value to tsh.

changelog: The TELEPORT_CDN_BASE_URL and TELEPORT_TOOLS_VERSION environment variables are deprecated for configuring Teleport Connect automatic updates on Windows. These settings must now be managed via the system policy registry keys under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER\SOFTWARE\Policies\Teleport\TeleportConnect. Legacy environment variables will prevent per-machine updates from installing silently.

Docs will be updated in a separate PR.

@gzdunek gzdunek changed the title Connect: read autoupdates configuration from Windows registry Connect: read automatic updates configuration from Windows registry Jan 29, 2026
@gzdunek gzdunek requested review from avatus and ravicious and removed request for flyinghermit and kimlisa January 29, 2026 15:33
@avatus avatus requested a review from tangyatsu January 29, 2026 16:21
Comment thread lib/teleterm/autoupdate/service.go
@ravicious ravicious self-requested a review January 30, 2026 17:11
@gzdunek gzdunek force-pushed the gzdunek/windows-registry-updates-config branch from bc829f8 to 10a55e0 Compare February 2, 2026 14:32
Comment thread lib/teleterm/autoupdate/service.go Outdated
Comment thread web/packages/teleterm/src/services/appUpdater/appUpdater.ts Outdated
Comment thread lib/teleterm/autoupdate/service_windows.go Outdated
Comment thread lib/teleterm/autoupdate/service_windows.go Outdated
Comment thread lib/teleterm/autoupdate/service_windows.go Outdated
Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

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

I still have to go through the commit with "Use UAC updater when app is configured with env vars", but I haven't found any major issues in the code so far.

Comment thread web/packages/teleterm/src/ui/AppUpdater/DetailsView.tsx
Comment thread lib/teleterm/autoupdate/service.go
Comment thread web/packages/teleterm/src/ui/AppUpdater/AppUpdater.story.tsx Outdated
Comment thread lib/teleterm/autoupdate/service.go Outdated
Comment thread web/packages/teleterm/src/services/appUpdater/appUpdater.ts
Comment thread proto/teleport/lib/teleterm/auto_update/v1/auto_update_service.proto Outdated
@ravicious ravicious self-requested a review February 3, 2026 17:18
Comment thread lib/teleterm/autoupdate/service.go Outdated
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from tangyatsu February 4, 2026 16:54
Base automatically changed from gzdunek/connect-dual-mode-installer to master February 5, 2026 09:42
@gzdunek gzdunek force-pushed the gzdunek/windows-registry-updates-config branch from 325d1a5 to 230d978 Compare February 5, 2026 09:45
@gzdunek gzdunek enabled auto-merge February 5, 2026 09:47
@gzdunek gzdunek added this pull request to the merge queue Feb 5, 2026
Merged via the queue into master with commit 34c0795 Feb 5, 2026
45 checks passed
@gzdunek gzdunek deleted the gzdunek/windows-registry-updates-config branch February 5, 2026 10:27
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@gzdunek See the table below for backport results.

Branch Result
branch/v17 Failed
branch/v18 Failed

gzdunek added a commit that referenced this pull request Mar 27, 2026
…63281)

* Replace `GetDownloadBaseUrl` RPC with `GetConfig`

* Implement reading ToolsVersion and CdnBaseUrl from system registry

* Read values from `getConfig()` instead of `getDownloadBaseUrl` and `process.env`

* Use UAC updater when app is configured with env vars

* Fix typos

* Handle tools version being 'off'

* Safely read values from `GetConfigResponse`

* Fix ordering in proto

* Non-official -> Unofficial

* Add TODO about docs

* Use switch-case instead of if-else

* Bring back if-else

(cherry picked from commit 34c0795)
gzdunek added a commit that referenced this pull request Mar 30, 2026
…63281)

* Replace `GetDownloadBaseUrl` RPC with `GetConfig`

* Implement reading ToolsVersion and CdnBaseUrl from system registry

* Read values from `getConfig()` instead of `getDownloadBaseUrl` and `process.env`

* Use UAC updater when app is configured with env vars

* Fix typos

* Handle tools version being 'off'

* Safely read values from `GetConfigResponse`

* Fix ordering in proto

* Non-official -> Unofficial

* Add TODO about docs

* Use switch-case instead of if-else

* Bring back if-else

(cherry picked from commit 34c0795)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants