Skip to content
This repository was archived by the owner on Oct 14, 2026. It is now read-only.

tod: use the Coder user secrets ONEDEV_SERVER_URL and ONEDEV_TOKEN - #23

Merged
lightningspirit merged 1 commit into
mainfrom
tod-coder-secrets
Oct 14, 2026
Merged

lightningspirit merged 1 commit into
mainfrom
tod-coder-secrets

Conversation

@lightningspirit

Copy link
Copy Markdown
Contributor

Summary

Users already have Coder user secrets ONEDEV_SERVER_URL and ONEDEV_TOKEN in their workspaces. tod reads ONEDEV_SERVER_URL directly, but the token as ONEDEV_ACCESS_TOKEN.

  • /usr/local/bin/tod is a wrapper (build/tod-env.sh): if ONEDEV_ACCESS_TOKEN is unset and ONEDEV_TOKEN is set, it exports ONEDEV_ACCESS_TOKEN=$ONEDEV_TOKEN, then exec /usr/local/lib/tod/tod. Works for terminals, scripts and Claude Code.
  • Remove the onedev_url template variable (added in Add the OneDev CLI (tod) and its Claude Code skills to all images #22): the URL comes from the user secret, so there is one source and no question which of template env and user secret wins. Remove onedev_url from your vars.yaml (done in this workspace) before the next release, or the push fails on an undeclared variable.
  • Without secrets, tod config set still works (config file).
  • Smoke test: no token without env; token present with only ONEDEV_TOKEN.
  • READMEs: set the two user secrets; note that an env token is readable by any process in the workspace, Claude Code included (use a minimal-scope token).
  • Image tags: node v0.8.0, php-wordpress v0.8.0, ops v0.7.0. main.tf is otherwise back to its pre-Add the OneDev CLI (tod) and its Claude Code skills to all images #22 content.

Checks

  • Local test of the wrapper: unset → none; ONEDEV_TOKEN only → used; ONEDEV_ACCESS_TOKEN="" explicit → kept empty; both set → ONEDEV_ACCESS_TOKEN wins
  • Local node-js build: smoke test passes; just lint, just validate pass

🤖 Generated with Claude Code

- /usr/local/bin/tod is now a wrapper (build/tod-env.sh): when
  ONEDEV_ACCESS_TOKEN is unset, it uses ONEDEV_TOKEN; the binary moves to
  /usr/local/lib/tod/tod.
- Remove the onedev_url template variable: ONEDEV_SERVER_URL comes from the
  user secret (one source, no precedence question).
- Smoke test checks the mapping; READMEs: set the two user secrets, or
  tod config set. Image tags: node/php v0.8.0, ops v0.7.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lightningspirit
lightningspirit merged commit 9522f37 into main Oct 14, 2026
7 checks passed
@lightningspirit
lightningspirit deleted the tod-coder-secrets branch October 14, 2026 13:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant