From 7f680abd8cdaabd0793ec499a506392ddb679023 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sun, 1 Nov 2026 13:37:47 +0000 Subject: [PATCH] Grant RiotCoder access to deployed CLI files --- dev2/agents/README.md | 5 +++-- dev2/agents/install-riotcoder.sh | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 dev2/agents/install-riotcoder.sh diff --git a/dev2/agents/README.md b/dev2/agents/README.md index 9a1bc67..57f0560 100644 --- a/dev2/agents/README.md +++ b/dev2/agents/README.md @@ -12,5 +12,6 @@ configuration or task state in Anthony's home. On dev2, deploy the CLI package and its production dependencies to `/opt/riotcoder-cli`, provision `/home/riotcoder/.config/cli-tools/mail.json` with only the RiotCoder account, then run -`dev2/agents/install-riotcoder.sh` as root. The installer places the responder and mail tools in -the correct homes and runs the mail poller as UID RiotCoder. +`bash dev2/agents/install-riotcoder.sh` as root. The installer grants RiotCoder's group read +access to the deployed CLI and places the responder and mail tools in the correct homes. +The mail poller runs as UID RiotCoder. diff --git a/dev2/agents/install-riotcoder.sh b/dev2/agents/install-riotcoder.sh old mode 100644 new mode 100755 index f48c6fc..13cdde1 --- a/dev2/agents/install-riotcoder.sh +++ b/dev2/agents/install-riotcoder.sh @@ -19,6 +19,11 @@ id "$USER_NAME" >/dev/null [ -d "$CLI_DIR/node_modules" ] || { echo "CLI runtime dependencies are missing at $CLI_DIR" >&2; exit 1; } [ -f "$USER_HOME/.config/cli-tools/mail.json" ] || { echo "RiotCoder's private mail configuration is missing" >&2; exit 1; } +# The deploy checkout and dependencies are installed by root; grant RiotCoder's +# own group read/traverse access so the account can execute its CLI tools. +chgrp -R "$GROUP_NAME" "$CLI_DIR" +chmod -R g+rX "$CLI_DIR" + install -d -o "$USER_NAME" -g "$GROUP_NAME" -m 0750 \ "$USER_HOME/.local/bin" "$USER_HOME/.config/agent-identities/riotcoder" "$USER_HOME/.local/state/agent-mail-poll" install -o root -g root -m 0755 "$SOURCE_DIR/qc-agent-responder.py" /usr/local/libexec/qc-agent-responder