MCPcopy Create free account
hub / github.com/bytebase/bytebase / getBaseProfile

Function getBaseProfile

backend/bin/server/cmd/profile.go:12–34  ·  view source on GitHub ↗
(dataDir string)

Source from the content-addressed store, hash-verified

10)
11
12func getBaseProfile(dataDir string) *config.Profile {
13 config := &config.Profile{
14 ExternalURL: flags.externalURL,
15 Port: flags.port, // Using flags.port as our gRPC server port.
16 DatastorePort: flags.port + 2, // Using flags.port + 2 as our datastore port.
17 HA: flags.ha,
18 SaaS: flags.saas,
19 Debug: flags.debug,
20 IsDocker: isDocker(),
21 DataDir: dataDir,
22 Version: version,
23 GitCommit: gitcommit,
24 PgURL: os.Getenv("PG_URL"),
25 ReplicaID: uuid.NewString(),
26 StripeAPISecret: os.Getenv("STRIPE_API_SECRET"),
27 StripeWebhookSecret: os.Getenv("STRIPE_WEBHOOK_SECRET"),
28 LicensePrivateKey: os.Getenv("LICENSE_PRIVATE_KEY"),
29 }
30
31 config.LastActiveTS.Store(time.Now().Unix())
32 config.RuntimeMemoryProfileThreshold.Store(flags.memoryProfileThreshold)
33 return config
34}
35
36func isDocker() bool {
37 if _, err := os.Stat("/etc/bb.env"); err == nil {

Callers 2

activeProfileFunction · 0.85
activeProfileFunction · 0.85

Calls 1

isDockerFunction · 0.85

Tested by

no test coverage detected