From aeeabd8ba229b4139ff4fd392cd49897fa0b8b68 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 23 Jun 2026 10:57:35 +0800 Subject: [PATCH] security: use domain for license endpoints --- douyin/license/license_manager.py | 2 +- douyin/updater/force_update.py | 2 +- license_server/README.md | 2 +- tests/test_auto_update.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/douyin/license/license_manager.py b/douyin/license/license_manager.py index 892c16c..147ad9e 100644 --- a/douyin/license/license_manager.py +++ b/douyin/license/license_manager.py @@ -24,7 +24,7 @@ from douyin.license.public_key import PUBLIC_KEY_PEM LICENSE_FILENAME = "license.dat" ACTIVATION_CODE_PREFIX = "DYGJ-" -DEFAULT_ACTIVATION_URL = "http://dy.absfan.cn:18100/api/v1/activate" +DEFAULT_ACTIVATION_URL = "https://dy.absfan.cn/api/v1/activate" DEFAULT_VERIFY_INTERVAL_SECONDS = 600 DEFAULT_VERIFY_FAILURES_BEFORE_EXIT = 3 diff --git a/douyin/updater/force_update.py b/douyin/updater/force_update.py index de643c8..9c82488 100644 --- a/douyin/updater/force_update.py +++ b/douyin/updater/force_update.py @@ -28,7 +28,7 @@ DEFAULT_INSTALLER_ARGS = ( "/NORESTART", "/CURRENTUSER", ) -DEFAULT_UPDATE_MANIFEST_URL = "http://dy.absfan.cn:18100/api/v1/update/manifest" +DEFAULT_UPDATE_MANIFEST_URL = "https://dy.absfan.cn/api/v1/update/manifest" class UpdateError(RuntimeError): diff --git a/license_server/README.md b/license_server/README.md index f7a42fa..02a5652 100644 --- a/license_server/README.md +++ b/license_server/README.md @@ -100,7 +100,7 @@ http://服务器IP:18100/admin 打包后的客户端默认读取: ```text -http://dy.absfan.cn:18100/api/v1/update/manifest +https://dy.absfan.cn/api/v1/update/manifest ``` 如果后台未发布更新,manifest 返回 `version=0.0.0`,客户端不会下载。发布高于客户端当前版本的安装包后,客户端启动时会下载、校验签名和 SHA256,然后启动安装器并退出旧进程。 diff --git a/tests/test_auto_update.py b/tests/test_auto_update.py index cb7c881..0a225f9 100644 --- a/tests/test_auto_update.py +++ b/tests/test_auto_update.py @@ -115,7 +115,7 @@ def test_forced_update_accepts_signed_manifest(tmp_path, monkeypatch): manifest = { "enabled": True, "version": "3.3.4", - "url": "http://dy.absfan.cn:18100/api/v1/update/download/DouyinGuaji-3.3.4-Setup.exe", + "url": "https://dy.absfan.cn/api/v1/update/download/DouyinGuaji-3.3.4-Setup.exe", "filename": "DouyinGuaji-3.3.4-Setup.exe", "sha256": expected_sha, "force": True, @@ -128,7 +128,7 @@ def test_forced_update_accepts_signed_manifest(tmp_path, monkeypatch): result = perform_forced_update( UpdateSettings( enabled=True, - manifest_url="http://dy.absfan.cn:18100/api/v1/update/manifest", + manifest_url="https://dy.absfan.cn/api/v1/update/manifest", download_dir=tmp_path, require_https=False, require_signed_manifest=True, @@ -150,7 +150,7 @@ def test_forced_update_rejects_bad_signed_manifest(tmp_path, monkeypatch): monkeypatch.setattr(force_update, "PUBLIC_KEY_PEM", TEST_PUBLIC_KEY_PEM) manifest = { "version": "3.3.4", - "url": "http://dy.absfan.cn:18100/api/v1/update/download/app.exe", + "url": "https://dy.absfan.cn/api/v1/update/download/app.exe", "sha256": "0" * 64, "signature": "bad", } @@ -159,7 +159,7 @@ def test_forced_update_rejects_bad_signed_manifest(tmp_path, monkeypatch): perform_forced_update( UpdateSettings( enabled=True, - manifest_url="http://dy.absfan.cn:18100/api/v1/update/manifest", + manifest_url="https://dy.absfan.cn/api/v1/update/manifest", download_dir=tmp_path, require_https=False, require_signed_manifest=True,