Skip to content

Fix provider OAuth with non-localhost callback urls #21454

@colinmollenhour

Description

@colinmollenhour

Description

I run OpenCode on a separate compute and access it through tailscale so when I run the provider connections like OpenAI, Z.AI, etc they typically load a localhost-based url at the end to pass the auth code back to opencode. I know to either copy this url and run it on my remote host with curl or modify it to use my tailscale hostname, but many users might not know to do this and it's clunky.

I propose that an environment variable like OPENCODE_REMOTE_URL_HOST=my-tail-name be supported so that remote callback urls can be constructed according to the environment.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions