Skip to content

Commit 36b8864

Browse files
committed
Add docker secret support
1 parent 1b5fe1a commit 36b8864

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Default login is `wallabag:wallabag`.
4444
- `-e POPULATE_DATABASE=...`(defaults to "True". Does the DB has to be populated or is it an existing one)
4545
- `-e SYMFONY__ENV__SERVER_NAME=...` (defaults to "Your wallabag instance". Specifies a user-friendly name for the 2FA issuer)
4646

47+
To set any of these environment variables from a file (for instance a Docker Secret), append `__FILE` to the name of the environment variable.
48+
4749
## SQLite
4850

4951
The easiest way to start wallabag is to use the SQLite backend. You can spin that up with

root/entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#!/bin/sh
22

3+
FILE_ENV_VARS="$(env | grep '__FILE=')"
4+
for env_var in $FILE_ENV_VARS; do
5+
var_name="$(echo $env_var | grep -o '.*__FILE=' | sed 's/__FILE=//g')"
6+
file_path="$(echo $env_var | grep -o '__FILE=.*' | sed 's/__FILE=//g')"
7+
file_content="$(cat $file_path)"
8+
new_var="$(echo $var_name=$file_content)"
9+
export $(echo $new_var | xargs)
10+
done
11+
312
provisioner () {
413
echo "Starting provisioner..."
514
if ! out=`ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local "$@"`;then

0 commit comments

Comments
 (0)