Skip to content

Conversation

@sgao640
Copy link
Contributor

@sgao640 sgao640 commented Oct 22, 2025

@livefire2015
Copy link
Collaborator

Could you use AI to post a summary in each PR?

@sgao640
Copy link
Contributor Author

sgao640 commented Oct 22, 2025

Purpose: Add environment-driven URL generation strategy support to the server config.

File changed: pkg/simplecontent/config/env.go.

New env vars:

  • URL_STRATEGY (allowed: "content-based", "storage-delegated", "cdn")
  • API_BASE_URL
  • CDN_BASE_URL
  • UPLOAD_BASE_URL

Implementation:

  • Adds applyURLStrategyEnv which reads/validates those env vars and sets ServerConfig fields (URLStrategy, APIBaseURL, CDNBaseURL, UploadBaseURL).
  • WithEnv now calls applyURLStrategyEnv during env parsing.

Validation: rejects unknown URL_STRATEGY values; other vars are applied if present.

No tests or additional validation (e.g., URL format or storage compatibility) included in this PR.

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.

2 participants