Commit graph

3043 commits

Author SHA1 Message Date
Christian Hesse
20bf609c44 check-routeros-update: fix condition for license check
Turns out that `next-renewal-at` is moved forward when renewal failed,
so it never matches the criteria. Just start complaining three weeks
before deadline.
2025-03-13 10:51:39 +01:00
Christian Hesse
b63e0fcb2f netwatch-notify: check matching address type only 2025-03-12 11:26:22 +01:00
Christian Hesse
1555426687 netwatch-notify: increase the timeout even more
This interacts with the number of addresses in the address-list. Having
a lot of addresses there (for exemple from script 'fw-addr-lists' 😜)
makes the 'find' take longer. We have to make sure that 'find' succeeds
before the address times out.

As this does not hurt... Let's just bump to 10 seconds to be safe.
2025-03-12 11:18:18 +01:00
Christian Hesse
97b99316b2 netwatch-notify: increase timeout...
... as a timeout of one second expires immediately. 🤨
2025-03-12 10:31:11 +01:00
Christian Hesse
788400c458 fw-addr-lists: raw.githubusercontent.com requires 'USERTrust RSA Certification Authority' now 2025-03-11 15:51:25 +01:00
Christian Hesse
eb59dd21ca check-routeros-update: check perpetual license...
... as these have to be renewed and can expire.
2025-03-11 15:51:25 +01:00
Christian Hesse
79a4b369cb Merge branch 'fw-addr-lists' into next 2025-03-11 15:51:25 +01:00
Christian Hesse
f0e6cbcfe1 fw-addr-lists: get branch from calculated checksum
The addresses were spread very uneven before.

Let's calculate a checksum, and take the first two characters of that.
The addresses are now spread evenly on 256 branches (0x00 to 0xff).
2025-03-11 15:51:10 +01:00
Christian Hesse
d71ea804b0 fw-addr-lists: two characters for branch
Using one character for IPv4 is ok (1 to 9), but IPv6 global unicase
(2000::/3) results in just two different characters (2 and 3).

So let's use first two characters...
2025-03-11 14:20:50 +01:00
Christian Hesse
e148df9e57 fw-addr-lists: put addresses into "branches"...
... effectively adding another layer and some complexity, but:
The addresses are sorted inside the array, and sorting less addresses in
a branch saves a lot of processing power. So this is a lot faster now...
2025-03-11 14:20:44 +01:00
Christian Hesse
2f55bfaf00 fw-addr-lists: strip cidr for host addresses
This makes sure the addresses match later when we read them from
address-list for renew.
2025-03-11 14:19:10 +01:00
Christian Hesse
ea6de35699 fw-addr-lists: do not clean up
Cleanup is important on renew (so the script does not attempt to re-add),
but we do not care here.
2025-03-11 14:13:55 +01:00
Christian Hesse
fb343c99e3 fw-addr-lists: put timeout into variable 2025-03-06 22:59:31 +01:00
Christian Hesse
7be26a0712 DEBUG: add info on $LogPrintVerbose 2025-03-06 15:59:44 +01:00
Christian Hesse
6d718ec987 fw-addr-lists: use $LogPrintVerbose ...
... to reduce debug output and speed up execution.
2025-03-06 15:59:44 +01:00
Christian Hesse
e341e1c30c global-functions: introduce $LogPrintVerbose ...
... which is a declared function, but has no code, intentionally. It can be
called as a no-op by default.

If you want this output set the function to be the same as $LogPrint:

    :set LogPrintVerbose $LogPrint;
2025-03-06 15:59:11 +01:00
Christian Hesse
b43b1b3955 Merge branch 'checksums' into next 2025-03-06 10:43:15 +01:00
Christian Hesse
1b46a5fd9b global-functions: $ScriptInstallUpdate: checksum only for same source
So ignore if script is fetched from different base or with different
suffix.
2025-03-06 10:43:13 +01:00
Christian Hesse
b13360e4b8 global-functions: $ScriptInstallUpdate: simplify check
This one should suffice...
2025-03-06 10:42:52 +01:00
Christian Hesse
c9de6d8579 global-functions: $ScriptInstallUpdate: put checksum into variable 2025-03-06 10:42:27 +01:00
Christian Hesse
10374afc18 global-functions: $ScriptInstallUpdate: support checksums for CRLF scripts 2025-03-06 10:42:00 +01:00
Christian Hesse
0c1d96f89d global-functions: $ScriptInstallUpdate: get and compare checksums
The file 'checksums.json' is generated when deploying to my web
server... This should speed up the update a lot as it reduces downloads
to a minimum. 🎉😁
2025-03-06 10:41:28 +01:00
Christian Hesse
3ccaafd1b3 global-functions: $ScriptInstallUpdate: move code into block 2025-03-05 01:15:22 +01:00
Christian Hesse
469f783a92 ipv6-update: check for availability of both variables 2025-03-03 09:12:43 +01:00
Christian Hesse
33c02e0609 ipv6-update: ignore if prefix is no longer valid 2025-03-03 09:10:54 +01:00
Christian Hesse
6331505dbe Merge branch 'quote-file-name' into next
This is required with RouterOS 7.18 now...

Well, probably the change was introduced with one of the
beta versions...
2025-02-27 10:52:52 +01:00
Christian Hesse
0c4fb42616 mod/notification-telegram: $GetTelegramChatId: give thead id...
... if message was sent to group's topic.
2025-02-27 10:52:52 +01:00
Christian Hesse
f5189b8bd7 INITIAL-COMMANDS: quote the certificate file name 2025-02-27 10:52:52 +01:00
Christian Hesse
e2fe653035 mod/notification-telegram: $GetTelegramChatId: use last message 2025-02-27 10:52:52 +01:00
Christian Hesse
b11be59b08 README: quote the certificate file name 2025-02-27 10:52:52 +01:00
Christian Hesse
24de060904 Merge branch 'check-certificates' into next 2025-02-27 10:52:19 +01:00
Christian Hesse
14195c51ca check-certificates: try PKCS#12 before PEM...
... as that is more likely to have a private key.

Is that true? 🤨
2025-02-26 18:25:58 +01:00
Christian Hesse
e833dfcf25 check-certificates: simplify return from function...
... and also break earch on success.
2025-02-26 18:05:32 +01:00
Christian Hesse
512c54bd59 check-certificates: ... and even more 2025-02-26 18:05:32 +01:00
Christian Hesse
3d40b4419d check-certificates: add more debug output 2025-02-26 18:03:45 +01:00
Christian Hesse
a6d4e7e82c check-certificates: drop dot from type...
... and add it in file name.
2025-02-26 18:03:17 +01:00
Christian Hesse
f6c2225f68 check-certificates: catch and ignore import error
Hmm... 🤨 When was that runtime error introduced? I *think* it
worked before.
2025-02-26 13:57:51 +01:00
Christian Hesse
53b13b295a mod/notification-telegram: introduce $GetTelegramChatId 2025-02-25 22:37:30 +01:00
Christian Hesse
4eafcaa3ac telegram-chat: say hello when awaiting commands 2025-02-25 22:16:48 +01:00
Christian Hesse
c33eb41c9c global-functions: $DeviceInfo: add license level, re-order 2025-02-25 17:55:26 +01:00
Christian Hesse
78f9687558 Merge branch 'telegram-topics' into next 2025-02-25 17:55:26 +01:00
Christian Hesse
e5de9de391 notify on support for Telegram group topics 2025-02-25 17:55:26 +01:00
Christian Hesse
7928c5f054 telegram-chat: support reply in group's topic 2025-02-25 17:55:26 +01:00
Christian Hesse
757fa60e6f telegram-chat: make $IsReply a boolean...
... and check for correct data type.

We need this for a group with topic feature enabled, as that variable is
set there, but is is an array.
2025-02-25 17:55:26 +01:00
Christian Hesse
a22b62f588 mod/notification-telegram: support sending to group's topic...
... when a group has enabled the "Topics" feature.
2025-02-25 17:55:12 +01:00
Christian Hesse
cad104879c mod/notification-telegram: simplify the queue...
... and pass http-data as a complete sting.
2025-02-24 15:18:53 +01:00
Christian Hesse
58da92e36a global-functions: $WaitForFile: drop the warning on file handling breakage...
... but keep the workaround for now - just to be sure.
2025-02-19 22:21:03 +01:00
Christian Hesse
2c92c78b46 global-functions: $ScriptInstallUpdate: also show commit info 2025-02-17 13:55:44 +01:00
Christian Hesse
75633872aa global-functions: $DeviceInfo: also show commit info 2025-02-17 13:55:36 +01:00
Christian Hesse
dafcc1a0cb global-functions: $RmFile: fix type safeguard
Ups... 🫣
The type is not just literal 'file' - but what ever type the file is,
like 'backup', 'package', 'script', '.conf file', ...

So let's match those types we do *not* want to remove.

Fixes: https://github.com/eworm-de/routeros-scripts/issues/90
2025-02-13 17:58:48 +01:00