91 Commits

Author SHA1 Message Date
Nikita Voronchev e46df1b21d manager: Restore multiple simultaneous tunnels feature (#30) 2025-03-10 14:16:49 +07:00
Roman Zakharchuk a780e4a5c7 restore update feature (#36)
* replace wg.exe with awg.exe

* update docs, update admin reg key

* rename awg modules

* build awg from source

* remove unused params

* improve work with tools

* safe rebranding: change upgrade code, windows class and name

* safe rebranding: wg -> awg

* update dependencies, fixed showing transfered KBs

* Revert "remove application update feature"

This reverts commit 9670f4298e.

* Revert "remove application update feature #2"

This reverts commit b0c96a9fd6.

* updatepage and tray change WireGuard to AmneziaWG

* move crypto from indirect to direct

---------

Signed-off-by: Roman Zakharchuk <romikb@mail.ru>
2025-03-10 09:58:37 +07:00
Roman Zakharchuk 2722627073 rebranding and dependency rename (#5)
* replace wg.exe with awg.exe

* update docs, update admin reg key

* rename awg modules

* build awg from source

* remove unused params

* improve work with tools
2024-05-20 21:54:21 +01:00
RomikB 66bdd1c636 unsafe rebranding: change tunnel service name and install folder 2024-05-05 11:24:24 +02:00
RomikB 4c74b9fe3d safe rebranding: change wireguard to amneziawg 2024-05-05 09:47:31 +02:00
RomikB 79d9faaf41 remove wintun driver uninstall 2024-05-04 23:50:23 +02:00
RomikB 9670f4298e remove application update feature 2024-05-04 23:48:12 +02:00
RomikB 9c2771e882 fix tunnel runtime statistics 2024-05-02 19:22:03 +02:00
Roman Zakharchuk 918fd3ed3f Import code from RomikB/amneziawg-client-windows (#2)
AmneziaWG for Windows client
2024-04-29 19:37:53 +01:00
Jason A. Donenfeld 6ed37f30f5 global: bump date
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-01-06 17:28:13 +01:00
Jason A. Donenfeld a3534b576f global: interface{} -> any
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-12-16 03:14:14 +01:00
Jason A. Donenfeld 182247f5c8 global: apply gofumpt
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-12-09 23:13:56 +01:00
Jason A. Donenfeld b1fc806ad0 tunnel: check for WeakHostSend/Forwarding in pitfalls
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-11-08 20:32:38 +01:00
Jason A. Donenfeld 539979e99b manager: cleanup legacy wintun
It's not good to leave cruft around from the upgrade case when people
want to uninstall, so we remove wintun in the uninstaller manually
(without the help of wintun.dll, which we no longer ship). But also, so
that we can eventually drop that code, we also remove it
opportunistically when the manager starts.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-29 21:09:26 +02:00
Jason A. Donenfeld 1f536ffe98 manager: use pre-seeded fastrandn instead of math.rand
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-28 13:57:14 +02:00
Jason A. Donenfeld ea932e4304 manager: delay boottime updates and simplify
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-27 19:04:36 +02:00
Jason A. Donenfeld dc5878bea1 manager: pitfalls: cap virtio check to min 40 for Parallels
It looks like Parallels forked NetKVM from Red Hat and changed the
versioning scheme, but kept the same driver name. So we skip the warning
for a floor of v40.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-26 12:21:56 +02:00
Jason A. Donenfeld e9c7358b01 services: use more reliable method of detecting boot-up
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-26 11:54:56 +02:00
Jason A. Donenfeld a8236761c5 mod: bump for x/sys changes
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-21 01:51:40 -06:00
Jason A. Donenfeld 58a4703b0b manager: warn about dnscache and old virtio driver
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-20 01:15:24 -06:00
Jason A. Donenfeld 548405e21b global: remove wireguard-go/Wintun implementation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-16 22:55:24 -06:00
Jason A. Donenfeld 94949cd72f manager: remove legacy store support
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-16 22:54:34 -06:00
Jason A. Donenfeld 838c6f1c7b manager: use newer wireguard-go APIs
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-12 00:28:36 -06:00
Jason A. Donenfeld af60ab2299 global: use unsafe.Slice instead of unsafeSlice
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-11 13:14:19 -06:00
Jason A. Donenfeld b9e3a703e8 driver: use new API
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-05 23:56:27 -06:00
Jason A. Donenfeld eca2bc860a tunnel: reinitialize configuration after PnP flaps driver on <10
On older Windows, PnP will unload the driver and reload it. This makes
multiple tunnels impossible, as we knew. But this also happens when
various adapter settings change, like ICS, which is maybe a bigger
issue. Solve this by reloading the configuration after these flaps.

Reported-by: Harland Coles <harland.coles@energy-x.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-09-14 12:24:17 +02:00
Jason A. Donenfeld 1288280bea global: prefer WireGuardNT over wireguard-go/Wintun
Also remove Wintun driver on startup.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-09-12 22:58:32 +02:00
Jason A. Donenfeld cb1c42e036 manager: disable multiple tunnels on pre-win10
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-09-10 23:25:52 +02:00
Jason A. Donenfeld 9f92a33737 manager: make multiple tunnels mode automatic
Rather than having to set a registry knob to enable multiple tunnels, it
is now automatic. If an additional activated tunnel has the same route
subnets or interface IP addresses as a previous tunnel, that previous
one is stopped. But if there's no overlap, then they coexist.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-13 00:25:13 +02:00
Jason A. Donenfeld 14a4cc5dbf manager: do both wgnt and wintun cleanups
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-09 13:39:50 +02:00
Jason A. Donenfeld e60a3b02b8 manager: track externally created tunnels
Requested-by: Bruno UT1 <bandry@ut1.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-09 13:12:47 +02:00
Jason A. Donenfeld 301773302e driver: break encapsulation and pass timestamp to ringlogger
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-08 17:16:30 +02:00
Jason A. Donenfeld 82129ba288 ui: show update tab but not alert for limited user
Suggested-by: Diab Neiroukh <lazerl0rd@thezest.dev>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-04 20:22:14 +02:00
Jason A. Donenfeld 5409c45a10 driver: introduce new module for talking with kernel driver
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-02 19:10:58 +02:00
Jason A. Donenfeld 376a08840b conf: list unencrypted conf files
By ignoring unencrypted ones, the tunnel tracker would miss running
configurations at startup.

Reported-by: Станислав Мацак <smatsak@mail.ru>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-06-25 22:21:37 +02:00
Jason A. Donenfeld e99d28cf81 manager: do not terminate current process when intended target is child
If we've already collected this, handle is -1, which is current process.
Catch this case.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-06-22 19:56:14 +02:00
Jason A. Donenfeld 1636a8c94b manager: manually use CreateProcess for launching UI process
Go's standard library for this is buggy (PID races, handle races) and
requires passing NUL, which we don't really care about for Windows.
Simplify and speed up process creation by only passing exactly what we
need.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-06-18 11:28:50 +02:00
Jason A. Donenfeld 7701c82a2a manager: rewrite service arguments when migrating configs
If a service is installed already, it's a good idea to migrate its conf
argument when migrating the file name, so that these don't get out of
sync. We're already doing this when migrating from the legacy config
store, so this is also an opportunity to clean up that code a bit and
quit using regexes.

Reported-by: Станислав Мацак <smatsak@mail.ru>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-06-18 11:28:50 +02:00
Jason A. Donenfeld 31e0fd9fbe manager: use new DialConfig struct for pipe
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-03-05 16:05:13 -07:00
Jason A. Donenfeld 2eee4c5614 manager: use non-stuttering function name
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-03-05 16:05:13 -07:00
Jason A. Donenfeld 8e0ce1f21b global: use CloseHandle rather than Close
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-02 21:44:59 +01:00
Jason A. Donenfeld a2216958d9 manager: use stricter handle inheritability
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-02 21:44:58 +01:00
Jason A. Donenfeld fdf117deeb global: move away from ioutil
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-01 16:55:02 +01:00
Jason A. Donenfeld b37434e846 global: bump copyright date
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-01 16:55:02 +01:00
Jason A. Donenfeld b95b36756e manager: pipeline UAPI requests
This avoids the somewhat expensive pipe setup.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-01 16:55:02 +01:00
Jason A. Donenfeld 27054088c9 manager: do not raise error if manager service is already starting
If the service is in StartPending state, then it means that we were
*just* started by something else, so return success here, assuming the
other program starting this does the right thing. This can happen when,
e.g., the updater relaunches the manager service and then invokes
wireguard.exe to raise the UI.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-17 14:45:19 +01:00
Jason A. Donenfeld 450189162e ringlogger: hook into global panic writer
This is a grotesque hack, and hopefully upstream Go will provide a nicer
way of doing this, but already it seems quite adept at catching panics.
See https://github.com/golang/go/issues/42888 for more info.

This requires us to rewrite the ringlogger path to avoid all
allocations.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-09 16:01:47 +01:00
Jason A. Donenfeld 1b4a2a1e97 manager: use service subscriptions on win 8+
Work in progress, but this should be more reliable than the older Win 7
code. It's still unclear what the role of checkForDisabled is to be for
the Win 8+ path.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-09 16:01:47 +01:00
Jason A. Donenfeld 0b3b3584fe manager: do not respond to update state requests for non-elevated
Reported-by: Simon Rozman <simon@rozman.si>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-28 19:13:42 +01:00
Jason A. Donenfeld 2bdcbc5f2b conf: separate out migration and print errors
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-27 13:15:38 +01:00