jdeath / homeassistant-addons

MIT License
65 stars 16 forks source link

wgeasy won't start #24

Closed LeonardoCT closed 5 months ago

LeonardoCT commented 7 months ago

I installed the addon and followed the instructions, i will get some log but the ingress web page won't open i dont know why here is my log: `WG_HOST: [REDACTED] PASSWORD: 12 WG_PORT: 51820 WG_DEVICE: eth0 WG_PERSISTENT_KEEPALIVE: 0 WG_DEFAULT_ADDRESS: 10.8.0.x WG_DEFAULT_DNS: 1.1.1.1 WG_ALLOWED_IPS: 0.0.0.0/0, ::/0 WG_PATH: /ssl/wgeasy/ WG_POST_UP: 12 WG_POST_DOWN: 12 2024-03-27T23:22:25.546Z Server Listening on http://0.0.0.0:51821 2024-03-27T23:22:25.551Z WireGuard Loading configuration... 2024-03-27T23:22:25.557Z WireGuard Configuration loaded. 2024-03-27T23:22:25.558Z WireGuard Config saving... 2024-03-27T23:22:25.564Z WireGuard Config saved. $ wg-quick down /ssl/wgeasy/wg0.conf $ wg-quick up /ssl/wgeasy/wg0.conf Error: Command failed: wg-quick up /ssl/wgeasy/wg0.conf [#] [#] ip link add wg0 type wireguard [#] wg setconf wg0 /dev/fd/63 [#] ip -4 address add 10.8.0.1/24 dev wg0 [#] ip link set mtu 1420 up dev wg0 [#] 12 /usr/bin/wg-quick: line 295: 12: command not found [#] ip link delete dev wg0

at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:517:28)
at maybeClose (node:internal/child_process:1098:16)
at ChildProcess._handle.onexit (node:internal/child_process:303:5) {

code: 127, killed: false, signal: null, cmd: 'wg-quick up /ssl/wgeasy/wg0.conf' }`

jdeath commented 7 months ago

Working here. Did you make the wgeasy directory in your \homeassistant\ssl\ directory as showin in step 6 of the readme?

Try uninstalling the addon, go to addon store, click the 3 dots at the top, click "check for updates". Then install the addon again. You'll need to reset the configuration. Maybe it downloaded a bad version. My auto-update script sometimes messes things up.

it should show "Current version: 12" in addon page

adriy-be commented 7 months ago

I have the same error

WG_HOST: ********
PASSWORD: 12
WG_PORT: 62981
WG_DEVICE: eth0
WG_PERSISTENT_KEEPALIVE: 0
WG_DEFAULT_ADDRESS: 10.8.0.x
WG_DEFAULT_DNS: 1.1.1.1
WG_ALLOWED_IPS: 0.0.0.0/0, ::/0
WG_PATH: /ssl/wgeasy/
WG_POST_UP: 12
WG_POST_DOWN: 12
2024-04-15T10:15:33.086Z Server Listening on http://0.0.0.0:51821
2024-04-15T10:15:33.086Z WireGuard Loading configuration...
2024-04-15T10:15:33.087Z WireGuard Configuration loaded.
2024-04-15T10:15:33.087Z WireGuard Config saving...
2024-04-15T10:15:33.088Z WireGuard Config saved.
$ wg-quick down /ssl/wgeasy/wg0.conf
$ wg-quick up /ssl/wgeasy/wg0.conf
Error: Command failed: wg-quick up /ssl/wgeasy/wg0.conf
[#] 
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.8.0.1/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] 12
/usr/bin/wg-quick: line 295: 12: command not found
[#] ip link delete dev wg0

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:517:28)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5) {
  code: 127,
  killed: false,
  signal: null,
  cmd: 'wg-quick up /ssl/wgeasy/wg0.conf'
}

Installed on HAOS who is in proxmox. The folder wgeasy is created. So, what is called on line 295 ? /usr/bin/wg-quick: line 295: 12: command not found

adriy-be commented 7 months ago

I try docker run --rm -it --entrypoint bash ghcr.io/wg-easy/wg-easy And there is the content of wg-quick

   290  execute_hooks() {
   291          local hook
   292          for hook in "$@"; do
   293                  hook="${hook//%i/$INTERFACE}"
   294                  echo "[#] $hook" >&2
   295                  (eval "$hook")
   296          done
   297  }

It seems to be the same file of https://github.com/WireGuard/wireguard-tools/blob/master/src/wg-quick/linux.bash

StefanStrampel commented 5 months ago

Same problem over here. Any update?

jdeath commented 5 months ago

Works fine for me. Make sure WG_POST_UP: WG_POST_DOWN:, PASSWORD in your config is blank. I think the auto updater made it say "12" for some reason

Only tested on homeassistant OS. Due to permissions, may not work in other hosting approaches

StefanStrampel commented 5 months ago

That fixed it! The configuration page defaulted to 12 and with the asteriks makes it look required. But is saves and starts just fine without any values. image

Thank you!

jdeath commented 5 months ago

Awesome. Sorry about that. Not sure why the script did that!