]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Autocommit in repo: ros.vados.ru, generated by owner: root, in 03:20:03 01.05.2026.
authorvados-dev <192440777+vados-dev@users.noreply.github.com>
Fri, 1 May 2026 00:20:04 +0000 (03:20 +0300)
committervados-dev <192440777+vados-dev@users.noreply.github.com>
Fri, 1 May 2026 00:20:04 +0000 (03:20 +0300)
html/AM-GlobalFunc.rsc
html/AM-UnblockRKN.rsc [new file with mode: 0644]
html/fw-addr-lists.d/.#allow [new symlink]
html/fw-addr-lists.d/allow [new file with mode: 0644]
html/fw-addr-lists.d/block [new file with mode: 0644]
html/fw-addr-lists.d/mikrotik [new file with mode: 0644]
html/fw-addr-lists.d/updateVPNList [new file with mode: 0644]

index 4c1e34ad3de152844f983bec5858c25dcc78c1d2..f30c8a8f539f654a05d92e0b86d5255868015745 100644 (file)
@@ -17,9 +17,9 @@
 :global GlobalFuncReady false;
 
 # Git commit id & info, expected configuration version
-:global CommitId "main/333/a01c1573";
+:global CommitId "main/334/91030f8f";
 :global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 03:15:02 01.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 03:20:03 01.05.2026.";
 
 # The variables are received right here.
 :global GlobalConfVersion 138;
diff --git a/html/AM-UnblockRKN.rsc b/html/AM-UnblockRKN.rsc
new file mode 100644 (file)
index 0000000..480eae6
--- /dev/null
@@ -0,0 +1,64 @@
+:global ListRKN;
+:global SrvRKN;
+:global Done;
+
+#has $Done been initialized?
+:if ([:typeof $Done] != "boolean") do={
+    :set Done true;
+}
+
+#make sure previous runs have finished
+while (!$Done) do={
+    :nothing;
+}
+
+#block any other runs
+:set Done false;
+
+#delete old address lists
+:foreach aListItem in=[/ip firewall address-list find list=$ListRKN] do={
+    /ip firewall address-list remove $aListItem;
+}
+
+:foreach aSrvRKN in=$SrvRKN do={
+#force the dns entries to be cached
+    :do {
+        :resolve $aSrvRKN;
+    } on-error={
+        :log error "dns resolve failure [ ip - resolve ip ]"
+    }
+
+    :foreach dnsRecord in=[/ip dns cache all find where (name=$aSrvRKN)] do={
+#if it's an A records add it directly
+        :if ([/ip dns cache all get $dnsRecord type]="A") do={
+            :local newAddress [/ip dns cache all get $dnsRecord data];
+            :do {
+                /ip firewall address-list add list=$ListRKN address=$newAddress comment=$aSrvRKN;
+            } on-error={
+                :log error "error when adding ip to list: $newAddress"
+            }
+        }
+
+#if it's a CNAME follow it until we get A records
+        :if ([/ip dns cache all get $dnsRecord type]="CNAME") do={
+            :local cname;
+            :local nextCname
+            :set cname [/ip dns cache all find where (name=$aSrvRKN && type="CNAME")];
+            :set nextCname [/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="CNAME")];
+
+            :while ($nextCname != "") do={
+                :set cname $nextCname;
+                :set nextCname [/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="CNAME")];
+            }
+            
+#add the a records we found
+            :foreach aRecord in=[/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="A")] do={
+                :do {
+                    /ip firewall address-list add list=$ListRKN address=[/ip dns cache all get $aRecord data] comment=$aSrvRKN;
+                } on-error={
+                    :log error "error when adding ip to list: $newAddress"
+                }
+            }
+        }
+    }
+}
diff --git a/html/fw-addr-lists.d/.#allow b/html/fw-addr-lists.d/.#allow
new file mode 120000 (symlink)
index 0000000..bf238fe
--- /dev/null
@@ -0,0 +1 @@
+root@amster.16966
\ No newline at end of file
diff --git a/html/fw-addr-lists.d/allow b/html/fw-addr-lists.d/allow
new file mode 100644 (file)
index 0000000..8c4ca3c
--- /dev/null
@@ -0,0 +1,3 @@
+# an ip address list for use with fw-addr-lists script
+# https://rsc.eworm.de/doc/fw-addr-lists.md
+rsc.eworm.de
diff --git a/html/fw-addr-lists.d/block b/html/fw-addr-lists.d/block
new file mode 100644 (file)
index 0000000..86a6c62
--- /dev/null
@@ -0,0 +1,5 @@
+# an ip address list for use with fw-addr-lists script
+# https://rsc.eworm.de/doc/fw-addr-lists.md
+
+# example.net
+93.184.216.34
diff --git a/html/fw-addr-lists.d/mikrotik b/html/fw-addr-lists.d/mikrotik
new file mode 100644 (file)
index 0000000..3b31a94
--- /dev/null
@@ -0,0 +1,5 @@
+# AS51894 Mikrotikls SIA
+# https://bgp.he.net/AS51894
+159.148.147.0/24
+159.148.172.0/24
+2a02:610:7501::/48
diff --git a/html/fw-addr-lists.d/updateVPNList b/html/fw-addr-lists.d/updateVPNList
new file mode 100644 (file)
index 0000000..cdd3f99
--- /dev/null
@@ -0,0 +1,20 @@
+:global Servers {
+# Feel free to use your own unblock list ;)
+"telegra.ph";
+"grani.ru";
+"xhamster.com";
+"kasparov.ru";
+"lostfilm.tv";
+"rutracker.org";
+"lurkmore.to";
+"dou.ua";
+"youporn.com";
+"pornolab.net";
+"crimerussia.com";
+"telegram.org";
+"telegram.me";
+"t.me";
+}
+:global ListName VPN
+
+/system script run dnsLookup
\ No newline at end of file