Vagrant Trellis Sequel
Open Trellis databases in Sequel Pro with a single command
- Installation
- Usage
- Common Errors
- Connection Errors
- Support!
- Feedback
- Change log
- Credits
- Contributing
- License
Installation
$ vagrant plugin install vagrant-trellis-sequel
Usage
$ 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
Noob
$ vagrant trellis-sequel open
This works for most of the cases:
vault.ymlis unencryptedvault.ymlis encrypted and.vault_passcontains the vault password- running from within the Trellis directory
Specify which site's database
$ vagrant trellis-sequel open --site example.com
Use the --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_wordpress_sites in vault.yml, usually ends with .com.
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
Use the --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_pass if vault.yml is encrypted.
Specify vault password
$ vagrant trellis-sequel open --vault-pass my-top-secret
Use the --vault-pass option to provide vault password if you encrypted vault.yml but don't have a vault password file.
Common Errors
DB password not found for example_dev
That means you passed wrong --site or 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 2 commands are valid:
$ 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.
Connection Errors
(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 ~/.ssh/config file:
# 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.
Support!
Donate via PayPal 
Love Vagrant Trellis Sequel? Help me maintain it, a donation here can help with it.
Why don't you hire me?
Ready to take freelance WordPress jobs. Contact me via the contact form here or, via email [email protected]
Want to help in other way? Want to be a sponsor?
Contact: Tang Rufus
Feedback
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.
Change log
Please see CHANGELOG for more information on what has changed recently.
Credits
Vagrant Trellis Sequel is a Typist Tech project and maintained by Tang Rufus, freelance developer for hire.
Inspired from Sequel Pro for Chassis.
Special thanks to the Roots team whose Trellis make this project possible.
Full list of contributors can be found here.
Contributing
Please see CODE_OF_CONDUCT for details.
License
Vagrant Trellis Sequel is released under the MIT License.