aboutsummaryrefslogtreecommitdiff
path: root/restic-rest-server/entrypoint.sh
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2020-02-13 23:16:17 +0000
committerMike Crute <mike@crute.us>2020-02-13 23:16:17 +0000
commit86a24d2f31af40f3514913b2b4485355547f0130 (patch)
tree1e5beabe063bc6fbde472ee9b672092e51b436f2 /restic-rest-server/entrypoint.sh
parent053cca5b7614456cb6a64996a1b8b9afaeddf0a5 (diff)
downloaddockerfiles-86a24d2f31af40f3514913b2b4485355547f0130.tar.bz2
dockerfiles-86a24d2f31af40f3514913b2b4485355547f0130.tar.xz
dockerfiles-86a24d2f31af40f3514913b2b4485355547f0130.zip
restic-rest-server: use custom entrypoint
Diffstat (limited to 'restic-rest-server/entrypoint.sh')
-rwxr-xr-xrestic-rest-server/entrypoint.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/restic-rest-server/entrypoint.sh b/restic-rest-server/entrypoint.sh
new file mode 100755
index 0000000..57a9afb
--- /dev/null
+++ b/restic-rest-server/entrypoint.sh
@@ -0,0 +1,23 @@
1#!/bin/sh
2
3set -e
4
5DATA_DIRECTORY=${DATA_DIRECTORY:-"/data"}
6PASSWORD_FILE=${PASSWORD_FILE:-"/data/.htpasswd"}
7DISABLE_AUTHENTICATION=${DISABLE_AUTHENTICATION:-"true"}
8OPTIONS=${OPTIONS:-"--append-only --prometheus"}
9
10if [ "$DISABLE_AUTHENTICATION" = "false" ]; then
11 [ ! -f "$PASSWORD_FILE" ] && touch "$PASSWORD_FILE"
12
13 if [ ! -s "$PASSWORD_FILE" ]; then
14 echo
15 echo "**WARNING** No user exists, please 'docker exec -it \$CONTAINER_ID create_user'"
16 echo
17 fi
18else
19 rm -f "$PASSWORD_FILE"
20 OPTIONS="$OPTIONS --no-auth"
21fi
22
23exec rest-server --path "$DATA_DIRECTORY" $OPTIONS