Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix --version from failing without config #5055

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

BlackDex
Copy link
Collaborator

@BlackDex BlackDex commented Oct 6, 2024

Since we added the option to show the web-vault version also when running --version this causes the config to always be validated. While this is not very bad in general, it could cause the command to quit during the config validation, and not show the version, but also errors. This is probably not very useful for this specific command, unlike the --backup for example.

To fix this, and preventing the config from being validated, i added an AtomicBool to check if we need to validate the config on first load. This prevents errors, and will just show the Vaultwarden version, and if possible the web-vault version too.

Fixes #5046

@BlackDex BlackDex requested review from dani-garcia and removed request for dani-garcia October 10, 2024 10:14
src/config.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
Since we added the option to show the web-vault version also when running `--version` this causes the config to always be validated.
While this is not very bad in general, it could cause the command to quit during the config validation, and not show the version, but also errors.
This is probably not very useful for this specific command, unlike the `--backup` for example.

To fix this, and preventing the config from being validated, i added an AtomicBool to check if we need to validate the config on first load.
This prevents errors, and will just show the Vaultwarden version, and if possible the web-vault version too.

Fixes dani-garcia#5046

Signed-off-by: BlackDex <black.dex@gmail.com>
Signed-off-by: BlackDex <black.dex@gmail.com>
@dani-garcia dani-garcia merged commit cd195ff into dani-garcia:main Oct 11, 2024
5 checks passed
@BlackDex BlackDex deleted the fix-version-info-issue branch October 11, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants