Update env variable and readme

pull/261/head
Connor Rigby 2016-09-02 08:51:44 -07:00
parent a62bcbc35e
commit 998b8959ca
2 changed files with 6 additions and 8 deletions

View File

@ -18,13 +18,12 @@ The key responsibility of the API is *information and permissions management*. T
# Developer setup
0. `git clone git@github.com:FarmBot/farmbot-web-app.git`
0. `git clone https://github.com/FarmBot/Farmbot-Web-API farmbot-web-app`
0. `cd farmbot-web-app`
0. [Install MongoDB](http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/)
0. Start Mongo if you have not already done so. (typically via the `mongod` command)
0. `bundle install`
0. `MQTT_HOST=your_mqtt_server_domain:1883 rails s`
0. Go to `http://localhost:3000`
0. `MQTT_BROKER_URL=your_mqtt_server_domain rails s`
0. Start the [Web Front End](https://github.com/FarmBot/farmbot-web-frontend) (See it's README)
0. Open localhost in your [favorite web browser](www.google.com/chrome)
# Provisioning Your Own with Dokku
@ -42,7 +41,7 @@ Here are some of the configuration options you must set when provisioning a new
* **Encryption keys**: Encryption keys will be autogenerated if not present. They can be reset using `rake keys:generate`. If `ENV['RSA_KEY']` is set, it will be used in place of the `*.pem` files. Useful for environments like Heroku, where file system access is not allowed.
* `ENV['MONGO_URL']`: URL pointing to running MongoDB instance.
* `ENV['DEVISE_SECRET']`: Used for devise. Use `rake secret` to generate a new value.
* `ENV['MQTT_HOST']`: Host (no port or slashes or anything) of running [MQTT gateway](https://github.com/FarmBot/mqtt-gateway). This is required so that Farmbot can know where to connect when given an authorization token.
* `ENV['MQTT_BROKER_URL']`: Host (no port or slashes or anything) of running [MQTT gateway](https://github.com/FarmBot/mqtt-gateway). This is required so that Farmbot can know where to connect when given an authorization token.
* `ENV['JS_FILE_URL']`: URL pointing to the [Farmbot Frontend](https://github.com/FarmBot/farmbot-web-frontend) `bundle.js` file. This is what gets injected into the `<script>` tag when the user visits `/app`.
**We can't fix issues we don't know about.** Please submit an issue if you are having trouble installing on your local machine.
@ -52,7 +51,6 @@ Here are some of the configuration options you must set when provisioning a new
Please run them before submitting pull requests.
* `bundle exec rspec spec`
# Generating an API token
You must pass a `token` string into most HTTP requests under the `Authorization: ` request header.

View File

@ -3,7 +3,7 @@ class SessionToken
PRIVATE_KEY = KeyGen.current
PUBLIC_KEY = KeyGen.current.public_key
ALG = 'RS256'
MQTT = ENV['MQTT_HOST'] || "YOU_DID_NOT_SET_MQTT_HOST" # mqtt.farmbot.io
MQTT = ENV['MQTT_BROKER_URL'] || "YOU_DID_NOT_SET_MQTT_BROKER_URL" # mqtt.farmbot.io
attr_accessor :encoded, :unencoded