ROS scripting engine is fully custom like terminal. That route was chosen probably due to performance & security reasons.What kind (aka type eg. Python, Bash etc.) of scripts are used in RouterOS?
(...)
but what are they?... proprietary?
Nope.Is there a plugin to run a more common type of script like python or bash shell etc.?
There's no way besides external automation and updating certificates via SFTP.Any other suggestions/recommendations for the best route to solve this problem other then in wishful thinking of a RouterOS update one day?
How you generated the certificate and installed ?No, they are "certificats", can be use on anything (firewall, mail, ftp, etc...). The only "problem" is that they are 90 days lifetime... so without ACME, you'll have to update the cert manually each 3 month. Certs are actually working right now if you do install it manually.
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DOMAIN=vpn1.example.net
CERT=vpn1.example.net.cer
KEY=vpn1.example.ne.key
ROUTER=<Router 1 IP Address>
cd $DIR/$DOMAIN
if [ -f $CERT ]; then
echo -n "Uploading $DOMAIN certificate $ROUTER router..."
scp -q $CERT $ROUTER:$CERT
scp -q $KEY $ROUTER:$KEY
echo "done!"
exit 0
fi
DOMAIN=vpn2.example.net
CERT=vpn2.example.net.cer
KEY=vpn2.example.ne.key
ROUTER=<Router 2 IP Address>
cd $DIR/$DOMAIN
if [ -f $CERT ]; then
echo -n "Uploading $DOMAIN certificate $ROUTER router..."
scp -q $CERT $ROUTER:$CERT
scp -q $KEY $ROUTER:$KEY
rm $CERT $KEY
echo "done!"
exit 0
fi
:if ([:len [/file find name=vpn1.example.net]] > 0) do={
:put "Deleting Old Certificate"
/certificate remove vpn1.example.net.cer_0
:delay 1
:put "Importing new Certificate"
/certificate import file-name=vpn1.example.net.cer passphrase=""
/certificate import file-name=vpn1.example.net.key passphrase=""
:delay 1
:put "Assigning certificate to SSTP Server"
/interface sstp-server server set certificate=vpn1.example.net.cer_0
:delay 1
:put "Cleaning up files"
/file remove vpn1.example.net.cer
/file remove vpn1.example.net.key
:put "Certificate installation complete"
}
In other words, CCR, RB3011, RB850Gx2, RB1100AHx4, etc which have enough cpu/storage/memory resources are not supported.Currently MetaRouter can be used on
RB400, RB700 series except models with SPI flash, RB900 series except models with SPI flash, RB2011 boards
Listed PPC boards: RB1000, RB1100, RB1100AH and RB800.
certbot certonly --preferred-challenges=dns --manual -d $DOMAIN --manual-public-ip-logging-ok --post-hook /opt/letsencrypt-routeros/letsencrypt-routeros.sh
this is the only sad part. My CCR should be able to do it by itself!Dedicated Linux renew and push certificates to RouterOS / Mikrotik
I am wondering; because the "first" validation method is manual (by creating a TXT record at your DNS provider) it seems the renewal process also needs a TXT DNS record validation.You can use Let's Encrypt RouterOS / Mikrotik script
How it works:https://github.com/gitpel/letsencrypt-routeros
- Dedicated Linux renew and push certificates to RouterOS / Mikrotik
- After CertBot renew your certificates
- The script connects to RouterOS / Mikrotik using DSA Key (without password or user input)
- Delete previous certificate files
- Delete the previous certificate
- Upload two new files: Certificate and Key
- Import Certificate and Key
- Change SSTP Server Settings to use new certificate
- Delete certificate and key files form RouterOS / Mikrotik storage
To use script with CertBot hooks:Code: Select allcertbot certonly --preferred-challenges=dns --manual -d $DOMAIN --manual-public-ip-logging-ok --post-hook /opt/letsencrypt-routeros/letsencrypt-routeros.sh
A few do, most don't have a plugin available. However, the registration via the script is based on the manual TXT verification which in turn determines the way certbot stores the information regarding the particular certificate. So you'd have to fidget around with the certbot config to get this working properly. Furthermore; in the readme it is suggested the TXT verification is only once. I think this is false.It depends. Some DNS providers have API access for editing records, so if you use one of them, everything can be scripted and made fully automatic.
ok, so your script works for me, but how to script it to renew my certificate after 2-3 months, even when my DNS has no APIs to (automatically) change the DNS TXT file...You can use Let's Encrypt RouterOS / Mikrotik script
How it works:https://github.com/gitpel/letsencrypt-routeros
- Dedicated Linux renew and push certificates to RouterOS / Mikrotik
- After CertBot renew your certificates
- The script connects to RouterOS / Mikrotik using DSA Key (without password or user input)
- Delete previous certificate files
- Delete the previous certificate
- Upload two new files: Certificate and Key
- Import Certificate and Key
- Change SSTP Server Settings to use new certificate
- Delete certificate and key files form RouterOS / Mikrotik storage
To use script with CertBot hooks:Code: Select allcertbot certonly --preferred-challenges=dns --manual -d $DOMAIN --manual-public-ip-logging-ok --post-hook /opt/letsencrypt-routeros/letsencrypt-routeros.sh