removed unused stuff, changed natQ to use opnsense api

This commit is contained in:
2026-03-21 14:54:25 +02:00
parent 08cfad14ac
commit 1b023ea802
7 changed files with 88 additions and 158 deletions

View File

@@ -13,12 +13,11 @@ router.post('/', (req, res) => {
const event = body.event || '';
const data = body || {};
info(`Webhook: ${event}\n${JSON.stringify(body)}`);
// return res.status(418).json({ error: 'im a teapot' }); // temporary
try {
if (event === 'created: Allocation') {
enqueueNatAdd(data.ip, data.port, 'tcp');
enqueueNatAdd(data.ip, data.port);
} else if (event === 'deleted: Allocation') {
enqueueNatRemove(data.ip, data.port, 'tcp');
enqueueNatRemove(data.ip, data.port);
} else {
warn(`Unhandled webhook event: ${event}`);
}