Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configuration/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
firebaseconfig.json*
14 changes: 2 additions & 12 deletions configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@
```
git clone https://github.com/FirstBuild/green-bean-connect-utils
cd green-bean-connect-utils/configuration
npm install
```

If you want to use something other than FirstBuild's firebase sandbox, edit generateFirebaseLoginAndToken:
```
var ref = new Firebase('https://firstbuild-sandbox.firebaseio.com/'); //<---change to url you want
```

Finally, run

```
node generateFirebaseLoginAndToken
./script/bootstrap
```

After npm install runs, you'll be prompted to enter a Firebase sandbox name. If you want to use FirstBuild's, just hit enter.

This will create a new user in the firebase you specified and generate a firebase file. with credentials. By default it creates a make believe user, so modify if you would like to create with a valid email. Simple login must be enabled on the firebase instance you are using (it is on FirstBuild sandbox). Now that you have the information necessary to setup your Green Bean Connect Perform the next steps:

Expand Down
2 changes: 1 addition & 1 deletion configuration/generateFirebaseLoginAndToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var Firebase = require('firebase');
var uuid = require('node-uuid');
var ref = new Firebase('https://firstbuild-sandbox.firebaseio.com/'); //<---change to url you want
var ref = new Firebase(process.env.FIREBASE_SANDBOX_URL); //<---change to url you want
var fs = require('fs');
var generatePassword = require('password-generator');
var Moniker = require('moniker');
Expand Down
26 changes: 26 additions & 0 deletions configuration/script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" && pwd )"
PRJ_ROOT=$(dirname "${SCRIPT_DIR}")
cd $PRJ_ROOT

npm install

echo "Let's pick a firebase sandbox."
echo "Enter YOUR_FIREBASE: (https://<YOUR_FIREBASE>.firebaseio.com), or hit enter"
printf "> "
read input

if [[ -z $input ]]; then
FIREBASE_SANDBOX='firstbuild-sandbox'
else
FIREBASE_SANDBOX=$input
fi

# Pass as env var to generateFireBaseLoginAndToken
export FIREBASE_SANDBOX_URL="https://$FIREBASE_SANDBOX.firebaseio.com/"

echo "Using $FIREBASE_SANDBOX_URL"

node generateFirebaseLoginAndToken

16 changes: 0 additions & 16 deletions script/bootstrap

This file was deleted.