refactor: allow production license URL override#5
Open
Aditya-Rai-25 wants to merge 2 commits into
Open
Conversation
- Use the LAGO_LICENSE_URL environment variable to override the production license verification URL. - This allows a custom entitlement API server to receive the license verification request and validate the configured LAGO_LICENSE key.
njonty
requested changes
May 20, 2026
njonty
left a comment
Contributor
There was a problem hiding this comment.
The PR removes the existing staging/Lago Cloud behavior:
LAGO_CLOUD=true + RAILS_ENV=staging previously used http://license-web.default.svc.cluster.local
Now it always uses LAGO_LICENSE_URL or falls back to https://license.getlago.com . That may break staging cloud deployments unless they explicitly set LAGO_LICENSE_URL.
Suggested fix:
config.license_url = ENV.fetch("LAGO_LICENSE_URL") do
if ENV["LAGO_CLOUD"] == "true" && ENV["RAILS_ENV"] == "staging"
"http://license-web.default.svc.cluster.local"
else
"https://license.getlago.com"
end
end
- Refactor production license URL to support LAGO_LICENSE_URL override while preserving cloud staging fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue No: #6
This PR refactors the production license verification flow to support a configurable license verification URL.
The LAGO_LICENSE_URL environment variable can now be used to override the default production Lago license verification URL. This allows Mango Cloud deployments to route license verification requests to a custom entitlement API server, which can validate the configured LAGO_LICENSE key.
Changes include:
This change is required for Mango Cloud billing integration, where license verification needs to be handled by a custom entitlement API server instead of the default upstream Lago license verification endpoint.