GithubHelp home page GithubHelp logo

needscoffee / tailscale-updater-windows Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 3.0 40 KB

Windows PowerShell scripts that will keep installations of Tailscale updated daily. Tailscale is an excellent peer-to-peer style mesh VPN based on the Wireguard protocol. See https://tailscale.com

PowerShell 100.00%
tailscale windows powershell scheduled-tasks updater-script

tailscale-updater-windows's Introduction

A Tailscale Client Updater for Windows - ARCHIVED

Important

This project is archived - Tailscale now has a built-in automatic updater so is no longer required

This is a little project to develop an updater & release collector for Tailscale on Windows. Tailscale is a multi-platform peer-to-peer mesh vpn using the Wireguard protocol. See https://tailscale.com

Unfortunately something the Tailscale client doesn't do is provide the ability to update your clients automatically, and they could be quite numerous! That is what this little project is attempting to tackle, on Windows at least. Once installed as a scheduled task this script will download and install the latest version of the Windows Tailscale client each day.

The script requires PowerShell 5 or 7 and has been tested in both. To use as an updater the script should be launched as an administrator from a scheduled task.

If you use the installer script to setup the updater the default is to run once per day and at machine startup. The updater will also attempt to update itself too.

The script can be provided a number of switches which slightly alter its behaviour.

Available switches

-Track [string, optional] <stable (default)>\<unstable> - choose release to get (stable/unstable)

-DownloadOnly [switch, optional] <true>\<false (default)> - if specified just download then exit

-SiloPath [string, optional] <local or full path to release storage folder> - where to store release files

-Verbose [switch, optional] <true>\<false> (default)>

-TaskMode [switch, optional] <true>\<false> (default)> - reserved

Installation

You can download and install the job using the following PowerShell one-liner (as admin preferably) to do the whole thing:

try{Set-ExecutionPolicy Unrestricted -Scope:LocalMachine -Confirm:0}catch{}; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $f=(irm 'https://api.github.com/repos/needscoffee/tailscale-updater-windows/releases/latest').assets; $f|%{irm $_.url -Headers:@{Accept="application/octet-stream"} -o:$_.name}; $f.name|%{Unblock-File $_}; saps 'powershell.exe' -ArgumentList:"-ExecutionPolicy Bypass -Command `"& {cd $((pwd).Path);.\Install-Updater.ps1}`"" -Wait -Verb:RunAs; $f.name|ri;

Manually this would be:

  • Download the .ps1 files from the latest release
  • Run powershell as admin
  • Change to folder where you downloaded the files
  • Run .\Install-Updater.ps1
  • Tailscale-Updater-Windows.ps1 will be copied to C:\ProgramData\Tailscale-updater\
  • Then a scheduled task will be created to run the script on a daily basis at midday, storing files in a silo sub-folder.

Usage

Search for current stable release. Install if newer than an installed version

.\Tailscale-Updater-Windows.ps1

Search for current unstable release. Install if newer

.\Tailscale-Updater-Windows.ps1 -Track unstable

Search for current unstable release. Download, then exit without installing

.\Tailscale-Updater-Windows.ps1 -Track unstable -DownloadOnly

Search for current unstable release. Download to .\releases then exit without installing

.\Tailscale-Updater-Windows.ps1 -SiloPath .\releases -Track unstable -DownloadOnly

When run from PowerShell manually you can use -Verbose to monitor the progress

.\Tailscale-Updater-Windows.ps1 -Track stable -DownloadOnly -Verbose

To-Do

  • Automatic release pruning - 3 previous versions perhaps done
  • Auto-elevate and install as a scheduled task when run interactively done with installer script
  • Logging to a file or windows application log
  • Self-auto-update
  • Auto-repair if node falls out of tailnet (store tskey in a secure keystore)
  • Take a tskey as an interactive run switch to setup the node if needed
  • Determine alternative means of detecting new releases
  • Notification service support

tailscale-updater-windows's People

Contributors

needscoffee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.