mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Environment Variables aren't processed if running Docker binary normally #1332
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DUOLabs333 on GitHub (Jul 26, 2022).
Subject of the issue
If I run
vaultwarden/server:latestwithsource /etc/.env; /start.shorsource /etc/.etc; /vaultwarden, the new environment variables aren't used (DATA_FOLDERis still/data, and it is using a sqlite database, not my postgres one.Deployment environment
Install method: Docker image, but run manually in a chroot (the compiled version --- it's too old to show the version number at start-up --- does not have this problem).
Clients used:
Reverse proxy and version:
MySQL/MariaDB or PostgreSQL version:
Other relevant details:
Steps to reproduce
/etc/.envfile withDATA_FOLDER=/etc/data./datato/etc/data.source /etc/.env; /start.sh./etc/dataExpected behaviour
The variables in
/etc/.envare not respected.Actual behaviour
Troubleshooting data
@BlackDex commented on GitHub (Jul 26, 2022):
I'm unsure what you try to do here.
If you want to use a
.envfile for vaultwarden to read, either mount/put that.envfile in the same folder as thevaultwardenbinary. Or set theENV_FILE=/path/to/env-filebefore you start Vaultwarden.Also, a
source /etc/.env ; my_script.shdoesn't provide those env's tomy_script.shunless you haveexport VAR_NAMEinside the.envfile. That just not how bash or sh work, they do not have access to non-exported variables.Also, all version of Vaultwarden/Bitwarden_RS show the version numbers during startup, and else it should be somewhere in the docker image metadata.
@DUOLabs333 commented on GitHub (Jul 26, 2022):
I tried
set -a; source /etc/.env; /vaultwarden, which should export all variables, but that didn't work either.@DUOLabs333 commented on GitHub (Jul 26, 2022):
ENV_FILEworks though.@BlackDex commented on GitHub (Jul 26, 2022):
Not sure why
set -adoesn't work though.Could be the environment, could be something strange during export of all the vars compared to Vaultwarden reading the file it self. Could be the shell environment bash vs sh, or maybe even the bash/sh version it self.
Main thing is, Vaultwarden is able to read exported environment variables and read the
.envfile.So, I think there is no issue.