<commit_before>[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/gpa.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
[![Test Coverage](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/coverage.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
[![Build Status](https://travis-ci.org/FarmBot/farmbot-web-app.svg)](https://travis-ci.org/FarmBot/farmbot-web-app)

# Do I need this?

This repository is intended for *software developers* who wish to modify the [Farmbot Web App](http://my.farmbot.io/). **If you are not a developer**, you are highly encouraged to use [the publicly available web app](http://my.farmbot.io/).

If you are a developer interested in contributing or would like to provision your own server, you are in the right place.

# Farmbot Web App

**[LATEST STABLE VERSION IS HERE](https://github.com/FarmBot/farmbot-web-app/tree/dcf7cecf83d4b489ec55620f30614cc6b7c202f3)** :star: :star: :star:

This Repo is the Web based side of FarmBot. It allows users to control the device from their web browser. **We're getting closer to launch, but it this is an unstable pre-alpha repo.**

# Developer setup

 0. `git clone git@github.com:FarmBot/farmbot-web-app.git`
 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. `rails s`
 0. Go to `http://localhost:3000`

# Provisioning your own with Dokku

0. Create a fresh Ubuntu 14 server with Dokku (or just use DigitalOcean)
0. [Upgrade to the latest version of Dokku](https://github.com/dokku/dokku/blob/master/docs/upgrading.md) (especially if you are on DigitalOcean- their version is out of date)
0. Install dokku-haproxy plugin: `ssh root@YOUR_SERVER dokku plugin:install https://github.com/256dpi/dokku-haproxy.git`
0. Deploy: `git push dokku@YOUR_SERVER:mqtt`
0. Point to correct host/port: `ssh dokku@MQTT_SERVER config:set mqtt PORT=3002 DOKKU_NGINX_PORT=3002 WEB_APP_URL=WEBAPP_URL_HERE`
0. Expose MQTT port: `ssh dokku@MQTT_SERVER ports:add mqtt 1883 web 1883`

# Config Settings (important)

Here are some of the configuration options you must set when provisioning a new server:

 * **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_URL']`: URL 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.

The frontend (and asset management) are very much in a transitional state. We're experimenting with Gulp as an alternative

**We can't fix issues we don't know about.** Please submit an issue if you are having trouble installing on your local machine.

## Running Specs

Please run them before submitting pull requests.<commit_msg>Stub out repeater for steps on sequence builder<commit_after>[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/gpa.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
[![Test Coverage](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/coverage.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
[![Build Status](https://travis-ci.org/FarmBot/farmbot-web-app.svg)](https://travis-ci.org/FarmBot/farmbot-web-app)

# Do I need this?

This repository is intended for *software developers* who wish to modify the [Farmbot Web App](http://my.farmbot.io/). **If you are not a developer**, you are highly encouraged to use [the publicly available web app](http://my.farmbot.io/).

If you are a developer interested in contributing or would like to provision your own server, you are in the right place.

# Farmbot Web App

**[LATEST STABLE VERSION IS HERE](https://github.com/FarmBot/farmbot-web-app/tree/dcf7cecf83d4b489ec55620f30614cc6b7c202f3)** :star: :star: :star:

This Repo is the Web based side of FarmBot. It allows users to control the device from their web browser. **We're getting closer to launch, but it this is an unstable pre-alpha repo.**

# Developer setup

 0. `git clone git@github.com:FarmBot/farmbot-web-app.git`
 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_URL=your_mqtt_server_domain:1883 rails s`
 0. Go to `http://localhost:3000`

# Provisioning your own with Dokku

0. Create a fresh Ubuntu 14 server with Dokku (or just use DigitalOcean)
0. [Upgrade to the latest version of Dokku](https://github.com/dokku/dokku/blob/master/docs/upgrading.md) (especially if you are on DigitalOcean- their version is out of date)
0. Install dokku-haproxy plugin: `ssh root@YOUR_SERVER dokku plugin:install https://github.com/256dpi/dokku-haproxy.git`
0. Deploy: `git push dokku@YOUR_SERVER:mqtt`
0. Point to correct host/port: `ssh dokku@MQTT_SERVER config:set mqtt PORT=3002 DOKKU_NGINX_PORT=3002 WEB_APP_URL=WEBAPP_URL_HERE`
0. Expose MQTT port: `ssh dokku@MQTT_SERVER ports:add mqtt 1883 web 1883`

# Config Settings (important)

Here are some of the configuration options you must set when provisioning a new server:

 * **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_URL']`: URL 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.

The frontend (and asset management) are very much in a transitional state. We're experimenting with Gulp as an alternative

**We can't fix issues we don't know about.** Please submit an issue if you are having trouble installing on your local machine.

## Running Specs

Please run them before submitting pull requests.
{'fraction_non_alphanumeric': 0.1095514189807751, 'fraction_numerical': 0.01922490082392432, 'mean_word_length': 4.724890829694323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3414413', 'n_tokens_mistral': 2285, 'n_tokens_neox': 2120, 'n_words': 751}