fix(api): update firewall filter comments and test assertions
Build and Push EvoFirewall Docker Image / build-and-push (push) Successful in 1m52s
Build and Push EvoFirewall Docker Image / create-release (push) Skipped

- Modified comments in the `mikrotik-install.rsc` script to clarify the naming convention for filter rules, ensuring consistency with `policy.rsc`.
- Updated the test assertions in `install-links.test.ts` to reflect the new comment names in the firewall filter rules, enhancing test accuracy.

These changes improve the clarity and reliability of the firewall configuration and associated tests.
This commit is contained in:
Denozordec
2026-07-23 20:51:12 +07:00
parent 94812edab3
commit 1091931269
2 changed files with 6 additions and 6 deletions
@@ -51,13 +51,13 @@
/system script add name=evofw-env policy=read,write,policy,test source=(" :global EvofwCpUrl \"" . $EvofwCpUrl . "\"; :global EvofwToken \"" . $EvofwToken . "\" ")
}
# Filter rules (idempotent by comment)
# Filter rules (idempotent by comment) — names must match policy.rsc (mikrotik-rsc.ts)
:do { /ip firewall filter remove [find comment~"^evofw-"] } on-error={}
/ip firewall filter add chain=input action=drop src-address-list=EVOFW_DENY comment=evofw-bl-drop-input disabled=no
/ip firewall filter add chain=forward action=drop src-address-list=EVOFW_DENY comment=evofw-bl-drop-forward disabled=no
/ip firewall filter add chain=forward action=accept src-address-list=EVOFW_ALLOW comment=evofw-wl-accept-forward disabled=yes
/ip firewall filter add chain=forward action=drop comment=evofw-wl-drop-forward disabled=yes
/ip firewall filter add chain=input action=drop src-address-list=EVOFW_DENY comment=evofw-deny-drop-input disabled=no
/ip firewall filter add chain=forward action=drop src-address-list=EVOFW_DENY comment=evofw-deny-drop-forward disabled=no
/ip firewall filter add chain=forward action=accept src-address-list=EVOFW_ALLOW comment=evofw-allow-accept-forward disabled=no
/ip firewall filter add chain=forward action=drop comment=evofw-default-drop-forward disabled=yes
# Sync: fetch policy.rsc → import address-lists + toggle mode
:do { /system script remove [find name="evofw-sync"] } on-error={}
+1 -1
View File
@@ -140,7 +140,7 @@ describe('install-links', () => {
expect(byId.headers['content-type']).toContain('text/plain')
expect(byId.body).toContain(':global EvofwCpUrl "https://fw.example.com"')
expect(byId.body).toContain(`:global EvofwInstallLinkId "${body.id}"`)
expect(byId.body).toContain('evofw-bl-drop-input')
expect(byId.body).toContain('evofw-deny-drop-input')
expect(byId.body).toContain('/v1/agent/policy.rsc')
})