Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Elliot Saba <staticfloat@gmail.com>
Cc: wireguard@lists.zx2c4.com
Subject: Re: Automatically updating windows client
Date: Tue, 28 Jan 2020 12:02:40 +0100	[thread overview]
Message-ID: <20200128110240.GA17569@zx2c4.com> (raw)
In-Reply-To: <CAGGi21Y2pMuHhhCGH10Y44fQKLgTi9pL7-y9Tw3KZm=5R8B9hQ@mail.gmail.com>

On Wed, Jan 22, 2020 at 03:55:10PM -0800, Elliot Saba wrote:
> I have wireguard deployed on quite a few windows servers.  I like the
> auto-update functionality builtin to the GUI, but it's a little cumbersome
> to login with RDP and click through the menus to perform the auto-update;
> it would be much more convenient if I could use the WireGuard CLI interface
> to check and auto-update directly, or even if it automatically updated with
> no intervention on my part.  This way I can script it with scheduled tasks
> or similar.
> 
> What do you all think?

I'd be interested to see a powershell script posted to this list that
handles that. For help getting started, here's what the procedure looks
like with linux tools:

mkdir /tmp/winupdate && cd /tmp/winupdate
curl -A "MagicMailingListScript/0.1" -L -o latest.sig https://download.wireguard.com/windows-client/latest.sig
echo -e 'untrusted comment: key.pub\nRWRNqGKtBXftKTKPpBPGDMe8jHLnFQ0EdRy8Wg0apV6vTDFLAODD83G4' > key.pub
signify -V -e -p key.pub -m latest || exit 1
ARCH=amd64 #TODO: grab from system type
while read -r hash msi; do [[ $msi =~ wireguard-$ARCH-([0-9.]+)\.msi ]] && break; done < latest
[[ -n ${BASH_REMATCH[0]} ]] || exit 0
CURRENT_VERSION=0.0.36 #TODO: grab from msi database
[[ $(printf '%s\n%s\n' "${BASH_REMATCH[1]}" "$CURRENT_VERSION" | sort -V -r | head -n 1) == "${BASH_REMATCH[1]}" ]] || exit 1
curl -A "MagicMailingListScript/0.1" -L -o "$msi" "https://download.wireguard.com/windows-client/$msi"
echo "$hash $msi" | b2sum -c || exit 1
msiexec.exe /qb!- /i $msi
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

  reply	other threads:[~2020-01-28 11:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 23:55 Elliot Saba
2020-01-28 11:02 ` Jason A. Donenfeld [this message]
2020-04-05  6:32 ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200128110240.GA17569@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=staticfloat@gmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).