From a4fc6dcf9009822441cc151343548ac04fff7d0a Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Sun, 22 Feb 2026 14:31:11 +0100 Subject: [PATCH] fix(dogfood): auto-configure Mux GitHub owner login in startup script (#22239) --- dogfood/coder/main.tf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dogfood/coder/main.tf b/dogfood/coder/main.tf index 08ba4fa9e5..3d4957a94d 100644 --- a/dogfood/coder/main.tf +++ b/dogfood/coder/main.tf @@ -569,6 +569,20 @@ resource "coder_agent" "dev" { else echo "Already logged into GitHub CLI." fi + # Configure Mux GitHub owner login for browser access (skip if + # already set). See: https://mux.coder.com/config/server-access + if [ ! -f ~/.mux/config.json ] || ! jq -e '.serverAuthGithubOwner' ~/.mux/config.json >/dev/null 2>&1; then + GH_USER=$(gh api user --jq .login 2>/dev/null || true) + if [ -n "$GH_USER" ]; then + mkdir -p ~/.mux + if [ -f ~/.mux/config.json ]; then + jq --arg owner "$GH_USER" '. + {serverAuthGithubOwner: $owner}' ~/.mux/config.json > /tmp/mux-config.json && mv /tmp/mux-config.json ~/.mux/config.json + else + jq -n --arg owner "$GH_USER" '{serverAuthGithubOwner: $owner}' > ~/.mux/config.json + fi + echo "Configured Mux GitHub owner login: $GH_USER" + fi + fi # Increase the shutdown timeout of the docker service for improved cleanup. # The 240 was picked as it's lower than the 300 seconds we set for the