Open platform to collect and prioritize feedback
Various tweaks around multi / single commercial stuff.
Matt Roberts3e460cdfa5c0
diff --git a/app/pkg/env/env.go b/app/pkg/env/env.goindex 406892180..2559a2077 100644--- a/app/pkg/env/env.go+++ b/app/pkg/env/env.go@@ -242,9 +242,10 @@ func MultiTenantDomain() string {return ""}-// IsBillingEnabled returns true if Stripe is configured+// IsBillingEnabled returns true if Stripe is configured and running in multi-tenant mode+// Billing is only available in multi-tenant hosted mode, not in single-host self-hosted modefunc IsBillingEnabled() bool {- return Config.Stripe.SecretKey != ""+ return IsMultiHostMode() && Config.Stripe.SecretKey != ""}// IsMultiHostMode returns true if host mode is set to multi tenantdiff --git a/commercial/LICENSE b/commercial/LICENSEindex 4c4d6f386..abc043ae6 100644--- a/commercial/LICENSE+++ b/commercial/LICENSE@@ -13,8 +13,9 @@ RESTRICTIONS:PERMITTED USES:- You may view this Software's source code for evaluation purposes only.-- Licensed users with valid commercial agreements may use this Software in accordance- with their license terms.+- You may use this Software in non-production development and testing environments.+- Licensed users with valid commercial agreements may use this Software in production+ in accordance with their license terms.NO WARRANTY:This Software is provided "as is", without warranty of any kind, express or implied,diff --git a/commercial/init.go b/commercial/init.goindex 02e0affa0..8572f3b9d 100644--- a/commercial/init.go+++ b/commercial/init.go@@ -24,8 +24,18 @@ func init() {ctx := context.Background()var svc *commercialLicenseService- if env.IsSingleHostMode() && env.Config.License.Key != "" {- // Self-hosted with license key: validate at startup+ // Development/test mode: enable all commercial features without license key+ // Note: Production use of commercial features requires a valid license+ if env.Config.Environment != "production" {+ svc = &commercialLicenseService{+ isValid: true,+ tenantID: 0,+ }+ log.Warnf(ctx, "Running in @{Environment} mode - commercial features enabled for development/testing. Production use requires a license from https://fider.io", dto.Props{+ "Environment": env.Config.Environment,+ })+ } else if env.IsSingleHostMode() && env.Config.License.Key != "" {+ // Production self-hosted with license key: validate at startupresult := license.ValidateKey(env.Config.License.Key)if !result.IsValid {panic(result.Error)