-
Notifications
You must be signed in to change notification settings - Fork 676
Description
In mycli, managing the config has been challenging for awhile since we have five places a user can configure their experience, three of which are config files.
- The
~/.my.cnffile ([client]section) - The login path file, e.g.
~/.mylogin.cnf - The mycli config file,
~/.myclirc - The command-line arguments
- The commands in mycli
This issue documents the overall revamp of the config that we're trying to accomplish for version 2.
Tasks
- Use CLI Helpers to read and validate the config files, see Add config file reading/writing cli_helpers#39
- Store config files on macOS and Linux according to the XDG spec. Windows config files should be in a Windows-appropriate spot and not in the home folder.
- Make config file options consistent across pgcli and mycli, see Consolidate config options pgcli#835
- Add missing configuration options to mycli's config file, e.g. ssl, pager command, etc.
- Add a migration tool that migrates config settings from
.my.cnfand.mylogin.cnfto the mycli config file (allows user input to override this feature and control password migration) - Remove support for
.my.cnfand.mylogin.cnf-- "one config file to rule them all" - Store log and audit log files according to the XDG spec.
- Automatic config file permission checks -- warn or reject files that are group/world readable
- Fix favorite query config file reading/writing: Favorite queries not loaded from or saved to config file #669
Missing options in mycli's config file to consider adding
These options are currently supported in mycli via the .my.cnf file, so we need to consider adding them to mycli's config file.
- socket
- default-character-set
- ssl-ca
- ssl-cert
- ssl-key
- ssl-cipher
- ssl-mode
- local-infile
- pager (the command itself)
Assorted Background Notes
Previous config-related discussions:
The desire is to balance these three things well:
- Mycli's config is user-friendly
- Switching to mycli from MySQL is a seamless experience
- Mycli and pgcli have a consistent experience
There has been extensive discussion about the false sense of security that the encrypted login path file provides users. Many users have noted how it's not a security feature. In fact, if you have a copy of someone's login path file, you can decrypt it with a single command:
python -c 'from mycli.config import *;print(read_config_file(open_mylogin_cnf(get_mylogin_cnf_path())))'
Mycli now supports storing host/port/database information in its config file: http://www.mycli.net/loginpath#dsn
Another long-term goal is keyring support so that users can use their system's password manager with mycli.