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

tod: template-wide default server URL; users only need ONEDEV_TOKEN - #24

Merged
lightningspirit merged 1 commit into
mainfrom
tod-default-url
Oct 14, 2026
Merged

lightningspirit merged 1 commit into
mainfrom
tod-default-url

Conversation

@lightningspirit

Copy link
Copy Markdown
Contributor

Summary

Every user uses the same OneDev server, so the URL is now a template default and each user only needs the ONEDEV_TOKEN user secret.

  • main.tf: variable onedev_url (https://host[:port] or empty) → agent env ONEDEV_DEFAULT_SERVER_URL. A separate name, so it never conflicts with a user secret.
  • build/tod-env.sh (the /usr/local/bin/tod wrapper), server URL precedence: ONEDEV_SERVER_URL (user secret) → tod config file (read with tod config get server-url, tod's own parser) → template default. Token mapping unchanged.
  • Smoke test: default used when nothing else is set; a user value wins.
  • READMEs: only the ONEDEV_TOKEN secret (with the coder secret create command); vars.example.yaml has onedev_url again.
  • Image tags: node v0.9.0, php-wordpress v0.9.0, ops v0.8.0.

Existing workspaces

Nothing changes until a workspace is updated. After the update: users with an ONEDEV_SERVER_URL secret or a tod config server URL keep it (they win over the default); the token handling is unchanged.

Checks

  • Local precedence test: none → empty; default only → default; secret + default → secret; config file + default → file; secret + file + default → secret
  • Local node-js build: smoke test passes; just lint, just validate pass

Release

vars.yaml needs onedev_url (set in the release workspace).

🤖 Generated with Claude Code

- Template variable onedev_url -> agent env ONEDEV_DEFAULT_SERVER_URL (own
  name: no conflict with a user secret).
- tod wrapper: server URL = ONEDEV_SERVER_URL, else the tod config file,
  else the template default.
- Smoke test checks the default and that a user value wins. READMEs:
  only the ONEDEV_TOKEN secret is needed. Image tags: node/php v0.9.0,
  ops v0.8.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lightningspirit
lightningspirit merged commit bed381d into main Oct 14, 2026
7 checks passed
@lightningspirit
lightningspirit deleted the tod-default-url branch October 14, 2026 14:35
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