Add docker secret support

This commit is contained in:
Anes Belfodil
2021-01-20 11:27:29 -05:00
parent 1b5fe1a934
commit 36b8864ca3
2 changed files with 11 additions and 0 deletions

View File

@ -44,6 +44,8 @@ Default login is `wallabag:wallabag`.
- `-e POPULATE_DATABASE=...`(defaults to "True". Does the DB has to be populated or is it an existing one) - `-e POPULATE_DATABASE=...`(defaults to "True". Does the DB has to be populated or is it an existing one)
- `-e SYMFONY__ENV__SERVER_NAME=...` (defaults to "Your wallabag instance". Specifies a user-friendly name for the 2FA issuer) - `-e SYMFONY__ENV__SERVER_NAME=...` (defaults to "Your wallabag instance". Specifies a user-friendly name for the 2FA issuer)
To set any of these environment variables from a file (for instance a Docker Secret), append `__FILE` to the name of the environment variable.
## SQLite ## SQLite
The easiest way to start wallabag is to use the SQLite backend. You can spin that up with The easiest way to start wallabag is to use the SQLite backend. You can spin that up with

View File

@ -1,5 +1,14 @@
#!/bin/sh #!/bin/sh
FILE_ENV_VARS="$(env | grep '__FILE=')"
for env_var in $FILE_ENV_VARS; do
var_name="$(echo $env_var | grep -o '.*__FILE=' | sed 's/__FILE=//g')"
file_path="$(echo $env_var | grep -o '__FILE=.*' | sed 's/__FILE=//g')"
file_content="$(cat $file_path)"
new_var="$(echo $var_name=$file_content)"
export $(echo $new_var | xargs)
done
provisioner () { provisioner () {
echo "Starting provisioner..." echo "Starting provisioner..."
if ! out=`ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local "$@"`;then if ! out=`ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local "$@"`;then