Created attachment 11317 [details] Ошибка rsync url При указании пользовательского urlа, и отметке что будет локальное зеркало - возникает ошибка неверного url Я посмотрел код и нашел, что в /usr/lib/alterator/backend3/mirror регулярка rsync_url_re не содержит ошибку. Предлагаю заменить --- mirror.old 2022-08-12 11:17:22.908873911 +0500 +++ mirror 2022-08-12 11:15:47.895057333 +0500 @@ -13,7 +13,8 @@ alterator_api_version=1 url_re='^\(ftp://\|http://\|rsync://\|file:/\)[a-zA-Z0-9._/:@-]\+$' -rsync_url_re='^rsync://[a-zA-Z0-9._/-:@]\+$' +#rsync_url_re='^rsync://[a-zA-Z0-9._/-:@]\+$' +rsync_url_re='^rsync://[\/\-\d\w:@.]+$' . alterator-sh-functions . avahi-sh-functions @@ -400,7 +401,7 @@ elif ! echo "$in_custom_url"|grep -qs "$url_re";then write_error "`_ "Invalid or unsupported protocol. Should be http,ftp or rsync"`" return - elif [ -n "$in_local" ] && ! echo "$in_custom_url"|grep -qs "$rsync_url_re";then + elif [ -n "$in_local" ] && ! echo "$in_custom_url"|grep -qsP "$rsync_url_re";then write_error "`_ "Can mirror only from sources with rsync procotol"`" return fi Тест проходит #!/bin/bash #old #rsync_url_re='^rsync://[a-zA-Z0-9._/-:@]\+$' rsync_url_re='^rsync://[\/\-\d\w:@.]+$' in_custom_url='rsync://user:pass@adm-alt-update/path/' in_local=1 #if [ -n "$in_local" ] && ! echo "$in_custom_url"|grep -qs "$rsync_url_re" ;then if ! echo "$in_custom_url"|grep -qsP "$rsync_url_re" ;then echo "Can mirror only from sources with rsync procotol" else echo 'Rsync url valid' fi
не содержит ошибку = содержит ошибку
alterator-mirror-0.4.10-alt1 -> sisyphus: Mon Dec 04 2023 Andrey Cherepanov <cas@altlinux> 0.4.10-alt1 - Supported allowed repo names in /etc/alterator/mirror/allowed. - Fixed regexp for custom url (ALT #43503). - Added alterator-mirror-allowed package with allowed repositories.