From 03457a7f9edff3b856ef10e2d28549b0c1ed546c Mon Sep 17 00:00:00 2001 From: haosicheng Date: Tue, 21 Oct 2025 16:04:29 +0800 Subject: [PATCH] =?UTF-8?q?[patch]=20=E8=AE=BE=E8=AE=A1PDD=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=B6=88=E6=81=AF=E6=9E=B6=E6=9E=84=E4=B8=BA?= =?UTF-8?q?msg=5Ftype=20=E9=80=9A=E7=94=A8=E6=A8=A1=E5=BC=8F=20=E5=A4=84?= =?UTF-8?q?=E7=90=86PDD=E6=94=AF=E6=8C=81=E5=9B=BE=E7=89=87=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=92=8C=20=E5=95=86=E5=93=81=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=B6=88=E6=81=AF=E7=9A=84=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=9B=9E=E5=A4=8D=20=E4=BF=AE=E6=94=B9GUI=E6=89=98?= =?UTF-8?q?=E7=9B=98=E5=86=85=E9=83=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/scripts/upload_installer_to_ks3.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitea/scripts/upload_installer_to_ks3.py b/.gitea/scripts/upload_installer_to_ks3.py index 42cab0e..ba343ce 100644 --- a/.gitea/scripts/upload_installer_to_ks3.py +++ b/.gitea/scripts/upload_installer_to_ks3.py @@ -10,6 +10,16 @@ import sys import logging from pathlib import Path +# 🔥 强制禁用代理,避免代理连接问题 +# 必须在所有网络操作之前设置 +os.environ['NO_PROXY'] = '*' +os.environ['HTTP_PROXY'] = '' +os.environ['HTTPS_PROXY'] = '' +os.environ['http_proxy'] = '' +os.environ['https_proxy'] = '' +os.environ['ALL_PROXY'] = '' +os.environ['all_proxy'] = '' + try: from ks3.connection import Connection except ImportError: @@ -100,6 +110,7 @@ def upload_installer(connection, installer_path): # Upload file with public read permission and progress tracking # Use cb parameter for progress callback (called every 5% or every 10MB) + # 🔥 启用分片上传提高大文件上传成功率 key.set_contents_from_filename( str(installer_path), headers={ @@ -111,7 +122,9 @@ def upload_installer(connection, installer_path): }, policy='public-read', # Set ACL policy cb=progress_callback, # Progress callback function - num_cb=10 # Call callback 10 times during upload (every 10%) + num_cb=10, # Call callback 10 times during upload (every 10%) + multipart=True, # 🔥 启用分片上传 + chunk_size=10485760 # 🔥 10MB每片,提高上传稳定性 ) # Generate download URL (using KS3 third-level domain format) @@ -143,6 +156,8 @@ def main(): logger.info(f"KS3 Endpoint: {KS3_ENDPOINT}") logger.info(f"Bucket: {KS3_BUCKET}") logger.info(f"Target directory: {KS3_PREFIX}") + logger.info("Proxy disabled: Direct connection to KS3") + logger.info("Multipart upload: Enabled (10MB chunks)") logger.info("=" * 70) installer_path = find_latest_installer()