Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature Request: generate .vault_pass for existing sites #300

Closed
3 tasks done
mike-sheppard opened this issue May 26, 2022 · 2 comments · Fixed by #319
Closed
3 tasks done

Feature Request: generate .vault_pass for existing sites #300

mike-sheppard opened this issue May 26, 2022 · 2 comments · Fixed by #319
Labels
enhancement New feature or request

Comments

@mike-sheppard
Copy link

mike-sheppard commented May 26, 2022

Terms

Summary

./trellis/.vault_pass is required for the trellis dotenv task to run. It'd be great if the dotenv command either:

  • Automatically generates ./trellis/.vault_pass if missing during trellis init OR trellis dotenv
  • Or throws an error message that informs the user to create one before running the task

Motivation

trellis new creates the ./trellis/.vault_pass but it isn't a commited file, so when a new user clones the repo/project + runs trellis init the vault pass is not created, leading to the error below.

Additional Context

Current error message from trellis dotenv on a project without a .vault_pass file
trellis dotenv error

@swalkinshaw
Copy link
Member

Sorry for the delay @mike-sheppard and thanks for the good issue!

@tangrufus had started looking into this in #302 and then I was starting to prioritize fixing this after another report. I went down a similar path as @tangrufus to try to validate that a Vault pass file existed.

However, a .vault_pass isn't actually required. It's only required if the files are already encrypted. In those cases, generating a new password file isn't correct since you'd need the original password that was used to encrypt them.

Example:

  1. developer A creates a project + pushes it git
  2. developer B clones repo, runs trellis dotenv
  3. 💣 fails because B is missing .vault_pass

The solution is for B to get the password from A and create that file locally.

So ultimately I think the best solution is to just output the proper error message which will point anyone in the right direction:

trellis dotenv
[✘] Error templating .env file
[WARNING]: Error getting vault password file (default): The vault password file
/Users/scottwalkinshaw/dev/trellis/.vault_pass was not found
ERROR! The vault password file /Users/scottwalkinshaw/dev/trellis/.vault_pass was not found

#319 will do this and also fixes the hidden error output in a few other commands.

@mike-sheppard
Copy link
Author

Yup sounds good! + that error msg is perfect 👍🏻

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants