diff --git a/data_from_portwine/changelog_en b/data_from_portwine/changelog_en
index 79175fd..d796251 100755
--- a/data_from_portwine/changelog_en
+++ b/data_from_portwine/changelog_en
@@ -2,6 +2,9 @@ You can help us in the development of the project on the website: https://linux-
----------------------------------------
Changelog:
+###Scripts version 2333### / Date: 06.08.2024 / Download update size: 4 megabytes
+* changed the download source from CDN to the project server cloud.linux-gaming.ru (thanks Xpamych)
+
###Scripts version 2332### / Date: 05.08.2024 / Download update size: 4 megabytes
* fixed display of icons for renamed shortcuts (thanks to Arta48)
* general optimization of scripts (thanks to Htylol)
diff --git a/data_from_portwine/changelog_ru b/data_from_portwine/changelog_ru
index d571693..4e376fa 100755
--- a/data_from_portwine/changelog_ru
+++ b/data_from_portwine/changelog_ru
@@ -2,6 +2,9 @@
-----------------------------------------
История изменений:
+###Scripts version 2333### / Дата: 06.08.2024 / Размер скачиваемого обновления: 4 мегабайта
+* изменён источник скачивания с CDN (зеркало), на сервер проекта cloud.linux-gaming.ru (спасибо Храмычъ)
+
###Scripts version 2332### / Дата: 05.08.2024 / Размер скачиваемого обновления: 4 мегабайта
* исправлено отображение иконок для переименованных ярлыков (спасибо Arta48)
* общая оптимизация скриптов (спасибо Htylol)
diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper
index d886bd4..d9e74c7 100755
--- a/data_from_portwine/scripts/functions_helper
+++ b/data_from_portwine/scripts/functions_helper
@@ -271,11 +271,28 @@ check_process () {
}
export -f check_process
+try_check_sha256sum () {
+ SHA256SUM_EXT=$(curl -L "${1//.tar*/}.sha256sum" | awk '{print $1}')
+ if [[ ${#SHA256SUM_EXT} == 64 ]] ; then
+ SHA256SUM_INT=$(sha256sum "$dest" | awk '{print $1}')
+ if [[ "$SHA256SUM_EXT" == "$SHA256SUM_INT" ]] ; then
+ print_ok "Verification sha256sum was successfully."
+ return 0
+ else
+ print_error "Verification sha256sum was failed."
+ return 1
+ fi
+ else
+ print_warning "sha256sum not found for $(basename "$dest") on server. Skip it."
+ return 0
+ fi
+}
+
try_download () {
- local dest="$2"
+ export dest="$2"
local silent="false"
local no_mirror="false"
-
+
case "$3" in
silent)
silent=true ;;
@@ -291,14 +308,14 @@ try_download () {
local filename="$(basename "$1")"
fi
- if [[ "${MIRROR}" == CDN ]] \
+ if [[ "${MIRROR}" == CLOUD ]] \
&& [[ "$no_mirror" != "true" ]]
then
- FIRST_URL="$url_cdn/$filename"
- SECOND_URL="$1"
+ FIRST_URL=("$url_cloud/$filename" "-u" "portproton:portproton")
+ SECOND_URL=("$1")
else
- FIRST_URL="$1"
- SECOND_URL="$url_cdn/$filename"
+ FIRST_URL=("$1")
+ SECOND_URL=("$url_cloud/$filename" "-u" "portproton:portproton")
fi
[[ ! -f "${pw_yad}" ]] && local pw_yad="yad"
@@ -306,19 +323,19 @@ try_download () {
# If gamescope session is active, use PW_TERM for downloading
if check_gamescope_session ; then
$PW_TERM curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
- -H 'Pragma: no-cache' -L "$FIRST_URL" -o "$dest"
+ -H 'Pragma: no-cache' -L ${FIRST_URL[@]} -o "$dest"
[ "$?" != 0 ] && return 1 || return 0
fi
# Normal download
- print_info "Download $filename from $FIRST_URL..."
+ print_info "Download $filename from ${FIRST_URL[0]}..."
set -o pipefail
if [[ "$silent" == "true" ]] ; then
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
- -H 'Pragma: no-cache' -L "$FIRST_URL" -o "$dest" 2>&1
+ -H 'Pragma: no-cache' -L ${FIRST_URL[@]} -o "$dest" 2>&1
else
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
- -H 'Pragma: no-cache' -L "$FIRST_URL" -o "$dest" 2>&1 | \
+ -H 'Pragma: no-cache' -L ${FIRST_URL[@]} -o "$dest" 2>&1 | \
tr '\r' '\n' | sed -ur 's|[# ]+||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g' | \
"$pw_yad" --progress --text="$(gettext "Downloading") $filename" --auto-close --no-escape \
--auto-kill --center --text-align="center" --fixed --no-buttons --title "PortProton" --width=500 --height=90 \
@@ -327,9 +344,9 @@ try_download () {
if [[ "${PIPESTATUS[0]}" != 0 ]] ; then
if [[ "$no_mirror" != "true" ]] ; then
- print_warning "Failed download $filename from $FIRST_URL, trying mirror..."
+ print_warning "Failed download $filename from ${FIRST_URL[0]}, trying mirror..."
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
- -H 'Pragma: no-cache' -L "$SECOND_URL" -o "$dest" 2>&1 | \
+ -H 'Pragma: no-cache' -L ${SECOND_URL[@]} -o "$dest" 2>&1 | \
tr '\r' '\n' | sed -ur 's|[# ]+||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g' | \
"$pw_yad" --progress --text="$(gettext "Downloading") $filename" --auto-close --no-escape \
--auto-kill --center --text-align="center" --fixed --no-buttons --title "PortProton" --width=500 --height=90 \
@@ -339,12 +356,12 @@ try_download () {
print_error "Failed to download $filename from mirror. Skipping..."
return 1
else
- print_ok "File downloaded successfully: $filename from $SECOND_URL"
- return 0
+ print_ok "File downloaded successfully: $filename from ${SECOND_URL[0]}"
+ try_check_sha256sum ${SECOND_URL[@]} && return 0 || return 1
fi
fi
- print_ok "File downloaded successfully: $filename from $FIRST_URL"
- return 0
+ print_ok "File downloaded successfully: $filename from ${FIRST_URL[0]}"
+ try_check_sha256sum ${FIRST_URL[@]} && return 0 || return 1
}
var_winedlloverride_update () {
@@ -5282,12 +5299,12 @@ change_loc () {
export -f change_loc
change_mirror () {
- if [[ "$MIRROR" == "CDN" ]] ; then
- sed -i 's/="CDN"/="GITHUB"/g' "$USER_CONF"
+ if [[ "$MIRROR" == "CLOUD" ]] ; then
+ sed -i 's/="CLOUD"/="GITHUB"/g' "$USER_CONF"
yad_info "$(gettext "Mirror changed to:") GITHUB"
else
- sed -i 's/="GITHUB"/="CDN"/g' "$USER_CONF"
- yad_info "$(gettext "Mirror changed to:") CDN"
+ sed -i 's/="GITHUB"/="CLOUD"/g' "$USER_CONF"
+ yad_info "$(gettext "Mirror changed to:") CLOUD.LINUX-GAMING.RU"
fi
print_info "Restarting PP for change mirror..."
export SKIP_CHECK_UPDATES="1"
@@ -5299,9 +5316,6 @@ export -f change_mirror
change_branch () {
if [[ "$BRANCH" == "master" ]] ; then
sed -i 's/="master"/="devel"/g' "$USER_CONF"
- if [[ "$MIRROR" != "GITHUB" ]] ; then
- sed -i 's/="CDN"/="GITHUB"/g' "$USER_CONF"
- fi
export MIRROR="GITHUB"
yad_info "$(gettext "Branch changed to:") DEVEL"
else
diff --git a/data_from_portwine/scripts/start.sh b/data_from_portwine/scripts/start.sh
index 75e15a1..21cfb48 100755
--- a/data_from_portwine/scripts/start.sh
+++ b/data_from_portwine/scripts/start.sh
@@ -149,7 +149,7 @@ export pw_yad="${PW_GUI_THEMES_PATH}/gui/yad_gui_pp"
change_locale
export urlg="https://linux-gaming.ru/portproton/"
-export url_cdn="https://cdn.linux-gaming.ru"
+export url_cloud="https://cloud.linux-gaming.ru/portproton"
export PW_WINELIB="${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}"
try_remove_dir "${PW_WINELIB}/var"
install_ver="$(head -n 1 "${PORT_WINE_TMP_PATH}/PortProton_ver")"
@@ -157,6 +157,8 @@ export install_ver
export WINETRICKS_DOWNLOADER="curl"
export USER_CONF="${PORT_WINE_PATH}/data/user.conf"
check_user_conf
+sed -i 's/="CDN"/="CLOUD"/g' "$USER_CONF"
+
check_variables PW_LOG "0"
try_remove_file "${PW_TMPFS_PATH}/update_pfx_log"
@@ -195,8 +197,8 @@ if [[ -z "$MIRROR" ]] \
&& [[ "$LANGUAGE" == "ru" ]] \
&& [[ "$BRANCH" != "devel" ]]
then
- echo 'export MIRROR="CDN"' >> "$USER_CONF"
- MIRROR="CDN"
+ echo 'export MIRROR="CLOUD"' >> "$USER_CONF"
+ MIRROR="CLOUD"
elif [[ -z "$MIRROR" ]] ; then
echo 'export MIRROR="GITHUB"' >> "$USER_CONF"
MIRROR="GITHUB"
@@ -645,9 +647,9 @@ if [[ -f "${portwine_exe}" ]] ; then
else
export KEY="$RANDOM"
- if [[ "$MIRROR" == "CDN" ]]
+ if [[ "$MIRROR" == "CLOUD" ]]
then NEW_MIRROR="GITHUB"
- else NEW_MIRROR="CDN"
+ else NEW_MIRROR="CLOUD"
fi
if [[ "$BRANCH" == "master" ]]
diff --git a/data_from_portwine/scripts/var b/data_from_portwine/scripts/var
index 85e13a7..e392323 100755
--- a/data_from_portwine/scripts/var
+++ b/data_from_portwine/scripts/var
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#Author: Castro-Fidel (linux-gaming.ru)
-#SCRIPTS_NEXT_VERSION=2332
+#SCRIPTS_NEXT_VERSION=2333
#SCRIPTS_STABLE_VERSION=2327
########################################################################
export LANGUAGES_LIST="ru es"