├── .gitignore ├── .vscode ├── extensions.json └── tasks.json ├── LICENSE ├── README.md ├── icon └── Tailscale.png ├── tailscale.nuspec ├── tools ├── chocolateybeforemodify.ps1 └── chocolateyinstall.ps1 ├── updater.ps1 └── updater.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.nupkg 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | 5 | "recommendations": [ 6 | "ms-vscode.powershell" 7 | ], 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "choco pack", 8 | "type": "shell", 9 | "command": "choco pack", 10 | "group": { 11 | "kind": "build", 12 | "isDefault": true 13 | }, 14 | "problemMatcher": [] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tailscale Chocolatey Package 2 | 3 | This is a [Chocolatey][] package of the [Tailscale][] client, the private 4 | networking solution. 5 | 6 | ``` 7 | choco install tailscale 8 | ``` 9 | 10 | [Chocolatey]: https://chocolatey.org/ 11 | [Tailscale]: https://tailscale.com/ 12 | 13 | ## License 14 | 15 | The packaging scripts in this repository are released under the [Unlicense][]. 16 | 17 | The Tailscale client is released under its [Terms of Service][]. 18 | 19 | [Unlicense]: https://unlicense.org/ 20 | [Terms of Service]: https://tailscale.com/terms 21 | -------------------------------------------------------------------------------- /icon/Tailscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tailscale/tailscale-chocolatey/b61891ea00c64ed7e5176c6b4516f7d60b16ca07/icon/Tailscale.png -------------------------------------------------------------------------------- /tailscale.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | tailscale 7 | 1.82.5 8 | https://github.com/tailscale/tailscale-chocolatey 9 | Tailscale, Inc. 10 | 11 | 12 | Tailscale 13 | Tailscale, Inc. 14 | https://tailscale.com/ 15 | Copyright © Tailscale, Inc. and Contributors. 16 | https://tailscale.com/terms 17 | false 18 | https://tailscale.com/kb/ 19 | https://github.com/tailscale/tailscale/issues 20 | tailscale wireguard vpn 21 | Tailscale makes private networks easy. 22 | The Tailscale client allows you to connect all your devices using WireGuard®, without the hassle. Tailscale makes it as easy as installing an app and signing in. 23 | 24 | WireGuard is a registered trademark of Jason A. Donenfeld. 25 | https://cdn.jsdelivr.net/gh/tailscale/tailscale-chocolatey@main/icon/Tailscale.png 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tools/chocolateybeforemodify.ps1: -------------------------------------------------------------------------------- 1 | # This runs in 0.9.10+ before upgrade and uninstall. 2 | # Use this file to do things like stop services prior to upgrade or uninstall. 3 | 4 | # This script is currently best-effort; don't abort if it fails. 5 | $ErrorActionPreference = 'Continue'; 6 | 7 | # Remove device driver certificate (which was installed by older versions of this package). 8 | Get-ChildItem Cert:\LocalMachine\TrustedPublisher | Where-Object { $_.thumbprint -eq 'DEE8D4EF882C2C255D879EF109C1DB9CF743476E' } | Remove-Item 9 | -------------------------------------------------------------------------------- /tools/chocolateyinstall.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop'; 2 | 3 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 4 | 5 | $packageArgs = @{ 6 | SoftwareName = 'Tailscale' 7 | PackageName = $env:ChocolateyPackageName 8 | UnzipLocation = $toolsDir 9 | FileType = 'msi' 10 | 11 | SilentArgs = '/quiet' 12 | ValidExitCodes = @(0) 13 | } 14 | 15 | if ($env:PROCESSOR_IDENTIFIER.StartsWith('ARMv')) { 16 | # Windows on ARM 17 | $packageArgs += @{ 18 | Url = 'https://pkgs.tailscale.com/stable/tailscale-setup-1.82.5-arm64.msi' 19 | Checksum = '7409d1c9630ea953d3fb9802b666fb5055439ad81d76c9ae970573f5c75f7eb5' 20 | ChecksumType = 'sha256' 21 | } 22 | } 23 | else { 24 | # Windows on x86 or x64 25 | $packageArgs += @{ 26 | Url = 'https://pkgs.tailscale.com/stable/tailscale-setup-1.82.5-x86.msi' 27 | Checksum = '0878e42e54d504f6f62a2fa654bfc99d4bdedbbb337ffe6df34ef57b5609ee9c' 28 | ChecksumType = 'sha256' 29 | 30 | Url64Bit = 'https://pkgs.tailscale.com/stable/tailscale-setup-1.82.5-amd64.msi' 31 | Checksum64 = 'bc7b0698fc84ca98eb57f5c58fd94a76f6f66e9df39d2ddddb2d255c2b1e1da1' 32 | ChecksumType64 = 'sha256' 33 | } 34 | } 35 | 36 | Install-ChocolateyPackage @packageArgs 37 | -------------------------------------------------------------------------------- /updater.ps1: -------------------------------------------------------------------------------- 1 | function Get-RemoteSHA256 { 2 | param( 3 | [Parameter(Mandatory = $true)] 4 | [string]$Url 5 | ) 6 | 7 | (Get-FileHash -Algorithm SHA256 -InputStream ([System.Net.WebClient]::new().OpenRead($url))).Hash.ToLower() 8 | } 9 | 10 | $channel = "https://pkgs.tailscale.com/stable/" 11 | 12 | $meta = Invoke-WebRequest ($channel + "?mode=json&os=windows") | ConvertFrom-Json 13 | 14 | $version = $meta.Version 15 | 16 | # Update the nuspec 17 | $nuspec = New-Object xml 18 | $nuspec.Load("$PSScriptRoot/tailscale.nuspec") 19 | $nuspec.package.metadata.version = $version 20 | $nuspec.Save("$PSScriptRoot/tailscale.nuspec") 21 | 22 | # Update the installer script 23 | $installer = Get-Content "./tools/chocolateyinstall.ps1" 24 | $url = $channel + $meta.MSIs.arm64 25 | $installer[19] = $installer[19] -replace "https:\/\/pkgs.tailscale.com\/.*\.msi", $url 26 | $installer[20] = $installer[20] -replace "[0-9a-f]{64}", (Get-RemoteSHA256 $url) 27 | $url = $channel + $meta.MSIs.x86 28 | $installer[27] = $installer[27] -replace "https:\/\/pkgs.tailscale.com\/.*\.msi", $url 29 | $installer[28] = $installer[28] -replace "[0-9a-f]{64}", (Get-RemoteSHA256 $url) 30 | $url = $channel + $meta.MSIs.amd64 31 | $installer[31] = $installer[31] -replace "https:\/\/pkgs.tailscale.com\/.*\.msi", $url 32 | $installer[32] = $installer[32] -replace "[0-9a-f]{64}", (Get-RemoteSHA256 $url) 33 | $installer | Out-File "./tools/chocolateyinstall.ps1" 34 | 35 | # Check and see if files have been updated 36 | $files_modified = $(git diff --name-only HEAD) -split '\n' 37 | if ($files_modified.length -gt 0) { 38 | git commit -a -m "Update to version $version" 39 | 40 | Write-Host "Package files have been updated to version $version. Update has been committed and is ready to push. Displaying diff..." 41 | git diff HEAD~1 HEAD 42 | } 43 | else { 44 | Write-Host "No files have been updated. No commit has been made." 45 | } -------------------------------------------------------------------------------- /updater.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | base_url="https://pkgs.tailscale.com/stable" 5 | 6 | json_string=$(curl -s "$base_url/?mode=json&os=windows") 7 | version=$(echo $json_string | jq -r .Version) 8 | 9 | # replace ... in nuspec file 10 | sed -i "s/[^<]*<\/version>/$version<\/version>/g" tailscale.nuspec 11 | 12 | # for each arch in the json 13 | arches=($(echo $json_string | jq -r .MSIs | jq -r 'keys[]')) 14 | for arch in "${arches[@]}"; do 15 | # url to download file 16 | url="$base_url/$(echo $json_string | jq -r .MSIs.$arch)" 17 | # get sha256 of file 18 | sha256=$(curl -s "$url.sha256") 19 | # replace url and sha256 in chocolateyinstall.ps1 20 | sed -i "s|https://pkgs.tailscale.com/stable/.*$arch.msi|$url|" ./tools/chocolateyinstall.ps1 21 | nextlineno=$((1+$(grep -n "$url" ./tools/chocolateyinstall.ps1 | cut -d: -f1))) 22 | sed -Ei "${nextlineno}s|[0-9a-fA-F]{64}|$sha256|" ./tools/chocolateyinstall.ps1 23 | done 24 | 25 | readarray -t files_modified < <(git diff --name-only HEAD) 26 | if [[ ${#files_modified[@]} -gt 0 ]]; then 27 | git commit -a -m "Update to version $version" 28 | 29 | echo "Package files have been updated to version $version. Update has been committed and is ready to push. Displaying diff..." 30 | git diff HEAD~1 HEAD 31 | else 32 | echo "No files have been updated. No commit has been made." 33 | fi 34 | --------------------------------------------------------------------------------