The Chicago Boss API is mostly stable, but still might change before 1.0.
All configuration takes place in boss.config
in your project directory. Valid configuration options are:
acceptor_processes
- The number of acceptor processes to start (Cowboy only). Defaults to 100. Don't worry about this.assume_locale
- The presumed locale of translatable strings. Defaults to "en".cache_adapter
- The cache adapter to use. Currently the only valid value is memcached_bin
.cache_servers
- A list of cache servers ({Host, Port, PoolSize}
). Defaults to [{"localhost", 11211, 1}]
.
cache_exp_time
- The maximum time to keep a cache entry, in seconds. Defaults to 60.cache_prefix
- Prefix for cache keys. Defaults to 'db'.compiler_options
- A list of extra options to be passed to the Erlang compiler invoked by ChicagoBoss. For example, [debug_info]
may be specified to make the beam files build with debug information included. Valid options are those available to compile:forms/2.vm_args
- A string of additional vm args that will be appended to the start* commands. For example, limit the TCP ports for distributed Erlang traffic (running Erlang through a firewall), you can use {vm_args, "-kernel inet_dist_listen_max 9105 inet_dist_listen_min 9100"}
db_host
- The hostname of the database. Defaults to "localhost".db_port
- The port of the database. Defaults to 1978.db_username
- The username used for connecting to the database (if needed).db_password
- The password used for connecting to the database (if needed).db_database
- The name of the database to connect to (if needed).db_adapter
- The database adapter to use. Valid values are:
mock
- In-memory (non-persistent) database, useful for testingmnesia
- Mnesiamysql
- MySQLpgsql
- PostgreSQLtyrant
- Tokyo Tyrantdb_cache_enable
- Whether to enable the cache in boss_db. Defaults to false. Requires cache_enable to be set to true.db_shards
- A list of proplists with per-shard database configuration. The proplists override the above options, and should contain an additional option:
db_shard_models
- A list of models (atoms) which are stored on the shard.include_dirs
- List of additional directories to be searched for files specified in -include
directives.log_enable
- Controls whether ChicagoBoss will generate log files. If this is set to false
, log messages will still be sent to Erlang's internal error_logger
server and may be handled from there. Defaults to true
.mail_driver
- The email delivery driver to use. Valid values are:
boss_mail_driver_smtp
- SMTP delivery. If mail_relay
is present, it is used as a relay, otherwise direct delivery is attempted.boss_mail_driver_mock
- A black hole, useful for testing.mail_relay_host
- The relay server for SMTP mail deliveries.mail_relay_port
- The port to connect to on the SMTP relay (optional). Must be an integer.mail_relay_username
- The username used for connecting to the SMTP relay (if needed).mail_relay_password
- The password used for connecting to the SMTP relay (if needed).mail_relay_use_tls
- Specify whether to use tls (optional). Valid values are the atoms if_available
, always
and never
. Defaults to if_available
.master_node
- For distributed configurations, the name of the master node. The master node runs global services (incoming mail, message queue, events, sessions). Should be an atom, e.g. somenode@somehost
. The node name is specified in the -sname
or -name
argument in the startup script.model_manager
- The model manager adapter to use. Useful for situations where we need to use an alternative ActiveRecord compiler rather than boss_db. Defaults to boss_db
.port
- The port to run the HTTP server on, or a tuple of the format {env, "PORTVAR"} (where PORTVAR is the name of an environment variable containing the port number). Defaults to 8001.server
- The HTTP server to use. Valid values are:
base_url
Sets the base_url passed to the views (for deployments on suburl's)session_adapter
Selects the session driver to use. Valid values:cache
- Store sessions in the configured cache servers. Requires cache_enable
to be set to true
.mnesia
- Mnesia sessions. Note that old sessions are not deleted.mock
- In-memory sessions (default)session_enable
- Whether to enable sessions. Defaults to true
.session_key
- Cookie key for sessions. Defaults to "_boss_session"session_exp_time
- Expiration time for the session cookie. Defaults to 1440session_mnesia_nodes
(optional, Mnesia sessions only) - List of Mnesia nodes, defaults to node()session_cookie_http_only
- If set to true
, the HttpOnly
flag will be added to the session cookie. Defaults to false
.session_cookie_secure
- Whether to add the Secure
flag with the session cookie. Defaults to false
.smtp_server_enable
- Enable the SMTP server for incoming mailsmtp_server_address
- The address that the SMTP server should bind to. Defaults to {0, 0, 0, 0}
(all interfaces).smtp_server_domain
- The domain name of the SMTP serversmtp_server_port
- The port that the SMTP server should listen on. Defaults to 25.smtp_server_protocol
- The protocol that the SMTP server should use. Valid values are:tcp
(default)ssl
ssl_enable
- Enable HTTP over SSLssl_options
- SSL options; see ssl(3erl)Logging with lager
lager
- Lager config, see Lager Github Readme.Warning: From 0.5.2, the frontpage, default_action and default_actions configuration options has been moved to the new routing system