From cdd44dfb8b03adaefc6fa8aeb8c5ef5ba90c886c Mon Sep 17 00:00:00 2001 From: vados-dev <192440777+vados-dev@users.noreply.github.com> Date: Mon, 4 May 2026 13:20:03 +0300 Subject: [PATCH] Autocommit in repo: ros.vados.ru, generated by owner: root, in 13:20:03 04.05.2026. --- html/AM-GlobalFunc.rsc | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/html/AM-GlobalFunc.rsc b/html/AM-GlobalFunc.rsc index 4e77a1dd3..d6b285d97 100644 --- a/html/AM-GlobalFunc.rsc +++ b/html/AM-GlobalFunc.rsc @@ -17,9 +17,9 @@ :global GlobalFuncReady false; # Git commit id & info, expected configuration version -:global CommitId "main/556/4817e0dc"; +:global CommitId "main/557/130a1a08"; :global CommitTAG "unknown"; -:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 12:50:02 04.05.2026."; +:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 13:20:03 04.05.2026."; # The variables are received right here. :global GlobalConfVersion 140; @@ -1339,11 +1339,13 @@ # "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 ScriptName [:tostr $1]; + :local RunName [:tostr $1]; :local fetchUrl [:tostr $2]; - :local CheckCert [:tostr $3]; - :local fetchMode [:tostr $4]; - :local fetchMethod [:tostr $5]; + :local fetchFile [:tostr $3]; + :local CheckCert [:tostr $4]; + :local fetchMode [:tostr $5]; + :local fetchMethod [:tostr $6]; + :local tmpName; :global CleanName; :global FetchUserAgentStr; :global GetRandom20CharAlNum; @@ -1355,28 +1357,30 @@ :global WaitForFile; :set CheckCert [ $IfThenElse ($CheckCert = "false") "no" "yes-without-crl" ]; - - :local DirName ("tmpfs/" . [ $CleanName $ScriptName ]); + + :set tmpName [ $CleanName "tmp-" . [ $GetRandom20CharAlNum 4 ] ]; + :local DirName ("tmpfs/" . $tmpName); :if ([ $MkDir $DirName ] = false) do={ - $LogPrint error $0 ("Failed creating directory!"); + :log error ($RunName . " Failed creating directory: " . $DirName . "!"); :return false; } - :local FileName ($DirName . "/" . [ $CleanName $0 ] . "-" . [ $GetRandom20CharAlNum ]); + :local FileName ($DirName . "/" . [ $CleanName $fetchFile ] . "-" . [ $GetRandom20CharAlNum 5 ]); + :local Url ($fetchUrl . $FileName); :onerror Err { - /tool/fetch check-certificate=$CheckCert $fetchUrl dst-path=$FileName \ - http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value; + /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 ($0 . " Failed downloading from " . $fetchUrl . " - " . $Err); + :log error ($RunName . " Failed downloading from '" . $Url . "' - " . $Err); $RmDir $DirName; :return false; } :if ([ $WaitForFile $FileName 5s ] = false) do={ - :log error ($0 . "The file downloaded from " . $fetchUrl . " did not show up."); + :log error ($RunName . " The file downloaded from '" . $Url . "' did not show up."); :return false; } @@ -1423,12 +1427,12 @@ :global CommentsInScripts; :if ([ $CertificateAvailable "Root YE" "fetch" ] = false) do={ - $LogPrint warning $0 ("Downloading certificate failed, trying without."); + :log warning ($0 . "Downloading certificate failed, trying without."); } :foreach Script in=$Scripts do={ :if ([ :len [ /system/script/find where name=$Script ] ] = 0) do={ - $LogPrint info $0 ("Adding new script: " . $Script); + :log info ($0 . " Adding new script: " . $Script); /system/script/add name=$Script owner=$Script source="#!rsc by Vados\n" comment=$NewComment; } } -- 2.52.0