From 4b8e8adb2d83a910d07ad038e6021606c7c62bac Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 14:31:17 +0100 Subject: [PATCH 01/55] contrib/{logo-color,notification}: use a single style --- contrib/{notification.d => general}/style.css | 1 + contrib/logo-color.d/style.css | 5 ----- contrib/logo-color.html | 2 +- contrib/notification.html | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) rename contrib/{notification.d => general}/style.css (93%) delete mode 100644 contrib/logo-color.d/style.css diff --git a/contrib/notification.d/style.css b/contrib/general/style.css similarity index 93% rename from contrib/notification.d/style.css rename to contrib/general/style.css index 648ea23..a3099a9 100644 --- a/contrib/notification.d/style.css +++ b/contrib/general/style.css @@ -1,3 +1,4 @@ +/* stylesheet for RouterOS Scripts */ body { font-family: fira-sans, sans-serif; font-size: 10pt; diff --git a/contrib/logo-color.d/style.css b/contrib/logo-color.d/style.css deleted file mode 100644 index eb2ec6a..0000000 --- a/contrib/logo-color.d/style.css +++ /dev/null @@ -1,5 +0,0 @@ -body { - font-family: fira-sans, sans-serif; - font-size: 10pt; - background-color: transparent; -} diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 17942ce..802e36c 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -3,7 +3,7 @@ RouterOS-Scripts Logo Color Changer - + diff --git a/contrib/notification.html b/contrib/notification.html index 7875036..49bf8bd 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -3,8 +3,8 @@ RouterOS-Scripts Notification Generator - - + + From a5ac5138be0ce4ff51d2b36d6312ebc08972751c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 14:46:01 +0100 Subject: [PATCH 02/55] contrib/html.sh: include stylesheet via link --- contrib/general/style.css | 32 ++++++++++++++++++++++++++++++++ contrib/html.sh | 6 +++++- contrib/html.sh.d/head.html | 11 +---------- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/contrib/general/style.css b/contrib/general/style.css index a3099a9..d0cb371 100644 --- a/contrib/general/style.css +++ b/contrib/general/style.css @@ -4,6 +4,28 @@ body { font-size: 10pt; background-color: transparent; } +h2 { + border-bottom: 1px solid #ccc; + color: #000; +} +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +blockquote { + border-left: 4px solid #ccc; + padding: 0 10px; + color: #777; +} +code { + margin: 0 2px; + padding: 2px 5px; + border: 1px solid #ccc; + background-color: #f8f8f8; + border-radius: 3px; +} div.notification { position: relative; float: right; @@ -31,6 +53,16 @@ p.hint { pre { font-family: fira-mono, monospace; white-space: pre-wrap; + background-color: #f8f8f8; + border: 1px solid #ccc; + overflow: auto; + padding: 6px 10px; + border-radius: 3px; +} +pre code { + margin: 0; + padding: 0; + border: 0; } span.link { color: #863600; diff --git a/contrib/html.sh b/contrib/html.sh index bbd8ba8..194a7cd 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -2,7 +2,11 @@ set -e -sed "s|__TITLE__|$(head -n1 "${1}")|" < "${0}.d/head.html" +RELTO="$(dirname "${1}")" +sed \ + -e "s|__TITLE__|$(head -n1 "${1}")|" \ + -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" contrib/general/style.css)|" \ + < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ -e '/| id="\L\1">|' diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html index 1b1dd03..50653ae 100644 --- a/contrib/html.sh.d/head.html +++ b/contrib/html.sh.d/head.html @@ -1,15 +1,6 @@ RouterOS Scripts :: __TITLE__ - + From a4d436573548567bce38dd28daa69ecc63ee7dc8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Oct 2025 10:19:30 +0100 Subject: [PATCH 03/55] contrib/html.sh: link the stylesheet from top level... ... and copy it there in Makefile. --- .gitignore | 1 + Makefile | 7 +++++-- contrib/html.sh | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8abdc28..9d27373 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.rej # html files (as generated from markdown) +style.css *.html # checksums file as used by $ScriptInstallUpdate diff --git a/Makefile b/Makefile index 0265a51..a741fef 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,14 @@ LOCAL = $(wildcard *.local.rsc) WIFI = $(wildcard *.wifi.rsc) MARKDOWN = $(wildcard *.md doc/*.md doc/mod/*.md) -HTML = $(MARKDOWN:.md=.html) +HTML = $(MARKDOWN:.md=.html) style.css all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json -%.html: %.md contrib/html.sh contrib/html.sh.d/head.html +style.css: contrib/general/style.css + cp $< $@ + +%.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html contrib/html.sh $< > $@ %.capsman.rsc: %.template.rsc Makefile diff --git a/contrib/html.sh b/contrib/html.sh index 194a7cd..287119f 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -5,7 +5,7 @@ set -e RELTO="$(dirname "${1}")" sed \ -e "s|__TITLE__|$(head -n1 "${1}")|" \ - -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" contrib/general/style.css)|" \ + -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" style.css)|" \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ From 6317fb8f40196f62ff5debcb1ef1685f57d27118 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 12:51:34 +0100 Subject: [PATCH 04/55] contrib/html.sh: add a margin on left and right... ... for windows in landscape (wider than high). --- contrib/general/style.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/general/style.css b/contrib/general/style.css index d0cb371..f497edf 100644 --- a/contrib/general/style.css +++ b/contrib/general/style.css @@ -4,6 +4,12 @@ body { font-size: 10pt; background-color: transparent; } +@media only screen and (orientation: landscape) { + body { + margin-left: 10vw; + margin-right: 10vw; + } +} h2 { border-bottom: 1px solid #ccc; color: #000; From 45ee884d8a9504bfc1653b05c6204f9e0ff05342 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 14:55:00 +0100 Subject: [PATCH 05/55] contrib/html.sh: link the logo with relative path --- contrib/html.sh | 1 + contrib/html.sh.d/head.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/html.sh b/contrib/html.sh index 287119f..3b5b420 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -6,6 +6,7 @@ RELTO="$(dirname "${1}")" sed \ -e "s|__TITLE__|$(head -n1 "${1}")|" \ -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" style.css)|" \ + -e "s|__LOGO__|$(realpath --relative-to="${RELTO}" logo.png)|" \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html index 50653ae..779e246 100644 --- a/contrib/html.sh.d/head.html +++ b/contrib/html.sh.d/head.html @@ -2,5 +2,5 @@ RouterOS Scripts :: __TITLE__ - + From 51a4a070321b8bdeb9d9e4503eb91954a043c313 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 22:34:00 +0100 Subject: [PATCH 06/55] contrib/html.sh: properly handle anchors --- contrib/html.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/html.sh b/contrib/html.sh index 3b5b420..dbb40f6 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -9,6 +9,6 @@ sed \ -e "s|__LOGO__|$(realpath --relative-to="${RELTO}" logo.png)|" \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ - -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ + -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ -e '/| id="\L\1">|' printf '' From a66f8edbd1fa2939ae0631487d8730e01da84b21 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 22:57:17 +0100 Subject: [PATCH 07/55] contrib/html.sh: drop comman from id/anchor --- contrib/html.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/html.sh b/contrib/html.sh index dbb40f6..bd15bf0 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -10,5 +10,6 @@ sed \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ - -e '/| id="\L\1">|' + -e '/| id="\L\1">|' \ + -e '/' From 552dbbd9b9e49e4f52c4aa4eeea1ea6dc2595a5d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 15:19:32 +0100 Subject: [PATCH 08/55] contrib/*: unify html code --- contrib/html.sh.d/head.html | 4 ++-- contrib/logo-color.html | 17 +++++++---------- contrib/notification.html | 17 +++++++---------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html index 779e246..0ce3ff7 100644 --- a/contrib/html.sh.d/head.html +++ b/contrib/html.sh.d/head.html @@ -1,6 +1,6 @@ -RouterOS Scripts :: __TITLE__ - + +RouterOS Scripts :: __TITLE__ diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 802e36c..1dc74b0 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -1,14 +1,12 @@ - - - - -RouterOS-Scripts Logo Color Changer + + +RouterOS Scripts :: Logo Color Changer + - - + -

RouterOS-Scripts Logo Color Changer

+

Logo Color Changer

You want the logo for your own notifications? But you joined the Telegram Group and want @@ -36,5 +34,4 @@ for other browsers may differ.)

Set a profile photo for your Telegram bot.

- - + diff --git a/contrib/notification.html b/contrib/notification.html index 49bf8bd..1bd1ca5 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -1,14 +1,12 @@ - - - - -RouterOS-Scripts Notification Generator + + +RouterOS Scripts :: Notification Generator + - - + -

RouterOS-Scripts Notification Generator

+

Notification Generator

@@ -31,5 +29,4 @@

Then right-click, click "Take Screenshot" and finally select the notification and download it.

- - + From 76ddd9453798fbc86949f78e5ca8ec7e88300473 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 15:35:14 +0100 Subject: [PATCH 09/55] contrib/{logo-color,notification}: add navigation structure --- contrib/logo-color.html | 6 ++++++ contrib/notification.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 1dc74b0..78d19e6 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -8,6 +8,8 @@

Logo Color Changer

+

⬅️ Go back to main README

+

You want the logo for your own notifications? But you joined the Telegram Group and want something that differentiates? Color it!

@@ -34,4 +36,8 @@ for other browsers may differ.)

Set a profile photo for your Telegram bot.

+
+ +

⬅️ Go back to main README
+⬆️ Go back to top

diff --git a/contrib/notification.html b/contrib/notification.html index 1bd1ca5..a0eaa11 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -8,6 +8,8 @@

Notification Generator

+

⬅️ Go back to main README

+
@@ -29,4 +31,8 @@

Then right-click, click "Take Screenshot" and finally select the notification and download it.

+
+ +

⬅️ Go back to main README
+⬆️ Go back to top

From dbf332383aae947ad8f23d855b59c1fb0f2d9185 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 16:06:42 +0100 Subject: [PATCH 10/55] contrib/notification: update date format --- contrib/notification.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/notification.html b/contrib/notification.html index a0eaa11..5d761b9 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -16,7 +16,7 @@

[MikroTik] ℹ️ Subject

Message
-

⏰ This message was queued since oct/18/2022 18:30:48 and may be obsolete.

+

⏰ This message was queued since 2025-10-29 16:06:18 and may be obsolete.

✂️ The message was too long and has been truncated, cut off 13%!

@@ -25,7 +25,7 @@

Subject:

Message:

Show link:

-

Queued since

+

Queued since

Cut-off with percent

Then right-click, click "Take Screenshot" and finally select the From 24e3c12f02f85f775285c5fd3b85b78c29e0bf61 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 16:11:23 +0100 Subject: [PATCH 11/55] contrib/notification: format the values italic --- contrib/notification.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/notification.html b/contrib/notification.html index 5d761b9..298e3bd 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -16,8 +16,8 @@

[MikroTik] ℹ️ Subject

Message
-

⏰ This message was queued since 2025-10-29 16:06:18 and may be obsolete.

-

✂️ The message was too long and has been truncated, cut off 13%!

+

⏰ This message was queued since 2025-10-29 16:06:18 and may be obsolete.

+

✂️ The message was too long and has been truncated, cut off 13%!

From 9dc1c3b96c67df94d6126507f0eb1af9bc1edc4f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Oct 2025 11:07:38 +0100 Subject: [PATCH 12/55] contrib/checksums.sh: output to stdout... ... and let the Makefile redirect. --- Makefile | 2 +- contrib/checksums.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a741fef..bff5458 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ style.css: contrib/general/style.css < $< > $@ checksums.json: contrib/checksums.sh *.rsc */*.rsc - contrib/checksums.sh + contrib/checksums.sh > $@ clean: rm -f $(HTML) checksums.json diff --git a/contrib/checksums.sh b/contrib/checksums.sh index b472b49..ab4e973 100755 --- a/contrib/checksums.sh +++ b/contrib/checksums.sh @@ -6,4 +6,4 @@ set -e md5sum $(find -name '*.rsc' | sort) | \ sed -e "s| \./||" -e 's|.rsc$||' | \ - jq --raw-input --null-input '[ inputs | split (" ") | { (.[1]): (.[0]) }] | add' > 'checksums.json' + jq --raw-input --null-input '[ inputs | split (" ") | { (.[1]): (.[0]) }] | add' From b0a85436e1ca775b1514d4f4bc002df839562dbc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 2 Nov 2025 09:19:16 +0100 Subject: [PATCH 13/55] global-functions: $ScriptInstallUpdate: give hint on ignore Fixes: https://github.com/eworm-de/routeros-scripts/issues/112 --- global-functions.rsc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 5ede654..69f7e03 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1314,6 +1314,11 @@ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; } + :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \ + [ :len $CheckSum ] = 0) do={ + $LogPrintOnce warning $0 \ + ("Added the script manually? Skip updates with 'ignore=true' in comment."); + } :error false; } From 1a93c61bfd1390aa3a9ac721a8a2138526676661 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 00:00:03 +0100 Subject: [PATCH 14/55] global-functions: $ScriptInstallUpdate: either or... ... but not both. --- global-functions.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/global-functions.rsc b/global-functions.rsc index 69f7e03..4f62b2b 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1313,6 +1313,7 @@ :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; + :error false; } :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \ [ :len $CheckSum ] = 0) do={ From 33e8af19246e17e131d4657ec6ae224f02614a3e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 3 Nov 2025 09:17:25 +0100 Subject: [PATCH 15/55] global-functions: $ScriptInstallUpdate: extra actions on 'not found' only --- global-functions.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 4f62b2b..6323249 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1310,6 +1310,10 @@ } } do={ $LogPrint warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "': " . $Err); + :if ($Err != "Fetch failed with status 404") do={ + :error false; + } + :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; From 0e23facf827f9de09f10b175737bb48fa69654f6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Nov 2025 17:32:37 +0100 Subject: [PATCH 16/55] Makefile: clean up and add phony targets --- Makefile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bff5458..e376e56 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,22 @@ # template scripts -> final scripts # markdown files -> html files -CAPSMAN = $(wildcard *.capsman.rsc) -LOCAL = $(wildcard *.local.rsc) -WIFI = $(wildcard *.wifi.rsc) +ALL_RSC := $(wildcard *.rsc */*.rsc) +GEN_RSC := $(wildcard *.capsman.rsc *.local.rsc *.wifi.rsc) -MARKDOWN = $(wildcard *.md doc/*.md doc/mod/*.md) -HTML = $(MARKDOWN:.md=.html) style.css +MARKDOWN := $(wildcard *.md doc/*.md doc/mod/*.md) +HTML := $(MARKDOWN:.md=.html) style.css -all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json +.PHONY: all checksums docs rsc clean + +all: checksums docs rsc + +checksums: checksums.json + +checksums.json: contrib/checksums.sh $(ALL_RSC) + contrib/checksums.sh > $@ + +docs: $(HTML) style.css: contrib/general/style.css cp $< $@ @@ -17,6 +25,8 @@ style.css: contrib/general/style.css %.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html contrib/html.sh $< > $@ +rsc: $(GEN_RSC) + %.capsman.rsc: %.template.rsc Makefile sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ -e '/^# NOT \/caps-man\/ #$$/,/^# NOT \/caps-man\/ #$$/d' \ @@ -35,8 +45,5 @@ style.css: contrib/general/style.css -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ < $< > $@ -checksums.json: contrib/checksums.sh *.rsc */*.rsc - contrib/checksums.sh > $@ - clean: rm -f $(HTML) checksums.json From 7803d3f81a6ff9d23d0e752d00a2531138f59d75 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 23:03:58 +0100 Subject: [PATCH 17/55] fw-addr-lists.d/{allow,block}: use short url rsc.eworm.de --- fw-addr-lists.d/allow | 2 +- fw-addr-lists.d/block | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fw-addr-lists.d/allow b/fw-addr-lists.d/allow index 8b59ed7..f0239cd 100644 --- a/fw-addr-lists.d/allow +++ b/fw-addr-lists.d/allow @@ -1,3 +1,3 @@ # an ip address list for use with fw-addr-lists script -# https://git.eworm.de/cgit/routeros-scripts/about/doc/fw-addr-lists.md +# https://rsc.eworm.de/doc/fw-addr-lists.md git.eworm.de diff --git a/fw-addr-lists.d/block b/fw-addr-lists.d/block index 5e9fef2..86a6c62 100644 --- a/fw-addr-lists.d/block +++ b/fw-addr-lists.d/block @@ -1,5 +1,5 @@ # an ip address list for use with fw-addr-lists script -# https://git.eworm.de/cgit/routeros-scripts/about/doc/fw-addr-lists.md +# https://rsc.eworm.de/doc/fw-addr-lists.md # example.net 93.184.216.34 From a95077c14b75e6f4a8fbb3d5bcde22940a2cce35 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 23:05:56 +0100 Subject: [PATCH 18/55] fw-addr-lists.d/allow: use rsc.eworm.de in the list --- fw-addr-lists.d/allow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fw-addr-lists.d/allow b/fw-addr-lists.d/allow index f0239cd..8c4ca3c 100644 --- a/fw-addr-lists.d/allow +++ b/fw-addr-lists.d/allow @@ -1,3 +1,3 @@ # an ip address list for use with fw-addr-lists script # https://rsc.eworm.de/doc/fw-addr-lists.md -git.eworm.de +rsc.eworm.de From 3776a028f8fa66f785d28c40822a1d2b7793b9aa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:04:13 +0100 Subject: [PATCH 19/55] check-certificates: add missing semicolon --- check-certificates.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index c10e33b..f2d5c1f 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -21,7 +21,7 @@ :global CertWarnTime; :global Identity; - :global CertificateAvailable + :global CertificateAvailable; :global EscapeForRegEx; :global IfThenElse; :global LogPrint; From 572657393376144f826690c68084e9e0ef36aa60 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 14:31:17 +0100 Subject: [PATCH 20/55] contrib/{logo-color,notification}: use a single style --- contrib/{notification.d => general}/style.css | 3 ++- contrib/logo-color.d/style.css | 5 ----- contrib/logo-color.html | 2 +- contrib/notification.html | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) rename contrib/{notification.d => general}/style.css (93%) delete mode 100644 contrib/logo-color.d/style.css diff --git a/contrib/notification.d/style.css b/contrib/general/style.css similarity index 93% rename from contrib/notification.d/style.css rename to contrib/general/style.css index 648ea23..66d44f1 100644 --- a/contrib/notification.d/style.css +++ b/contrib/general/style.css @@ -1,7 +1,8 @@ +/* stylesheet for RouterOS Scripts */ body { + background-color: transparent; font-family: fira-sans, sans-serif; font-size: 10pt; - background-color: transparent; } div.notification { position: relative; diff --git a/contrib/logo-color.d/style.css b/contrib/logo-color.d/style.css deleted file mode 100644 index eb2ec6a..0000000 --- a/contrib/logo-color.d/style.css +++ /dev/null @@ -1,5 +0,0 @@ -body { - font-family: fira-sans, sans-serif; - font-size: 10pt; - background-color: transparent; -} diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 17942ce..802e36c 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -3,7 +3,7 @@ RouterOS-Scripts Logo Color Changer - + diff --git a/contrib/notification.html b/contrib/notification.html index 7875036..49bf8bd 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -3,8 +3,8 @@ RouterOS-Scripts Notification Generator - - + + From ec8a38d67b2d5425269b68e80abacb5fc37765f8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 14:46:01 +0100 Subject: [PATCH 21/55] contrib/html.sh: include stylesheet via link --- contrib/general/style.css | 32 ++++++++++++++++++++++++++++++++ contrib/html.sh | 6 +++++- contrib/html.sh.d/head.html | 11 +---------- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/contrib/general/style.css b/contrib/general/style.css index 66d44f1..be67afa 100644 --- a/contrib/general/style.css +++ b/contrib/general/style.css @@ -4,6 +4,28 @@ body { font-family: fira-sans, sans-serif; font-size: 10pt; } +h2 { + border-bottom: 1px solid #ccc; + color: #000; +} +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +blockquote { + border-left: 4px solid #ccc; + padding: 0 10px; + color: #777; +} +code { + margin: 0 2px; + padding: 2px 5px; + border: 1px solid #ccc; + background-color: #f8f8f8; + border-radius: 3px; +} div.notification { position: relative; float: right; @@ -31,6 +53,16 @@ p.hint { pre { font-family: fira-mono, monospace; white-space: pre-wrap; + background-color: #f8f8f8; + border: 1px solid #ccc; + overflow: auto; + padding: 6px 10px; + border-radius: 3px; +} +pre code { + margin: 0; + padding: 0; + border: 0; } span.link { color: #863600; diff --git a/contrib/html.sh b/contrib/html.sh index bbd8ba8..194a7cd 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -2,7 +2,11 @@ set -e -sed "s|__TITLE__|$(head -n1 "${1}")|" < "${0}.d/head.html" +RELTO="$(dirname "${1}")" +sed \ + -e "s|__TITLE__|$(head -n1 "${1}")|" \ + -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" contrib/general/style.css)|" \ + < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ -e '/| id="\L\1">|' diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html index 1b1dd03..50653ae 100644 --- a/contrib/html.sh.d/head.html +++ b/contrib/html.sh.d/head.html @@ -1,15 +1,6 @@ RouterOS Scripts :: __TITLE__ - + From 0af5d516a34add35d50a79c3d0925b0300f9d64c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Oct 2025 10:19:30 +0100 Subject: [PATCH 22/55] contrib/html.sh: link the stylesheet from top level... ... and copy it there in Makefile. --- .gitignore | 1 + Makefile | 7 +++++-- contrib/html.sh | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8abdc28..9d27373 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.rej # html files (as generated from markdown) +style.css *.html # checksums file as used by $ScriptInstallUpdate diff --git a/Makefile b/Makefile index 0265a51..a741fef 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,14 @@ LOCAL = $(wildcard *.local.rsc) WIFI = $(wildcard *.wifi.rsc) MARKDOWN = $(wildcard *.md doc/*.md doc/mod/*.md) -HTML = $(MARKDOWN:.md=.html) +HTML = $(MARKDOWN:.md=.html) style.css all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json -%.html: %.md contrib/html.sh contrib/html.sh.d/head.html +style.css: contrib/general/style.css + cp $< $@ + +%.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html contrib/html.sh $< > $@ %.capsman.rsc: %.template.rsc Makefile diff --git a/contrib/html.sh b/contrib/html.sh index 194a7cd..287119f 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -5,7 +5,7 @@ set -e RELTO="$(dirname "${1}")" sed \ -e "s|__TITLE__|$(head -n1 "${1}")|" \ - -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" contrib/general/style.css)|" \ + -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" style.css)|" \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ From 12b157220859dff69c51ea425d2e797416ab1c1d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 12:51:34 +0100 Subject: [PATCH 23/55] contrib/html.sh: add a margin on left and right... ... for windows in landscape (wider than high). --- contrib/general/style.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/general/style.css b/contrib/general/style.css index be67afa..304f3f0 100644 --- a/contrib/general/style.css +++ b/contrib/general/style.css @@ -4,6 +4,12 @@ body { font-family: fira-sans, sans-serif; font-size: 10pt; } +@media only screen and (orientation: landscape) { + body { + margin-left: 10vw; + margin-right: 10vw; + } +} h2 { border-bottom: 1px solid #ccc; color: #000; From 787feedbb59ae3900fcd59893f3c00705d0c1936 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 11:30:49 +0100 Subject: [PATCH 24/55] contrib/html.sh: increase default line height --- contrib/general/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/general/style.css b/contrib/general/style.css index 304f3f0..7ee47bb 100644 --- a/contrib/general/style.css +++ b/contrib/general/style.css @@ -3,6 +3,7 @@ body { background-color: transparent; font-family: fira-sans, sans-serif; font-size: 10pt; + line-height: 1.6; } @media only screen and (orientation: landscape) { body { From 6887d816bf772eb5cfe8d09128f83872268cd7da Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 14:55:00 +0100 Subject: [PATCH 25/55] contrib/html.sh: link the logo with relative path --- contrib/html.sh | 1 + contrib/html.sh.d/head.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/html.sh b/contrib/html.sh index 287119f..3b5b420 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -6,6 +6,7 @@ RELTO="$(dirname "${1}")" sed \ -e "s|__TITLE__|$(head -n1 "${1}")|" \ -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" style.css)|" \ + -e "s|__LOGO__|$(realpath --relative-to="${RELTO}" logo.png)|" \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html index 50653ae..779e246 100644 --- a/contrib/html.sh.d/head.html +++ b/contrib/html.sh.d/head.html @@ -2,5 +2,5 @@ RouterOS Scripts :: __TITLE__ - + From 962b082672baf48bc8a16b51da5b57c7abfaca35 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 11:20:47 +0100 Subject: [PATCH 26/55] README: support new builtin-trust-store... ... which was introduced with RouterOS 7.21beta7. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 529bb4c..b77538d 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,10 @@ download the certificates. > can skip the steps regarding certificate download and import and jump > to [installation of scripts](#installation-of-scripts) if you set the > trust for these builtin trust anchors: -> `/certificate/settings/set builtin-trust-anchors=trusted;` +> `/certificate/settings/set builtin-trust-anchors=trusted;` +> With RouterOS 7.21 the functionality was changed. Set this at minimum, +> but make sure not to drop other targets: +> `/certificate/settings/set builtin-trust-store=fetch;` If you intend to download the scripts from a different location (for example from github.com) install the corresponding From 4f55808ce06e420a32db7d7bb55a4d39e2028918 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 22:34:00 +0100 Subject: [PATCH 27/55] contrib/html.sh: properly handle anchors --- contrib/html.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/html.sh b/contrib/html.sh index 3b5b420..dbb40f6 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -9,6 +9,6 @@ sed \ -e "s|__LOGO__|$(realpath --relative-to="${RELTO}" logo.png)|" \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ - -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ + -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ -e '/| id="\L\1">|' printf '' From 4e1db10a6e8bbfc51150bf73f1f0ee2936373021 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 11:38:31 +0100 Subject: [PATCH 28/55] INITIAL-COMMANDS: support new builtin-trust-store... ... which was introduced with RouterOS 7.21beta7. --- INITIAL-COMMANDS.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/INITIAL-COMMANDS.md b/INITIAL-COMMANDS.md index 40f609b..6e70b66 100644 --- a/INITIAL-COMMANDS.md +++ b/INITIAL-COMMANDS.md @@ -22,8 +22,11 @@ Run the complete base installation: :local CertFileName "ISRG-Root-X2.pem"; :local CertFingerprint "69729b8e15a86efc177a57afb7171dfc64add28c2fca8cf1507e34453ccb1470"; - :if (!(([ /certificate/settings/get ]->"builtin-trust-anchors") = "trusted" && \ - [[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CertCommonName . "\" ] ]") ]] > 0)) do={ + :local CertSettings [ /certificate/settings/get ]; + :if (!((($CertSettings->"builtin-trust-anchors") = "trusted" || \ + ($CertSettings->"builtin-trust-store") ~ "fetch" || \ + ($CertSettings->"builtin-trust-store") = "all") && \ + [[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CertCommonName . "\" ] ]") ]] > 0)) do={ :put "Importing certificate..."; /tool/fetch ($BaseUrl . "certs/" . $CertFileName) dst-path=$CertFileName as-value; :delay 1s; From 9a88b6c8782397bb9ff1b7ca8e83c244cfa432c5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 22:57:17 +0100 Subject: [PATCH 29/55] contrib/html.sh: drop comman from id/anchor --- contrib/html.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/html.sh b/contrib/html.sh index dbb40f6..bd15bf0 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -10,5 +10,6 @@ sed \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ - -e '/| id="\L\1">|' + -e '/| id="\L\1">|' \ + -e '/' From d2f055a5544d80c03c2670aefae353aa0542c18f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 11:47:55 +0100 Subject: [PATCH 30/55] global-functions: $CertificateAvailable: support new builtin-trust-store... ... which was introduced with RouterOS 7.21beta7. --- global-functions.rsc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index eb837aa..9f92b07 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -106,11 +106,15 @@ # check and download required certificate :set CertificateAvailable do={ :local CommonName [ :tostr $1 ]; + :local UseFor [ :tostr $2 ]; :global CertificateDownload; + :global EitherOr; :global LogPrint; :global ParseKeyValueStore; + :set UseFor [ $EitherOr $UseFor "undefined" ]; + :if ([ /system/resource/get free-hdd-space ] < 8388608 && \ [ /certificate/settings/get crl-download ] = true && \ [ /certificate/settings/get crl-store ] = "system") do={ @@ -123,7 +127,10 @@ :return false; } - :if (([ /certificate/settings/get ]->"builtin-trust-anchors") = "trusted" && \ + :local CertSettings [ /certificate/settings/get ]; + :if ((($CertSettings->"builtin-trust-anchors") = "trusted" || \ + ($CertSettings->"builtin-trust-store") ~ $UseFor || \ + ($CertSettings->"builtin-trust-store") = "all") && \ [[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CommonName . "\" ] ]") ]] > 0) do={ :return true; } From 8a278569e724881a59b5138882cc42cd0c011362 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 15:19:32 +0100 Subject: [PATCH 31/55] contrib/*: unify html code --- contrib/html.sh.d/head.html | 4 ++-- contrib/logo-color.html | 17 +++++++---------- contrib/notification.html | 17 +++++++---------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html index 779e246..0ce3ff7 100644 --- a/contrib/html.sh.d/head.html +++ b/contrib/html.sh.d/head.html @@ -1,6 +1,6 @@ -RouterOS Scripts :: __TITLE__ - + +RouterOS Scripts :: __TITLE__ diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 802e36c..1dc74b0 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -1,14 +1,12 @@ - - - - -RouterOS-Scripts Logo Color Changer + + +RouterOS Scripts :: Logo Color Changer + - - + -

RouterOS-Scripts Logo Color Changer

+

Logo Color Changer

You want the logo for your own notifications? But you joined the Telegram Group and want @@ -36,5 +34,4 @@ for other browsers may differ.)

Set a profile photo for your Telegram bot.

- - + diff --git a/contrib/notification.html b/contrib/notification.html index 49bf8bd..1bd1ca5 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -1,14 +1,12 @@ - - - - -RouterOS-Scripts Notification Generator + + +RouterOS Scripts :: Notification Generator + - - + -

RouterOS-Scripts Notification Generator

+

Notification Generator

@@ -31,5 +29,4 @@

Then right-click, click "Take Screenshot" and finally select the notification and download it.

- - + From d845b1878b5d3273c205ad47c4db9c5ca9d65505 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 11:59:28 +0100 Subject: [PATCH 32/55] global-functions: $DownloadPackage: define certificate use --- global-functions.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 9f92b07..412777c 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -404,7 +404,7 @@ :return true; } - :if ([ $CertificateAvailable "ISRG Root X1" ] = false) do={ + :if ([ $CertificateAvailable "ISRG Root X1" "fetch" ] = false) do={ $LogPrint error $0 ("Downloading required certificate failed."); :return false; } From ebd84d1540432f24212ad652860ad9c03e803500 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 15:35:14 +0100 Subject: [PATCH 33/55] contrib/{logo-color,notification}: add navigation structure --- contrib/logo-color.html | 6 ++++++ contrib/notification.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 1dc74b0..78d19e6 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -8,6 +8,8 @@

Logo Color Changer

+

⬅️ Go back to main README

+

You want the logo for your own notifications? But you joined the Telegram Group and want something that differentiates? Color it!

@@ -34,4 +36,8 @@ for other browsers may differ.)

Set a profile photo for your Telegram bot.

+
+ +

⬅️ Go back to main README
+⬆️ Go back to top

diff --git a/contrib/notification.html b/contrib/notification.html index 1bd1ca5..a0eaa11 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -8,6 +8,8 @@

Notification Generator

+

⬅️ Go back to main README

+
@@ -29,4 +31,8 @@

Then right-click, click "Take Screenshot" and finally select the notification and download it.

+
+ +

⬅️ Go back to main README
+⬆️ Go back to top

From dd019a71c82f099fb6013b88c4e226a72510db53 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:01:11 +0100 Subject: [PATCH 34/55] global-functions: $GetMacVendor: define certificate use --- global-functions.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 412777c..d4c37a2 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -640,7 +640,7 @@ } :do { - :if ([ $CertificateAvailable "GTS Root R4" ] = false) do={ + :if ([ $CertificateAvailable "GTS Root R4" "fetch" ] = false) do={ $LogPrint warning $0 ("Downloading required certificate failed."); :error false; } From 4102b4963770bf9a92864c09e036173db5a1d2cd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 16:06:42 +0100 Subject: [PATCH 35/55] contrib/notification: update date format --- contrib/notification.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/notification.html b/contrib/notification.html index a0eaa11..5d761b9 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -16,7 +16,7 @@

[MikroTik] ℹ️ Subject

Message
-

⏰ This message was queued since oct/18/2022 18:30:48 and may be obsolete.

+

⏰ This message was queued since 2025-10-29 16:06:18 and may be obsolete.

✂️ The message was too long and has been truncated, cut off 13%!

@@ -25,7 +25,7 @@

Subject:

Message:

Show link:

-

Queued since

+

Queued since

Cut-off with percent

Then right-click, click "Take Screenshot" and finally select the From 268b8b6abe19a79d98f47e67caa6ed085e1223d2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:01:57 +0100 Subject: [PATCH 36/55] global-functions: $ScriptInstallUpdate: define certificate use --- global-functions.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index d4c37a2..48aaf7f 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1248,7 +1248,7 @@ :global SymbolForNotification; :global ValidateSyntax; - :if ([ $CertificateAvailable "ISRG Root X2" ] = false) do={ + :if ([ $CertificateAvailable "ISRG Root X2" "fetch" ] = false) do={ $LogPrint warning $0 ("Downloading certificate failed, trying without."); } @@ -1299,7 +1299,7 @@ } :if ([ :len ($ScriptInfo->"certificate") ] > 0) do={ - :if ([ $CertificateAvailable ($ScriptInfo->"certificate") ] = false) do={ + :if ([ $CertificateAvailable ($ScriptInfo->"certificate") "fetch" ] = false) do={ $LogPrint warning $0 ("Downloading certificate failed, trying without."); } } From 96f61be2e2fff96d7c67c3bee1d6f51492cb9deb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2025 16:11:23 +0100 Subject: [PATCH 37/55] contrib/notification: format the values italic --- contrib/notification.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/notification.html b/contrib/notification.html index 5d761b9..298e3bd 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -16,8 +16,8 @@

[MikroTik] ℹ️ Subject

Message
-

⏰ This message was queued since 2025-10-29 16:06:18 and may be obsolete.

-

✂️ The message was too long and has been truncated, cut off 13%!

+

⏰ This message was queued since 2025-10-29 16:06:18 and may be obsolete.

+

✂️ The message was too long and has been truncated, cut off 13%!

From ee06798d8bde369d52882020870edf32beceecb8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 11:58:23 +0100 Subject: [PATCH 38/55] global-functions: $CertificateDownload: drop unused function --- global-functions.rsc | 1 - 1 file changed, 1 deletion(-) diff --git a/global-functions.rsc b/global-functions.rsc index 5ede654..3089d2e 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -161,7 +161,6 @@ :global ScriptUpdatesBaseUrl; :global ScriptUpdatesUrlSuffix; - :global CertificateAvailable; :global CertificateNameByCN; :global CleanName; :global FetchUserAgentStr; From ec2401b5c3a966b8d4856a9d84977bc5933d41a2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:05:10 +0100 Subject: [PATCH 39/55] check-certificates: define certificate use --- check-certificates.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-certificates.rsc b/check-certificates.rsc index f2d5c1f..3300bee 100644 --- a/check-certificates.rsc +++ b/check-certificates.rsc @@ -189,7 +189,7 @@ fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>$CertRenewTime ]; :local CertNewVal [ /certificate/get $CertNew ]; - :if ([ $CertificateAvailable ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN") ] = false) do={ + :if ([ $CertificateAvailable ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN") "fetch" ] = false) do={ $LogPrint warning $ScriptName ("The certificate chain is not available!"); } From 62deb6aae3ba4c5b3db5391dcfb618492882721e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:06:03 +0100 Subject: [PATCH 40/55] fw-addr-lists: define certificate use --- fw-addr-lists.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index c85cc8b..e5a71aa 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -74,7 +74,7 @@ :if ([ :len ($List->"cert") ] > 0) do={ :set CheckCertificate true; - :if ([ $CertificateAvailable ($List->"cert") ] = false) do={ + :if ([ $CertificateAvailable ($List->"cert") "fetch" ] = false) do={ $LogPrint warning $ScriptName ("Downloading required certificate (" . $FwListName . \ " / " . $List->"url" . ") failed, trying anyway."); } From b9a72ef9c094b432cc0a1d22ed04cb8bb3be5871 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 30 Oct 2025 11:07:38 +0100 Subject: [PATCH 41/55] contrib/checksums.sh: output to stdout... ... and let the Makefile redirect. --- Makefile | 2 +- contrib/checksums.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a741fef..bff5458 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ style.css: contrib/general/style.css < $< > $@ checksums.json: contrib/checksums.sh *.rsc */*.rsc - contrib/checksums.sh + contrib/checksums.sh > $@ clean: rm -f $(HTML) checksums.json diff --git a/contrib/checksums.sh b/contrib/checksums.sh index b472b49..ab4e973 100755 --- a/contrib/checksums.sh +++ b/contrib/checksums.sh @@ -6,4 +6,4 @@ set -e md5sum $(find -name '*.rsc' | sort) | \ sed -e "s| \./||" -e 's|.rsc$||' | \ - jq --raw-input --null-input '[ inputs | split (" ") | { (.[1]): (.[0]) }] | add' > 'checksums.json' + jq --raw-input --null-input '[ inputs | split (" ") | { (.[1]): (.[0]) }] | add' From 90ce3db2f9f5d1a31588fc4c28f3e67987387598 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:10:22 +0100 Subject: [PATCH 42/55] mod/notification-ntfy: define certificate use --- mod/notification-ntfy.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc index 7114020..dd10812 100644 --- a/mod/notification-ntfy.rsc +++ b/mod/notification-ntfy.rsc @@ -109,7 +109,7 @@ :onerror Err { :if ($Server = "ntfy.sh") do={ - :if ([ $CertificateAvailable "ISRG Root X1" ] = false) do={ + :if ([ $CertificateAvailable "ISRG Root X1" "fetch" ] = false) do={ $LogPrint warning $0 ("Downloading required certificate failed."); :error false; } From 4ac9d6c09feda90a0222b82fdd4b22cebe7c7ae3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 2 Nov 2025 09:19:16 +0100 Subject: [PATCH 43/55] global-functions: $ScriptInstallUpdate: give hint on ignore Fixes: https://github.com/eworm-de/routeros-scripts/issues/112 --- global-functions.rsc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 3089d2e..b5fc0eb 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1313,6 +1313,11 @@ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; } + :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \ + [ :len $CheckSum ] = 0) do={ + $LogPrintOnce warning $0 \ + ("Added the script manually? Skip updates with 'ignore=true' in comment."); + } :error false; } From 089f95d5c9a402fbc9d46bb3a05b57a95e694ec4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:09:43 +0100 Subject: [PATCH 44/55] mod/notification-telegram: define certificate use --- mod/notification-telegram.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index ff9b4da..b1996a3 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -30,7 +30,7 @@ :return false; } - :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ + :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={ $LogPrint warning $0 ("Downloading required certificate failed."); :return false; } @@ -72,7 +72,7 @@ :global CertificateAvailable; :global LogPrint; - :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ + :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={ $LogPrint warning $0 ("Downloading required certificate failed."); :return false; } @@ -197,7 +197,7 @@ "&reply_to_message_id=" . ($Notification->"replyto") . "&message_thread_id=" . $ThreadId . \ "&disable_web_page_preview=true&parse_mode=MarkdownV2"); :onerror Err { - :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ + :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={ $LogPrint warning $0 ("Downloading required certificate failed."); :error false; } From 128526536ecea6ceeccfb73fe0b1e5e5ca594b24 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 00:00:03 +0100 Subject: [PATCH 45/55] global-functions: $ScriptInstallUpdate: either or... ... but not both. --- global-functions.rsc | 1 + 1 file changed, 1 insertion(+) diff --git a/global-functions.rsc b/global-functions.rsc index b5fc0eb..2379f9b 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1312,6 +1312,7 @@ :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; + :error false; } :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \ [ :len $CheckSum ] = 0) do={ From d2ea8b8d453d81a57dbe6a56739b1a3462d398ff Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:07:22 +0100 Subject: [PATCH 46/55] netwatch-dns: define certificate use --- netwatch-dns.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc index 9e2f9bc..eee5f85 100644 --- a/netwatch-dns.rsc +++ b/netwatch-dns.rsc @@ -112,7 +112,7 @@ :foreach DohServer in=$DohServers do={ :if ([ :len ($DohServer->"doh-cert") ] > 0) do={ - :if ([ $CertificateAvailable ($DohServer->"doh-cert") ] = false) do={ + :if ([ $CertificateAvailable ($DohServer->"doh-cert") "dns" ] = false) do={ $LogPrint warning $ScriptName ("Downloading certificate failed, trying without."); } } From c08ed68e86e0b247acaf072c9defa78d45123298 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 3 Nov 2025 09:17:25 +0100 Subject: [PATCH 47/55] global-functions: $ScriptInstallUpdate: extra actions on 'not found' only --- global-functions.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 2379f9b..eb837aa 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1309,6 +1309,10 @@ } } do={ $LogPrint warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "': " . $Err); + :if ($Err != "Fetch failed with status 404") do={ + :error false; + } + :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; From 1272eb2aa83ee3325c2758acb8e7389aeca887e0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:10:58 +0100 Subject: [PATCH 48/55] telegram-chat: define certificate use --- telegram-chat.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index 7f7b7a7..54872fb 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -61,7 +61,7 @@ :set TelegramRandomDelay 0; } - :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" ] = false) do={ + :if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={ $LogPrint warning $ScriptName ("Downloading required certificate failed."); :set ExitOK true; :error false; From 780a177ae6ab714058a9ed6c6f652f7de7786c2b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Nov 2025 17:32:37 +0100 Subject: [PATCH 49/55] Makefile: clean up and add phony targets --- Makefile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bff5458..e376e56 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,22 @@ # template scripts -> final scripts # markdown files -> html files -CAPSMAN = $(wildcard *.capsman.rsc) -LOCAL = $(wildcard *.local.rsc) -WIFI = $(wildcard *.wifi.rsc) +ALL_RSC := $(wildcard *.rsc */*.rsc) +GEN_RSC := $(wildcard *.capsman.rsc *.local.rsc *.wifi.rsc) -MARKDOWN = $(wildcard *.md doc/*.md doc/mod/*.md) -HTML = $(MARKDOWN:.md=.html) style.css +MARKDOWN := $(wildcard *.md doc/*.md doc/mod/*.md) +HTML := $(MARKDOWN:.md=.html) style.css -all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json +.PHONY: all checksums docs rsc clean + +all: checksums docs rsc + +checksums: checksums.json + +checksums.json: contrib/checksums.sh $(ALL_RSC) + contrib/checksums.sh > $@ + +docs: $(HTML) style.css: contrib/general/style.css cp $< $@ @@ -17,6 +25,8 @@ style.css: contrib/general/style.css %.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html contrib/html.sh $< > $@ +rsc: $(GEN_RSC) + %.capsman.rsc: %.template.rsc Makefile sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ -e '/^# NOT \/caps-man\/ #$$/,/^# NOT \/caps-man\/ #$$/d' \ @@ -35,8 +45,5 @@ style.css: contrib/general/style.css -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ < $< > $@ -checksums.json: contrib/checksums.sh *.rsc */*.rsc - contrib/checksums.sh > $@ - clean: rm -f $(HTML) checksums.json From 3be8ea0fb60bd5836457b629115216b6739bbc21 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:03:33 +0100 Subject: [PATCH 50/55] update-tunnelbroker: define certificate use --- update-tunnelbroker.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc index 9057e1e..5372f4c 100644 --- a/update-tunnelbroker.rsc +++ b/update-tunnelbroker.rsc @@ -28,7 +28,7 @@ :error false; } - :if ([ $CertificateAvailable "Starfield Root Certificate Authority - G2" ] = false) do={ + :if ([ $CertificateAvailable "Starfield Root Certificate Authority - G2" "fetch" ] = false) do={ $LogPrint error $ScriptName ("Downloading required certificate failed."); :set ExitOK true; :error false; From 4b5a3f7f90d4fbe4ea5f27cd7219174707b7c317 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 23:03:58 +0100 Subject: [PATCH 51/55] fw-addr-lists.d/{allow,block}: use short url rsc.eworm.de --- fw-addr-lists.d/allow | 2 +- fw-addr-lists.d/block | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fw-addr-lists.d/allow b/fw-addr-lists.d/allow index 8b59ed7..f0239cd 100644 --- a/fw-addr-lists.d/allow +++ b/fw-addr-lists.d/allow @@ -1,3 +1,3 @@ # an ip address list for use with fw-addr-lists script -# https://git.eworm.de/cgit/routeros-scripts/about/doc/fw-addr-lists.md +# https://rsc.eworm.de/doc/fw-addr-lists.md git.eworm.de diff --git a/fw-addr-lists.d/block b/fw-addr-lists.d/block index 5e9fef2..86a6c62 100644 --- a/fw-addr-lists.d/block +++ b/fw-addr-lists.d/block @@ -1,5 +1,5 @@ # an ip address list for use with fw-addr-lists script -# https://git.eworm.de/cgit/routeros-scripts/about/doc/fw-addr-lists.md +# https://rsc.eworm.de/doc/fw-addr-lists.md # example.net 93.184.216.34 From 617f67f2b7c28708a5f2e2e824536a2c4a4c3bb2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:11:38 +0100 Subject: [PATCH 52/55] CERTIFICATES: define certificate use --- CERTIFICATES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CERTIFICATES.md b/CERTIFICATES.md index 69d6c18..0e0a867 100644 --- a/CERTIFICATES.md +++ b/CERTIFICATES.md @@ -61,7 +61,7 @@ Import a certificate by CommonName Running the function `$CertificateAvailable` with that name as parameter makes sure the certificate is available in the device's store: - $CertificateAvailable "ISRG Root X2"; + $CertificateAvailable "ISRG Root X2" "fetch"; If the certificate is actually available already nothing happens, and there is no output. Otherwise the certificate is downloaded and imported. From 8a45e4836a2f2bd6607aa418ef259734630ba499 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 7 Nov 2025 23:05:56 +0100 Subject: [PATCH 53/55] fw-addr-lists.d/allow: use rsc.eworm.de in the list --- fw-addr-lists.d/allow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fw-addr-lists.d/allow b/fw-addr-lists.d/allow index f0239cd..8c4ca3c 100644 --- a/fw-addr-lists.d/allow +++ b/fw-addr-lists.d/allow @@ -1,3 +1,3 @@ # an ip address list for use with fw-addr-lists script # https://rsc.eworm.de/doc/fw-addr-lists.md -git.eworm.de +rsc.eworm.de From a7876e9833fb4bc8eb5bbc7b92f8a85f1001e179 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 12:08:49 +0100 Subject: [PATCH 54/55] doc/mod/notification-matrix: define certificate use --- doc/mod/notification-matrix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/mod/notification-matrix.md b/doc/mod/notification-matrix.md index da6d6de..ad4cf4f 100644 --- a/doc/mod/notification-matrix.md +++ b/doc/mod/notification-matrix.md @@ -49,7 +49,7 @@ your server in device's certificate store. The example below is for `matrix.org`, which uses a trust chain from *Google Trust Services*. Run this to import the required certificate: - $CertificateAvailable "GTS Root R4"; + $CertificateAvailable "GTS Root R4" "fetch"; Replace the CA certificate name with what ever is needed for your server. You may want to find the From fd9c892a50146189ce3c6548fe87c2df675a4b38 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Nov 2025 11:20:29 +0100 Subject: [PATCH 55/55] README: add a line break before command --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b0d26bd..529bb4c 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ download the certificates. > 💡️ **Hint**: RouterOS 7.19 comes with a builtin certificate store. You > can skip the steps regarding certificate download and import and jump > to [installation of scripts](#installation-of-scripts) if you set the -> trust for these builtin trust anchors: +> trust for these builtin trust anchors: > `/certificate/settings/set builtin-trust-anchors=trusted;` If you intend to download the scripts from a @@ -173,7 +173,7 @@ This last step is required when ever you make changes to your configuration. > ℹ️ **Info**: It is recommended to edit the configuration using the command > line interface. If using Winbox on Windows OS, the line endings may be -> missing. To fix this run: +> missing. To fix this run: > `/system/script/set source=[ :tocrlf [ get global-config-overlay source ] ] global-config-overlay;` Updating scripts