This document explains the various configurable parts of the Ruby Toolbox app that need to be set up for a production deployment
A PostgreSQL database is required to store data. It's recommended to provide it via the standard DATABASE_URL
environment variable.
A Redis instance is needed for sidekiq background processing. It is recommended to configure it by providing a REDIS_URL
environment variable.
The GITHUB_TOKEN
is used by the GraphQL API client to fetch repository data.
Since Github's GraphQL API does not support unauthenticated usage you must provide this, even in local development.
A "Personal Access Token" will do just fine, you can create one by following Github's instructions. At the time of writing, the direct link to the corresponding settings page is https://github.com/settings/tokens
To keep things nicely separated the main production site has a dedicated rubytoolbox-bot user account for these tokens.
The RAILS_MAX_THREADS
option sets the number of threads to be used per puma web server and sidekiq background worker process. It should be an integer number. A fallback default is pulled from the .env
file.
Setting CANONICAL_HOST=www.ruby-toolbox.com
will enforce any requests made to the app under a different domain to be redirected to the canonical one.
It will also enable SSL enforcement - if a user visits via plain HTTP, they will be redirected to the SSL variant.
In order to use AppSignal for exception tracking and performance monitoring, the APPSIGNAL_PUSH_API_KEY
must be set. It can be created from the appsignal dashboard.
The sidekiq web UI is mounted at /ops/sidekiq
. It is protected by the SIDEKIQ_PASSWORD
using basic auth. The username is irrelevant.
If this is not configured the app generates a random password on boot.
On every update the catalog builds a new JSON export and deploys it to Github Pages. In order to synchronize the live catalog as fast as possible, a Github event webhook can be configured to trigger catalog synchronization on successful catalog builds.
If this is not configured an hourly update cron job will pull the latest data, so this is not a required configuration option.
- Payload URL:
https://www.ruby-toolbox.com/webhooks/github
- Content-Type:
application/json
- Secret:
Some Secret String
. Also set this asGITHUB_WEBHOOK_SECRET
on the app environment. - ✔️ Enable SSL Verification
- "Let me select individual events"
- ✔️ Statuses
- ✔️ Active
See also rubytoolbox#339
By setting RAILS_SERVE_STATIC_FILES
to true the Rails app will be hosting the assets. The regular production app is running on Heroku and has this enabled by default, including asset precompilation that Heroku takes care of automatically.
Set AUTOCORRECT=true
when running guard
for continuouos testing to automatically fix any auto-correctable rubocop offenses that are found.
By default capybara acceptance tests are run via Chrome Headless. By passing CHROME_DEBUG=true
when running the tests the regular selenium_chrome
driver will be used instead, allowing visual debugging.