Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ghost-storage-adapter-s3

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghost-storage-adapter-s3 - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

15

index.js

@@ -46,3 +46,4 @@ 'use strict';

region = config.region,
secretAccessKey = config.secretAccessKey;
secretAccessKey = config.secretAccessKey,
endpoint = config.endpoint;

@@ -60,2 +61,3 @@ // Compatible with the aws-sdk's default environment variables

this.pathPrefix = stripLeadingSlash(process.env.GHOST_STORAGE_ADAPTER_S3_PATH_PREFIX || pathPrefix || '');
this.endpoint = process.env.GHOST_STORAGE_ADAPTER_S3_ENDPOINT || endpoint || '';
}

@@ -96,3 +98,3 @@

s3() {
return new _awsSdk2.default.S3({
var options = {
accessKeyId: this.accessKeyId,

@@ -102,3 +104,7 @@ bucket: this.bucket,

secretAccessKey: this.secretAccessKey
});
};
if (this.endpoint !== '') {
options.endpoint = this.endpoint;
}
return new _awsSdk2.default.S3(options);
}

@@ -144,4 +150,3 @@

res.status(404);
console.log(err + '\nkey: ' + stripLeadingSlash(req.path));
next();
next(err);
}).pipe(res);

@@ -148,0 +153,0 @@ };

@@ -75,3 +75,3 @@ {

},
"version": "2.2.1"
"version": "2.3.0"
}

@@ -10,3 +10,3 @@ # Ghost storage adapter S3

```
```shell
npm install ghost-storage-adapter-s3

@@ -19,12 +19,13 @@ mkdir -p ./content/adapters/storage

```
storage: {
active: 's3',
s3: {
accessKeyId: 'YOUR_ACCESS_KEY_ID',
assetHost: 'YOUR_OPTIONAL_CDN_URL',
bucket: 'YOUR_BUCKET_NAME',
pathPrefix: 'YOUR_OPTIONAL_BUCKET_SUBDIRECTORY',
region: 'YOUR_REGION_SLUG',
secretAccessKey: 'YOUR_SECRET_ACCESS_KEY'
```json
"storage": {
"active": "s3",
"s3": {
"accessKeyId": "YOUR_ACCESS_KEY_ID",
"assetHost": "YOUR_OPTIONAL_CDN_URL",
"bucket": "YOUR_BUCKET_NAME",
"pathPrefix": "YOUR_OPTIONAL_BUCKET_SUBDIRECTORY",
"region": "YOUR_REGION_SLUG",
"secretAccessKey": "YOUR_SECRET_ACCESS_KEY",
"endpoint": "YOUR_OPTIONAL_ENDPOINT_URL (only needed for 3rd party S3 providers)"
}

@@ -43,2 +44,3 @@ }

GHOST_STORAGE_ADAPTER_S3_PATH_PREFIX // optional
GHOST_STORAGE_ADAPTER_S3_ENDPOINT // optional
```

@@ -45,0 +47,0 @@

@@ -23,3 +23,4 @@ import AWS from 'aws-sdk'

region,
secretAccessKey
secretAccessKey,
endpoint
} = config

@@ -37,2 +38,3 @@

this.pathPrefix = stripLeadingSlash(process.env.GHOST_STORAGE_ADAPTER_S3_PATH_PREFIX || pathPrefix || '')
this.endpoint = process.env.GHOST_STORAGE_ADAPTER_S3_ENDPOINT || endpoint || ''
}

@@ -69,3 +71,3 @@

s3 () {
return new AWS.S3({
const options = {
accessKeyId: this.accessKeyId,

@@ -75,3 +77,7 @@ bucket: this.bucket,

secretAccessKey: this.secretAccessKey
})
}
if (this.endpoint !== '') {
options.endpoint = this.endpoint
}
return new AWS.S3(options)
}

@@ -114,4 +120,3 @@

res.status(404)
console.log(err + '\nkey: ' + stripLeadingSlash(req.path))
next()
next(err)
})

@@ -118,0 +123,0 @@ .pipe(res)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc