]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Autocommit in repo: ros.vados.ru, generated by owner: root, in 01:30:03 05.05.2026.
authorvados-dev <192440777+vados-dev@users.noreply.github.com>
Mon, 4 May 2026 22:30:03 +0000 (01:30 +0300)
committervados-dev <192440777+vados-dev@users.noreply.github.com>
Mon, 4 May 2026 22:30:03 +0000 (01:30 +0300)
html/AM-GlobalConfig.rsc
html/AM-GlobalFunc.rsc
html/tmp/next/global-functions.rsc

index aadf5de4298428fc5a6b6b26fd178861e8aaaef6..69d4292c020a39dca44b9eade71c1cd01809edc1 100644 (file)
@@ -12,7 +12,7 @@
 # Global Url For Amster scripts to fetch
 # most be defined in AM-Init-Script or AM-setup scripts
 :global GlobalScriptsUrl "https://ros.vados.ru/";
-:global ScriptsUrlSuffix "";
+:global ScriptsUrlSuffix (a);
 :global CheckSumsVerify true;
 
 :global ScriptUpdatesCRLF true;
 
 :global CertRenewUrl ($GlobalScriptsUrl . "certs/" . $Identity . "/");
 :global CertRenewTime 2w;
-:global CertRenewPass {
-  "";
+:global CertRenewPass (a); #{
+#  "";
 #  "v3ry-s3cr3t";
 #  "4n0th3r-s3cr3t";
-};
+#};
 :global CertWarnTime 1w;
-:global CertIssuedExportPass {
-  "";
+:global CertIssuedExportPass (a); # {
+#  "";
 #  "cert1-cn"="v3ry-s3cr3t";
 #  "cert2-cn"="4n0th3r-s3cr3t";
-};
+#};
 
 # Script BackupAndUpdate mode, possible values: backup,
 # updateOnce - Update once as "osnotify" and back "osnotify" mode (in terminal run :set OSUpdateMode updateOnce; $OSUpdateMode;).  
index 1550af9d84ff27fffcf78be8392c960d4ca21ec4..f8009cd86b56072eba0c8b5d41155ffe553cc1b0 100644 (file)
@@ -17,9 +17,9 @@
 :global GlobalFuncReady false;
 
 # Git commit id & info, expected configuration version
-:global CommitId "main/618/22f80b83";
+:global CommitId "main/619/a99e710a";
 :global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 01:25:02 05.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 01:30:03 05.05.2026.";
 
 # The variables are received right here.
 :global GlobalConfVersion 140;
   :return true;
 }
 
-# read parts of a large file
-# Description of parameters:
-# $1 - script name for logging and user agent
-# $2 - url to fetch from
-# $3 - check-certificate value for /tool/fetch (true/false)
-# $4 - mode value for /tool/fetch (optional, e.g. "keep-broken", "https-only", "http-only"
-#      "no-redirects", "background", "background-and-keep-broken", "background-and-https-only",
-#      "background-and-http-only", "background-and-no-redirects", "background-and-keep-broken-and-https-only", "background-and-keep-broken-and-http-only",
-#      "background-and-keep-broken-and-no-redirects")
-# $5 - fetch method for /tool/fetch (optional, e.g. "get", "head", "post", "put", "patch", "delete")
-#:set FetchLargeFiles do={
-#  :local RunName [:tostr $1];
-#  :local fetchUrl [:tostr $2];
-#  :local fetchFile [:tostr $3];
-#  :local CheckCert [:tostr $4];
-#  :local fetchMode [:tostr $5];
-#  :local fetchMethod [:tostr $6];
-#  :local tmpName;
-#  :global CleanName;
-#  :global FetchUserAgentStr;
-#  :global GetRandom20CharAlNum;
-#  :global IfThenElse;
-#  :global LogPrint;
-#  :global MkDir;
-#  :global RmDir;
-#  :global RmFile;
-#  :global WaitForFile;
-#
-#  :set CheckCert [ $IfThenElse ($CheckCert = "false") "no" "yes-without-crl" ];
-#
-#  :set tmpName ($CleanName "tmp-" . [ $GetRandom20CharAlNum 6 ]);
-#  :local DirName ("tmpfs/" . $tmpName);
-#  :if ([ $MkDir $DirName ] = false) do={
-#    :log error ($RunName . " Failed creating directory: " . $DirName . "!");
-#    :return false;
-#  }
-#
-#  :local FileName ($DirName . "/" . [ $CleanName $fetchFile ] . "-" . [ $GetRandom20CharAlNum 5 ]);
-#  :local Url ($fetchUrl . $fetchFile);
-#  :onerror Err {
-#    /tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \
-#      http-header-field=({ [ $FetchUserAgentStr $RunName ] }) as-value;
-#  } do={
-#    :if ([ $WaitForFile $FileName 500ms ] = true) do={
-#      $RmFile $FileName;
-#    }
-#    :log error ($RunName . " Failed downloading from '" . $Url . "' - " . $Err);
-#    $RmDir $DirName;
-#    :return false;
-#  }
-#
-#  :if ([ $WaitForFile $FileName 5s ] = false) do={
-#    :log error ($RunName . " The file downloaded from '" . $Url . "' did not show up.");
-#    :return false;
-#  }
-#  
-#  :local FileSize [ /file/get $FileName size ];
-#  :local Return "";
-#  :local VarSize 0;
-#  :while ($VarSize != $FileSize) do={
-#    :set Return ($Return . ([ /file/read offset=$VarSize chunk-size=32768 file=$FileName as-value ]->"data"));
-#    :set FileSize [ /file/get $FileName size ];
-#    :set VarSize [ :len $Return ];
-#    :if ($VarSize > $FileSize) do={
-#      :delay 100ms;
-#    }
-#  }
-##  $RmFile $FileName;
-#  $RmDir $DirName;
-#  :return $Return;
-#}
-
 :set FetchHugeFiles do={
   :local ScriptName [ :tostr $1 ];
   :local Url        [ :tostr $2 ];
             [ $SymbolForNotification "pushpin" "*" ] . $Change);
         $LogPrint info $0 ("Change " . $I . ": " . $Change);
       }
-    } else={:set NotificationMessage ($NotificationMessage . "\n\nNews and changes are not available.")}
+    } else={
+      :set NotificationMessage ($NotificationMessage . "\n\nNews and changes are not available.");
+
+      }
 
-    :set GlobalConfChanges;
-    :set GlobalConfMigration;
+    :if ([ :len $GlobalConfChanges ] > 0) do={ :set GlobalConfChanges; } else={ :global GlobalConfChanges (a); }
+    :if ([ :len $GlobalConfMigration ] > 0) do={ :set GlobalConfMigration; } else={ :global GlobalConfMigration (a); }
   }
 } do={
   :global ExitOnError; $ExitOnError $0 $Err;
index af3f0c287988d279250d9934697fb1579a8979c0..10a9b5acc3bd7bbec639a32717bc4fc0dc4c261c 100644 (file)
         subject=([ $SymbolForNotification "pushpin" ] . "News and configuration changes"); \
         message=$NotificationMessage; link=$Link });
     }
-    :if ([ :len $GlobalConfigChanges ] > 0) do={ :set GlobalConfigChanges; } else={ :global GlobalConfigChanges (a); }
-    :if ([ :len $GlobalConfigMigration ] > 0) do={ :set GlobalConfigMigration; } else={ :global GlobalConfigMigration (a); }
+
+    :set GlobalConfigChanges;
+    :set GlobalConfigMigration;
   }
 } do={
   :global ExitOnError; $ExitOnError $0 $Err;