From 1c158df4f3a6414a458eac753a69a69f23c0ca24 Mon Sep 17 00:00:00 2001
From: "nikolay.panko" <nikolay.panko@demlabs.net>
Date: Thu, 6 Mar 2025 15:35:36 +0700
Subject: [PATCH 1/4] [*] change link in updtr.sh ; gitlab pipe add manual job
 for updater build

---
 .gitlab-ci.yml             |  2 ++
 dist.linux/share/update.sh | 20 +++++++++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c364c615d..c658e57d9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,4 @@
+
 variables:
     GIT_SUBMODULE_STRATEGY: recursive
     GIT_SUBMODULE_UPDATE_FLAGS: --force
@@ -343,3 +344,4 @@ version:up:
     - 'curl -s --request PUT --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/variables/$PATCH_NUM_VAR_NAME" --form "key=$PATCH_NUM_VAR_NAME" --form "value=${PATCH_NUM}" || true'
     
 
+    
\ No newline at end of file
diff --git a/dist.linux/share/update.sh b/dist.linux/share/update.sh
index e15f4fe87..d772cc20e 100755
--- a/dist.linux/share/update.sh
+++ b/dist.linux/share/update.sh
@@ -1,6 +1,7 @@
- #! /bin/bash
+#! /bin/bash
 set -e
-STORAGE_URL=https://pub.cellframe.net/linux/cellframe-node/master/updates
+#STORAGE_URL=https://pub.cellframe.net/linux/cellframe-node/master/updates
+STORAGE_URL=https://internal-pub.cellframe.net/linux/cellframe-node/bugfix-13205
 
 MACHINE=$(uname -m)
 
@@ -45,13 +46,22 @@ CURRENT_REBUILD=$(echo $INSTALLED_VERSION | grep -Po "[0-9]([0-9]+)")
 echo "Available patch: $MAX_REBUILD | Current patch: $CURRENT_REBUILD"
 
 if (( MAX_REBUILD > CURRENT_REBUILD )); then
-    echo "Need update cellframe-node to 5.2-$MAX_REBUILD..."
+    # Determine the full version (e.g. 5.3-354) from AVAILABLE_VERSIONS by the patch we found
+    for ver in "${AVAILABLE_VERSIONS[@]}"
+    do
+        patch=$(echo $ver | cut -d'-' -f2)
+        if [ "$patch" = "$MAX_REBUILD" ]; then
+            NEW_VERSION=$ver
+            break
+        fi
+    done
+    echo "Need update cellframe-node to $NEW_VERSION..."
 else
     echo "No need to update cellframe-node"
     exit 0
 fi
 
-PACKAGE_NAME="cellframe-node-5.2-$MAX_REBUILD-updtr-amd64.deb"
+PACKAGE_NAME="cellframe-node-$NEW_VERSION-updtr-${POSTFIX}.deb"
 echo "wget"
 mkdir -p /tmp/cfupd/
 wget $STORAGE_URL/$PACKAGE_NAME -O /tmp/cfupd/$PACKAGE_NAME
@@ -73,4 +83,4 @@ fi
 
 
 dpkg -i /tmp/cfupd/$PACKAGE_NAME
-service cellframe-node restart
\ No newline at end of file
+service cellframe-node restart
-- 
GitLab


From f57191c379d596636dbc4503e0b6990f169bbe9e Mon Sep 17 00:00:00 2001
From: "nikolay.panko" <nikolay.panko@demlabs.net>
Date: Thu, 6 Mar 2025 17:57:43 +0700
Subject: [PATCH 2/4] [*] added to pipeline manual start updtr build

---
 .gitlab-ci.yml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c658e57d9..ce8e2ab88 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,3 @@
-
 variables:
     GIT_SUBMODULE_STRATEGY: recursive
     GIT_SUBMODULE_UPDATE_FLAGS: --force
