Skip to content

Add config options for OAuth callback hostname and port (CEA-122) - #69

Merged
Connoropolous merged 5 commits into
mainfrom
cea-122-add-oauth-hostname-config
Jun 25, 2025
Merged

Add config options for OAuth callback hostname and port (CEA-122)#69
Connoropolous merged 5 commits into
mainfrom
cea-122-add-oauth-hostname-config

Conversation

@cyrusagent

@cyrusagent cyrusagent commented Jun 25, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Add OAUTH_CALLBACK_BASE_URL environment variable (defaults to 'http://localhost:3457')
  • Replace hardcoded localhost:3457 references with configurable base URL
  • Fixes issue where OAuth callback URL was hardcoded and couldn't be customized for different environments
  • Provides full flexibility without assuming port format

Changes

  • Modified apps/cli/app.ts to use OAUTH_CALLBACK_BASE_URL environment variable
  • Updated OAuth URL construction, console output, and HTML templates to use configurable base URL
  • Maintains backward compatibility with existing defaults
  • Allows users to specify complete URLs with or without ports

Test plan

  • Test with default values (should work exactly as before)
  • Test with custom OAUTH_CALLBACK_BASE_URL=https://my-domain.com
  • Test with custom OAUTH_CALLBACK_BASE_URL=http://my-host:8080
  • Verify OAuth flow completes successfully with custom values
  • Check that console output and HTML templates show correct URLs

Usage

# Examples of different base URL configurations:
export OAUTH_CALLBACK_BASE_URL=https://my-domain.com
# OAuth callback will use: https://my-domain.com/callback

export OAUTH_CALLBACK_BASE_URL=http://my-host:8080  
# OAuth callback will use: http://my-host:8080/callback

# Default (no env var set):
# OAuth callback will use: http://localhost:3457/callback

This approach provides maximum flexibility - users can specify the complete base URL (with or without port, HTTP or HTTPS) and the system simply appends /callback to it.

Closes CEA-122

🤖 Generated with Claude Code

cyrusagent and others added 3 commits June 25, 2025 13:06
- Add OAUTH_CALLBACK_HOSTNAME environment variable (defaults to 'localhost')
- Add OAUTH_CALLBACK_PORT environment variable (defaults to '3457')
- Update all hardcoded localhost:3457 references to use these config options
- Fixes issue where OAuth callback URL was hardcoded and couldn't be customized for different environments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace OAUTH_CALLBACK_HOSTNAME and OAUTH_CALLBACK_PORT with single OAUTH_CALLBACK_BASE_URL
- Defaults to 'http://localhost:3457' (maintains backward compatibility)
- Users can now set complete base URLs without assuming port format:
  - OAUTH_CALLBACK_BASE_URL=https://my-domain.com
  - OAUTH_CALLBACK_BASE_URL=http://my-host:8080
  - OAUTH_CALLBACK_BASE_URL=http://localhost:3457 (default)
- Updated all OAuth URL construction, console output, and HTML templates

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Document new OAUTH_CALLBACK_BASE_URL environment variable
- Note support for configurable OAuth callback URLs for different deployment environments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Reference PR #69 in changelog for OAuth callback configuration feature

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jakeleventhal

Copy link
Copy Markdown
Contributor

@Connoropolous before this merges... i dont know if you want this set in global env. is there not a config file to load this into? OAUTH_CALLBACK_BASE_URL is also super generic for globla env and may clash with other projects/services etc

prefer if theres a .cyrus file or something where you configure this type of thing

Copy link
Copy Markdown
Contributor

gotcha… there is a --env-file=path option now I think, to specify that's how you want env vars loaded. I can also tweak the namespace of those env vars a bit 👍

- Rename OAUTH_CALLBACK_PORT to CYRUS_OAUTH_CALLBACK_PORT
- Rename OAUTH_CALLBACK_BASE_URL to CYRUS_OAUTH_CALLBACK_BASE_URL
- Update all references in OAuth URL construction, HTML templates, and console output
- Update changelog to document both variables and --env-file option support
- Maintains backward compatibility with same default values

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Connoropolous
Connoropolous merged commit 6a8f90e into main Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants