mirror of
https://github.com/laosb/ghos3.git
synced 2025-07-23 10:42:40 +00:00
Merge 02069ba82c
into 82a47babb7
This commit is contained in:
commit
5b9676cce0
1 changed files with 9 additions and 0 deletions
|
@ -26,6 +26,7 @@ type Config = {
|
||||||
secretAccessKey?: string
|
secretAccessKey?: string
|
||||||
endpoint?: string
|
endpoint?: string
|
||||||
forcePathStyle?: boolean
|
forcePathStyle?: boolean
|
||||||
|
useDualstackEndpoint?: boolean
|
||||||
acl?: string
|
acl?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +39,7 @@ class S3Storage extends StorageBase {
|
||||||
pathPrefix: string
|
pathPrefix: string
|
||||||
endpoint: string
|
endpoint: string
|
||||||
forcePathStyle: boolean
|
forcePathStyle: boolean
|
||||||
|
useDualstackEndpoint: boolean
|
||||||
acl?: ObjectCannedACL
|
acl?: ObjectCannedACL
|
||||||
|
|
||||||
constructor(config: Config = {}) {
|
constructor(config: Config = {}) {
|
||||||
|
@ -52,6 +54,7 @@ class S3Storage extends StorageBase {
|
||||||
secretAccessKey,
|
secretAccessKey,
|
||||||
endpoint,
|
endpoint,
|
||||||
forcePathStyle,
|
forcePathStyle,
|
||||||
|
useDualstackEndpoint,
|
||||||
acl,
|
acl,
|
||||||
} = config
|
} = config
|
||||||
|
|
||||||
|
@ -70,6 +73,11 @@ class S3Storage extends StorageBase {
|
||||||
Boolean(forcePathStyle) ||
|
Boolean(forcePathStyle) ||
|
||||||
false
|
false
|
||||||
|
|
||||||
|
this.useDualstackEndpoint =
|
||||||
|
Boolean(process.env.GHOST_STORAGE_ADAPTER_S3_USE_DUALSTACK_ENDPOINT) ||
|
||||||
|
Boolean(useDualstackEndpoint) ||
|
||||||
|
false
|
||||||
|
|
||||||
let defaultHost: string
|
let defaultHost: string
|
||||||
|
|
||||||
if (this.forcePathStyle) {
|
if (this.forcePathStyle) {
|
||||||
|
@ -129,6 +137,7 @@ class S3Storage extends StorageBase {
|
||||||
const options: S3ClientConfig = {
|
const options: S3ClientConfig = {
|
||||||
region: this.region,
|
region: this.region,
|
||||||
forcePathStyle: this.forcePathStyle,
|
forcePathStyle: this.forcePathStyle,
|
||||||
|
useDualstackEndpoint: this.useDualstackEndpoint,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set credentials only if provided, falls back to AWS SDK's default provider chain
|
// Set credentials only if provided, falls back to AWS SDK's default provider chain
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue