Closed mike-sheppard closed 2 years ago
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:
trellis dotenv
.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
https://github.com/roots/trellis-cli/pull/319 will do this and also fixes the hidden error output in a few other commands.
Yup sounds good! + that error msg is perfect 👍🏻
Terms
Summary
./trellis/.vault_pass
is required for thetrellis dotenv
task to run. It'd be great if the dotenv command either:./trellis/.vault_pass
if missing duringtrellis init
ORtrellis dotenv
Motivation
trellis new
creates the./trellis/.vault_pass
but it isn't a commited file, so when a new user clones the repo/project + runstrellis 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