From 142faa7fe3fb1d30e44a0974dc6259fab949d4c5 Mon Sep 17 00:00:00 2001 From: Hippo Date: Thu, 26 Sep 2019 18:08:10 +0530 Subject: [PATCH] Add (untested!) WebDAV support --- app.json | 18 +++++++++++++++++- bin/copy-themes.sh | 2 ++ bin/create-config | 12 ++++++++++++ package.json | 7 ++++--- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/app.json b/app.json index 8c567d8..a411cd7 100644 --- a/app.json +++ b/app.json @@ -36,6 +36,22 @@ "S3_ASSET_HOST_URL": { "description": "Optional custom CDN asset host url, if using S3 file storage.", "required": false - } + }, + "WEBDAV_SERVER_URL": { + "description": "URL of your WebDAV server, if using WebDAV file storage", + "required": false + }, + "WEBDAV_USERNAME": { + "description": "Username for your WebDAV server, if using WebDAV file storage", + "required": false + }, + "WEBDAV_PATH_PREFIX": { + "description": "Optional path prefix for your WebDAV server, if using WebDAV file storage", + "required": false + }, + "WEBDAV_STORAGE_PATH_PREFIX": { + "description": "Optional storage path prefix for your WebDAV server, if using WebDAV file storage", + "required": false + }, } } diff --git a/bin/copy-themes.sh b/bin/copy-themes.sh index 58ac5fd..8103188 100644 --- a/bin/copy-themes.sh +++ b/bin/copy-themes.sh @@ -12,3 +12,5 @@ for theme in "${themes[@]}" do cp -Rf "node_modules/$theme" content/themes done + +ln -s ../../../node_modules/ghost-webdav-storage-adapter/dist content/adapters/storage/webdav diff --git a/bin/create-config b/bin/create-config index 0b9c8d9..67d1f5c 100755 --- a/bin/create-config +++ b/bin/create-config @@ -23,6 +23,18 @@ function createConfig() { assetHost: process.env.S3_ASSET_HOST_URL } } + } else if (!!process.env.WEBDAV_SERVER_URL){ + fileStorage = true + storage = { + 'active': 'webdav', + 'webdav': { + 'url': process.env.WEBDAV_SERVER_URL, + 'username': process.env.WEBDAV_USERNAME, + 'password': process.env.WEBDAV_PASSWORD, + 'pathPrefix': process.env.WEBDAV_PATH_PREFIX, + 'storagePathPrefix': process.env.WEBDAV_STORAGE_PATH_PREFIX + } + } } else if (!!process.env.BUCKETEER_AWS_ACCESS_KEY_ID) { fileStorage = true storage = { diff --git a/package.json b/package.json index 5df1f46..a4e2719 100644 --- a/package.json +++ b/package.json @@ -10,15 +10,16 @@ "private": true, "version": "2.27.0", "dependencies": { + "attila": "github:zutrinken/attila#1.13.0", + "bleak": "github:zutrinken/bleak#1.4.0", "casper": "github:tryghost/Casper#2.10.6", "ghost": "2.27.0", "ghost-storage-adapter-s3": "^2.8.0", "ghost-storage-cloudinary": "^1.1.4", - "mysql": "^2.17.1", - "attila": "github:zutrinken/attila#1.13.0", + "ghost-webdav-storage-adapter": "^0.3.5", "london": "github:tryghost/london#1.0.0", "massively": "github:tryghost/massively#1.0.2", - "bleak": "github:zutrinken/bleak#1.4.0", + "mysql": "^2.17.1", "the-shell": "github:mityalebedev/The-Shell#v2.0.0", "vapor": "github:sethlilly/Vapor#v1.6.0" },