Skip to content

Commit

Permalink
Add docker secret support
Browse files Browse the repository at this point in the history
  • Loading branch information
abelfodil committed Jan 20, 2021
1 parent 1b5fe1a commit 36b8864
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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

The easiest way to start wallabag is to use the SQLite backend. You can spin that up with
Expand Down
9 changes: 9 additions & 0 deletions root/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/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 () {
echo "Starting provisioner..."
if ! out=`ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local "$@"`;then
Expand Down

0 comments on commit 36b8864

Please sign in to comment.