Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
chore(dss): move DSS to use gateway url (#6110)
Will Hutchinsondb09426d82e8
diff --git a/apps/docs/AI/bring-your-own.mdx b/apps/docs/AI/bring-your-own.mdxindex e3c11699f4..772bbb1764 100644--- a/apps/docs/AI/bring-your-own.mdx+++ b/apps/docs/AI/bring-your-own.mdx@@ -75,7 +75,7 @@ You need:```toml[macro]api_url = "https://agent-harness.macro.com"- storage_url = "https://cloud-storage.macro.com"+ storage_url = "https://gateway.macro.com/dss"[identity]# Optional: how this machine shows up in Settings. Defaults to its hostname.diff --git a/apps/web/scripts/services.ts b/apps/web/scripts/services.tsindex 2cb6dbcb4f..83ee56a3f7 100644--- a/apps/web/scripts/services.ts+++ b/apps/web/scripts/services.ts@@ -10,16 +10,16 @@ export type Service = {export const services: Service[] = [{name: "cloud-storage",- dev: "https://cloud-storage-dev.macro.com/api-doc/openapi.json",- prod: "https://cloud-storage.macro.com/api-doc/openapi.json",+ dev: "https://dev-gateway.macro.com/dss/api-doc/openapi.json",+ prod: "https://gateway.macro.com/dss/api-doc/openapi.json",local: "http://localhost:8086/api-doc/openapi.json",output: "../src/lib/service-clients/service-storage/",orvalKey: "storageService",},{name: "properties-service",- dev: "https://cloud-storage-dev.macro.com/properties/api-doc/openapi.json",- prod: "https://cloud-storage.macro.com/properties/api-doc/openapi.json",+ dev: "https://dev-gateway.macro.com/dss/properties/api-doc/openapi.json",+ prod: "https://gateway.macro.com/dss/properties/api-doc/openapi.json",local: "http://localhost:8086/properties/api-doc/openapi.json",output: "../src/lib/service-clients/service-properties/",orvalKey: "propertiesService",diff --git a/apps/web/src/lib/core/constant/servers.ts b/apps/web/src/lib/core/constant/servers.tsindex 18f1ac554c..dabbd8156a 100644--- a/apps/web/src/lib/core/constant/servers.ts+++ b/apps/web/src/lib/core/constant/servers.ts@@ -18,6 +18,14 @@ const serverHostLocal: Servers = {const devServerSuffix = import.meta.env.MODE === 'development' ? '-dev' : '';+// The shared gateway ALB fronts DSS under a `/dss` path prefix. Unlike the+// other services it is named with a `dev-` prefix rather than a `-dev` suffix,+// so it cannot reuse `devServerSuffix`.+const gatewayHost =+ import.meta.env.MODE === 'development'+ ? 'https://dev-gateway.macro.com'+ : 'https://gateway.macro.com';+const authLogoutUrl =import.meta.env.MODE === 'development'? 'https://fusionauth-dev.macro.com/oauth2/logout?client_id=eb75fe7a-0ef1-4186-96d9-cc62cfb1d10c&tenantId=5e13f524-8d32-0454-81f8-061936256aa4'@@ -27,7 +35,7 @@ const serverHostRemote = {'auth-service': `https://auth-service${devServerSuffix}.macro.com`,'auth-logout': authLogoutUrl,'pdf-service': `https://pdf-service${devServerSuffix}.macro.com`,- 'document-storage-service': `https://cloud-storage${devServerSuffix}.macro.com`,+ 'document-storage-service': `${gatewayHost}/dss`,'websocket-service': `wss://services${devServerSuffix}.macro.com`,'cognition-service': `https://document-cognition${devServerSuffix}.macro.com`,'connection-gateway': `wss://connection-gateway${devServerSuffix}.macro.com`,diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.test.tsindex a547d4822b..7991d4e71d 100644--- a/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.test.ts+++ b/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.test.ts@@ -21,12 +21,9 @@ import {describe('GraphQL Soup websocket auth', () => {it('maps HTTP protocols and appends encoded bearer auth', () => {expect(- buildGraphqlSoupWebSocketUrl(- 'https://cloud-storage.macro.com',- 'token+/='- )+ buildGraphqlSoupWebSocketUrl('https://gateway.macro.com/dss', 'token+/=')).toBe(- 'wss://cloud-storage.macro.com/items/soup/graphql/ws?macro-api-token=token%2B%2F%3D'+ 'wss://gateway.macro.com/dss/items/soup/graphql/ws?macro-api-token=token%2B%2F%3D');expect(buildGraphqlSoupWebSocketUrl('http://localhost:8086')).toBe('ws://localhost:8086/items/soup/graphql/ws'@@ -37,14 +34,14 @@ describe('GraphQL Soup websocket auth', () => {const refreshCookieAuth = vi.fn().mockResolvedValue(undefined);const getApiToken = vi.fn();const resolveUrl = createGraphqlSoupWebSocketUrlResolver({- dssHost: 'https://cloud-storage.macro.com',+ dssHost: 'https://gateway.macro.com/dss',bearerTokenAuth: false,getApiToken,refreshCookieAuth,});await expect(resolveUrl()).resolves.toBe(- 'wss://cloud-storage.macro.com/items/soup/graphql/ws'+ 'wss://gateway.macro.com/dss/items/soup/graphql/ws');expect(refreshCookieAuth).toHaveBeenCalledOnce();expect(getApiToken).not.toHaveBeenCalled();@@ -57,7 +54,7 @@ describe('GraphQL Soup websocket auth', () => {.mockResolvedValueOnce('second');const refreshCookieAuth = vi.fn();const resolveUrl = createGraphqlSoupWebSocketUrlResolver({- dssHost: 'https://cloud-storage.macro.com',+ dssHost: 'https://gateway.macro.com/dss',bearerTokenAuth: true,getApiToken,refreshCookieAuth,diff --git a/crates/coding_agent_worker/src/config/test.rs b/crates/coding_agent_worker/src/config/test.rsindex afe82144c7..cfa2c21b7f 100644--- a/crates/coding_agent_worker/src/config/test.rs+++ b/crates/coding_agent_worker/src/config/test.rs@@ -70,7 +70,7 @@ fn the_gateway_url_is_the_api_base_with_a_websocket_scheme() {let secure = MacroApi {api_url: "https://agent-harness.macro.com/".to_owned(),- storage_url: "https://cloud-storage.macro.com".to_owned(),+ storage_url: "https://gateway.macro.com/dss".to_owned(),web_url: "https://macro.com/app/".to_owned(),};assert_eq!(diff --git a/crates/macro_service_urls/src/lib.rs b/crates/macro_service_urls/src/lib.rsindex 0774200ad8..1c33213314 100644--- a/crates/macro_service_urls/src/lib.rs+++ b/crates/macro_service_urls/src/lib.rs@@ -227,8 +227,8 @@ impl ServiceUrlVarErr {/// #[derive(Debug, Clone)]/// pub struct DocumentStorageServiceUrl {/// local: "http://localhost:8086",-/// dev: "https://cloud-storage-dev.macro.com",-/// prod: "https://cloud-storage.macro.com",+/// dev: "https://dev-gateway.macro.com/dss",+/// prod: "https://gateway.macro.com/dss",/// }/// }///@@ -515,8 +515,8 @@ service_url! {/// Document storage service API URL.pub DocumentStorageServiceUrl {local: "http://localhost:8086",- dev: "https://cloud-storage-dev.macro.com",- prod: "https://cloud-storage.macro.com",+ dev: "https://dev-gateway.macro.com/dss",+ prod: "https://gateway.macro.com/dss",},/// WebSocket service URL.pub WebsocketServiceUrl {diff --git a/crates/macro_service_urls/src/test.rs b/crates/macro_service_urls/src/test.rsindex e1d29d67b9..49c8c858d4 100644--- a/crates/macro_service_urls/src/test.rs+++ b/crates/macro_service_urls/src/test.rs@@ -193,8 +193,8 @@ crate::service_url! {#[derive(Debug, Clone)]pub TestDocumentStorageServiceUrl {local: "http://localhost:8086",- dev: "https://cloud-storage-dev.macro.com",- prod: "https://cloud-storage.macro.com",+ dev: "https://dev-gateway.macro.com/dss",+ prod: "https://gateway.macro.com/dss",},#[derive(Debug, Clone)]pub TestEmailServiceUrl {@@ -220,7 +220,7 @@ fn grouped_macro_resolves_all_service_urls() {assert_eq!(service_urls.test_document_storage_service_url.as_ref(),- "https://cloud-storage-dev.macro.com",+ "https://dev-gateway.macro.com/dss",);assert_eq!(service_urls.test_email_service_url.as_ref(),@@ -234,7 +234,7 @@ fn grouped_defaults_do_not_check_overrides() {assert_eq!(service_urls.test_document_storage_service_url.as_ref(),- "https://cloud-storage.macro.com",+ "https://gateway.macro.com/dss",);assert_eq!(service_urls.test_email_service_url.as_ref(),@@ -330,7 +330,7 @@ fn exported_service_urls_match_dev_values() {);assert_eq!(service_urls.document_storage_service_url.as_ref(),- "https://cloud-storage-dev.macro.com",+ "https://dev-gateway.macro.com/dss",);assert_eq!(service_urls.websocket_service_url.as_ref(),@@ -397,7 +397,7 @@ fn exported_service_urls_match_prod_values() {);assert_eq!(service_urls.document_storage_service_url.as_ref(),- "https://cloud-storage.macro.com",+ "https://gateway.macro.com/dss",);assert_eq!(service_urls.websocket_service_url.as_ref(),diff --git a/docs/AGENT_GUIDE/observability.md b/docs/AGENT_GUIDE/observability.mdindex 195a09ef43..ef213f6835 100644--- a/docs/AGENT_GUIDE/observability.md+++ b/docs/AGENT_GUIDE/observability.md@@ -31,10 +31,15 @@ attribute.(add `start`/`end` RFC3339 to narrow; default window is 1h). Note CORS preflights createseparate tiny traces for the same path — prefer the trace whose root is `web-app`.-URL prefix → service mapping (proxy strips the prefix): `/dss/*` → document_storage_service,+URL prefix → service mapping: `/dss/*` → document_storage_service,`/cognition/*` → document_cognition_service, `/auth/*` → authentication_service,`/email/*` → email_service. Frontend OTel exports to `/i/otlp/v1/{traces,logs}`.+The local Caddy proxy strips these prefixes before forwarding, so `span.url.path` is+unprefixed locally. The deployed gateway ALB does **not** strip `/dss` — DSS serves the+same routes at both `/` and `/dss` — so in dev and prod `span.url.path` includes the+prefix. Query both forms when a search comes back empty.+## Logs (Loki)Only two stream labels exist: `service_name`, `deployment_environment`. Example:diff --git a/infra/packages/shared/src/index.ts b/infra/packages/shared/src/index.tsindex 8acd879c9e..56b2ef8533 100644--- a/infra/packages/shared/src/index.ts+++ b/infra/packages/shared/src/index.ts@@ -23,10 +23,24 @@ export const SERVICE_NAME = 'doc-storage';export const BASE_DOMAIN = 'macro.com';+/**+ * Legacy per-service hostname for DSS. Still backs the dedicated ALB and its+ * Route53 alias record during the gateway cutover, so it must remain a bare+ * hostname — never give it a scheme or a path.+ */export const SERVICE_DOMAIN_NAME = `cloud-storage${stack === 'dev' ? '-dev' : ''}.${BASE_DOMAIN}`;+/**+ * Public base URL for DSS behind the shared gateway ALB, which routes the+ * `/dss` path prefix to the service. Callers append paths by concatenation, so+ * this must not end with a trailing slash.+ */+export const DOCUMENT_STORAGE_GATEWAY_URL = `https://${+ stack === 'prod' ? '' : `${stack}-`+}gateway.${BASE_DOMAIN}/dss`;+export const MACRO_SUBDOMAIN_CERT ='arn:aws:acm:us-east-1:569036502058:certificate/a75b1b07-534c-44e1-b59b-fa5f74fd8069';diff --git a/infra/packages/shared/src/service_urls.ts b/infra/packages/shared/src/service_urls.tsindex 7aa1a2691b..d775d73e91 100644--- a/infra/packages/shared/src/service_urls.ts+++ b/infra/packages/shared/src/service_urls.ts@@ -34,7 +34,7 @@ const DEV_SERVICE_URLS: ServiceUrlMap = {[ServiceUrl.NOTIFICATION_SERVICE_URL]: 'https://notifications-dev.macro.com',[ServiceUrl.AUTHENTICATION_SERVICE_URL]: 'https://auth-service-dev.macro.com',[ServiceUrl.DOCUMENT_STORAGE_SERVICE_URL]:- 'https://cloud-storage-dev.macro.com',+ 'https://dev-gateway.macro.com/dss',[ServiceUrl.CONNECTION_GATEWAY_URL]:'https://connection-gateway-dev.macro.com',[ServiceUrl.DOCUMENT_COGNITION_SERVICE_URL]:@@ -53,7 +53,7 @@ const PROD_SERVICE_URLS: ServiceUrlMap = {[ServiceUrl.STATIC_FILE_SERVICE_URL]: 'https://static-file-service.macro.com',[ServiceUrl.NOTIFICATION_SERVICE_URL]: 'https://notifications.macro.com',[ServiceUrl.AUTHENTICATION_SERVICE_URL]: 'https://auth-service.macro.com',- [ServiceUrl.DOCUMENT_STORAGE_SERVICE_URL]: 'https://cloud-storage.macro.com',+ [ServiceUrl.DOCUMENT_STORAGE_SERVICE_URL]: 'https://gateway.macro.com/dss',[ServiceUrl.CONNECTION_GATEWAY_URL]: 'https://connection-gateway.macro.com',[ServiceUrl.DOCUMENT_COGNITION_SERVICE_URL]:'https://document-cognition.macro.com',diff --git a/infra/stacks/cloud-storage-service/index.ts b/infra/stacks/cloud-storage-service/index.tsindex 40e60a23d6..c9d217989d 100644--- a/infra/stacks/cloud-storage-service/index.ts+++ b/infra/stacks/cloud-storage-service/index.ts@@ -3,6 +3,7 @@ import * as pulumi from '@pulumi/pulumi';import { createBucket, Queue } from '../../packages/resources';import {config,+ DOCUMENT_STORAGE_GATEWAY_URL,getMacroApiToken,getMacroNotify,getSearchEventQueue,@@ -331,7 +332,10 @@ const cloudStorageService = new CloudStorageService(export const cloudStorageServiceRoleArn = cloudStorageService.role.arn;export const cloudStorageServiceSgId = cloudStorageService.serviceSg.id;export const cloudStorageServiceAlbSgId = cloudStorageService.serviceAlbSg.id;-export const cloudStorageServiceUrl = pulumi.interpolate`${cloudStorageService.domain}`;+// Consumers call the service through the shared gateway, not the legacy+// per-service hostname. `cloudStorageService.domain` still names the dedicated+// ALB and stays in place until that listener is retired.+export const cloudStorageServiceUrl = DOCUMENT_STORAGE_GATEWAY_URL;const convertServiceStack = new pulumi.StackReference('convert-service-stack', {name: `macro-inc/convert-service/${stack}`,diff --git a/infra/stacks/web-app/index.ts b/infra/stacks/web-app/index.tsindex 923235576e..29ce494173 100644--- a/infra/stacks/web-app/index.ts+++ b/infra/stacks/web-app/index.ts@@ -196,7 +196,7 @@ const appRouteLambda = new aws.lambda.Function('app-route-lambda', {publish: true,environment: {variables: {- PREVIEW_URL: `https://cloud-storage${stack === 'dev' ? '-dev' : ''}.macro.com/documents/preview`,+ PREVIEW_URL: `https://${stack === 'dev' ? 'dev-' : ''}gateway.macro.com/dss/documents/preview`,},},});diff --git a/packages/sdk/src/config.ts b/packages/sdk/src/config.tsindex fa37f9f3b7..d1cf182ba2 100644--- a/packages/sdk/src/config.ts+++ b/packages/sdk/src/config.ts@@ -26,13 +26,13 @@ export const WEB_APP_URLS: Record<Env, string> = {export const HOSTS: Record<Env, Record<ServiceName, string>> = {dev: {'agent-harness': 'https://agent-harness-dev.macro.com',- storage: 'https://cloud-storage-dev.macro.com',+ storage: 'https://dev-gateway.macro.com/dss',auth: 'https://auth-service-dev.macro.com',email: 'https://email-service-dev.macro.com',cognition: 'https://document-cognition-dev.macro.com',notification: 'https://notifications-dev.macro.com',- properties: 'https://cloud-storage-dev.macro.com',- search: 'https://cloud-storage-dev.macro.com',+ properties: 'https://dev-gateway.macro.com/dss',+ search: 'https://dev-gateway.macro.com/dss','scheduled-action': 'https://agent-schedule-dev.macro.com','static-files': 'https://static-file-service-dev.macro.com',connection: 'https://connection-gateway-dev.macro.com',@@ -41,13 +41,13 @@ export const HOSTS: Record<Env, Record<ServiceName, string>> = {},prod: {'agent-harness': 'https://agent-harness.macro.com',- storage: 'https://cloud-storage.macro.com',+ storage: 'https://gateway.macro.com/dss',auth: 'https://auth-service.macro.com',email: 'https://email-service.macro.com',cognition: 'https://document-cognition.macro.com',notification: 'https://notifications.macro.com',- properties: 'https://cloud-storage.macro.com',- search: 'https://cloud-storage.macro.com',+ properties: 'https://gateway.macro.com/dss',+ search: 'https://gateway.macro.com/dss','scheduled-action': 'https://agent-schedule.macro.com','static-files': 'https://static-file-service.macro.com',connection: 'https://connection-gateway.macro.com',diff --git a/services/ai-editing-worker/wrangler.toml b/services/ai-editing-worker/wrangler.tomlindex f1e39b893a..4fedb09278 100644--- a/services/ai-editing-worker/wrangler.toml+++ b/services/ai-editing-worker/wrangler.toml@@ -34,8 +34,8 @@ ENVIRONMENT = "local"# Unset in deployed envs = trace export disabled.OTEL_EXPORTER_OTLP_ENDPOINT = "http://localhost:4318/v1/traces"SYNC_WS_BASE = "wss://sync-service-prod2.macroverse.workers.dev"-DSS_BASE = "https://cloud-storage.macro.com"-SEARCH_SERVICE_BASE = "https://cloud-storage.macro.com"+DSS_BASE = "https://gateway.macro.com/dss"+SEARCH_SERVICE_BASE = "https://gateway.macro.com/dss"CONTACTS_SERVICE_BASE = "https://contacts.macro.com"AUTH_SERVICE_BASE = "https://auth-service.macro.com"@@ -61,8 +61,8 @@ database_id = "16d34e99-3bc6-44e4-a287-1ea65183bd28"ENVIRONMENT = "development"OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-dev.macroverse.workers.dev/i/otlp/v1/traces"SYNC_WS_BASE = "wss://sync-service-dev3.macroverse.workers.dev"-DSS_BASE = "https://cloud-storage-dev.macro.com"-SEARCH_SERVICE_BASE = "https://cloud-storage-dev.macro.com"+DSS_BASE = "https://dev-gateway.macro.com/dss"+SEARCH_SERVICE_BASE = "https://dev-gateway.macro.com/dss"CONTACTS_SERVICE_BASE = "https://contacts-dev.macro.com"AUTH_SERVICE_BASE = "https://auth-service-dev.macro.com"@@ -77,8 +77,8 @@ name = "ai-editing-worker-playground"[env.playground.vars]ENVIRONMENT = "development"SYNC_WS_BASE = "wss://sync-service-dev3.macroverse.workers.dev"-DSS_BASE = "https://cloud-storage-dev.macro.com"-SEARCH_SERVICE_BASE = "https://cloud-storage-dev.macro.com"+DSS_BASE = "https://dev-gateway.macro.com/dss"+SEARCH_SERVICE_BASE = "https://dev-gateway.macro.com/dss"CONTACTS_SERVICE_BASE = "https://contacts-dev.macro.com"AUTH_SERVICE_BASE = "https://auth-service-dev.macro.com"@@ -94,8 +94,8 @@ name = "ai-editing-worker"ENVIRONMENT = "production"OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-prod.macroverse.workers.dev/i/otlp/v1/traces"SYNC_WS_BASE = "wss://sync-service-prod2.macroverse.workers.dev"-DSS_BASE = "https://cloud-storage.macro.com"-SEARCH_SERVICE_BASE = "https://cloud-storage.macro.com"+DSS_BASE = "https://gateway.macro.com/dss"+SEARCH_SERVICE_BASE = "https://gateway.macro.com/dss"CONTACTS_SERVICE_BASE = "https://contacts.macro.com"AUTH_SERVICE_BASE = "https://auth-service.macro.com"diff --git a/services/document_storage_service/src/config.rs b/services/document_storage_service/src/config.rsindex d03293d964..5125e64102 100644--- a/services/document_storage_service/src/config.rs+++ b/services/document_storage_service/src/config.rs@@ -62,7 +62,7 @@ maybe_env_vars! {pub struct LivekitTranscriptionAgentName;/// Shared secret for internal call endpoints (e.g. transcript ingestion from the agent).pub struct InternalCallSecret;- /// Public base URL of this service (e.g. `https://cloud-storage.macro.com`),+ /// Public base URL of this service (e.g. `https://gateway.macro.com/dss`),/// used to build the ring-status URL included in VoIP push payloads./// When unset, payloads omit the URL and native ring-status polling is off.pub struct CallRingStatusBaseUrl;diff --git a/services/sync-service/wrangler.toml b/services/sync-service/wrangler.tomlindex a7b34baa04..1f917b57b7 100644--- a/services/sync-service/wrangler.toml+++ b/services/sync-service/wrangler.toml@@ -62,7 +62,7 @@ INTERNAL_API_SECRET_KEY = "SYNC_SERVICE_KEY_PLAYGROUND"DOCUMENT_PERMISSIONS_SECRET = "local"ENVIRONMENT = "development"SPS_URL = "https://search-processing-dev.macro.com"-DSS_URL = "https://cloud-storage-dev.macro.com"+DSS_URL = "https://dev-gateway.macro.com/dss"[env.playground.durable_objects]bindings = [@@ -102,7 +102,7 @@ ENVIRONMENT = "development"# The proxy injects the Datadog key; the exporter appends the signal path.OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-dev.macroverse.workers.dev/i/otlp"SPS_URL = "https://search-processing-dev.macro.com"-DSS_URL = "https://cloud-storage-dev.macro.com"+DSS_URL = "https://dev-gateway.macro.com/dss"[env.dev.durable_objects]bindings = [@@ -142,7 +142,7 @@ ENVIRONMENT = "production"# The proxy injects the Datadog key; the exporter appends the signal path.OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-prod.macroverse.workers.dev/i/otlp"SPS_URL = "https://search-processing.macro.com"-DSS_URL = "https://cloud-storage.macro.com"+DSS_URL = "https://gateway.macro.com/dss"[env.prod.durable_objects]bindings = [