backend/config/upload.config.js
garrettmills f7e4c535f8
All checks were successful
continuous-integration/drone/push Build is passing
Add support for S3 backed uploads
2020-11-15 10:55:36 -06:00

61 lines
1.7 KiB
JavaScript

/*
* flitter-upload configuration
* ---------------------------------------------------------------
* Specifies the configuration for various uploader aspects. Mainly,
* contains the configuration for the different file upload backends.
*/
const upload_config = {
/*
* The name of the upload backend to use by default.
*/
default_store: env('UPLOAD_DEFAULT_STORE', 'flitter'),
enabled: true,
/*
* Stores available to the uploader.
*/
stores: {
/*
* Example of the basic, filesystem-backed uploader.
* The name of the store is arbitrary. Here, it's called 'flitter'.
*/
flitter: {
enabled: true,
// This is a filesystem backed 'FlitterStore'
type: 'FlitterStore',
// Destination for uploaded files. Will be relative to the root
// path of the application.
destination: './uploads',
},
/*
* Example of an Amazon AWS S3 (or compatible) uploader.
*/
s3: {
enabled: true,
// Backed by an S3 bucket.
type: 'AWSS3Store',
// AWS SDK credentials and configuration
aws: {
region: env('AWS_REGION', 'us-east-1'),
key_id: env('AWS_ACCESS_KEY_ID'),
key_secret: env('AWS_SECRET_ACCESS_KEY'),
endpoint: env('AWS_S3_ENDPOINT'),
},
// The bucket to which the files should be uploaded
bucket: env('AWS_UPLOAD_BUCKET', 'flitter.localhost'),
// The prefix to be used for file uploads
prefix: env('AWS_UPLOAD_PREFIX', ''),
},
},
}
module.exports = exports = upload_config