Gobierto

The Gobierto Developer Hub

Welcome to the Gobierto developer hub. You'll find comprehensive guides and documentation to help you start working with Gobierto as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides    

Environment variables overview

Gobierto requires a few environment variables to be setup properly in order for the application to run. To help with the setup, a file named .env.example has been added to the repository:

# Rails configuration variables
SECRET_KEY_BASE=
RACK_ENV=development
RAILS_ENV=development
TLD_LENGTH=2
HOST=gobierto.test
BASE_HOST=gobierto.test
PORT=3000
RAILS_MAX_THREADS=5

# Poltergeist debug and inspector variables
INTEGRATION_DEBUG=false
INTEGRATION_INSPECTOR=false

# Populate data variables
# - Main endpoint
POPULATE_DATA_ENDPOINT=
# - Suggestion endpoint for municipalities suggestion
MUNICIPALITIES_SUGGESTIONS_ENDPOINT=

# Elastic search URL
ELASTICSEARCH_URL=http://localhost:9200

# Redis instance URL
REDIS_URL=redis://localhost:6379/0

# Rollbar API token (https://rollbar.com)
ROLLBAR_ACCESS_TOKEN=

# Amazon S3 credentials, to upload assets
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=eu-west-1
S3_BUCKET_NAME=gobierto-dev

# Cloudinary credentials to crop images
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=

# Google Places API Key, to geolocalize places
GOOGLE_PLACES_API_KEY=

# Google Maps Geocoding API Key, to get coordinates from addresses names or find addresses based on either geographic coordinates or place IDs
GOOGLE_MAPS_GEOCODING_API_KEY=

# Action mailer config
MAILER_DELIVERY_METHOD=
MAILER_SMTP_ADDRESS=
MAILER_SMTP_USER_NAME=
MAILER_SMTP_PASSWORD=
# If webservice delivery is enabled
# MAIL_WEBSERVICE_ADDRESS=

# AsymmetricEncryptor
ASYMMETRIC_ENCRYPTION_KEY=

# Rails performance
APPSIGNAL_PUSH_API_KEY=

Rails configuration variables

  • SECRET_KEY_BASE: Rails secret key base. See config/secrets.yml
  • RACK_ENV and RAILS_ENV: Rack and Rails environment
  • TLD_LENGTH: TLD length setting for the session storage. See config/initializers/session_store.rb
  • HOST and PORT: application host and port
  • BASE_HOST: the application main host. It might be different from host, for example: hosted.gobierto.es vs gobierto.es
  • RAILS_MAX_THREADS: Puma setting
  • TEST_LOG_LEVEL: logger level in test environment. Set it to fatal to don't log anything.
  • INTEGRATION_INSPECTOR and INTEGRATION_DEBUG: Poltergeist settings to enable the inspector and the debugger. See https://github.com/teampoltergeist/poltergeist#remote-debugging-experimental
  • MAILER_DELIVERY_METHOD
  • MAILER_SMTP_ADDRESS
  • MAILER_SMTP_USER_NAME
  • MAILER_SMTP_PASSWORD
  • MAIL_WEBSERVICE_ADDRESS

Populate Data variables

Populate Data is a tool developed by Populate that stores many of the open date used by Gobierto. Gobierto needs Populate Data to run. If you need access just write us to: [email protected]

  • POPULATE_DATA_ENDPOINT: The endpoint of the Populate Data account
  • MUNICIPALITIES_SUGGESTIONS_ENDPOINT: The endpoint from Populate data with the places autosuggestion

NoSQL databases

Gobierto uses ElasticSearch and Redis.

  • ELASTICSEARCH_URL: ElasticSearch endpoint
  • REDIS_URL: Redis endpoint

External services

  • ROLLBAR_ACCESS_TOKEN: Rollbar access token
  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION and S3_BUCKET_NAME: Amazon S3 credentials, region and bucket name
  • GOOGLE_PLACES_API_KEY: Google Places API key
  • GOOGLE_MAPS_GEOCODING_API_KEY: Google Maps Geocoding API key
  • CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET: Cloudinary API keys. Sign up for a free account to cropping the user's avatar
  • APPSIGNAL_PUSH_API_KEY: AppSinal API key (used for performance monitoring)

Asymmetric encryption

The AsymmetricEncryptor defined in lib/ looks for a RSA public key defined in config/secrets.yml.
The instances of AsymmetricEncryptor must be initialized with the name of the key in secrets.yml.
To create a valid key use, for example: OpenSSL::PKey::RSA.new(2048).public_key.to_pem

  • ASYMMETRIC_ENCRYPTION_KEY

SSL requirement

  • GOBIERTO_FORCE_SSL: if defined forces the application to run under SSL.

Cache storage configuration

Gobierto supports Memcached in staging and production environments.

  • set GOBIERTO_CACHE_TYPE to mem_cache_store if you want to enable memcached
  • set GOBIERTO_CACHE_MEMCACHE_HOST to a valid host if your memcached is in a different server

Updated about a month ago


What's Next

Login using the demo accounts

Development user and admin accounts

Environment variables overview


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.