From f305791590e8c7ca193111ee1584655f5b9ef8de Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Tue, 23 Dec 2025 10:00:56 +0000 Subject: [PATCH 01/16] 503 --- config/nginx/public.conf | 12 ++++ nginx/build.sh | 1 + nginx/errors/502.html | 148 +++++++++++++++++++++++++++++++++++++++ test/test-ui.py | 7 ++ 4 files changed, 168 insertions(+) create mode 100644 nginx/errors/502.html diff --git a/config/nginx/public.conf b/config/nginx/public.conf index cac4faa0..e4541d35 100644 --- a/config/nginx/public.conf +++ b/config/nginx/public.conf @@ -31,6 +31,8 @@ http { #less slow sd card io proxy_buffering off; + + # internal ui redirect for backwards compatibility server { @@ -70,6 +72,7 @@ http { add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; add_header 'Access-Control-Allow-Origin' '*'; + location /rest { proxy_pass http://unix:/var/snap/platform/current/backend.sock: ; } @@ -137,6 +140,15 @@ http { add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; + error_page 502 /502.html; + error_page 503 /502.html; + error_page 504 /502.html; + + location = /502.html { + root /snap/platform/current/nginx/errors; + internal; + } + location / { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $http_host; diff --git a/nginx/build.sh b/nginx/build.sh index 42c103bd..fb9ffb9a 100755 --- a/nginx/build.sh +++ b/nginx/build.sh @@ -11,3 +11,4 @@ cp -r /usr ${BUILD_DIR} cp -r /bin ${BUILD_DIR} cp -r /lib ${BUILD_DIR} cp -r ${DIR}/bin/* ${BUILD_DIR}/bin +cp -r ${DIR}/errors ${BUILD_DIR} diff --git a/nginx/errors/502.html b/nginx/errors/502.html new file mode 100644 index 00000000..2fd398f3 --- /dev/null +++ b/nginx/errors/502.html @@ -0,0 +1,148 @@ + + + + + + Service Temporarily Unavailable + + + +
+

âš ī¸

+
Error 502
+

Service Temporarily Unavailable

+

Our servers are currently experiencing high traffic or undergoing maintenance. Please try again in a few moments.

+ + + +
+ +
+

What you can do:

+
    +
  • Wait a few minutes and try again
  • +
  • Check your internet connection
  • +
  • Clear your browser cache
  • +
  • Contact support if the problem persists
  • +
+
+
+ + + + + + diff --git a/test/test-ui.py b/test/test-ui.py index c393602c..2bdc0ebe 100644 --- a/test/test-ui.py +++ b/test/test-ui.py @@ -263,6 +263,13 @@ def test_settings_deactivate(selenium, device_host, full_domain, selenium.find_by_xpath("//h1[text()='Applications']") selenium.screenshot('reactivate-index') + +def test_502(selenium, device_host, full_domain, + domain, device_user, device_password, redirect_user, redirect_password): + selenium.driver.get("https://unknown.{0}".format(domain) + selenium.find_by_xpath("//h1[text()='unavailable']") + + def test_permission_denied(selenium, device, ui_mode): device.run_ssh('/snap/platform/current/openldap/bin/ldapadd.sh -x -w syncloud -D "dc=syncloud,dc=org" -f /test/test.{0}.ldif'.format(ui_mode)) menu(selenium, 'logout') From b5f376593482365627f1ed55aa1f81cc516ec403 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Tue, 23 Dec 2025 10:45:39 +0000 Subject: [PATCH 02/16] fix --- test/test-ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-ui.py b/test/test-ui.py index 2bdc0ebe..342ecac5 100644 --- a/test/test-ui.py +++ b/test/test-ui.py @@ -266,7 +266,7 @@ def test_settings_deactivate(selenium, device_host, full_domain, def test_502(selenium, device_host, full_domain, domain, device_user, device_password, redirect_user, redirect_password): - selenium.driver.get("https://unknown.{0}".format(domain) + selenium.driver.get("https://unknown.{0}".format(domain)) selenium.find_by_xpath("//h1[text()='unavailable']") From 9961fd6d32757bea1511ec3ea7d4a2e2d6b3e0dd Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Tue, 23 Dec 2025 12:48:54 +0000 Subject: [PATCH 03/16] seleniu --- .drone.jsonnet | 8 ++++---- test/pytest.ini | 3 +++ test/requirements.txt | 8 +++++--- test/{test-ui.py => ui.py} | 3 --- test/{test-upgrade.py => upgrade.py} | 0 5 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 test/pytest.ini rename test/{test-ui.py => ui.py} (99%) rename test/{test-upgrade.py => upgrade.py} (100%) diff --git a/.drone.jsonnet b/.drone.jsonnet index 2ddcf2ef..d76825ca 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,7 +1,7 @@ local name = 'platform'; local browser = 'chrome'; -local selenium = '4.19.0-20240328'; -local go = '1.22.0'; +local selenium = '4.35.0-20250828'; +local go = '1.25.0'; local node = '22.16.0'; local deployer = 'https://github.com/syncloud/store/releases/download/4/syncloud-release'; local authelia = '4.38.8'; @@ -174,7 +174,7 @@ local build(arch, testUI) = [{ commands: [ 'cd test', './deps.sh', - 'py.test -x -s test-ui.py --ui-mode=' + mode + ' --domain=' + distro_default + '-' + arch + ' --device-host=' + distro_default + '-' + arch + ' --redirect-user=redirect --redirect-password=redirect --app=' + name + ' --browser=' + browser, + 'py.test -x -s ui.py --ui-mode=' + mode + ' --domain=' + distro_default + '-' + arch + ' --device-host=' + distro_default + '-' + arch + ' --redirect-user=redirect --redirect-password=redirect --app=' + name + ' --browser=' + browser, ], privileged: true, volumes: [{ @@ -192,7 +192,7 @@ local build(arch, testUI) = [{ 'APP_ARCHIVE_PATH=$(realpath $(cat package.name))', 'cd test', './deps.sh', - 'py.test -x -s test-upgrade.py --domain=' + distro_default + '-' + arch + ' --device-host=' + distro_default + '-' + arch + ' --app-archive-path=$APP_ARCHIVE_PATH --app=' + name, + 'py.test -x -s upgrade.py --domain=' + distro_default + '-' + arch + ' --device-host=' + distro_default + '-' + arch + ' --app-archive-path=$APP_ARCHIVE_PATH --app=' + name, ], privileged: true, volumes: [{ diff --git a/test/pytest.ini b/test/pytest.ini new file mode 100644 index 00000000..f184d3be --- /dev/null +++ b/test/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +log_cli = True +log_level=INFO \ No newline at end of file diff --git a/test/requirements.txt b/test/requirements.txt index fb6357f7..138e851d 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,4 +1,6 @@ -pytest==6.2.4 +pytest==8.4.1 +selenium==4.35.0 +syncloud-lib==356 +pytest-retry==1.6.3 +retrying==1.4.2 responses==0.5.0 -selenium==3.141.0 -syncloud-lib==305 diff --git a/test/test-ui.py b/test/ui.py similarity index 99% rename from test/test-ui.py rename to test/ui.py index 342ecac5..de70ea5d 100644 --- a/test/test-ui.py +++ b/test/ui.py @@ -334,6 +334,3 @@ def wait_for_loading(driver): wait_driver = WebDriverWait(driver, 120) wait_driver.until(EC.invisibility_of_element_located((By.CLASS_NAME, 'el-loading-mask'))) - -def test_teardown(driver): - driver.quit() diff --git a/test/test-upgrade.py b/test/upgrade.py similarity index 100% rename from test/test-upgrade.py rename to test/upgrade.py From 940a403c26a2482621863a0143169c75312039e9 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Tue, 23 Dec 2025 14:07:52 +0000 Subject: [PATCH 04/16] 3.12 --- .drone.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index d76825ca..97cdf862 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -9,7 +9,7 @@ local distro_default = 'buster'; local distros = ['bookworm', 'buster']; local bootstrap = '25.02'; local nginx = '1.24.0'; -local python = '3.8-slim-bookworm'; +local python = '3.12-slim-bookworm'; local build(arch, testUI) = [{ kind: 'pipeline', From 4b05e6cf0ef8190dbd5beb9f29210a4b203e69df Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Tue, 23 Dec 2025 17:06:46 +0000 Subject: [PATCH 05/16] unknown dns --- .drone.jsonnet | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.jsonnet b/.drone.jsonnet index 97cdf862..675e3540 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -144,6 +144,7 @@ local build(arch, testUI) = [{ 'DOMAIN="' + distro_default + '-' + arch + '"', 'getent hosts $DOMAIN | sed "s/$DOMAIN/auth.$DOMAIN.redirect/g" | sudo tee -a /etc/hosts', 'getent hosts $DOMAIN | sed "s/$DOMAIN/$DOMAIN.redirect/g" | sudo tee -a /etc/hosts', + 'getent hosts $DOMAIN | sed "s/$DOMAIN/unknown.$DOMAIN/g" | sudo tee -a /etc/hosts', 'cat /etc/hosts', '/opt/bin/entry_point.sh', ], From 1fc396fce17a8bfb47304ccacfb1128ccb2252df Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Tue, 23 Dec 2025 18:54:38 +0000 Subject: [PATCH 06/16] dns --- .drone.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 675e3540..0ae43434 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -144,7 +144,7 @@ local build(arch, testUI) = [{ 'DOMAIN="' + distro_default + '-' + arch + '"', 'getent hosts $DOMAIN | sed "s/$DOMAIN/auth.$DOMAIN.redirect/g" | sudo tee -a /etc/hosts', 'getent hosts $DOMAIN | sed "s/$DOMAIN/$DOMAIN.redirect/g" | sudo tee -a /etc/hosts', - 'getent hosts $DOMAIN | sed "s/$DOMAIN/unknown.$DOMAIN/g" | sudo tee -a /etc/hosts', + 'getent hosts $DOMAIN | sed "s/$DOMAIN/unknown.$DOMAIN.redirect/g" | sudo tee -a /etc/hosts', 'cat /etc/hosts', '/opt/bin/entry_point.sh', ], From 03cc8c6f560b8fe9875b61b49fc200b8e2c991bb Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Tue, 23 Dec 2025 23:14:53 +0000 Subject: [PATCH 07/16] dns fix --- test/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ui.py b/test/ui.py index de70ea5d..89a181e8 100644 --- a/test/ui.py +++ b/test/ui.py @@ -266,7 +266,7 @@ def test_settings_deactivate(selenium, device_host, full_domain, def test_502(selenium, device_host, full_domain, domain, device_user, device_password, redirect_user, redirect_password): - selenium.driver.get("https://unknown.{0}".format(domain)) + selenium.driver.get("https://unknown.{0}".format(full_domain)) selenium.find_by_xpath("//h1[text()='unavailable']") From 476203f353c442113cf563c3a4ce398e634638c7 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Wed, 24 Dec 2025 23:10:21 +0000 Subject: [PATCH 08/16] fix test --- nginx/errors/502.html | 148 ------------------------------------------ test/ui.py | 2 +- 2 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 nginx/errors/502.html diff --git a/nginx/errors/502.html b/nginx/errors/502.html deleted file mode 100644 index 2fd398f3..00000000 --- a/nginx/errors/502.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - Service Temporarily Unavailable - - - -
-

âš ī¸

-
Error 502
-

Service Temporarily Unavailable

-

Our servers are currently experiencing high traffic or undergoing maintenance. Please try again in a few moments.

- - - -
- -
-

What you can do:

-
    -
  • Wait a few minutes and try again
  • -
  • Check your internet connection
  • -
  • Clear your browser cache
  • -
  • Contact support if the problem persists
  • -
-
-
- -
-

Error occurred at

-

Request ID:

-
- - - - diff --git a/test/ui.py b/test/ui.py index 89a181e8..ff76c98a 100644 --- a/test/ui.py +++ b/test/ui.py @@ -267,7 +267,7 @@ def test_settings_deactivate(selenium, device_host, full_domain, def test_502(selenium, device_host, full_domain, domain, device_user, device_password, redirect_user, redirect_password): selenium.driver.get("https://unknown.{0}".format(full_domain)) - selenium.find_by_xpath("//h1[text()='unavailable']") + selenium.find_by_xpath("//h2[contains(.,'App is not available')]") def test_permission_denied(selenium, device, ui_mode): From bc7e1a7f9ef3285c328d193c4153f2717acd8b6c Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Wed, 24 Dec 2025 23:26:16 +0000 Subject: [PATCH 09/16] fix conf --- config/nginx/public.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/nginx/public.conf b/config/nginx/public.conf index e4541d35..2c0013cb 100644 --- a/config/nginx/public.conf +++ b/config/nginx/public.conf @@ -145,7 +145,7 @@ http { error_page 504 /502.html; location = /502.html { - root /snap/platform/current/nginx/errors; + root /var/snap/platform/current/config/errors; internal; } From 1b795ea0d7c0f106b2d687587f6cadb0e687d20e Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Wed, 24 Dec 2025 23:45:08 +0000 Subject: [PATCH 10/16] fix conf 1 --- config/errors/502.html | 105 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 config/errors/502.html diff --git a/config/errors/502.html b/config/errors/502.html new file mode 100644 index 00000000..b865ee46 --- /dev/null +++ b/config/errors/502.html @@ -0,0 +1,105 @@ + + + + + + Service Temporarily Unavailable + + + +
+
Error 502
+

App is not available or still starting.

+ + + +
+

What you can do:

+
    +
  • Wait a few minutes and try again
  • +
  • Contact support if the problem persists
  • +
+
+
+ + + From 21471ffe9f85d0072fff55ebc6e62d9a970776a4 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Wed, 24 Dec 2025 23:49:30 +0000 Subject: [PATCH 11/16] fix conf 2 --- nginx/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/nginx/build.sh b/nginx/build.sh index fb9ffb9a..42c103bd 100755 --- a/nginx/build.sh +++ b/nginx/build.sh @@ -11,4 +11,3 @@ cp -r /usr ${BUILD_DIR} cp -r /bin ${BUILD_DIR} cp -r /lib ${BUILD_DIR} cp -r ${DIR}/bin/* ${BUILD_DIR}/bin -cp -r ${DIR}/errors ${BUILD_DIR} From 304bfbe115108ce1d82dd154a96210549a84e22b Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Thu, 25 Dec 2025 10:08:05 +0000 Subject: [PATCH 12/16] path --- config/nginx/public.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/nginx/public.conf b/config/nginx/public.conf index 2c0013cb..e3e8787e 100644 --- a/config/nginx/public.conf +++ b/config/nginx/public.conf @@ -145,7 +145,7 @@ http { error_page 504 /502.html; location = /502.html { - root /var/snap/platform/current/config/errors; + root /snap/platform/current/config/errors; internal; } @@ -164,5 +164,3 @@ http { } } - - From 22787a4dc2fbbb8237b1fc1fb71dc4ead23b02b3 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Thu, 25 Dec 2025 11:10:37 +0000 Subject: [PATCH 13/16] fix 502 --- test/ui.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/ui.py b/test/ui.py index ff76c98a..3fd99c99 100644 --- a/test/ui.py +++ b/test/ui.py @@ -264,12 +264,6 @@ def test_settings_deactivate(selenium, device_host, full_domain, selenium.screenshot('reactivate-index') -def test_502(selenium, device_host, full_domain, - domain, device_user, device_password, redirect_user, redirect_password): - selenium.driver.get("https://unknown.{0}".format(full_domain)) - selenium.find_by_xpath("//h2[contains(.,'App is not available')]") - - def test_permission_denied(selenium, device, ui_mode): device.run_ssh('/snap/platform/current/openldap/bin/ldapadd.sh -x -w syncloud -D "dc=syncloud,dc=org" -f /test/test.{0}.ldif'.format(ui_mode)) menu(selenium, 'logout') @@ -280,6 +274,12 @@ def test_permission_denied(selenium, device, ui_mode): selenium.find_by_xpath("//div[contains(.,'not admin')]") selenium.screenshot('permission-denied') + +def test_502(selenium, full_domain): + selenium.driver.get("https://unknown.{0}".format(full_domain)) + selenium.find_by_xpath("//h2[contains(.,'App is not available')]") + + def menu(selenium, element_id): retries = 10 retry = 0 @@ -333,4 +333,3 @@ def settings(selenium, setting): def wait_for_loading(driver): wait_driver = WebDriverWait(driver, 120) wait_driver.until(EC.invisibility_of_element_located((By.CLASS_NAME, 'el-loading-mask'))) - From f22b8a86c18d7da0cb67c6e1234d2a89e001d860 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Thu, 25 Dec 2025 11:35:30 +0000 Subject: [PATCH 14/16] go 22 --- .drone.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 0ae43434..7e3722c8 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,7 +1,7 @@ local name = 'platform'; local browser = 'chrome'; local selenium = '4.35.0-20250828'; -local go = '1.25.0'; +local go = '1.22.0'; local node = '22.16.0'; local deployer = 'https://github.com/syncloud/store/releases/download/4/syncloud-release'; local authelia = '4.38.8'; From 52d5795563a1208f7021bafc33e1e2994201ceea Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Thu, 25 Dec 2025 14:07:24 +0000 Subject: [PATCH 15/16] go 23 --- .drone.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 7e3722c8..dbce3b50 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,7 +1,7 @@ local name = 'platform'; local browser = 'chrome'; local selenium = '4.35.0-20250828'; -local go = '1.22.0'; +local go = '1.23.0'; local node = '22.16.0'; local deployer = 'https://github.com/syncloud/store/releases/download/4/syncloud-release'; local authelia = '4.38.8'; From 1b5f3846a5797cd6ad9106bb3ba644ca0944e177 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Thu, 25 Dec 2025 16:16:30 +0000 Subject: [PATCH 16/16] go 24 --- .drone.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index dbce3b50..23371dc3 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,7 +1,7 @@ local name = 'platform'; local browser = 'chrome'; local selenium = '4.35.0-20250828'; -local go = '1.23.0'; +local go = '1.24.0'; local node = '22.16.0'; local deployer = 'https://github.com/syncloud/store/releases/download/4/syncloud-release'; local authelia = '4.38.8';