wg-api icon indicating copy to clipboard operation
wg-api copied to clipboard

Persistence: WireGuad Interface/Peer Configuration

Open jamescun opened this issue 5 years ago • 3 comments

WG-API currently makes no attempt to persist WireGuard configuration between restarts. The restart may be of the wg-api daemon, or of the system itself.

In the case of the wg-api daemon being restarted, all configuration is persisted as the WireGuard interface itself is used as the source of truth. No persistence nessecary.

In the case of the system restarting, the system may not be configured with wg-quick to load configuration on startup, and thus wg-api will see an empty state. No attempt is made to store configuration changes made by wg-api on termination, this must be done seperately.

WG-API should have a mechanism to snapshot and restore WireGuard's interface/peer configuration, perferably in a format that is compatible with wg-quick.

jamescun avatar Feb 26 '20 13:02 jamescun

@jamescun isnt SaveConfig = true inside server config for that?

vandot avatar Mar 04 '20 20:03 vandot

@vandot SaveConfig = true is a feature that is part of wg-quick rather than wg, and requires extra configuration to automatically load/save configuration as part of boot/shutdown.

This question is whether or not wg-api should have the same / similar functionality, or if we should simply document how to achieve this with wg-quick

jamescun avatar Mar 06 '20 13:03 jamescun

@jamescun for start at least to document that people configure server with SaveConfig = true

vandot avatar Mar 08 '20 20:03 vandot