Add hooks overrides support with environment variables
- Added WG_PRE_UP, WG_POST_UP, WG_PRE_DOWN, WG_POST_DOWN environment variables - Created applyHooksOverrides() helper function - Updated WireGuard service to apply hooks overrides when generating config - Updated /api/admin/overrides endpoint to include hooks override information - Updated documentation with hooks environment variables Co-authored-by: kaaax0815 <32197462+kaaax0815@users.noreply.github.com>
This commit is contained in:
@@ -27,10 +27,11 @@ class WireGuard {
|
||||
async #saveWireguardConfig(wgInterface: InterfaceType) {
|
||||
const clients = await Database.clients.getAll();
|
||||
const hooks = await Database.hooks.get();
|
||||
const hooksWithOverrides = applyHooksOverrides(hooks);
|
||||
|
||||
const result = [];
|
||||
result.push(
|
||||
wg.generateServerInterface(wgInterface, hooks, {
|
||||
wg.generateServerInterface(wgInterface, hooksWithOverrides, {
|
||||
enableIpv6: !WG_ENV.DISABLE_IPV6,
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user