@envsync-cloud/deploy 0.20.7 → 0.20.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -293,6 +293,7 @@ function domainMap(rootDomain) {
293
293
  api: `api.${rootDomain}`,
294
294
  auth: `auth.${rootDomain}`,
295
295
  obs: `obs.${rootDomain}`,
296
+ track: `t.${rootDomain}`,
296
297
  mail: `mail.${rootDomain}`,
297
298
  s3: `s3.${rootDomain}`,
298
299
  s3Console: `console.s3.${rootDomain}`
@@ -438,6 +439,9 @@ function buildRuntimeEnv2(config, generated, options) {
438
439
  OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-agent:4318",
439
440
  OTEL_SERVICE_NAME: "envsync-api",
440
441
  OTEL_SDK_DISABLED: "false",
442
+ POSTHOG_KEY: config.analytics?.posthog_key || process.env.POSTHOG_KEY || "",
443
+ POSTHOG_HOST: config.analytics?.posthog_host || process.env.POSTHOG_HOST || "https://eu.i.posthog.com",
444
+ ENVSYNC_POSTHOG_DISABLED: config.analytics?.disabled ? "true" : process.env.ENVSYNC_POSTHOG_DISABLED || "false",
441
445
  CLICKSTACK_URL: publicHttpsUrl(config, hosts.obs),
442
446
  KEYCLOAK_IMAGE_TAG: keycloakImageTag(config.images.keycloak),
443
447
  // Is this too hacky? We go Shawn way.
@@ -639,6 +643,12 @@ function renderTraefikDynamicConfig(config, generated) {
639
643
  ` service: ${apiServiceName}`,
640
644
  " entryPoints: [websecure]",
641
645
  " tls:",
646
+ " certResolver: letsencrypt",
647
+ " track-router:",
648
+ ` rule: Host(\`${hosts.track}\`)`,
649
+ ` service: ${apiServiceName}`,
650
+ " entryPoints: [websecure]",
651
+ " tls:",
642
652
  " certResolver: letsencrypt"
643
653
  ].join("\n") + "\n";
644
654
  }
@@ -682,7 +692,8 @@ function renderApiMaintenanceConf() {
682
692
  }
683
693
  function renderFrontendRuntimeConfig(config, generated) {
684
694
  const hosts = domainMap(config.domain.root_domain);
685
- const otelEndpoint = publicHttpsUrl(config, hosts.obs);
695
+ const otelEndpoint = publicHttpsUrl(config, hosts.track, "/obs");
696
+ const posthogProxy = publicHttpsUrl(config, hosts.track, "/ph");
686
697
  const managementApiEnabled = !isOssConfig(config);
687
698
  const activeReleaseVersion = generated.deployment.slots[generated.deployment.active_slot].release_version || config.release.version;
688
699
  const apiBaseUrl = publicHttpsUrl(config, hosts.api);
@@ -709,6 +720,9 @@ function renderFrontendRuntimeConfig(config, generated) {
709
720
  hyperdxUrl: otelEndpoint,
710
721
  hyperdxDisabled: generated.clickstack.browser_api_key.length === 0,
711
722
  hyperdxAdvancedNetworkCapture: false,
723
+ posthogKey: config.analytics?.posthog_key || process.env.POSTHOG_KEY || void 0,
724
+ posthogHost: config.analytics?.posthog_host || process.env.POSTHOG_HOST || posthogProxy,
725
+ posthogDisabled: Boolean(config.analytics?.disabled) || process.env.ENVSYNC_POSTHOG_DISABLED === "true",
712
726
  releaseVersion: activeReleaseVersion,
713
727
  activeApiSlot: generated.deployment.active_slot
714
728
  }, null, 2)};
