diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index a0c36675b..3d01ff052 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -1,6 +1,22 @@ +# Run on a Local Machine + +If you want to run a server on a LAN for personal use, this is the easiest and cheapest option. + +**Simplicity:** :heart::heart::heart: +**Reliability:** :broken_heart: +**Affordability:** :heart::heart::heart: + + 1. Follow the [developer setup guide](https://github.com/FarmBot/Farmbot-Web-API#developer-setup). + 2. Run `rails s -e production -b 0.0.0.0` (Set ENV vars accordingly). # Deployment to Dokku (cheaper) +**NOTE TO USERS**: We no longer deploy the server using Dokku. Although we will make a best effort to support Dokku users, our ability to provide troubleshooting and documentation for Dokku setups is limited since we do not use it ourselves. + +**Simplicity:** :broken_heart: +**Reliability:** :heart::heart: +**Affordability:** :heart::heart: + 0. Provision a fresh Ubuntu 16 server (we use DigitalOcean's "Ubuntu 16 docker" image). * Make sure you have atleast 1gb. 0. [Install the latest version of Dokku (don't use that DigitalOcean image)](https://github.com/dokku/dokku#installing) @@ -23,8 +39,12 @@ # Deployment Using Heroku (easier) - 1. Deploy as you would normally [deploy to Heroku](https://devcenter.heroku.com/articles/getting-started-with-rails4#deploy-your-application-to-heroku) - 2. Enable Dyno metadata: `heroku labs:enable runtime-dyno-metadata --app ` +**Simplicity:** :heart::heart::heart::heart: +**Reliability:** :heart::heart::heart::heart: +**Affordability:** :broken_heart: + + 1. Deploy as you would normally [deploy to Heroku](https://devcenter.heroku.com/articles/getting-started-with-rails4#deploy-your-application-to-heroku) + 2. Enable Dyno metadata: `heroku labs:enable runtime-dyno-metadata --app ` (we need this to know the version number of the web app). # Setting up SSL @@ -42,7 +62,7 @@ http://yourdomain.io/.well-known/acme-challenge/SOME-LONG-URL before continuing: ya6k1edW38z-CopyThisValueNow!!! -``` +``` Set the `ACME_SECRET` ENV var to the value shown above (yours will be different) and **restart your API process**. @@ -64,7 +84,8 @@ heroku certs:add /etc/letsencrypt/live/yourdomain.io/fullchain.pem /etc/letsencr Heroku will then give you instructions on which DNS records you must create. -**Dokku Users**: We haven't had a need for this yet, because we usually run Dokku on staging setups only. Please [raise an issue](https://github.com/FarmBot/farmbot-web-frontend/issues/new) to receive support. +**Dokku Users**: FarmBot, Inc. no longer uses Dokku. As such, our ability to troubleshoot problems is limited. +Please [raise an issue](https://github.com/FarmBot/farmbot-web-frontend/issues/new) to receive community support. # Renew SSL Certificates diff --git a/Gemfile b/Gemfile index 86aa29855..a8f0db360 100755 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -ruby "2.3.2" +ruby "2.3.3" gem "rails", "5.0.0.1" gem "thin" diff --git a/Gemfile.lock b/Gemfile.lock index 99f2200b8..87281524d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -225,7 +225,7 @@ DEPENDENCIES thin RUBY VERSION - ruby 2.3.2p217 + ruby 2.3.3p222 BUNDLED WITH 1.13.6 diff --git a/README.md b/README.md index a0036877c..b8b79e5fa 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # 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/). +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/). Running a server is a non-trivial task which will require an intermediate background in Ruby, SQL and Linux system administration. If you are a developer interested in contributing or would like to provision your own server, you are in the right place. @@ -11,7 +11,7 @@ If you are a developer interested in contributing or would like to provision you **[LATEST STABLE VERSION IS HERE](https://github.com/FarmBot/Farmbot-Web-API/releases)** :star: :star: :star: -This Repo is RESTful JSON API for Farmbot. This includes things like storage of user data, plant data, authorization tokens and a variety of other resources. +This Repo is the RESTful JSON API for Farmbot. This includes things like storage of user data, plant data, authorization tokens and a variety of other resources. The key responsibility of the API is *information and permissions management*. This should not be confused with device control, which is done via [MQTT](https://github.com/FarmBot/mqtt-gateway). @@ -25,7 +25,7 @@ For a list of example API requests and responses, see our [reference documentati Your machine will need the following: - 0. [Ruby 2.3.2](http://rvm.io/rvm/install) + 0. [Ruby 2.3.3](http://rvm.io/rvm/install) ### Setup 0. `git clone https://github.com/FarmBot/Farmbot-Web-API farmbot-web-app` @@ -124,4 +124,4 @@ $.ajax({ # Want to Help? -[Low Hanging Fruit](https://github.com/FarmBot/Farmbot-Web-API/search?utf8=%E2%9C%93&q=todo) +[Low Hanging Fruit](https://github.com/FarmBot/Farmbot-Web-API/search?utf8=%E2%9C%93&q=todo). [Raise an issue](https://github.com/FarmBot/Farmbot-Web-API/issues/new?title=Question%20about%20a%20TODO) if you have any questions. diff --git a/config/database.example.yml b/config/database.example.yml index 59e0d05d4..4465b9f48 100644 --- a/config/database.example.yml +++ b/config/database.example.yml @@ -1,22 +1,23 @@ +# EXAMPLE FOR MYSQL USERS: +# ======================== # default: &default # adapter: mysql # encoding: utf8 # pool: 5 # timeout: 5000 -# + # development: # <<: *default # database: farmbot_api_dev # password: "password123" -# + # test: # <<: *default # database: farmbot_api_test # password: "password123" -# + # production: # <<: *default - default: &default adapter: sqlite3 database: db/db_dev_db.sqlite3 diff --git a/config/initializers/mongoid.rb b/config/initializers/mongoid.rb deleted file mode 100644 index 4060c1fc1..000000000 --- a/config/initializers/mongoid.rb +++ /dev/null @@ -1,18 +0,0 @@ -# module Mongoid -# puts "TODO: DELETE THIS!!" -# module Errors -# puts "TODO: DELETE THIS!!" -# class DocumentNotFound < Exception -# puts "TODO: DELETE THIS!!" -# end - -# class InvalidFind < Exception -# puts "TODO: DELETE THIS!!" -# end - - -# class Validations < Exception -# puts "TODO: DELETE THIS!!" -# end -# end -# end \ No newline at end of file diff --git a/spec/lib/celery_script/tree_climber_spec.rb b/spec/lib/celery_script/tree_climber_spec.rb index 89ca88461..90ea36846 100644 --- a/spec/lib/celery_script/tree_climber_spec.rb +++ b/spec/lib/celery_script/tree_climber_spec.rb @@ -19,7 +19,6 @@ describe CeleryScript::TreeClimber do end it "searches the tree for a specific `kind`" do - # TODO: Remove this in the name of simplicity? query = CeleryScript::TreeClimber.find_all_by_kind(node, "var_get") expect(query.length).to eq(1) expect(query.first.kind).to eq("var_get")