Closed NOXCIS closed 5 days ago
Ohhhhh.. I think there's another user with a similar issue..
What if you wg-quick up ADMIN
and wg-quick down ADMIN
manually through console?
I found this interesting cuz WGDashboard does not edit the configuration file only when you use the Edit Configuration feature through the UI, other than that is through wg
or wg-quick
.. maybe this is a bug with WireGuard itself?
@donaldzou Nope, Wireguard works fine and doesnt cause this issue turns out. The AmneziaWG-go is based off of wireguard-go, which doesnt natively handle ipv6 causing a new one to be generated upon interface startup. Youll run into this and other issues trying to intigrate AmneziaWG-go, im still working on the kernel module image, which wouldnt need patching. The only issue sould now be IPV6 Allowed Ip Assignment.
Also there is a typo called "ListenPost" in the dashboard along with some syntax issues with a missing "/" these too... dashboard.py:712: DeprecationWarning: 'maxsplit' is passed as positional argument dashboard.py:707: DeprecationWarning: 'maxsplit' is passed as positional argument
def toggleConfiguration(self) -> [bool, str]:
self.getStatus()
interface_address = self.get_awg_iface_address()
config_file_path = os.path.join(DashboardConfig.GetConfig("Server", "wg_conf_path")[1], f"{self.Name}.conf")
if self.Status:
try:
check = subprocess.check_output(f"wg-quick down {self.Name}",
shell=True, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as exc:
return False, str(exc.output.strip().decode("utf-8"))
# Write the interface address after bringing it down
write_error = self.patch_awg_iface_address(interface_address)
if write_error:
return write_error
else:
try:
# Extract IPv6 address from the WireGuard configuration file
with open(config_file_path, 'r') as f:
config_data = f.read()
# Extract the IPv6 address from the Address line
ipv6_address = None
for line in config_data.splitlines():
if line.strip().startswith("Address"):
parts = line.split("=")[1].strip().split(", ")
for part in parts:
if ":" in part: # Check if the part looks like an IPv6 address
ipv6_address = part.strip()
break
if ipv6_address:
break
# Modify the logic to continue without IPv6 if not found
if ipv6_address:
# Bring the WireGuard interface up
check = subprocess.check_output(f"wg-quick up {self.Name}",
shell=True, stderr=subprocess.STDOUT)
try:
# Remove any existing IPv6 addresses for the interface
remove_ipv6_cmd = f"ip -6 addr flush dev {self.Name}"
subprocess.check_output(remove_ipv6_cmd, shell=True, stderr=subprocess.STDOUT)
# Add the new IPv6 address with the desired parameters
add_ipv6_cmd = f"ip -6 addr add {ipv6_address} dev {self.Name}"
subprocess.check_output(add_ipv6_cmd, shell=True, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as exc:
return False, str(exc.output.strip().decode("utf-8"))
else:
# No IPv6 address found, just bring the interface up without modifying IPv6
check = subprocess.check_output(f"wg-quick up {self.Name}",
shell=True, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as exc:
return False, str(exc.output.strip().decode("utf-8"))
self.getStatus()
return True, None
WireGate using Static WGDashboard Binary with AmneziaWG Support
https://github.com/user-attachments/assets/921afd53-39c5-4d08-ae44-340d499e9292
Describe The Problem A clear and concise description of what the bug is.
https://github.com/user-attachments/assets/79a14f27-32ba-442a-8194-99a885377cc4
Expected Error / Traceback
Sample of your
.conf
file