feat: AWS S3 + Digitalocean Spaces storage modules (#1015)

* Provide basic implementation of AWS S3 storage module

* Abstract S3 Compatible Storage Module logic

* Refactor `getFileExtension()` into the `page` object

* Add implementation for Digitalocean storage module

* Remove accidental `async`/`await` in S3 Storage Module

* Remove argument from the call to `page.getFileExtension()`

https://github.com/Requarks/wiki/pull/1015#discussion_r321990073
This commit is contained in:
Andrew Sim
2019-09-09 02:11:25 +01:00
committed by Nicolas Giard
parent 3ab7bcf8ea
commit 5202eadebb
8 changed files with 132 additions and 101 deletions

View File

@@ -1,28 +1,28 @@
key: digitalocean
title: DigitalOcean Spaces
description: DigitalOcean provides developers and businesses a reliable, easy-to-use cloud computing platform of virtual servers (Droplets), object storage (Spaces) and more.
author: requarks.io
author: andrewsim
logo: https://static.requarks.io/logo/digitalocean.svg
website: https://www.digitalocean.com/products/spaces/
isAvailable: false
isAvailable: true
supportedModes:
- push
defaultMode: push
schedule: false
props:
region:
endpoint:
type: String
title: Region
hint: The DigitalOcean datacenter region where the Space will be created.
default: nyc3
title: Endpoint
hint: The DigitalOcean spaces endpoint that has the form ${REGION}.digitaloceanspaces.com
default: nyc3.digitaloceanspaces.com
enum:
- ams3
- fra1
- nyc3
- sfo2
- sgp1
- ams3.digitaloceanspaces.com
- fra1.digitaloceanspaces.com
- nyc3.digitaloceanspaces.com
- sfo2.digitaloceanspaces.com
- sgp1.digitaloceanspaces.com
order: 1
spaceId:
bucket:
type: String
title: Space Unique Name
hint: The unique space name to create (e.g. wiki-johndoe)

View File

@@ -1,23 +1,3 @@
module.exports = {
async activated() {
const S3CompatibleStorage = require('../s3/common')
},
async deactivated() {
},
async init() {
},
async created() {
},
async updated() {
},
async deleted() {
},
async renamed() {
}
}
module.exports = new S3CompatibleStorage('Digitalocean')