@envsync-cloud/deploy-cli 0.6.18 → 0.6.20

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -269,6 +269,16 @@ function domainMap(rootDomain) {
269
269
  s3Console: `console.s3.${rootDomain}`
270
270
  };
271
271
  }
272
+ function publicHttpsOrigin(config, host) {
273
+ return `https://${host}${config.services.public_https_port === 443 ? "" : `:${config.services.public_https_port}`}`;
274
+ }
275
+ function publicHttpsOriginVariants(config, host) {
276
+ const canonical = `https://${host}`;
277
+ if (config.services.public_https_port === 443) {
278
+ return [canonical];
279
+ }
280
+ return [canonical, publicHttpsOrigin(config, host)];
281
+ }
272
282
  function getDeployCliVersion() {
273
283
  try {
274
284
  const packageJsonPath = new URL("../package.json", import.meta.url);
@@ -650,6 +660,10 @@ function renderKeycloakRealm(config, runtimeEnv) {
650
660
  }
651
661
  function renderTraefikDynamicConfig(config) {
652
662
  const hosts = domainMap(config.domain.root_domain);
663
+ const otelAllowedOrigins = [
664
+ ...publicHttpsOriginVariants(config, hosts.landing),
665
+ ...publicHttpsOriginVariants(config, hosts.app)
666
+ ];
653
667
  return [
654
668
  "http:",
655
669
  " middlewares:",
@@ -664,8 +678,7 @@ function renderTraefikDynamicConfig(config) {
664
678
  " otel-cors:",
665
679
  " headers:",
666
680
  " accessControlAllowOriginList:",
667
- ` - https://${hosts.landing}`,
668
- ` - https://${hosts.app}`,
681
+ ...otelAllowedOrigins.map((origin) => ` - ${origin}`),
669
682
  " accessControlAllowMethods:",
670
683
  " - POST",
671
684
  " - OPTIONS",
@@ -674,7 +687,7 @@ function renderTraefikDynamicConfig(config) {
674
687
  " - content-type",
675
688
  " - Authorization",
676
689
  " - authorization",
677
- " accessControlAllowCredentials: false",
690
+ " accessControlAllowCredentials: true",
678
691
  " accessControlMaxAge: 600",
679
692
  " addVaryHeader: true",
680
693
  " services:",
@@ -705,10 +718,6 @@ function renderTraefikDynamicConfig(config) {
705
718
  " loadBalancer:",
706
719
  " servers:",
707
720
  " - url: http://clickstack:8080",
708
- " clickstack-api:",
709
- " loadBalancer:",
710
- " servers:",
711
- " - url: http://clickstack:8000",
712
721
  " clickstack-otlp:",
713
722
  " loadBalancer:",
714
723
  " servers:",
@@ -736,7 +745,7 @@ function renderTraefikDynamicConfig(config) {
736
745
  " certResolver: letsencrypt",
737
746
  " obs-api-router:",
738
747
  ` rule: Host(\`${hosts.obs}\`) && PathPrefix(\`/api\`)`,
739
- " service: clickstack-api",
748
+ " service: clickstack-ui",
740
749
  " priority: 90",
741
750
  " entryPoints: [websecure]",
742
751
  " tls:",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envsync-cloud/deploy-cli",
3
- "version": "0.6.18",
3
+ "version": "0.6.20",
4
4
  "description": "CLI for self-hosted EnvSync deployment on Docker Swarm",
5
5
  "type": "module",
6
6
  "bin": {