]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Autocommit in repo: ros.vados.ru, generated by owner: root, in 03:00:02 01.05.2026.
authorvados-dev <192440777+vados-dev@users.noreply.github.com>
Fri, 1 May 2026 00:00:03 +0000 (03:00 +0300)
committervados-dev <192440777+vados-dev@users.noreply.github.com>
Fri, 1 May 2026 00:00:03 +0000 (03:00 +0300)
html/AM-GlobalFunc.rsc
html/func-collection/git/README.md
html/func-collection/git/updateVPNList/README.md [new file with mode: 0644]
html/func-collection/git/updateVPNList/dnsLookup [new file with mode: 0644]
html/func-collection/git/updateVPNList/updateVPNList [new file with mode: 0644]
html/func-collection/git/vados-dev.github.io [deleted submodule]

index 18c46106023041cd97ccf52a8201e11057caaddd..5c7798e5f0f27709cd29a8f9f94a23ee3f80148d 100644 (file)
@@ -17,9 +17,9 @@
 :global GlobalFuncReady false;
 
 # Git commit id & info, expected configuration version
-:global CommitId "main/329/d1d1be7e";
+:global CommitId "main/330/d3b01a82";
 :global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 02:55:02 01.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 03:00:02 01.05.2026.";
 
 # The variables are received right here.
 :global GlobalConfVersion 138;
index 43ad0aca5e5695ac3f4e7305a5d23d8509d646dd..106163b0ee06a66150a7e7247f887620accc74e4 100644 (file)
@@ -1,6 +1,6 @@
 # Git commands, examples, links and help
 
-- [⬅️ Go back to section README ](/func-collection//README.md)
+- [⬅️ Go back to section README ](/func-collection/README.md)
 ---
 ###
 *
diff --git a/html/func-collection/git/updateVPNList/README.md b/html/func-collection/git/updateVPNList/README.md
new file mode 100644 (file)
index 0000000..c611d8c
--- /dev/null
@@ -0,0 +1 @@
+Just add both scripts to your Mikrotik setup and put `updateVPNList` script on a schedule.
\ No newline at end of file
diff --git a/html/func-collection/git/updateVPNList/dnsLookup b/html/func-collection/git/updateVPNList/dnsLookup
new file mode 100644 (file)
index 0000000..7262c48
--- /dev/null
@@ -0,0 +1,67 @@
+:global ListName
+:global Servers
+: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=$ListName] do={
+    /ip firewall address-list remove $aListItem;
+}
+
+:foreach aServer in=$Servers do={
+#force the dns entries to be cached
+    :do {
+        :resolve $aServer;
+    } on-error={
+        :log error "dns resolve failure [ ip - resolve ip ]"
+    }
+
+    :foreach dnsRecord in=[/ip dns cache all find where (name=$aServer)] 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=$ListName address=$newAddress comment=$aServer;
+            } 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=$aServer && 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=$ListName address=[/ip dns cache all get $aRecord data] comment=$aServer;
+                } on-error={
+                    :log error "error when adding ip to list: $newAddress"
+                }
+            }
+        }
+    }
+}
+
+#allow other scripts to call this
+:set Done true
\ No newline at end of file
diff --git a/html/func-collection/git/updateVPNList/updateVPNList b/html/func-collection/git/updateVPNList/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
diff --git a/html/func-collection/git/vados-dev.github.io b/html/func-collection/git/vados-dev.github.io
deleted file mode 160000 (submodule)
index 1a0f849..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 1a0f849a4eaf012eaead44751adfb00a01cfeb46