forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix NongKung remote flow: stop relying on .env readability / gh auth login; harden GH_TOKEN + exec fallback #20
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Description
Problem Summary
NongKung remote flow via LINE OA is blocked/inconsistent when GitHub auth and exec behavior differ from assumptions in docs.
Observed from runtime + docs:
- Container
.envis owned by root with mode600(expected), sonodeuser cannot read it. GH_TOKENmay exist in environment, but flow still fails when skill/runtime expectsgh auth loginor exec path assumptions.gh-issuesskill docs say primary path iscurl + GH_TOKEN(nogh auth loginrequired), but some docs/checklists still implygh auth loginprerequisite.- Known issue patterns already exist for token invalid (
KI-036) and exec host mismatch (KI-010), but remote flow docs are not aligned.
Why this matters
NongKung should be able to run /gh-issues ... from LINE OA without laptop access and without requiring unsafe file permission changes on .env.
Security Note
Do not change .env from 600 to 644 in production-like runtime.
644makes secrets world-readable for all users in the container.- Correct pattern: inject tokens as environment variables/secrets and consume via process env.
Scope
Standardize and harden remote flow so that:
gh-issuesworks withGH_TOKENenv directly (curl-first path).gh auth loginis optional/diagnostic, not a hard requirement.- flow survives when exec/tooling has restrictions by providing explicit fallback behavior.
Required Changes
- Doc alignment (source of truth)
- Update remote-flow docs to state:
- Primary auth path:
GH_TOKENenv + GitHub REST (curl). gh auth statusis optional validation only.- No recommendation to expose
.envby relaxing file mode.
- Primary auth path:
- Align with skill docs that already state curl-first behavior.
- Runtime auth hardening
- Ensure all GitHub operations in
gh-issuesand related automation use:Authorization: Bearer $GH_TOKEN- explicit 401/403 handling with actionable error.
- If
GH_TOKENmissing: clear failure with where to configure it.
- Exec fallback behavior
- When
exechost/policy blocks command execution (e.g., KI-010-like conditions), return a deterministic remediation message:- check
tools.exec.host - check security policy (
security.exec/ allowlist) - avoid silent failure loops.
- check
- For auth-dependent steps, prefer non-interactive env-based flow over interactive
gh auth login.
- NongKung flow checklist update
- Replace prereq item "gh auth login on VPS container" with:
GH_TOKEN/GITHUB_TOKENinjection verifiedcurl https://api.github.com/userwith Bearer token returns 200- optional
gh auth statusonly for diagnostics
- Regression tests / smoke checks
- Add or update smoke checks covering:
- valid
GH_TOKEN+ no gh auth login =>/gh-issues --dry-runworks - missing/invalid token => clear auth error
- exec restricted => clear remediation guidance, not loop
- valid
Acceptance Criteria
- No step in NongKung remote flow requires making
.envworld-readable. /gh-issues ... --dry-runsucceeds using env token only.- Docs no longer conflict on whether
gh auth loginis mandatory. - Auth failures and exec restrictions produce explicit, actionable diagnostics.
References
- Openclaw docs:
docs/cicd/18-nongkung-remote-dev-flow.md - Skill:
skills/gh-issues/SKILL.md - Known Issues: KI-036 (
gh auth statusinvalid token), KI-010 (exec host not allowed)
Suggested Labels
- bug
- docs
- security
- scope:ops
- scope:skills
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels