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

Add "ENV:" placeholder for environment variables #11105

Open
agowa opened this issue Jul 25, 2024 · 3 comments
Open

Add "ENV:" placeholder for environment variables #11105

agowa opened this issue Jul 25, 2024 · 3 comments

Comments

@agowa
Copy link

agowa commented Jul 25, 2024

Summary

Add a way to insert environment variables as placeholders to allow access to user provided and host specific information within auto-type and backup paths.

Examples

For example it could be used in the following ways:

  • Within the backup path {DB_FILENAME}-{TIME:yyyy-MM-dd-hh-mm-ss}-{ENV:HOSTNAME}.kdbx to track which host created that backup file. This can be helpful when the database (or the backup) are on shared storage or are accessed (and backed up) by multiple clients (for now ignore concurrent use and assume it is only one host at a time but multiple hosts in general, e.g. PC-001 today and PC-002 tomorrow)
  • Within auto-type for entering {ENV:WAYLAND_DISPLAY}, {ENV:SHELL}, {ENV:UID}, {ENV:USER}, {ENV:SSH_AUTH_SOCK}

Context

I use one database on multiple computers (desktop and notebook) however the notebook one time failed to properly save the database to the share and I had to revert to a backup and thereby noticed that the most recent backup also was damaged (also 0 KB in size). And while debugging this issue I noticed that it would have been really helpful if the hostname of the host that (tried to) make the backup was included in the filename.

I then checked the documentation if maybe a {HOSTNAME} placeholder exists for the backup path, but it didn't. And to make it more generic and to not having to cover every possible individual use case of adding custom information to the backup path placeholders I thought having a generic way to just reference an environment variable to be inserted into the path/name would be quite helpful going forward.

@droidmonkey
Copy link
Member

Each computer would have its own backup configuration so just place the computer name in there. I am not in favoring of resolving environment variables.

@agowa
Copy link
Author

agowa commented Jul 25, 2024

@droidmonkey that's my workaround for now. But I was about to create another feature request to have the backup settings within the database file 😅 (Edit: Don't have to it already exists #8497)

Also I kinda would like to have access to environment variables in such placeholders in general. I hit this limitation before with auto-type. But would you mind elaborating why you're opposing resolving environment variables in general here? And kinda depending on your reason, would you consider it ok if it was an opt-in feature?

@droidmonkey
Copy link
Member

Env vars are highly volatile, and if you start injecting them into various places you can have things "break" randomly. I just prefer to not be at the whim of the execution environment for functionality of something you would expect to be stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants