Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
ca0708ea
Commit
ca0708ea
authored
Jun 07, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: extra options for generic S3 module
parent
e4514598
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
6 deletions
+42
-6
common.js
server/modules/storage/s3/common.js
+23
-5
definition.yml
server/modules/storage/s3generic/definition.yml
+19
-1
No files found.
server/modules/storage/s3/common.js
View file @
ca0708ea
...
...
@@ -31,17 +31,35 @@ module.exports = class S3CompatibleStorage {
}
async
init
()
{
WIKI
.
logger
.
info
(
`(STORAGE/
${
this
.
storageName
}
) Initializing...`
)
const
{
accessKeyId
,
secretAccessKey
,
region
,
bucket
,
endpoin
t
}
=
this
.
config
this
.
s3
=
new
S3
(
{
const
{
accessKeyId
,
secretAccessKey
,
bucke
t
}
=
this
.
config
const
s3Config
=
{
accessKeyId
,
secretAccessKey
,
region
,
endpoint
,
params
:
{
Bucket
:
bucket
},
apiVersions
:
'2006-03-01'
})
}
if
(
!
_
.
isNil
(
this
.
config
.
region
))
{
s3Config
.
region
=
this
.
config
.
region
}
if
(
!
_
.
isNil
(
this
.
config
.
endpoint
))
{
s3Config
.
endpoint
=
this
.
config
.
endpoint
}
if
(
!
_
.
isNil
(
this
.
config
.
sslEnabled
))
{
s3Config
.
sslEnabled
=
this
.
config
.
sslEnabled
}
if
(
!
_
.
isNil
(
this
.
config
.
s3ForcePathStyle
))
{
s3Config
.
s3ForcePathStyle
=
this
.
config
.
s3ForcePathStyle
}
if
(
!
_
.
isNil
(
this
.
config
.
s3BucketEndpoint
))
{
s3Config
.
s3BucketEndpoint
=
this
.
config
.
s3BucketEndpoint
}
this
.
s3
=
new
S3
(
s3Config
)
// determine if a bucket exists and you have permission to access it
await
this
.
s3
.
headBucket
().
promise
()
WIKI
.
logger
.
info
(
`(STORAGE/
${
this
.
storageName
}
) Initialization completed.`
)
}
async
created
(
page
)
{
...
...
server/modules/storage/s3generic/definition.yml
View file @
ca0708ea
...
...
@@ -26,12 +26,30 @@ props:
title
:
Access Key ID
hint
:
The Access Key ID.
order
:
3
secretAccessKey
:
secretAccessKey
:
type
:
String
title
:
Access Key Secret
hint
:
The Access Key Secret for the Access Key ID above.
sensitive
:
true
order
:
4
sslEnabled
:
type
:
Boolean
title
:
Use SSL
hint
:
Whether to enable SSL for requests
default
:
true
order
:
5
s3ForcePathStyle
:
type
:
Boolean
title
:
Force Path Style for S3 objects
hint
:
Whether to force path style URLs for S3 objects.
default
:
false
order
:
6
s3BucketEndpoint
:
type
:
Boolean
title
:
Single Bucket Endpoint
hint
:
Whether the provided endpoint addresses an individual bucket.
default
:
false
order
:
7
actions
:
-
handler
:
exportAll
label
:
Export All
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment