0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Added local file storage adapter

refs https://github.com/TryGhost/Toolbox/issues/114

- This adapter is meant to power Files API
- The files will be stored under `/files/` in the configured content path and under `/content/files/` URL.
This commit is contained in:
Naz 2021-11-08 11:29:33 +04:00
parent 9d0af694d0
commit 151ab6968c
5 changed files with 26 additions and 6 deletions

View file

@ -0,0 +1,16 @@
// # Local File System Video Storage module
// The (default) module for storing media, using the local file system
const config = require('../../../shared/config');
const constants = require('@tryghost/constants');
const LocalStorageBase = require('./LocalStorageBase');
class LocalFilesStorage extends LocalStorageBase {
constructor() {
super({
storagePath: config.getContentPath('files'),
staticFileURLPrefix: constants.STATIC_FILES_URL_PREFIX
});
}
}
module.exports = LocalFilesStorage;

View file

@ -25,7 +25,9 @@
"storage": {
"active": "LocalImagesStorage",
"media": "LocalMediaStorage",
"LocalMediaStorage": {}
"files": "LocalFilesStorage",
"LocalMediaStorage": {},
"LocalFilesStorage": {}
},
"scheduling": {
"active": "SchedulingDefault"

View file

@ -34,6 +34,8 @@ const getContentPath = function getContentPath(type) {
return path.join(this.get('paths:contentPath'), 'images/');
case 'media':
return path.join(this.get('paths:contentPath'), 'media/');
case 'files':
return path.join(this.get('paths:contentPath'), 'files/');
case 'themes':
return path.join(this.get('paths:contentPath'), 'themes/');
case 'adapters':

View file

@ -61,7 +61,7 @@
"@tryghost/bootstrap-socket": "0.2.13",
"@tryghost/color-utils": "0.1.2",
"@tryghost/config-url-helpers": "0.1.3",
"@tryghost/constants": "0.1.12",
"@tryghost/constants": "1.0.0",
"@tryghost/custom-theme-settings-service": "0.3.1",
"@tryghost/debug": "0.1.9",
"@tryghost/email-analytics-provider-mailgun": "1.0.5",

View file

@ -1335,10 +1335,10 @@
resolved "https://registry.yarnpkg.com/@tryghost/config-url-helpers/-/config-url-helpers-0.1.3.tgz#42c88bbfe343d55595aa27b25665b87cb9cbaa23"
integrity sha512-+Ob3QTLxxpV4VBNEG/6Veop5MLxKlpPkGtnuRO/0PNaxm77Xo6TdLYAqUL+SnHSYRySr3lkLZCZUa9e6HhECbg==
"@tryghost/constants@0.1.12":
version "0.1.12"
resolved "https://registry.yarnpkg.com/@tryghost/constants/-/constants-0.1.12.tgz#17efd5dbb5d0bfbf11de1ceaaed347d165e63b1f"
integrity sha512-nQPov2XnfnWxMf330JVLRGUJUqupgvBGWrUU31GJYQRTheKS0N6DSBCKJaO0euGEsWfvJ+BsWVbAJp0vxsUDzg==
"@tryghost/constants@1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@tryghost/constants/-/constants-1.0.0.tgz#63ceeb4614e4e79bf208b79664c5898334b00a5f"
integrity sha512-vbJFj/jhPockvcjf3prBTj9YD9aeIWu2rK9Y0rXNQDA2RslTh9m8Y7NO2JzQ+kG2n1yOJRqdcgNJCXwwS/CjoA==
"@tryghost/custom-theme-settings-service@0.3.1":
version "0.3.1"