@@ -261,9 +260,14 @@ amd64:linux.tps:
       - ./prod_build/pack.sh --target linux release
       - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*.deb
 
-.amd64:linux.updtr:
+amd64:linux.updtr:
     extends: .build
+    stage: build
     image: demlabs/debian/amd64:qt5
+    rules:
+      - when: manual
+        allow_failure: true
+
     before_script: 
       - /opt/buildtools/prepare_environment.sh amd64-linux
       - *fill_version_mk
@@ -344,4 +348,3 @@ version:up:
     - 'curl -s --request PUT --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/variables/$PATCH_NUM_VAR_NAME" --form "key=$PATCH_NUM_VAR_NAME" --form "value=${PATCH_NUM}" || true'
     
 
-    
\ No newline at end of file
-- 
GitLab


From 43db610d9dab8f5234a9e65f24ebbc3e69fda597 Mon Sep 17 00:00:00 2001
From: "nikolay.panko" <nikolay.panko@demlabs.net>
Date: Thu, 6 Mar 2025 18:38:35 +0700
Subject: [PATCH 3/4] [*] sourse link in update.sh to master

---
 dist.linux/share/update.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dist.linux/share/update.sh b/dist.linux/share/update.sh
index d772cc20e..43710d300 100755
--- a/dist.linux/share/update.sh
+++ b/dist.linux/share/update.sh
@@ -1,7 +1,7 @@
 #! /bin/bash
 set -e
-#STORAGE_URL=https://pub.cellframe.net/linux/cellframe-node/master/updates
-STORAGE_URL=https://internal-pub.cellframe.net/linux/cellframe-node/bugfix-13205
+STORAGE_URL=https://pub.cellframe.net/linux/cellframe-node/master
+
 
 MACHINE=$(uname -m)
 
-- 
GitLab


From dbb7f5bcd204a8b78b1e173f0b2e99ea2458d2e9 Mon Sep 17 00:00:00 2001
From: "nikolay.panko" <nikolay.panko@demlabs.net>
Date: Mon, 10 Mar 2025 13:51:26 +0700
Subject: [PATCH 4/4] [-] Removed extra slashes in paths

---
 conftool/main.cpp        | 6 +++---
 dist/share/default.setup | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/conftool/main.cpp b/conftool/main.cpp
index 6e56531bc..1d5c098c4 100644
--- a/conftool/main.cpp
+++ b/conftool/main.cpp
@@ -114,11 +114,11 @@ std::string getNodeConfigPath(std::string basepath){
     #endif
 
     #ifdef __linux__
-        return "/opt/cellframe-node/";
+        return "/opt/cellframe-node";
     #endif
     
     #ifdef __APPLE__ 
-        return  "/Library/Application Support/CellframeNode/";
+        return  "/Library/Application Support/CellframeNode";
     #endif
 
 
@@ -130,7 +130,7 @@ std::string getNodeConfigPath(std::string basepath){
         std::wstring path;
         GetStringRegKey(hKey, L"Common Documents", path, L"");
         std::string stdpath(path.begin(),path.end());
-        return (std::filesystem::path{stdpath}/"cellframe-node/").string();
+        return (std::filesystem::path{stdpath}/"cellframe-node").string();
     #endif
 }
 
diff --git a/dist/share/default.setup b/dist/share/default.setup
index dd929b4c1..546d47675 100644
--- a/dist/share/default.setup
+++ b/dist/share/default.setup
@@ -7,7 +7,7 @@
 # Predefined variables:
 #   ${HOST_OS} -> Linux | Windows | Macos
 #   ${HOSTNAME} -> hostname of a machine
-#   ${CONFIGS_PATH} -> /opt/cellframe-node/ for linux, 
+#   ${CONFIGS_PATH} -> /opt/cellframe-node for linux, 
 #                      Common Documents (usually C:\Users\Public\Documents\cellframe-node\) for Windows
 #
 # fromtemplate: create and populate config from "share/configs" templates  
-- 
GitLab