Configuration
Mightstone behavior is defined by configuration. You can configure your mightstone by three means:
Programmatically with a
MightstoneSettings
instance passed to yourMightstone
application instanceThrough environment variables, for instance
MIGHTSTONE_APPNAME
to alterappname
keyThrough a configuration file, with 3 means of defining
In CLI by passing a
--config
parameter to the command line clientVia
MIGHTSTONE_CONFIG_FILE
environment variablePassively, by storing your configuration file in an standard location.
Configuration
Path |
Environment Variable |
Type |
default |
description |
---|---|---|---|---|
|
|
string |
|
Your application name, it will be used to build your storage and cache paths on the filesystem. |
Storage
Path |
Environment Variable |
Type |
default |
description |
---|---|---|---|---|
|
|
string |
|
Either |
|
|
string |
Mongodb dsn ( |
|
|
|
string |
|
Data storage directory, only used if |
|
|
string |
|
The mongo (or beanita) database |
Http
Path |
Environment Variable |
Type |
default |
description |
---|---|---|---|---|
|
|
bool |
|
Use memory (transient) or filesystem (persistent) cache |
|
|
string |
|
The directory to store HTTP cache, only used of |
|
|
list[string] |
|
HTTP verbs to cache |
|
|
list[int] |
|
HTTP status code to cache |
Where to store your configuration ?
Mightstone will search configuration file in this order:
<current_directory>/mightstone.yaml
<current_directory>/mightstone.yml
<current_directory>/mightstone.json
<current_directory>/mightstone.toml
<user_config_directory>/mightstone.yaml
<user_config_directory>/mightstone.yml
<user_config_directory>/mightstone.json
<user_config_directory>/mightstone.toml
Mighstone relies on AppDirs package to resolve user config directory:
Mac OS X: ~/Library/Application Support/Mightstone
Unix: ~/.config/Mightstone # or in $XDG_CONFIG_HOME, if defined
Win XP (not roaming): C:\Documents and Settings\<username>\Application Data\Mightstone\Mightstone
Win XP (roaming): C:\Documents and Settings\<username>\Local Settings\Application Data\Mightstone\Mightstone
Win 7 (not roaming): C:\Users\<username>\AppData\Local\Mightstone\Mightstone
Win 7 (roaming): C:\Users\<username>\AppData\Roaming\Mightstone\Mightstone