Opslaan als PDF
Lyve Cloud Object Storage Resources Guide 
Lyve Cloud Object Storage Resources Guide 

Heeft deze informatie u geholpen?

Apostrophe CMS

Apostrophe CMS can be used with Lyve Cloud.

Configure Apostrophe CMS

  1. Install Required Modules:

  2. npm install @aws-sdk/client-s3

  1. Configure Lyve Cloud credentials. It's recommended that you use environment variables (.env) to define credentials.
  • LC_ACCESS_KEY_ID=<access-key>
  • LC_SECRET_ACCESS_KEY=<secret-key>
  • LC_ENDPOINT=<s3-endpoint>for examplehttps://s3.us-east-1.lyve.seagate.com
  • LC_BUCKET_NAME=<bucket>

where:

  • <bucket> is the name of your Lyve Cloud bucket.
  • <access-key> is your access key.
  • <secret-key> is your secret key.
  • <s3-endpoint> is the appropriate Lyve Cloud S3 endpoint URL, for example, https://s3.us-east-1.lyve.seagate.com.

Sample command for listing S3 objects in the bucket

require('dotenv').config();
const AWS = require('aws-sdk');

// Configure AWS credentials and region
AWS.config.update({
accessKeyId: process.env.LC_ACCESS_KEY_ID,
secretAccessKey: process.env.LC_SECRET_ACCESS_KEY,
region: process.env.LC_REGION,
endpoint: process.env.LC_ENDPOINT
});

const s3 = new AWS.S3();
// List objects in a specific S3 bucket
s3.listObjectsV2({ Bucket: process.env.LC_BUCKET_NAME }, (err, data) => {
if (err) {
console.error('Error listing objects:', err);
} else {
const objects = data.Contents;
console.log(objects);
}
});

Result example

[
  {
    Key: 'Pic-1.png',
    LastModified: 2024-11-05T12:17:38.261Z,
    ETag: '"651b690ab5db93496d9ca412e8d7823a"',
    ChecksumAlgorithm: [],
    Size: 1121955,
    StorageClass: 'STANDARD'
  },
  {
    Key: 'Pic-2.png',
    LastModified: 2024-11-05T12:17:28.824Z,
    ETag: '"03685db85f0533211f4f865768e0100d"',
    ChecksumAlgorithm: [],
    Size: 479053,
    StorageClass: 'STANDARD'
  },
  {
    Key: 'Pic-3.png',
    LastModified: 2024-11-05T12:17:33.578Z,
    ETag: '"7b71081d8b7b21d6ee712692cc0d335e"',
    ChecksumAlgorithm: [],
    Size: 645935,
    StorageClass: 'STANDARD'
  }
]