Add support for a config file #85
Replies: 8 comments 12 replies
-
Great feature!!! What would be allowed in the config file?
|
Beta Was this translation helpful? Give feedback.
-
I think we could maybe choose TOML for the same reasons Patrick Walton does for Cargo. |
Beta Was this translation helpful? Give feedback.
-
Adding "env override" to specs is helpful. OverrideOverride props specific to one instance meilistart-mysitesearch.sh# 'predictable pattern' environment variables to override
#
DB_PATH = /mnt/datastorage/mysite/meili/data/instance1
PORT_BIND = 9191
#CONFIG_FILE=
# config files can be refered also from a http url (github/other)?
/my/bin/meilisearch --config-file file:///path/to/common-config.toml To put common defaults in a toml fileEncourages org wide standard setting, while individual instance can use. common-config.toml
|
Beta Was this translation helpful? Give feedback.
-
As stated in meilisearch/meilisearch#958, clap (therefore structopt) fails to correctly parse flags when used with an env variable. This force the user to input |
Beta Was this translation helpful? Give feedback.
-
Following a refinement session with @Kerollmops and @irevoire. Constraints
Format ideas
From our exploration, it seems that TOML is a good choice.
Other formats can still be discussed. Priority orderThe ideal order of priority seems to be:
First iteration
master_key = "thisisasuper1337masterkey@@@"
no_analytics = true
...
ssl_require_auth = true Bonus points
master_key = "thisisasuper1337masterkey@@@"
no_analytics = true
[dump]
path = "dumps"
[snapshot]
enabled = true
[ssl]
require_auth = true |
Beta Was this translation helpful? Give feedback.
-
@gmourier and @irevoire already made some researches about the best config format file to use: you can see why we chose toml for a first solution in the comment above However, if some of you (@meilisearch/cloud-team, @meilisearch/integration-team or any Meilisearch users) have a better idea or would expect a different format, please let us know which one and why 😄 the solution is not implemented yet, here see the related issue |
Beta Was this translation helpful? Give feedback.
-
Hello everyone 👋 Some product updates may interest you regarding that feature request. A first iteration will support the TOML format; it's scheduled to be released for The tracking issue is here. At first, we had the idea to introduce TOML sections to facilitate the reading of the file, but it imposes some undesired edge effects. See The simplest solution is to replace the TOML sections with TOML comments for now, to avoid them. We will also provide a default The order of priority defined is: Configuration file < Env variables < command-line options It means the options in the configuration file can be overwritten by the environment variable set (if they exist), and that can be themself overwritten by the command-line options (if they exist). |
Beta Was this translation helpful? Give feedback.
-
The support for a configuration file is now a reality with the Thanks to it, you can now seamlessly version and share your Meilisearch configurations. 📚 More information here Locking this discussion. For any feedback about the configuration file support, please open a new one. Thank you, everyone! |
Beta Was this translation helpful? Give feedback.
-
Summary
We want a way to configure Meilisearch with config files. The format of the file has not yet been decided upon, but it will be one of JSON, toml, or yaml.
Motivations
This file will serve to consistently launch MeiliSearch instances, as executable options list grows bigger and bigger.
Explanation
The options in the file mirror these already present in the executable options and the environment variables.
We will be able to launch with a configuration file with:
or
Beta Was this translation helpful? Give feedback.
All reactions