backend/config/upload.config.js

61 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-02-09 10:37:21 +00:00
/*
* 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.
*/
2020-11-15 16:55:36 +00:00
default_store: env('UPLOAD_DEFAULT_STORE', 'flitter'),
2020-02-09 10:37:21 +00:00
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',
},
2020-11-15 16:55:36 +00:00
/*
* 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', ''),
},
2020-02-09 10:37:21 +00:00
},
}
module.exports = exports = upload_config