Commit graph

3253 commits

Author SHA1 Message Date
Christian Hesse
090f25a82d check-certificates: add missing semicolon 2025-11-19 16:19:59 +01:00
Christian Hesse
8ff34a2408 mod/notification-ntfy: define certificate use 2025-11-19 16:19:59 +01:00
Christian Hesse
affb9b3baf doc/mode-button: create code block with indention 2025-11-19 16:19:59 +01:00
Christian Hesse
87787eefe3 fw-addr-lists: define certificate use 2025-11-19 16:19:59 +01:00
Christian Hesse
677b5b8069 doc/mod/ssh-keys-import: create code block with indention 2025-11-19 16:19:59 +01:00
Christian Hesse
876505c36d check-certificates: define certificate use 2025-11-19 16:19:59 +01:00
Christian Hesse
b5a0269667 global-functions: $ScriptInstallUpdate: define certificate use 2025-11-19 16:19:59 +01:00
Christian Hesse
f3e6e152bc global-functions: $GetMacVendor: define certificate use 2025-11-19 16:19:59 +01:00
Christian Hesse
8eb397f79f global-functions: $DownloadPackage: define certificate use 2025-11-19 16:19:59 +01:00
Christian Hesse
db0a5bf33c global-functions: $CertificateAvailable: support new builtin-trust-store...
... which was introduced with RouterOS 7.21beta7.
2025-11-19 16:19:59 +01:00
Christian Hesse
fbfeea3042 INITIAL-COMMANDS: support new builtin-trust-store...
... which was introduced with RouterOS 7.21beta7.
2025-11-19 16:19:59 +01:00
Christian Hesse
1a1399d302 README: support new builtin-trust-store...
... which was introduced with RouterOS 7.21beta7.
2025-11-19 16:19:59 +01:00
Christian Hesse
335266f247 README: update the screenshot for script update...
... to match commit 2c92c78b46.
2025-11-19 16:19:47 +01:00
Christian Hesse
d100cac9ed README: add a line break before command 2025-11-13 12:03:37 +01:00
Christian Hesse
c88953e44d README: fix typo
We had it there since 39d1027d697c09ec709a1b847a185ccff3b00540... 😜
2025-11-07 22:11:25 +01:00
Christian Hesse
20987221d9 mod/notification-email: ignore errors (for now...)
Errors are returned since RouterOS 7.21beta2.

We keep the current logic for now, as we want to support older
RouterOS versions. This is something to be reworked later...
2025-10-26 19:19:13 +01:00
Christian Hesse
ea4b5553c2 Merge branch 'netmask6' into next
This branch is a follow-up on 9ceed0926a
with clean solution. Read on for details...

The data type `ip6-prefix` used to hold what it was named for - an IPv6
prefix:

    [user@mikrotik] > :put 2001:db8::dead:beef/32
    2001:db8::/32

This changed with RouterOS 6.21beta2, which now allows that exact same
data type to hold something like "address with prefix length attached":

    [user@mikrotik] > :put 2001:db8::dead:beef/32
    2001:db8::dead:beef/32

My scripts (namely `fw-addr-lists`) relied on the old behaviour and broke.
The commit mentioned above was just a quick workaround, with rough edges,
and it could still fail.

Sadly RouterOS does not support bit shifting on IPv6 data types, so a
(completely) mathematical solution is out of scope.

This branch implements a new and better workaround, see the first commit
of branch (6ad6f9aa08) for details.

I opened a support ticket / feature request on this topic, let's see
what results it brings...

https://help.mikrotik.com/servicedesk/servicedesk/customer/portal/1/SUP-201881
2025-10-22 19:05:38 +02:00
Christian Hesse
b80b872e55 mod/ipcalc: support IPv6
Well, some of these values do not make a lot of sense for IPv6...
Something to be cleaned up later.
2025-10-19 19:55:12 +02:00
Christian Hesse
ea05b69f7c fw-addr-lists: use $NetMask6 2025-10-19 19:55:12 +02:00
Christian Hesse
d7a6eb1d00 global-functions: $NetMask6: implement simple caching
The calculation is quite complex for something that needs to be done
frequently, for example by `fw-addr-lists`. The number of possible
netmasks is limited, so let's cache the results that were calculated
already.
2025-10-19 19:52:42 +02:00
Christian Hesse
6ad6f9aa08 global-functions: introduce $NetMask6
RouterOS does not support bit shifting on IPv6 data types, so we have to
split the problem:

 * each 16 bit block is calculated separately, as number
 * the complete netmask is assembled in a loop, as string
 * the final string is casted to correct data type
2025-10-19 19:48:14 +02:00
Christian Hesse
c62f236251 Merge branch 'netmask4' into next 2025-10-19 19:26:51 +02:00
Christian Hesse
47309e5c03 fw-addr-lists: normalize IPv4 addresses 2025-10-16 15:43:43 +02:00
Christian Hesse
9fa11cb79a mod/ipcalc: use $NetMask4 2025-10-16 13:03:54 +02:00
Christian Hesse
def540c965 global-functions: introduce $NetMask4 2025-10-16 10:47:19 +02:00
Christian Hesse
025b492783 global-functions: remove trailing space 2025-10-16 10:34:09 +02:00
Christian Hesse
6630d35eea mod/notification-telegram: $FlushTelegramQueue: check for cert, again
Chances are that messages have been queued before system was fully up or
connected. Thus the certificate may be missing, and it should be checked
again for on flush.
2025-10-13 12:06:01 +02:00
Christian Hesse
c81618b571 log-forward: always use memo symbol...
... and add warning sign on top.
2025-10-09 09:22:39 +02:00
Christian Hesse
35b556f0b2 fw-addr-lists: calculate branch after post-processing...
... as branch will likely change, and we want to avoid duplicates. 😉
2025-10-08 18:43:06 +02:00
Christian Hesse
9ceed0926a fw-addr-lists: do not use IPv6 net addresses smaller /64
This should reduce the number of addresses in list by aggregating them,
and also fix addresses with host part set (like 2001:470:1:fb5::2a0/64,
which should be 2001:470:1:fb5::/64 really).

The latter caused new warnings with RouterOS 7.21beta2.
2025-10-08 18:43:06 +02:00
Christian Hesse
5ffa85f8bf mod/ssh-keys-import: handle new parameter
With RouterOS 7.21beta2 the user SSH keys "key-owner" field was
renamed to "info".

Either of both is displayed in red by syntax highlighting, but it
works anyway.
2025-10-08 18:42:26 +02:00
Christian Hesse
48d0f1f0b9 fw-addr-lists: check last character of line for JSON
This is not a proof, but a line also ending with a curly bracket
has higher probability of being valid JSON.

Better safe than sorry... We are suffering a CVE in RouterOS:
https://www.cve.org/CVERecord?id=CVE-2025-10948
2025-10-02 11:51:08 +02:00
Christian Hesse
a931cb61a0 packages-update: fix condition when checking for scheduler
This broke with commit 6b0c9ab17d2e7e3693cebf281e5300d1e4de3446...
2025-09-30 10:02:20 +02:00
Christian Hesse
14b51d96b0 generate valid HTML, including head & style 2025-09-25 10:25:20 +02:00
Miquel Bonastre
2c715096b9 mod/ssh-keys-import: $SSHKeysImportFile: fix file exists condition...
... which broke in commit 80aed200fd.
2025-09-25 10:24:07 +02:00
Christian Hesse
2773fef9d8 global-functions: $WaitForFile: try less expensive operation
Checking a specific file is less expensive operation than finding one,
especially when on hardware with huge storage and lots of files (like
RDS). We have to keep the find command in the latter loop, though.
2025-09-25 10:24:07 +02:00
Christian Hesse
6b0c9ab17d packages-update: exit early if scheduler exists 2025-09-15 13:18:30 +02:00
Christian Hesse
59dc7e6d0c Merge branch 'check-health' into next 2025-08-26 09:25:01 +02:00
Christian Hesse
22e6383e86 check-health.d/voltage: use script name for origin in notification 2025-08-25 11:11:07 +02:00
Christian Hesse
62ca30b5d3 check-health.d/temperature: use script name for origin in notification 2025-08-25 11:11:07 +02:00
Christian Hesse
907358cb85 check-health.d/state: use script name for origin in notification 2025-08-25 11:11:07 +02:00
Christian Hesse
2fed8f967b check-health: pass script name to plugin 2025-08-25 11:11:07 +02:00
Christian Hesse
386ea2419f check-health: fix variable name 2025-08-25 11:04:07 +02:00
Christian Hesse
fe080c0d3d global-functions: $CertificateAvailable: properly handle duplicate CN
There are CA certificates with identical CommonName out there... 🤪
Let's handle these.

    [admin@MikroTik] > /certificate/print proplist=common-name,skid where common-name="GlobalSign";
    Flags: T - TRUSTED
    Columns: COMMON-NAME, SKID
    #   COMMON-NAME  SKID
    0 T GlobalSign   8FF04B7FA82E4524AE4D50FA639A8BDEE2DD1BBC
    1 T GlobalSign   3DE629489BEA07CA21444A26DE6EDED283D09F59
    2 T GlobalSign   AE6C05A39313E2A2E7E2D71CD6C7F07FC86753A0
    3 T GlobalSign   54B07BAD45B8E2407FFB0A6EFBBE33C93CA384D5
2025-08-16 23:14:31 +02:00
Christian Hesse
a856d309df global-functions: $SymbolByUnicodeName: allow to add more symbols...
... for example from a module. Add a script `mod/symbols-extra` with
something like:

    :global SymbolsExtra;

    :set ($SymbolsExtra->"rocket") "\F0\9F\9A\80";
2025-07-28 16:47:27 +02:00
Christian Hesse
721e786f68 netwatch-notify: increase the address-list timeout even further 2025-07-21 10:52:22 +02:00
Christian Hesse
4c2c7e817a netwatch-notify: give the number of failures...
... to indicated this happened several times.
2025-07-21 10:47:19 +02:00
Christian Hesse
89175e511f accesslist-duplicates: print without paging 2025-07-07 18:38:21 +02:00
Christian Hesse
b068f86995 netwatch-dns: fix indention 2025-06-25 10:47:12 +02:00
Christian Hesse
d46574b4fe netwatch-dns: retry doh server...
... for more resilience on bad connectivity or saturated link.
2025-06-25 10:30:26 +02:00