init_ee.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //go:build ee
  2. // +build ee
  3. package loader
  4. import (
  5. // TODO: delete once the billing code is cleaned up
  6. // eeBilling "github.com/porter-dev/porter/ee/billing"
  7. "github.com/porter-dev/porter/ee/models"
  8. )
  9. func init() {
  10. sharedInit()
  11. InstanceDB.AutoMigrate(
  12. &models.ProjectBilling{},
  13. &models.UserBilling{},
  14. )
  15. var key [32]byte
  16. for i, b := range []byte(InstanceEnvConf.DBConf.EncryptionKey) {
  17. key[i] = b
  18. }
  19. // TODO: delete once the billing code is cleaned up
  20. // if InstanceEnvConf.ServerConf.BillingPrivateServerURL != "" && InstanceEnvConf.ServerConf.BillingPrivateKey != "" && InstanceEnvConf.ServerConf.BillingPublicServerURL != "" {
  21. // serverURL := InstanceEnvConf.ServerConf.BillingPrivateServerURL
  22. // publicServerURL := InstanceEnvConf.ServerConf.BillingPublicServerURL
  23. // apiKey := InstanceEnvConf.ServerConf.BillingPrivateKey
  24. // var err error
  25. // InstanceBillingManager, err = eeBilling.NewClient(serverURL, publicServerURL, apiKey)
  26. // if err != nil {
  27. // panic(err)
  28. // }
  29. // } else {
  30. // InstanceBillingManager = &billing.StripeBillingManager{}
  31. // }
  32. }