Skip to content

Commit 29e106a

Browse files
committed
config: install varlock as agent user, not root
setup.sh was running 'curl | sh' as root, which installed varlock to root's home. start.sh expects it at ~/.varlock/bin/varlock under the agent user. Now runs the installer as baudbot_agent via sudo -u so it lands in the right place.
1 parent 8e09046 commit 29e106a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

setup.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,13 @@ echo "=== Installing Slack bridge dependencies ==="
191191
(cd "$REPO_DIR/slack-bridge" && npm install)
192192

193193
echo "=== Installing varlock ==="
194-
if command -v varlock &>/dev/null; then
195-
echo "varlock already installed, skipping"
194+
# varlock must be available to the agent user (start.sh adds ~/.varlock/bin to PATH).
195+
# Install as agent user so it lands in the right home directory.
196+
AGENT_VARLOCK="$BAUDBOT_HOME/.varlock/bin/varlock"
197+
if [ -x "$AGENT_VARLOCK" ]; then
198+
echo "varlock already installed for baudbot_agent, skipping"
196199
else
197-
curl -sSfL https://varlock.dev/install.sh | sh -s
200+
sudo -u baudbot_agent bash -c 'curl -sSfL https://varlock.dev/install.sh | sh -s'
198201
fi
199202

200203
echo "=== Deploying from source to runtime ==="

0 commit comments

Comments
 (0)