[patch] 修正ks3问题

This commit is contained in:
Gitea Actions Bot
2025-10-11 16:54:14 +08:00
parent bcb76c0a99
commit 5c73bbf8bc
3 changed files with 29 additions and 13 deletions

View File

@@ -83,18 +83,18 @@ def upload_installer(connection, installer_path):
key = bucket.new_key(ks3_key)
with open(installer_path, 'rb') as f:
key.set_contents_from_file(
f,
headers={
'Content-Type': 'application/octet-stream',
'Content-Disposition': f'attachment; filename="{installer_path.name}"',
'Cache-Control': 'public, max-age=3600',
'x-kss-storage-class': 'STANDARD'
}
)
key.set_acl('public-read')
# Upload file with public read permission (reference: bulk_upload_static_to_ks3.py)
key.set_contents_from_filename(
str(installer_path),
headers={
'Content-Type': 'application/octet-stream',
'Content-Disposition': f'attachment; filename="{installer_path.name}"',
'Cache-Control': 'public, max-age=3600',
'x-kss-storage-class': 'STANDARD',
'x-kss-acl': 'public-read' # Set public read permission in headers
},
policy='public-read' # Set ACL policy
)
# Generate download URL (using HTTPS)
protocol = 'https' if KS3_IS_SECURE else 'http'