Skip to content

Commit

Permalink
tuxbot fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
heronhaye committed Mar 20, 2020
1 parent 407ddcf commit 972b0c2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packaging/linux/fingerprint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e -u -o pipefail

here="$(dirname "${BASH_SOURCE[0]}")"

if [ -v KEYBASE_TEST_CODE_SIGNING_KEY ]; then
if [ "${KEYBASE_TEST_CODE_SIGNING_KEY:-}" = "1" ]; then
cat "$here/test_code_signing_fingerprint"
else
cat "$here/code_signing_fingerprint"
Expand Down
13 changes: 5 additions & 8 deletions packaging/linux/tuxbot/init
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
#!/usr/bin/env bash
set -euox pipefail
set -euo pipefail

systemctl --user daemon-reload
systemctl --user import-environment

for varname in SECRETS_TEAM SECRETS_REPO CHAT_TEAM CHAT_CHANNEL GNUPGHOME; do
if [ -z "${!varname}" ]; then
echo "No $varname found, check environment settings...aborting."
exit 1
fi
if ! systemctl --user show-environment | grep -q "$varname"; then
echo "systemd: No $varname found, check environment settings...aborting."
exit 1
fi
done

echo Enter tuxbot paperkey next
keybase oneshot -u tuxbot

echo Enter code signing key triplesec password next
if [ -v KEYBASE_TEST_CODE_SIGNING_KEY ]; then
if [ "${KEYBASE_TEST_CODE_SIGNING_KEY:-}" = "1" ]; then
echo Enter test code signing key triplesec password next
opts="-b "
fn=test_code_signing_key.gpg.3sv4
else
echo Enter code signing key triplesec password next
opts="-b --compatibility"
fn=code_signing_key.gpg.3s
fi
echo "(wait until you seee 'Key (will not be printed):', may take a bit)"
# shellcheck disable=SC2086
triplesec dec $opts < "/keybase/team/$SECRETS_TEAM/.kbfs_autogit/$SECRETS_REPO/$fn" | gpg --import

Expand Down
3 changes: 0 additions & 3 deletions packaging/linux/tuxbot/provision_tuxbot_env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ set -euox pipefail

# shellcheck disable=SC1090
cat /home/vagrant/tuxbot.env > /etc/environment

echo "[Manager]" > /etc/systemd/user.conf
echo "DefaultEnvironment=$(xargs < /home/vagrant/tuxbot.env)" >> /etc/systemd/user.conf
1 change: 1 addition & 0 deletions packaging/linux/tuxbot/tuxbot.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Description=tuxbot

[Service]
WorkingDirectory=%h/go/src/github.com/keybase/client/packaging/linux/tuxbot/bot/
EnvironmentFile=%h/tuxbot.env
ExecStart=go run %h/go/src/github.com/keybase/client/packaging/linux/tuxbot/bot/tuxbot/
Restart=on-failure

Expand Down

0 comments on commit 972b0c2

Please sign in to comment.