From ff3f8fdd8d35d5e92fc7e5cacaaf472d6cb14d30 Mon Sep 17 00:00:00 2001 From: Aditya-Rai-25 Date: Wed, 20 May 2026 17:41:54 +0530 Subject: [PATCH 1/2] refactor: allow production license URL override - 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. --- config/environments/production.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 475188b..dc55638 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -73,11 +73,8 @@ config.cache_store = :redis_cache_store, cache_store_config end - config.license_url = if ENV["LAGO_CLOUD"] == "true" && ENV["RAILS_ENV"] == "staging" - "http://license-web.default.svc.cluster.local" - else - "https://license.getlago.com" - end + # Allow self-hosted deployments to override the license verification endpoint. + config.license_url = ENV.fetch("LAGO_LICENSE_URL", "https://license.getlago.com") if ENV["LAGO_SMTP_ADDRESS"].present? && !ENV["LAGO_SMTP_ADDRESS"].empty? config.action_mailer.delivery_method = :smtp From 6788d989f8f898c816a241d540ec506636c63bd4 Mon Sep 17 00:00:00 2001 From: Aditya-Rai-25 Date: Wed, 20 May 2026 18:49:21 +0530 Subject: [PATCH 2/2] fix review commenti - Refactor production license URL to support LAGO_LICENSE_URL override while preserving cloud staging fallback --- config/environments/production.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index dc55638..ed1bf56 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -74,7 +74,13 @@ end # Allow self-hosted deployments to override the license verification endpoint. - config.license_url = ENV.fetch("LAGO_LICENSE_URL", "https://license.getlago.com") + 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 if ENV["LAGO_SMTP_ADDRESS"].present? && !ENV["LAGO_SMTP_ADDRESS"].empty? config.action_mailer.delivery_method = :smtp