@@ -2073,6 +2087,7 @@ function domainMap2(rootDomain) {
2073
2087
  api: `api.${rootDomain}`,
2074
2088
  auth: `auth.${rootDomain}`,
2075
2089
  obs: `obs.${rootDomain}`,
2090
+ track: `t.${rootDomain}`,
2076
2091
  mail: `mail.${rootDomain}`,
2077
2092
  s3: `s3.${rootDomain}`,
2078
2093
  s3Console: `console.s3.${rootDomain}`
@@ -2428,7 +2443,12 @@ function normalizeConfig(raw) {
2428
2443
  } : raw.edition === "oss" ? void 0 : {
2429
2444
  install_fingerprint: deterministicInstallFingerprint(rootDomain, stackName),
2430
2445
  certificate_validity_days: 1095
2431
- }
2446
+ },
2447
+ analytics: raw.analytics ? {
2448
+ posthog_key: raw.analytics.posthog_key,
2449
+ posthog_host: raw.analytics.posthog_host,
2450
+ disabled: raw.analytics.disabled
2451
+ } : void 0
2432
2452
  };
2433
2453
  }
2434
2454
  function emptyGeneratedState() {
@@ -4571,7 +4591,8 @@ async function cmdHealth(asJson) {
4571
4591
  app: publicHttpsUrl2(config, hosts.app),
4572
4592
  api: publicHttpsUrl2(config, hosts.api, "/health"),
4573
4593
  auth: publicHttpsUrl2(config, hosts.auth, `/realms/${config.auth.keycloak_realm}/.well-known/openid-configuration`),
4574
- obs: publicHttpsUrl2(config, hosts.obs)
4594
+ obs: publicHttpsUrl2(config, hosts.obs),
4595
+ track: publicHttpsUrl2(config, hosts.track)
4575
4596
  },
4576
4597
  frontend_runtime: {
4577
4598
  web: {
package/dist/index.js CHANGED
@@ -294,6 +294,7 @@ function domainMap(rootDomain) {
294
294
  api: `api.${rootDomain}`,
295
295
  auth: `auth.${rootDomain}`,
296
296
  obs: `obs.${rootDomain}`,
297
+ track: `t.${rootDomain}`,
297
298
  mail: `mail.${rootDomain}`,
298
299
  s3: `s3.${rootDomain}`,
299
300
  s3Console: `console.s3.${rootDomain}`
@@ -439,6 +440,9 @@ function buildRuntimeEnv2(config, generated, options) {
439
440
  OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-agent:4318",
440
441
  OTEL_SERVICE_NAME: "envsync-api",
441
442
  OTEL_SDK_DISABLED: "false",
443
+ POSTHOG_KEY: config.analytics?.posthog_key || process.env.POSTHOG_KEY || "",
444
+ POSTHOG_HOST: config.analytics?.posthog_host || process.env.POSTHOG_HOST || "https://eu.i.posthog.com",
445
+ ENVSYNC_POSTHOG_DISABLED: config.analytics?.disabled ? "true" : process.env.ENVSYNC_POSTHOG_DISABLED || "false",
442
446
  CLICKSTACK_URL: publicHttpsUrl(config, hosts.obs),
443
447
  KEYCLOAK_IMAGE_TAG: keycloakImageTag(config.images.keycloak),
444
448
  // Is this too hacky? We go Shawn way.
@@ -640,6 +644,12 @@ function renderTraefikDynamicConfig(config, generated) {
640
644
  ` service: ${apiServiceName}`,
641
645
  " entryPoints: [websecure]",
642
646
  " tls:",
647
+ " certResolver: letsencrypt",
648
+ " track-router:",
649
+ ` rule: Host(\`${hosts.track}\`)`,
650
+ ` service: ${apiServiceName}`,
651
+ " entryPoints: [websecure]",
652
+ " tls:",
643
653
  " certResolver: letsencrypt"
644
654
  ].join("\n") + "\n";
645
655
  }
@@ -683,7 +693,8 @@ function renderApiMaintenanceConf() {
683
693
  }
684
694
  function renderFrontendRuntimeConfig(config, generated) {
685
695
  const hosts = domainMap(config.domain.root_domain);
686
- const otelEndpoint = publicHttpsUrl(config, hosts.obs);
696
+ const otelEndpoint = publicHttpsUrl(config, hosts.track, "/obs");
697
+ const posthogProxy = publicHttpsUrl(config, hosts.track, "/ph");
687
698
  const managementApiEnabled = !isOssConfig(config);
688
699
  const activeReleaseVersion = generated.deployment.slots[generated.deployment.active_slot].release_version || config.release.version;
689
700
  const apiBaseUrl = publicHttpsUrl(config, hosts.api);
@@ -710,6 +721,9 @@ function renderFrontendRuntimeConfig(config, generated) {
710
721
  hyperdxUrl: otelEndpoint,
711
722
  hyperdxDisabled: generated.clickstack.browser_api_key.length === 0,
712
723
  hyperdxAdvancedNetworkCapture: false,
724
+ posthogKey: config.analytics?.posthog_key || process.env.POSTHOG_KEY || void 0,
725
+ posthogHost: config.analytics?.posthog_host || process.env.POSTHOG_HOST || posthogProxy,
726
+ posthogDisabled: Boolean(config.analytics?.disabled) || process.env.ENVSYNC_POSTHOG_DISABLED === "true",
713
727
  releaseVersion: activeReleaseVersion,
714
728
  activeApiSlot: generated.deployment.active_slot
715
729
  }, null, 2)};
@@ -1935,6 +1949,7 @@ function domainMap2(rootDomain) {
1935
1949
  api: `api.${rootDomain}`,
1936
1950
  auth: `auth.${rootDomain}`,
1937
1951
  obs: `obs.${rootDomain}`,
1952
+ track: `t.${rootDomain}`,
1938
1953
  mail: `mail.${rootDomain}`,
1939
1954
  s3: `s3.${rootDomain}`,
1940
1955
  s3Console: `console.s3.${rootDomain}`
@@ -2290,7 +2305,12 @@ function normalizeConfig(raw) {
2290
2305
  } : raw.edition === "oss" ? void 0 : {
2291
2306
  install_fingerprint: deterministicInstallFingerprint(rootDomain, stackName),
2292
2307
  certificate_validity_days: 1095
2293
- }
2308
+ },
2309
+ analytics: raw.analytics ? {
2310
+ posthog_key: raw.analytics.posthog_key,
2311
+ posthog_host: raw.analytics.posthog_host,
2312
+ disabled: raw.analytics.disabled
2313
+ } : void 0
2294
2314
  };
2295
2315
  }
2296
2316
  function emptyGeneratedState() {
@@ -4428,7 +4448,8 @@ async function cmdHealth(asJson) {
4428
4448
  app: publicHttpsUrl2(config, hosts.app),
4429
4449
  api: publicHttpsUrl2(config, hosts.api, "/health"),
4430
4450
  auth: publicHttpsUrl2(config, hosts.auth, `/realms/${config.auth.keycloak_realm}/.well-known/openid-configuration`),
4431
- obs: publicHttpsUrl2(config, hosts.obs)
4451
+ obs: publicHttpsUrl2(config, hosts.obs),
4452
+ track: publicHttpsUrl2(config, hosts.track)
4432
4453
  },
4433
4454
  frontend_runtime: {
4434
4455
  web: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envsync-cloud/deploy",
3
- "version": "0.20.7",
3
+ "version": "0.20.8",
4
4
  "description": "OSS CLI for self-hosted EnvSync deployment on Docker Swarm",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,7 +46,7 @@
46
46
  "zod": "^3.25.76"
47
47
  },
48
48
  "devDependencies": {
49
- "@envsync-cloud/deploy-core": "0.20.7",
49
+ "@envsync-cloud/deploy-core": "0.20.8",
50
50
  "tsup": "^8.5.0",
51
51
  "typescript": "^5.9.2"
52
52
  },