From 9d8ca06a771ec39ddd31e7ee294eb3509e71ae3b Mon Sep 17 00:00:00 2001 From: Adrian Goins Date: Mon, 3 Feb 2020 19:51:36 -0300 Subject: [PATCH] fix issues with env vars and entrypoint (#79) * fix issues with env vars and entrypoint * update example env.list --- docker/Makefile | 2 +- docker/entrypoint-generate.sh | 3 +++ docker/entrypoint-server.sh | 3 +++ docker/env.list.example | 12 +++++++++--- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index caad271..b0035d7 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -28,7 +28,7 @@ generate: env-file-exists build # Start the CA chatbot in the background serve: env-file-exists ca-key-exists docker run -d --restart unless-stopped --env-file ./env.list -v $(CURDIR)/example-keybaseca-volume:/mnt:rw ca:latest ./entrypoint-server.sh - @echo "Started CA bot service in the background... Use `docker ps` and `docker logs` to monitor it" + @echo 'Started CA bot service in the background... Use `docker ps` and `docker logs` to monitor it' # Stop the service stop: diff --git a/docker/entrypoint-generate.sh b/docker/entrypoint-generate.sh index 1f25117..60bcdb9 100755 --- a/docker/entrypoint-generate.sh +++ b/docker/entrypoint-generate.sh @@ -8,6 +8,9 @@ chown -R keybase:keybase /mnt # Run everything else as the keybase user sudo -i -u keybase bash << EOF export "FORCE_WRITE=$FORCE_WRITE" +export "TEAMS=$TEAMS" +export "KEYBASE_USERNAME=$KEYBASE_USERNAME" +export "KEYBASE_PAPERKEY=$KEYBASE_PAPERKEY" nohup bash -c "KEYBASE_RUN_MODE=prod kbfsfuse /keybase | grep -v 'ERROR Mounting the filesystem failed' &" sleep 3 keybase oneshot diff --git a/docker/entrypoint-server.sh b/docker/entrypoint-server.sh index 94ed287..64c585b 100755 --- a/docker/entrypoint-server.sh +++ b/docker/entrypoint-server.sh @@ -7,6 +7,9 @@ chown -R keybase:keybase /mnt # Run everything else as the keybase user sudo -i -u keybase bash << EOF +export "TEAMS=$TEAMS" +export "KEYBASE_USERNAME=$KEYBASE_USERNAME" +export "KEYBASE_PAPERKEY=$KEYBASE_PAPERKEY" nohup bash -c "KEYBASE_RUN_MODE=prod kbfsfuse /keybase | grep -v 'ERROR Mounting the filesystem failed' &" sleep 3 keybase oneshot diff --git a/docker/env.list.example b/docker/env.list.example index 3a4a2de..63a723a 100644 --- a/docker/env.list.example +++ b/docker/env.list.example @@ -1,7 +1,13 @@ # List the subteams here separated by commas (eg "teamname.ssh.production,teamname.ssh.staging") that you # wish to use to grant SSH access -TEAMS="teamname.ssh.staging,teamname.ssh.production,..." +TEAMS=teamname.ssh.staging,teamname.ssh.production # Login info for the chat bot -KEYBASE_USERNAME="username_of_ca_bot" -KEYBASE_PAPERKEY="paper key for the ca bot" +KEYBASE_USERNAME=username_of_ca_bot +KEYBASE_PAPERKEY=paper key for the ca bot + +# DO NOT QUOTE VARIABLE VALUES +# +# These variables will be single quoted when loaded into the container. If you quote them here, those +# quotes will become part of the variable value. +