Skip to content

Conversation

@JedMeister
Copy link
Member

@JedMeister JedMeister commented Nov 19, 2024

  • Ensure that /etc/wireguard/wg0.conf exists - initialisation fails unless it exists; empty file is fine.
    • Note that wg0.conf should always exist when the inithook runs, but it's best to not expect things to be "as they should be"!
  • Fix broken error message if wireguard-server-init.sh fails - cmd is string and should be passing proc.stderr

@JedMeister
Copy link
Member Author

@OnGle

Following our offline discussion & your concerns, I have tested this more thoroughly and had a "proper" look at wireguard-server-init.sh.

I'm happy to give you more details, but the TL;DR is that beyond the error message fix, the other change I made addresses a highly unlikely - perhaps even impossible - edge case. It would only occur if the /etc/wireguard/wg0.conf had been removed after boot. If it did not exist at boot, the wg0 service would fail to start and the wg0 interface could not be up - so wg show interfaces would not list it. So that change - i.e. touching the conf file it if it does not exist - is of little to no value. OTOH touching the conf file would make no significant difference as wireguard-server-init.sh would overwrite the conf file anyway...

So the error message fix should be applied, but the other change probably should just be removed as it's cruft...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant