aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
AgeCommit message (Collapse)AuthorFilesLines
6 daysglobal-functions: $WaitForFile: delay until "complete"...Gravatar Christian Hesse1-0/+10
Well, turns out that waiting for existence of a file is not sufficient. Chances are that a file is available just partly, so wait until the size no longer changes... Let's hope that works as expected. 🤞
14 daysglobal-functions: $SendNotification: use $ExitError to indicate ↵Gravatar Christian Hesse1-2/+4
unintentional error
14 daysglobal-functions: $ScriptInstallUpdate: use $ExitError to indicate ↵Gravatar Christian Hesse1-2/+4
unintentional error
14 daysglobal-functions: $ExitError: give matching message for functionsGravatar Christian Hesse1-3/+5
14 daysglobal-functions: $ExitError: give script name in messageGravatar Christian Hesse1-1/+1
14 daysglobal-functions: introduce $ExitError...Gravatar Christian Hesse1-0/+13
... as a simple macro to print error message on unintentional error.
14 daysglobal-functions: $FetchHuge: passing boolean to function is still broken... ↵Gravatar Christian Hesse1-4/+4
🤨
2024-10-30global-functions: $CertificateAvailable: fail without CommonNameGravatar Christian Hesse1-0/+5
2024-09-26global-functions: $CertificateDownload: add another check...Gravatar Christian Hesse1-0/+6
... that the certificate is really available. Turns out that mkcert.org ships certificates where OU or whatever matches - that's not what we want.
2024-09-13global-functions: $VersionToNum: support "zero"...Gravatar Christian Hesse1-1/+2
... to have a clean way to generate bitmasks. [admin@mikrotik] > :put [ $VersionToNum 0.255zero0 ] 16711680 [admin@mikrotik] > :put 0x00ff0000 16711680 Once implemented everywhere the internal calculation could be changed easily.
2024-07-22global-functions: $EitherOr: revert...Gravatar Christian Hesse1-3/+1
... but leave a comment.
2024-07-22global-functions: $EitherOr: pass boolean valueGravatar Christian Hesse1-0/+3
Note that literal "true" or "false" (even without quotes) is converted to string. So you may have to enclose it in parentheses for a boolean value: > :put [ :typeof [ $EitherOr true false ] ]; str > :put [ :typeof [ $EitherOr (true) (false) ] ]; bool
2024-07-16global-functions: $Unix2Dos: use :tocrlfGravatar Christian Hesse1-6/+1
2024-07-16global-functions: $PrettyPrint: use :tocrlfGravatar Christian Hesse1-5/+1
2024-07-16global-functions: $Dos2Unix: use :tolfGravatar Christian Hesse1-5/+1
2024-07-16global-functions: $ScriptInstallUpdate: support storing with CRLFGravatar Christian Hesse1-1/+3
Adding this in `global-config-overlay` make the scripts being stored with CRLF line breaks: :global ScriptUpdatesCRLF true; Handle with care, I do not recommend it. Thus it's just a hidden setting.
2024-07-16global-functions: $ScriptInstallUpdate: allow CRLF on deviceGravatar Christian Hesse1-1/+2
2024-07-16global-functions: $ScriptInstallUpdate: forcibly convert to LF...Gravatar Christian Hesse1-2/+2
... to make sure we do not have unintended CRLF line breaks.
2024-07-04global-functions: $MkDir: enable tmpfs if disabledGravatar Christian Hesse1-1/+6
2024-07-02global-functions: $GetMacVendor: cert 'GTS Root R4'Gravatar Christian Hesse1-1/+1
2024-06-21global-functions: $CertificateDownload: try fallback to mkcert.orgchange-131Gravatar Christian Hesse1-11/+30
There's a nice API that allows to download certificate by exact common name. Let's use that, as a fallback at least. https://mkcert.org/
2024-06-21notify on changes regarding certificateschange-130Gravatar Christian Hesse1-1/+1
2024-06-21certs: GTS CA 1C3 / GTS CA 1P5 -> GTS Root R1Gravatar Christian Hesse1-1/+1
2024-06-21certs: R3 / R10 -> ISRG Root X1Gravatar Christian Hesse1-1/+1
2024-06-21certs: E1 / E5 -> ISRG Root X2Gravatar Christian Hesse1-1/+1
In the beginning of Let's Encrypt their root certificate ISRG Root X1 was not widely trusted, at least some older and/or mobile platforms were missing that certificate in their root certificate store. At that time Let's Encrypt was using an alternative chain of trust, where a certificate was cross-signed with DST Root CA X3. To make sure a valid chain of trust is available under all circumstances a set of all certificates had to be supplied: both root vertificates ISRG Root X1 & DST Root CA X3, and an intermediate certificate. This was still true after DST Root CA X3 expired, as it could still be used as a root anchor and was shipped by Let's Encrypt when requested. 🤪 This time is finally over, and we have a clean chain for trust ending in ISRG Root X1 (or ISRG Root X2). Well, actually it is the other way round... Let's Encrypt signs with different tantamount intermediate certificates. There is not only E5, but also E6 - and we can not know beforehand which one is used on renew. So let's jetzt drop the intermediate certificates now, and rely on root certificates only. We are perfectly fine with this these days. Follow-up commits will do the same for *all* certificates. The certificate is downloaded with: curl -d '["ISRG Root X2"]' https://mkcert.org/generate/ | grep -v '^$' > certs/ISRG-Root-X2.pem
2024-06-19Let's Encrypt changed their intermediate certificatesGravatar Christian Hesse1-1/+1
https://letsencrypt.org/2024/03/19/new-intermediate-certificates https://letsencrypt.org/certificates/ But let's keep the old ones around for now, as some sites are still using the old intermediate.
2024-06-01global-functions: $CleanName: no exception for dash...Gravatar Christian Hesse1-1/+1
... as we still want to deduplicate it when it is inside the input string. This also unbreak certificate import for "Go Daddy Secure Certificate Authority - G2" (and more)...
2024-05-23backup-partition: news on support for copy-overchange-129Gravatar Christian Hesse1-1/+1
2024-05-15global-functions: $IsTimeSync: initialize with uptime...Gravatar Christian Hesse1-2/+2
... to make sure the warning is not issued too early.
2024-05-14fw-addr-lists: add 'strongips' list from blocklist.dechange-128Gravatar Christian Hesse1-1/+1
2024-05-08global-functions: $IsTimeSync: add (one time) warning on failed ntp syncGravatar Christian Hesse1-0/+1
2024-05-08global-functions: $IsTimeSync: log just onceGravatar Christian Hesse1-3/+3
2024-04-29global-functions: $WaitForFile: drop extra conversionGravatar Christian Hesse1-1/+1
2024-04-29global-functions: $WaitForFile: respect minimum delayGravatar Christian Hesse1-1/+2
2024-04-29global-functions: $WaitForFile: use fewer stepsGravatar Christian Hesse1-2/+2
2024-04-29global-functions: $CleanName: do not start with a dashGravatar Christian Hesse1-4/+12
2024-04-29global-functions: $FetchHuge: remove temporary directoryGravatar Christian Hesse1-4/+5
2024-04-19global-functions: $CertificateDownload: remove with find...routeros-7.15rc1-1Gravatar Christian Hesse1-1/+1
... to make sure this does not break when the file does no longer exist. Starting with RouterOS 7.15rc1 the file is automatically removed on import.
2024-04-19global-functions: introduce $ProtocolStripGravatar Christian Hesse1-0/+12
2024-04-15global-functions: $CertificateDownload: use single quotesGravatar Christian Hesse1-2/+2
2024-04-15global-functions: $CertificateAvailable: use single quotesGravatar Christian Hesse1-3/+3
2024-04-15mod/notification-ntfy: support basic authchange-127Gravatar Christian Hesse1-1/+1
Closes #59
2024-04-11global-functions: $ScriptFromTerminal: check multiple invocations...Gravatar Christian Hesse1-1/+6
... and return false. We can not tell which job is us... So better safe than sorry.
2024-04-11global-functions: $ScriptLock: break long linesGravatar Christian Hesse1-2/+5
2024-04-11global-functions: $ScriptLock: degrade message to debugGravatar Christian Hesse1-2/+2
2024-04-10global-functions: $SendNotification: set originGravatar Christian Hesse1-1/+1
2024-04-07global-functions: $HumanReadableNum: indicate binary base...Gravatar Christian Hesse1-2/+6
... and update scripts to match the change.
2024-04-07global-functions: drop $LogPrintExit2Gravatar Christian Hesse1-22/+0
2024-04-06global-functions: $FetchHuge: remove file on failed downloadGravatar Christian Hesse1-0/+3
2024-04-06global-functions: $FetchHuge: make sure to work with clean file namesGravatar Christian Hesse1-3/+4
2024-04-06global-functions: $FetchHuge: control check-certificate with parameterGravatar Christian Hesse1-3/+7
2024-04-06global-functions: $FetchHuge: use custom user agent stringGravatar Christian Hesse1-1/+3
2024-04-06global-functions: introduce $FetchHugerouteros-7.13-4Gravatar Christian Hesse1-1/+38
2024-04-02global-functions: drop $ParseJsonGravatar Christian Hesse1-61/+0
2024-04-01telegram-chat: read file content...routeros-7.13-2change-126Gravatar Christian Hesse1-1/+1
... instead of getting it. This lifts the size limit, though we are still limited by Telegram message size. This requires RouterOS 7.13.
2024-03-31news on charge and feesGravatar Christian Hesse1-1/+1
2024-03-29global-functions: rename $FetchUserAgent -> $FetchUserAgentStrGravatar Christian Hesse1-7/+7
... to make sure the function does not clash with the variable we had before, as this causes issue with news and changes notification.
2024-03-27global-functions: $HumanReadableNum: set declared function onlyGravatar Christian Hesse1-1/+1
2024-03-27global-functions: $AlignRight: set declared function onlyGravatar Christian Hesse1-1/+1
2024-03-27global-functions: $FetchUserAgent: set declared function onlyGravatar Christian Hesse1-1/+1
2024-03-27global-functions: $LogPrintOnce: detect and warn on possible crashGravatar Christian Hesse1-0/+5
2024-03-26global-functions: $LogPrintOnce: indicate action via returnGravatar Christian Hesse1-1/+2
2024-03-21telegram-chat: improve readability with symbolsGravatar Christian Hesse1-0/+1
2024-03-16global-functions: $CertificateDownload: download via clean name...Gravatar Christian Hesse1-9/+8
... and rename certificates in repository.
2024-03-16global-functions: generate user agent string in function...Gravatar Christian Hesse1-11/+16
... and add the caller and my shortened url.
2024-03-15global-functions: $LogPrintExit2: add deprecation warningGravatar Christian Hesse1-0/+4
2024-03-15global-functions: $ScriptInstallUpdate: use shorter urlGravatar Christian Hesse1-1/+1
2024-03-14global-functions: $SymbolByUnicodeName: add these for later useGravatar Christian Hesse1-0/+3
2024-03-13netwatch-notify: pass link to notificationchange-124Gravatar Christian Hesse1-1/+1
This is pass verbatim below the notification text.
2024-03-12global-functions: switch to $LogPrintGravatar Christian Hesse1-80/+82
2024-03-12global-functions: introduce $LogPrint, deprecate $LogPrintExit2change-123Gravatar Christian Hesse1-4/+17
2024-03-12global-functions: $LogPrintOnce: drop support for exitGravatar Christian Hesse1-5/+4
This is not widely adopted or used, so let's just drop it - no compatibility.
2024-03-12global-functions: add architecture in user-agent stringGravatar Christian Hesse1-1/+6
2024-03-12global-config: support loading snippetschange-122Gravatar Christian Hesse1-1/+1
This adds support for loading snippets, which need a name starting with "global-config-overlay.d/". This allows to split off configuration if desired.
2024-03-12news on wifiwave2 EOLchange-121Gravatar Christian Hesse1-1/+1
2024-03-12backup-cloud: catch error with :execute workaroundchange-120Gravatar Christian Hesse1-1/+1
Catching a runtime error here fails... So let's try a workaround with :execute...
2024-03-12global-functions: $ScriptLock: fix wording...Gravatar Christian Hesse1-1/+1
... as this does (no longer) abort.
2024-03-12global-functions: $ScriptLock: do not exit from global functionGravatar Christian Hesse1-5/+4
2024-03-12global-functions: $DownloadPackage: do not exit from global functionGravatar Christian Hesse1-1/+2
2024-03-12global-functions: use variable name $ScriptNameGravatar Christian Hesse1-2/+2
2024-02-29fw-addr-lists: add support for IPv6change-119Gravatar Christian Hesse1-1/+1
2024-01-31global-functions: $CertificateNameByCN: use $CleanNameGravatar Christian Hesse1-3/+2
2024-01-31global-functions: introduce $CleanNameGravatar Christian Hesse1-0/+19
2024-01-31global-functions: $MkDir: drop declaration of unused functionsGravatar Christian Hesse1-2/+0
2024-01-31global-functions: $IsDNSResolving: drop declaration of unused functionGravatar Christian Hesse1-2/+0
2024-01-30global-functions: $ScriptInstallUpdate: warn just once...Gravatar Christian Hesse1-1/+2
... for every script on required RouterOS version.
2024-01-30global-functions: use :jobname to get script nameGravatar Christian Hesse1-1/+1
2024-01-30send a warning on storage sizechange-118Gravatar Christian Hesse1-1/+1
2024-01-30packages-update: support deferred reboot on auto-updatechange-117Gravatar Christian Hesse1-1/+1
Closes #56
2024-01-30global-functions: $RandomDelay: always scale to ms...routeros-7.12-1Gravatar Christian Hesse1-2/+3
... to randomize in friction of unit. This requires :tonsec from RouterOS 7.12.
2024-01-29global-functions: $RandomDelay: allow zero time, return immediatelyGravatar Christian Hesse1-0/+4
2024-01-29global-functions: $RandomDelay: name the parametersGravatar Christian Hesse1-1/+4
2024-01-20global-functions: $SymbolByUnicodeName: log warning on missing nameGravatar Christian Hesse1-0/+7
2024-01-20global-functions: $SymbolByUnicodeName: name the parameterGravatar Christian Hesse1-1/+3
2024-01-18global-functions: log successful loadingGravatar Christian Hesse1-0/+5
2024-01-18global-functions: $LogPrintOnce: support exitGravatar Christian Hesse1-1/+2
2024-01-16global-functions: $HexToNum: use :tonumGravatar Christian Hesse1-7/+5
2024-01-08global-functions: $CertificateDownload: move delay upGravatar Christian Hesse1-1/+1
We still had cases where fetch misbehaves... But this was permanent. Perhaps we should not touch the certificate too early...
2024-01-01update copyright for 2024Gravatar Christian Hesse1-1/+1
2023-12-22global-functions: $GetMacVendor: get new certificateGravatar Christian Hesse1-1/+1
The service now uses: GTS CA 1P5 -> GTS Root R1