FarmBot Web App
This codebase 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, farm designs, sequences, authorization tokens, and a variety of other resources. The MQTT server facilitates realtime messaging from the browser to the device.
I own a FarmBot, do I need this?
No. If you are an owner of a FarmBot kit, you do not need to download or self-host this software. FarmBot Inc provides a free-to-use instance of the web app at my.farm.bot which we recommend to all FarmBot owners. Get started with these instructions.
Self hosting
Hosting your own server requires an understanding of how Ruby on Rails applications (and databases) operate. Self-hosting the web app will not provide you with a more stable user experience and may result in accidental security issues or data loss. There are only a handful of use cases where running a third party server may be necessary:
- Development of new features, bug fixes, and pull requests.
- Independent security research and auditing.
Local setup
We recommend all self hosted installations be installed on a fresh Ubuntu server using the instructions provided in ubuntu_example.sh. These instructions are reguarly checked and updated to ensure they work. At this time we cannot provide assistance for running the web app in different environments.
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 my.farm.bot. Running a self-hosted server is not easy!
Configuration settings (important)
Your server won't run without setting ENV variables first. Set the ENV variables directly from your shell / server management tool or by writing a .env
file in the server's base directory. See example.env for a list of all the variables that must be set.
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.
Updates
We update main
roughly every 2 to 4 weeks. If you self host the application you will need to manually update the software to get the latest updates. Technical support for self hosting is beyond the scope of the basic technical support that we provide with each FarmBot kit.
Example API requests
See our documentation for a list of example API requests and responses. 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.
Contributing
There are many ways in which you can contribute to the FarmBot web app:
Translating the web app
Thanks for your interest in internationalizing the FarmBot web app! To add translations:
- Fork this repo
- Navigate to
/public/app-resources/languages
and run the commandnode _helper.js yy
whereyy
is your language's language code. Eg:ru
for Russian. - Edit the translations in the file created in the previous step:
"phrase": "translated phrase"
. - When you have updated or added new translations, commit/push your changes and submit a pull request.