Commit graph

57 commits

Author SHA1 Message Date
Christian Hesse
4954a88695 check-certificates: check for global config to be ready 2025-05-08 09:51:07 +02:00
Christian Hesse
9b811e1ed2 check-certificates: fail if global functions do not become ready 2025-05-08 09:51:07 +02:00
Christian Hesse
e44a5384b7 check-certificates: use :onerror for outer block 2025-05-06 09:53:59 +02: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
6570a84904 check-certificates: use $RmFile 2025-02-10 15:23:50 +01:00
Christian Hesse
4bfb591fa0 bump required RouterOS version for all scripts 2025-02-07 17:44:41 +01:00
Christian Hesse
3ad7ccd3d6 check-certificates: check to characters for star-dot 2025-02-03 10:05:35 +01:00
Christian Hesse
eabe3f6e95 check-certificates: pass real and modified name into function 2025-01-31 21:40:51 +01:00
Christian Hesse
75e5ddec52 check-certificates: do not rename the wrong certificate 2025-01-31 13:09:22 +01:00
Christian Hesse
44d0c852f1 check-certificates: try with "star." for renewal with wildcards 2025-01-31 12:14:05 +01:00
Christian Hesse
95b675f67e check-certificates: add dependencies on device-mode 2025-01-30 09:00:02 +01:00
Christian Hesse
1239ac3104 check-certificates: use short url rsc.eworm.de 2025-01-29 14:14:26 +01:00
Christian Hesse
9e3729c279 update copyright for 2025 2025-01-02 00:04:06 +01:00
Christian Hesse
00487f93d4 check-certificates: use $ExitError to indicate unintentional error 2024-12-09 11:49:50 +01:00
Christian Hesse
6fbafe76ba bump RouterOS requirement for all scripts and modules...
... now that global-functions requires RouterOS 7.14 anyway.
2024-07-16 13:50:22 +02:00
Christian Hesse
f3f7d3edc0 check-certificates: limit scope for $CertNew...
... into block where certificate is replaced.

This should unbreak renewing with a certificate updated in place.
2024-06-25 07:58:10 +02:00
Christian Hesse
009674b5bc bump RouterOS requirement for all scripts and modules...
... now that global-functions requires RouterOS 7.13 anyway.
2024-04-07 22:51:24 +02:00
Christian Hesse
4df1468e25 global-functions: rename $FetchUserAgent -> $FetchUserAgentStr
... 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-29 11:11:17 +01:00
Christian Hesse
81f1d9aa99 check-certificates: pass script name into local function 2024-03-20 13:55:55 +01:00
Christian Hesse
eb7919c1d8 global-functions: generate user agent string in function...
... and add the caller and my shortened url.
2024-03-16 23:10:47 +01:00
Christian Hesse
3625808749 check-certificates: switch to $LogPrint 2024-03-12 20:37:57 +01:00
Christian Hesse
b1e37c2734 check-certificates: drop main function, use :do with on-error 2024-03-12 15:27:15 +01:00
Christian Hesse
09393d3ef5 check-certificates: handle formatting of self signed cert 2024-03-12 15:27:15 +01:00
Christian Hesse
53ff8fbf97 check-certificates: exit block on failed import 2024-03-12 15:27:15 +01:00
Christian Hesse
1e8918fdaa global-functions: $ScriptLock: do not exit from global function 2024-03-12 15:27:15 +01:00
Christian Hesse
fc3fad5e87 check-certificates: move code into function 2024-03-04 17:04:45 +01:00
Christian Hesse
fb463419fe check-certificates: always quote the certificate name 2024-01-30 15:00:31 +01:00
Christian Hesse
a43202326b check-certificates: use :jobname to get script name 2024-01-30 00:52:21 +01:00
Christian Hesse
468b5a18f3 check-certificates: unbreak certificate download
This was borked with a2749b2760. 😳
2024-01-24 16:13:44 +01:00
Christian Hesse
a2749b2760 check-certificates: use prepared user-agent string with fetch 2024-01-19 13:23:52 +01:00
Christian Hesse
9a73fc526f update copyright for 2024 2024-01-01 15:25:25 +01:00
Christian Hesse
9fb596135e check-certificates: properly renew from template 2023-12-05 00:11:19 +01:00
Christian Hesse
a12ccba29e check-certificates: improve wording 2023-12-05 00:11:19 +01:00
Christian Hesse
8de6995c4b check-certificates: add workaround for broken certificates...
... where the issuer array is borked. Or is this a RouterOS issue?

[eworm@carpo] > $InspectVar [ $ParseKeyValueStore  [ /certificate/get ISRG-Root-X2 issuer ] ]
-type-> array
  -key-> C
    -type-> str
    -value-> US,O=Internet Security Research Group,CN=ISRG Root X2

A good certificate looks like this:

[eworm@carpo] > $InspectVar [ $ParseKeyValueStore  [ /certificate/get [ find where name~"eworm.net" ] issuer ] ]
-type-> array
  -key-> C
    -type-> str
    -value-> US
  -key-> CN
    -type-> str
    -value-> E1
  -key-> O
    -type-> str
    -value-> Let's Encrypt
2023-12-04 13:05:46 +01:00
Christian Hesse
a08df7bdec check-certificates: prevent infinte loop 2023-12-04 13:05:46 +01:00
Christian Hesse
3df99b0ee0 check-certificates: give full certificate chain 2023-12-04 13:05:46 +01:00
Christian Hesse
94607496ae check-certificates: fix typo and syntax 2023-12-04 12:15:10 +01:00
Christian Hesse
4ddc6be585 global-functions: split off $FormatMultiLines ...
... to format multiple lines from an array.
2023-09-18 07:55:05 +02:00
Christian Hesse
5b789d298b check-certificates: properly handle in place updates
This worked just kind of... The certification was updated, but script
aborted before the notification was sent.
2023-07-23 22:01:43 +02:00
Christian Hesse
e0714bdfff check-certificates: lock the script 2023-06-13 08:53:03 +02:00
Christian Hesse
6327348405 check-certificates: split validity output 2023-05-25 10:39:00 +02:00
Christian Hesse
7ed70bdb26 check-certificates: use $FormatLine 2023-04-24 22:26:26 +02:00
Christian Hesse
fb9feea595 check-certificates: add certificate name in notification subject 2023-04-19 22:05:43 +02:00
Christian Hesse
f14788a104 check-certificates: properly escape the name for regex 2023-04-07 23:36:09 +02:00
Christian Hesse
9617095022 check-certificates: try all SANs for download 2023-04-07 23:36:09 +02:00