Veröffentlichung Ghost Custom Storage Adapter Google Cloud Storage

Veröffentlichung Ghost Custom Storage Adapter Google Cloud Storage

Da yakisch.com Umgestellt wurde auf Ghost, gehosted auf der GAE flexible environment nodejs. Wollte ich auch die Mediendateien auf Google Cloud Storage bereitstellen. Das Problem war nur das kein Plugin vernünftig mit der neusten Ghost Version 2.x funktionieren wollte.

Um dieses Problem zu lösen habe ich ein bestehenden Storage Adapter for Ghost und Google Cloud Storage auf die neuste Ghost Version portiert und noch kleinere Verbesserungen durchgeführt (Bugfixing). Da die Quelle des forks nicht mehr betreut wird, habe ich den neuen Adapter selbst auf npm veröffentlicht.

Getestet mit Ghost 2.x. erhältlich als npm package und source auf github.

Installation:

npm install  ghost-google-cloud-storage-new --save

Storage adapter Datei erstellen:

# This assumes that you are operating on your production environemnt, change the following variable if necessary. 
export GHOST_ENVIRONMENT=production
# Your content path will be determined by your config file: https://docs.ghost.org/v1.0/docs/config#section-paths 
# You can run the jq command to get it for you 
export CONTENT_PATH=$(jq -r '.paths.contentPath // "."' config.${GHOST_ENVIRONMENT}.json)
mkdir -p ${CONTENT_PATH}/adapters/storage/gcloud
cat > ${CONTENT_PATH}/adapters/storage/gcloud/index.js << EOL
'use strict';
module.exports = require('ghost-google-cloud-storage-new');
EOL