1- # Ghost CMS Firebase Storage Adapter
1+ # Ghost Firebase Storage Adapter
22
33This a Firebase [ Storage adapter] ( https://ghost.org/docs/concepts/storage-adapters/ ) for Ghost CMS. Images uploaded via Ghost CMS
44will be save to Firebase Storage.
55
6- ## Configure Adapter For your Firebase Project
6+ ## Prerequisite
77
8- To configure you project, the following fields can be passed along:
8+ - Have a [ Firebase Project] ( https://firebase.google.com/docs ) with [ Firebase Storage] ( https://firebase.google.com/docs/storage ) enabled.
9+ - Generate Private key for your Firebase Service Account - [ Instructions] ( https://firebase.google.com/docs/admin/setup#initialize-sdk )
910
10- | Field | Required | Desc |
11- | -------------- | -------- | -------------------------------------------------------------- |
12- | serviceAccount | true | Path to your firebase account credentials |
13- | bucketName | true | The bucket to save ghost uploads to |
14- | basePath | false | the path to append to the filename of the ghost upload |
15- | uploadOptions | false | set uploadOptions to be added to your file uploads to firebase |
16- | domain | false | the domain name to append to the destination path name |
11+ ## Setup
12+
13+ ### Installation
14+
15+ At the root of you ghost blog, install this adapter using either ` npm ` or
16+ ` yarn ` .
17+
18+ #### NPM
19+
20+ ``` sh
21+ npm i ghost-firebase-storage-adapter
22+ ```
23+
24+ #### Yarn
25+
26+ ``` sh
27+ yarn add ghost-firebase-storage-adapter
28+ ```
29+
30+ ### Create Firebase Storage Module
1731
18- ### Example
32+ After installation, a scripts runs that automatically creates a storage adapter
33+ in the ` content/adapters/storage ` directory, named ` firebase.js ` with the
34+ following content:
35+
36+ ``` javascript
37+ ' use strict'
38+
39+ module .exports = require (' ghost-firebase-storage-adapter' );
40+ ```
41+
42+ > ** NB:** if the ` firebase.js ` was not created, create it and add the content.
43+
44+ ## Configurations
45+
46+ > Before we can proceed, make sure you have the bucket-name, without any prefix
47+ > (` gs:// ` ) or suffix (` .appspot.com ` ) and your Firebase Service Account Private
48+ > Key, a ` json ` file.
49+
50+ - Add the json file containing the private key to the root of you ghost
51+ directory or somewhere else more secure.
52+ - Add a ` storage ` block to your config.${GHOST_ENVIRONMENT}.json as shown below:
1953
2054``` json
2155"serviceAccount" : " ./path/to/service/account.json" ,
@@ -29,6 +63,15 @@ To configure you project, the following fields can be passed along:
2963}
3064```
3165
32- ## Note
66+ ### Configure Adapter For your Firebase Project
67+
68+ To configure you project, the following fields can be passed along:
69+
70+ | Field | Required | c |
71+ | -------------- | -------- | -------------------------------------------------------------- |
72+ | serviceAccount | true | Path to your firebase account credentials |
73+ | bucketName | true | The bucket to save ghost uploads to |
74+ | basePath | false | the path to append to the filename of the ghost upload |
75+ | uploadOptions | false | set uploadOptions to be added to your file uploads to firebase |
76+ | domain | false | the domain name to append to the destination path name |
3377
34- This is a very work in progress.
0 commit comments