Configuration
Mightstone behavior is defined by configuration. You can configure your mightstone by three means:
Programmatically with a
MightstoneSettingsinstance passed to yourMightstoneapplication instanceThrough environment variables, for instance
MIGHTSTONE_APPNAMEto alterappnamekeyThrough a configuration file, with 3 means of defining
In CLI by passing a
--configparameter to the command line clientVia
MIGHTSTONE_CONFIG_FILEenvironment 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 database |
By default, Mighstone will use a jerry-rigged storage mechanism based on pymongo_inmemory. This will not work with multiple concurrent instances of Mightstone tough.
There was an aborted attempt to use beanita / mongita backend, but we are still in dire need of features not implemented yet, and some bugfixes.
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