Open Trellis databases in Sequel Pro with a single command
$ vagrant plugin install vagrant-trellis-sequel
$ vagrant trellis-sequel open --help Usage: vagrant trellis-sequel open [options] [vm-id] --site [site] Site whose database going to be opened. --vault-password-file [VAULT_PASSWORD_FILE] Vault password file. --vault-pass [VAULT_PASS] Vault password. -h, --help Print this help
$ vagrant trellis-sequel open
This works for most of the cases:
vault.yml is unencrypted
vault.yml is encrypted and
.vault_pass contains the vault password
- running from within the Trellis directory
- open the first found database
Specify which site's database
$ vagrant trellis-sequel open --site example.com
--site option to specify which site's database to open. By default, the first site's database will be opened.
Note: This is the site key of
vault.yml, usually ends with
Specify vault password file
$ vagrant trellis-sequel open --vault-password-file .my_vault_password_file $ vagrant trellis-sequel open --vault-password-file /my/top/secret.txt
--vault-password-file option to specify path to the vault password file, either relative path from Trellis root or absolute path.
Default value is
vault.yml is encrypted.
Specify vault password
$ vagrant trellis-sequel open --vault-pass my-top-secret
--vault-pass option to provide vault password if you encrypted
vault.yml but don't have a vault password file.
DB password not found for
That means you passed wrong
vault.yml is malformed.
# group_vars/development/vault.yml vault_wordpress_sites: example.com: admin_password: admin env: db_password: bye www.typist.tech: admin_password: admin env: db_password: hello
For the above
vault.yml, these 3 commands are valid:
$ vagrant trellis-sequel open # Open one of the DB, most likely the first one $ vagrant trellis-sequel open --site example.com $ vagrant trellis-sequel open --site www.typist.tech
HMAC encoded in the file does not match calculated one
That means vault password is incorrect.
(This part is stolen from from Sequel Pro for Chassis.)
If you get a connection error, the first thing to attempt to debug is to check the details that Sequel Pro gives you (under the Show Details button).
key_load_public: No such file or directory
If you get this error on macOS Sierra, it's possible that you have too many SSH keys loaded into your
ssh-agent. If you're using multiple boxes with this setup in your SSH config (
AddKeysToAgent yes), each new box you add will be added to your agent. With too many of these, SSH will hit the authentication retries limit before getting to the correct key.
The simple solution is to add this to your
# Disable checks on Vagrant machines Host 127.0.0.1 # Skip adding to agent AddKeysToAgent no # Only use key specified on CLI IdentitiesOnly yes # Skip known hosts UserKnownHostsFile /dev/null StrictHostKeyChecking no
This disables using system-level keys (both from the agent, and your regular SSH keys), and disables host checks (which are not necessary for localhost). This does not affect
vagrant ssh, which already uses these options.
Love Vagrant Trellis Sequel? Help me maintain it, a donation here can help with it.
Why don't you hire me?
Want to help in other way? Want to be a sponsor?
Contact: Tang Rufus
Please provide feedback! We want to make this library useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.
Please see CHANGELOG for more information on what has changed recently.
Inspired from Sequel Pro for Chassis.
Full list of contributors can be found here.
Please see CODE_OF_CONDUCT for details.