Skip to content

Commit

Permalink
fix issues with env vars and entrypoint (#79)
Browse files Browse the repository at this point in the history
* fix issues with env vars and entrypoint

* update example env.list
  • Loading branch information
oskapt authored Feb 3, 2020
1 parent c7b16b9 commit 9d8ca06
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions docker/entrypoint-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docker/entrypoint-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/env.list.example
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 9d8ca06

Please sign in to comment.