zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
884 stars 46 forks source link

[BUG] - Every tunnel is exported twice, but often with broken configurations. #414

Open bobpaul opened 1 week ago

bobpaul commented 1 week ago

Describe the bug The zip file created with Settings -> Export configs includes every tunnel twice, once with "-am" appended to the name and once with "-wg" appended to the name.

Smartphone (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Create several tunnels. On some tunnels, include Amnezia settings, such as Junk Count, but leave others as pure Wireguard configurations.
  2. Click Settings -> Export configurations. A zip file is written to your downloads folder
  3. Open the Zip file that's created. Observe: a. For every pure wireguard tunnel, there's 2 *.conf files, one named ${tunnel}-wg.conf and one named ${tunnel}-am.conf. These two files are identical. b. For every Amnezia tunnel (tunnels with custom H* and/or S* values) there's also 2 *.conf files. The ${tunnel}-wg.conf file does not contain the Amnezia options and is not a valid configuration file. Only the ${tunnel}-am.conf file is useful. c. For Wireguard tunnels with custom J* values, two *.conf files are created. The ${tunnel}-wg.conf file has the Jc, Jmin, and Jmax entries removed. The ${tunnel}-am.conf file retains the settings for Junk packets.

Expected behavior a. Only 1 file should be created named ${tunnel}.conf for tunnels that are purely Wireguard tunnels. These files can be used unmodified with any Wireguard client (including AmneziaWG). b. For AmneziaWG tunnels (those with customized H1, H2, H3, H4, S1, or S2 values) only an AmneziaWG client can use this config file. Only 1 file should be created named ${tunnel}.conf. c. There's some argument for this case. The *-am.conf file with JC=, Jmin=, and Jmax= values will be rejected by a pure Wireguard client. But I'd argue the *-wg.conf file is NOT an export of my configuration, only the *-am.conf file serves as a backup of my WGTunnel configuration for this tunnel.

Additional context I think maybe 2 separate export options could be provided: Export Configs and Export for Wireguard, where the latter option would only export (a) and (c) tunnels (those that can work with Wireguard) and with an J* values either removed or commented out.

merlinuwe commented 1 week ago

Same here with Android 11, 3.5.4 nightly, user space.