rl-rock 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2384,12 +2384,9 @@ var Sandbox = class extends AbstractSandbox {
2384
2384
  const objectName = `download-${timestamp}-${fileName}`;
2385
2385
  const credentials = await this.getOssStsCredentials();
2386
2386
  const bucketName = envVars.ROCK_OSS_BUCKET_NAME ?? "";
2387
- const region = envVars.ROCK_OSS_BUCKET_REGION ?? "";
2388
- const endpoint = `https://oss-${region}.aliyuncs.com`;
2389
- const envPrefix = `OSS_ACCESS_KEY_ID=${credentials.accessKeyId} OSS_ACCESS_KEY_SECRET=${credentials.accessKeySecret} OSS_SESSION_TOKEN=${credentials.securityToken}`;
2390
- const ossutilConfigCmd = `${envPrefix} ossutil config -e ${endpoint} --region ${region}`;
2391
- await this.arun(ossutilConfigCmd, { mode: "nohup", waitTimeout: 60 });
2392
- const uploadToOssCmd = `${envPrefix} ossutil cp ${remotePath} oss://${bucketName}/${objectName}`;
2387
+ const region = (envVars.ROCK_OSS_BUCKET_REGION ?? "").replace(/^oss-/, "");
2388
+ const endpoint = envVars.ROCK_OSS_BUCKET_ENDPOINT ?? `oss-${region}.aliyuncs.com`;
2389
+ const uploadToOssCmd = `ossutil cp '${remotePath}' 'oss://${bucketName}/${objectName}' --access-key-id '${credentials.accessKeyId}' --access-key-secret '${credentials.accessKeySecret}' --sts-token '${credentials.securityToken}' --endpoint '${endpoint}' --region '${region}'`;
2393
2390
  const uploadResult = await this.arun(uploadToOssCmd, { mode: "nohup", waitTimeout: 600 });
2394
2391
  if (uploadResult.exitCode !== 0) {
2395
2392
  return { success: false, message: `Sandbox to OSS upload failed: ${uploadResult.output}` };