@envsync-cloud/deploy-cli 0.8.11 → 0.8.13

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 +61 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4400,6 +4400,7 @@ function buildRuntimeEnv2(config, generated) {
4400
4400
  const oss = isOssConfig(config);
4401
4401
  const enterprise = !oss;
4402
4402
  const license = config.license ?? {};
4403
+ const accessProxy = config.access_proxy;
4403
4404
  return {
4404
4405
  NODE_ENV: "production",
4405
4406
  ENVSYNC_EDITION: oss ? "oss" : "enterprise",
@@ -4428,6 +4429,13 @@ function buildRuntimeEnv2(config, generated) {
4428
4429
  POSTGRES_USER: "postgres",
4429
4430
  POSTGRES_PASSWORD: "envsync-postgres",
4430
4431
  POSTGRES_DB: "envsync",
4432
+ ENVSYNC_ACCESS_PROXY_ENABLED: `${accessProxy?.enabled ?? false}`,
4433
+ ENVSYNC_ACCESS_PROXY_PROVIDER: accessProxy?.provider ?? "",
4434
+ ENVSYNC_ACCESS_PROXY_DOMAIN: accessProxy?.domain ?? "",
4435
+ ENVSYNC_ACCESS_PROXY_SERVICE_SCOPE: accessProxy?.service_scope ?? "all",
4436
+ ENVSYNC_ACCESS_PROXY_SERVICES: Array.isArray(accessProxy?.services) ? accessProxy.services.join(",") : "",
4437
+ ENVSYNC_ACCESS_PROXY_ADVERTISE_ROUTES: `${accessProxy?.advertise_routes ?? false}`,
4438
+ ENVSYNC_ACCESS_PROXY_INCLUDE_ADMIN_SERVICES: `${accessProxy?.include_admin_services ?? false}`,
4431
4439
  S3_BUCKET: bucketName,
4432
4440
  S3_REGION: "us-east-1",
4433
4441
  S3_ACCESS_KEY: "envsync-rustfs",
@@ -4737,11 +4745,16 @@ function renderFrontendRuntimeConfig(config, generated) {
4737
4745
  const otelEndpoint = publicHttpsUrl(config, hosts.obs);
4738
4746
  const managementApiEnabled = !isOssConfig(config);
4739
4747
  const activeReleaseVersion = generated.deployment.slots[generated.deployment.active_slot].release_version || config.release.version;
4748
+ const accessProxy = config.access_proxy;
4740
4749
  const managementApiUrl = managementApiEnabled ? publicHttpsUrl(config, hosts.manage_api) : "";
4741
4750
  return `window.__ENVSYNC_RUNTIME_CONFIG__ = ${JSON.stringify({
4742
4751
  apiBaseUrl: publicHttpsUrl(config, hosts.api),
4743
4752
  appBaseUrl: publicHttpsUrl(config, hosts.app),
4744
4753
  authBaseUrl: publicHttpsUrl(config, hosts.auth),
4754
+ accessProxyEnabled: accessProxy?.enabled ?? false,
4755
+ accessProxyDomain: accessProxy?.domain ?? "",
4756
+ accessProxyServiceScope: accessProxy?.service_scope ?? "all",
4757
+ accessProxyServices: accessProxy?.services ?? [],
4745
4758
  managementApiUrl,
4746
4759
  keycloakRealm: config.auth.keycloak_realm,
4747
4760
  webClientId: config.auth.web_client_id,
@@ -5462,6 +5475,12 @@ function parseEnvFile(content) {
5462
5475
  }
5463
5476
  return out;
5464
5477
  }
5478
+ function asBool(value) {
5479
+ return value.trim().toLowerCase() === "true" || value.trim().toLowerCase() === "y" || value.trim().toLowerCase() === "yes";
5480
+ }
5481
+ function asStringList(value) {
5482
+ return value.split(",").map((item) => item.trim()).filter((item) => item.length > 0);
5483
+ }
5465
5484
  async function ask(question, fallback = "") {
5466
5485
  if (!process.stdin.isTTY) return fallback;
5467
5486
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
@@ -5803,6 +5822,30 @@ function normalizeConfig(raw) {
5803
5822
  } : raw.edition === "oss" ? void 0 : {
5804
5823
  install_fingerprint: deterministicInstallFingerprint(rootDomain, stackName),
5805
5824
  certificate_validity_days: 1095
5825
+ },
5826
+ access_proxy: {
5827
+ enabled: raw.access_proxy?.enabled ?? false,
5828
+ provider: "tsdproxy",
5829
+ auth_token: raw.access_proxy?.auth_token ?? "",
5830
+ domain: raw.access_proxy?.domain ?? `tsdproxy.${rootDomain}`,
5831
+ service_scope: raw.access_proxy?.service_scope === "selected" ? "selected" : "all",
5832
+ services: Array.isArray(raw.access_proxy?.services) ? raw.access_proxy.services.filter((s) => typeof s === "string" && s.trim().length > 0) : [
5833
+ "api",
5834
+ "web",
5835
+ "landing",
5836
+ "keycloak",
5837
+ "openfga",
5838
+ "postgre*",
5839
+ "redis",
5840
+ "rustfs",
5841
+ "clickstack",
5842
+ "obs",
5843
+ "envsync_api_*",
5844
+ "envsync_management-api",
5845
+ "envsync-api"
5846
+ ],
5847
+ advertise_routes: raw.access_proxy?.advertise_routes ?? false,
5848
+ include_admin_services: raw.access_proxy?.include_admin_services ?? false
5806
5849
  }
5807
5850
  };
5808
5851
  }
@@ -7212,6 +7255,14 @@ async function cmdSetup() {
7212
7255
  const licenseKey = licenseServerUrl ? await ask("Enterprise license key", "") : "";
7213
7256
  const certificateBundleFile = licenseServerUrl ? "" : await ask("Enterprise certificate bundle file (optional)", "");
7214
7257
  const installFingerprint = deterministicInstallFingerprint(rootDomain, "envsync");
7258
+ const enableAccessProxy = asBool(await ask("Enable private access proxy for container services (y/N)", "n"));
7259
+ const accessProxyProvider = enableAccessProxy ? await ask("Private access proxy provider", "tsdproxy") : "tsdproxy";
7260
+ const accessProxyAuthToken = enableAccessProxy ? await ask("Proxy auth token or API key", "") : "";
7261
+ const accessProxyDomain = enableAccessProxy ? await ask("Private access domain", `tsdproxy.${rootDomain}`) : `tsdproxy.${rootDomain}`;
7262
+ const accessProxyExposeAll = enableAccessProxy ? asBool(await ask("Expose all services through proxy (Y/n)", "y")) : true;
7263
+ const accessProxyServices = !accessProxyExposeAll ? asStringList(await ask("Service hostnames to expose (comma-separated)", "postgres,api,web,landing,keycloak,minikms,openfga,rustfs,clickstack,obs,manage-api")) : [];
7264
+ const includeAdminServices = enableAccessProxy ? asBool(await ask("Expose admin/maintenance services (y/N)", "n")) : false;
7265
+ const accessProxyAdvertiseRoutes = enableAccessProxy ? asBool(await ask("Advertise overlay subnet routes through the proxy provider (y/N)", "n")) : false;
7215
7266
  const config = {
7216
7267
  edition: "enterprise",
7217
7268
  source: defaultSourceConfig(releaseVersion),
@@ -7284,6 +7335,16 @@ async function cmdSetup() {
7284
7335
  install_fingerprint: installFingerprint,
7285
7336
  certificate_bundle_file: certificateBundleFile || void 0,
7286
7337
  certificate_validity_days: 1095
7338
+ },
7339
+ access_proxy: {
7340
+ enabled: enableAccessProxy,
7341
+ provider: accessProxyProvider,
7342
+ auth_token: accessProxyAuthToken,
7343
+ domain: accessProxyDomain,
7344
+ service_scope: accessProxyExposeAll ? "all" : "selected",
7345
+ services: accessProxyServices,
7346
+ advertise_routes: accessProxyAdvertiseRoutes,
7347
+ include_admin_services: includeAdminServices
7287
7348
  }
7288
7349
  };
7289
7350
  saveDesiredConfig(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envsync-cloud/deploy-cli",
3
- "version": "0.8.11",
3
+ "version": "0.8.13",
4
4
  "description": "CLI for self-hosted EnvSync deployment on Docker Swarm",
5
5
  "type": "module",
6
6
  "bin": {