[NET-546] Move ee code to ee package, unify ee status and terminology (#2538)

* Move ee code to ee package and unify ee status to IsPro

* Consolidate naming for paid/professional/enterprise version as "pro". Notes:

- Changes image tags
- Changes build tags
- Changes package names
- Doesn't change links to docs that mention "ee"
- Doesn't change parameters sent to PostHog that mention "ee"

* Revert docker image tag being -pro, back to -ee

* Revert go build tag being pro, back to ee

* Add build tags for some ee content

* [2] Revert go build tag being pro, back to ee

* Fix test workflow

* Add a json tag to be backwards compatible with frontend "IsEE" check

* Add a json tag for the serverconfig struct for IsEE

* Ammend json tag to Is_EE

* fix ee tags

---------

Co-authored-by: Abhishek Kondur <abhi281342@gmail.com>
This commit is contained in:
Gabriel de Souza Seibel
2023-08-31 23:12:05 -03:00
committed by GitHub
parent 31fcc8cd6d
commit 1a1ba1ccf4
50 changed files with 753 additions and 716 deletions

View File

@@ -13,7 +13,6 @@ import (
// flags to keep for telemetry
var isFreeTier bool
var isEE bool
// posthog_pub_key - Key for sending data to PostHog
const posthog_pub_key = "phc_1vEXhPOA1P7HP5jP2dVU9xDTUqXHAelmtravyZ1vvES"
@@ -21,14 +20,8 @@ const posthog_pub_key = "phc_1vEXhPOA1P7HP5jP2dVU9xDTUqXHAelmtravyZ1vvES"
// posthog_endpoint - Endpoint of PostHog server
const posthog_endpoint = "https://app.posthog.com"
// setEEForTelemetry - store EE flag without having an import cycle when used for telemetry
// (as the ee package needs the logic package as currently written).
func SetEEForTelemetry(eeFlag bool) {
isEE = eeFlag
}
// setFreeTierForTelemetry - store free tier flag without having an import cycle when used for telemetry
// (as the ee package needs the logic package as currently written).
// (as the pro package needs the logic package as currently written).
func SetFreeTierForTelemetry(freeTierFlag bool) {
isFreeTier = freeTierFlag
}
@@ -73,7 +66,7 @@ func sendTelemetry() error {
Set("docker", d.Count.Docker).
Set("k8s", d.Count.K8S).
Set("version", d.Version).
Set("is_ee", isEE).
Set("is_ee", d.IsPro). // TODO change is_ee to is_pro for consistency, but probably needs changes in posthog
Set("is_free_tier", isFreeTier),
})
}
@@ -82,6 +75,7 @@ func sendTelemetry() error {
func fetchTelemetryData() (telemetryData, error) {
var data telemetryData
data.IsPro = servercfg.IsPro
data.ExtClients = getDBLength(database.EXT_CLIENT_TABLE_NAME)
data.Users = getDBLength(database.USERS_TABLE_NAME)
data.Networks = getDBLength(database.NETWORKS_TABLE_NAME)
@@ -176,7 +170,7 @@ type telemetryData struct {
Networks int
Servers int
Version string
IsEE bool
IsPro bool
IsFreeTier bool
}