mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(dogfood): auto-configure Mux GitHub owner login in startup script (#22239)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user