Adding firebase 3 authentication
In index.html, add the following scripts (Firebase stuff taken from app dashboard):
<script src="https://www.gstatic.com/firebasejs/4.5.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyByZsPeF91OUxUr4s-bk8s80wzn5EYmKZc",
authDomain: "foodsurve.firebaseapp.com",
databaseURL: "https://foodsurve.firebaseio.com",
projectId: "foodsurve",
storageBucket: "foodsurve.appspot.com",
messagingSenderId: "317591627032"
};
firebase.initializeApp(config);
</script>
Assuming Cassowary is installed, then add grad-token.js.php and /gradfire directory at top level
Put an (unversioned) copy of the firebase app key into /gradfire/firebase-config.php on the server
running local cassowary server: The instructions for running locally are in _router.php
Basically, do jekyll build
, then php -S localhost:8080 -t _site _router.php
and look at http://localhost:8080
Note that you run php in the same dir as you run jekyll (the -t _site makes it serve _site). By default, _router.php uses the fake Cassid server. One tip: to logout, just add ?logout to any protected URL, like h t t p://localhost:8080/results/?logout
Security Rules
https://firebase.google.com/docs/database/rest/app-management
curl -X PUT -d ./jekyll/_site/firebase/firebase_security_rules.json 'https://padawan.firebaseio.com/.settings/rules.json?access_token=