Farmbot-Web-App/README.md

4.8 KiB

FarmBot Web App

codebeat badge codecov Coverage Status Maintainability

😎🆕 Documentation to help software developers write add-ons and plugins for FarmBot👀

Q: Do I need this?

This repository is intended for software developers who wish to modify the Farmbot Web App. If you are not a developer, you are highly encouraged to use the publicly available web app. Running a server is a non-trivial task with security implications. It requires an intermediate background in Ruby, SQL and Linux system administration.

We do not have the resources available to help novice developers learn to setup servers, environments, configurations, or perform basic Linux command line instructions.

If you raise an issue indicating that you haven't followed the setup instructions, looked through past issues, or done a cursory internet search for basic help, expect the issue to be closed and we'll point you to the setup instructions. Again, if you do not have at least intermediate Linux and Ruby experience, please use the hosted version of the web app at my.farm.bot. Running a self-hosted server is not easy!

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

Q: Where do I report security issues?

We take security seriously and value the input of independent researchers. Please see our responsible disclosure guidelines.

Q: What is the Farmbot Web App?

This repo contains FarmBot's web based user interface, a RESTful JSON API and a Dockerized MQTT server. The API stores data such as user account information, plant data, authorization tokens and a variety of other resources. The MQTT server facilitates realtime messaging from the browser to the device.

Q: Can I see some example API requests?

For a list of example API requests and responses, see our reference documentation. If you wish to write an add-on application that uses the FarmBot API, please let us know in an issue. We are happy to answer any specific questions you may have.

Q: How do I Setup an instance locally?

We provide example setup instructions for Ubuntu 18 here.

Installation was last tested against Ubuntu 18.04 in October of 2018 on an x86 based machine.

Our ability to help individual users with private setup is limited. Using the public server at http://my.farm.bot is the recommended setup for end users. Please see the top of this document for more information.

Config Settings (important)

We follow the 12 Factor Methodology. As such, ENV variables are the primary means of storing configuration. Your server won't run without setting ENV variables first.

You can accomplish this by setting the ENV variables directly from your shell / server management tool or by writing an .env file in server's base directory.

See example.env for a list of all the variables that must be set.

Encryption keys: Encryption keys will be auto-generated 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. This is useful for environments like Heroku and Docker, where file system access is not allowed.

Translating the Web App into Your Language

Thanks for your interest in internationalizing the FarmBot web app! To add translations:

  1. Fork this repo
  2. Navigate to /public/app-resources/languages and run the command node _helper.js yy where yy is your language's language code. Eg: ru for Russian.
  3. Edit the translations in the file created in the previous step: "phrase": "translated phrase".
  4. When you have updated or added new translations, commit/push your changes and submit a pull request.

Want to Help?

Low Hanging Fruit. Raise an issue if you have any questions.