apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "openwork-ee.configName" . }}
  labels:
    {{- include "openwork-ee.labels" . | nindent 4 }}
data:
  CI: "true"
  NODE_ENV: "production"
  OPENWORK_DEV_MODE: {{ .Values.config.openworkDevMode | quote }}
  DEN_API_NODE_OPTIONS: {{ .Values.config.denApiNodeOptions | quote }}
  DB_MODE: {{ .Values.config.databaseMode | quote }}
  DEN_ORG_MODE: {{ .Values.config.tenancy.mode | quote }}
  DEN_SINGLE_ORG_NAME: {{ .Values.config.tenancy.singleOrgName | quote }}
  DEN_SINGLE_ORG_SLUG: {{ .Values.config.tenancy.singleOrgSlug | quote }}
  DEN_SINGLE_ORG_OWNER_EMAILS: {{ .Values.config.tenancy.ownerEmails | quote }}
  DEN_SINGLE_ORG_ALLOW_PUBLIC_SIGNUP: {{ .Values.config.tenancy.allowPublicSignup | quote }}
  DEN_REQUIRE_EMAIL_VERIFICATION: {{ .Values.config.tenancy.requireEmailVerification | quote }}
  DEN_PASSWORD_BREACH_SCREENING_ENABLED: {{ .Values.config.auth.passwordBreachScreeningEnabled | quote }}
  GITHUB_CONNECTOR_APP_ID: {{ .Values.config.githubConnector.appId | quote }}
  GITHUB_CONNECTOR_APP_CLIENT_ID: {{ .Values.config.githubConnector.clientId | quote }}
  BETTER_AUTH_URL: {{ .Values.config.public.webOrigin | quote }}
  DEN_MCP_RESOURCE_URL: {{ .Values.config.public.mcpResourceUrl | quote }}
  # Extra MCP resource URLs beyond the DEN_API_PUBLIC_URL API origin and web-app defaults.
  {{ if .Values.config.public.mcpAdditionalResources }}
  DEN_MCP_ADDITIONAL_RESOURCES: {{ .Values.config.public.mcpAdditionalResources | quote }}
  {{ end }}
  DEN_MCP_CLAIM_NAMESPACE: {{ .Values.config.public.mcpClaimNamespace | quote }}
  DEN_BETTER_AUTH_TRUSTED_ORIGINS: {{ .Values.config.public.betterAuthTrustedOrigins | quote }}
  DEN_WEB_APP_HOSTS: {{ .Values.config.public.webAppHosts | quote }}
  DEN_BOOTSTRAP_ADMIN_EMAILS: {{ .Values.config.public.bootstrapAdminEmails | quote }}
  DEN_INSTALL_LINKS_GATING_ENABLED: {{ .Values.config.public.installLinksGatingEnabled | quote }}
  DEN_CONNECT_LINK_MODE: {{ .Values.config.public.connectLinkMode | quote }}
  {{ if .Values.config.public.connectLinkKeyId }}
  DEN_CONNECT_LINK_KEY_ID: {{ .Values.config.public.connectLinkKeyId | quote }}
  {{ end }}
  CORS_ORIGINS: {{ .Values.config.public.corsOrigins | quote }}
  DEN_CORS_ORIGINS: {{ .Values.config.public.corsOrigins | quote }}
  DEN_API_PUBLIC_URL: {{ .Values.config.public.apiOrigin | quote }}
  DEN_DESKTOP_DEN_BASE_URL: {{ .Values.config.public.desktopDenBaseUrl | quote }}
  {{ if .Values.config.public.installerReleaseTag }}
  OPENWORK_INSTALLER_RELEASE_TAG: {{ .Values.config.public.installerReleaseTag | quote }}
  {{ end }}
  {{ if .Values.config.public.installerReleaseRepo }}
  OPENWORK_INSTALLER_RELEASE_REPO: {{ .Values.config.public.installerReleaseRepo | quote }}
  {{ end }}
  PROVISIONER_MODE: {{ .Values.config.provisioner.mode | quote }}
  WORKER_PROVISIONING_RECONCILE_INTERVAL_MS: {{ .Values.config.provisioner.reconcileIntervalMs | quote }}
  WORKER_PROVISIONING_RECONCILE_STALE_MS: {{ .Values.config.provisioner.reconcileStaleMs | quote }}
  WORKER_PROVISIONING_RECONCILE_BATCH_SIZE: {{ .Values.config.provisioner.reconcileBatchSize | quote }}
  WORKER_URL_TEMPLATE: {{ .Values.config.provisioner.workerUrlTemplate | quote }}
  {{ if or .Values.inference.enabled .Values.config.internal.inferenceProxyBaseUrl }}
  INFERENCE_PROXY_BASE_URL: {{ include "openwork-ee.inferenceInternalUrl" . | quote }}
  {{ end }}
  POLAR_FEATURE_GATE_ENABLED: {{ .Values.config.polar.featureGateEnabled | quote }}
  DAYTONA_SIGNED_PREVIEW_EXPIRES_SECONDS: {{ .Values.config.daytona.signedPreviewExpiresSeconds | quote }}
  DEN_API_BASE: {{ include "openwork-ee.denApiInternalUrl" . | quote }}
  DEN_AUTH_FALLBACK_BASE: {{ include "openwork-ee.authFallbackInternalUrl" . | quote }}
  DEN_AUTH_ORIGIN: {{ .Values.config.public.webOrigin | quote }}
  DEN_WEB_PUBLIC_ORIGIN: {{ .Values.config.public.webOrigin | quote }}
  DEN_WEB_OPENWORK_AUTH_CALLBACK_URL: {{ .Values.config.public.authCallbackUrl | quote }}
  {{ with .Values.config.polar.apiBase }}
  POLAR_API_BASE: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.polar.productId }}
  POLAR_PRODUCT_ID: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.polar.benefitId }}
  POLAR_BENEFIT_ID: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.polar.successUrl }}
  POLAR_SUCCESS_URL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.polar.returnUrl }}
  POLAR_RETURN_URL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.apiUrl }}
  DAYTONA_API_URL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.target }}
  DAYTONA_TARGET: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.snapshot }}
  DAYTONA_SNAPSHOT: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxImage }}
  DAYTONA_SANDBOX_IMAGE: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxCpu }}
  DAYTONA_SANDBOX_CPU: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxMemory }}
  DAYTONA_SANDBOX_MEMORY: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxDisk }}
  DAYTONA_SANDBOX_DISK: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxPublic }}
  DAYTONA_SANDBOX_PUBLIC: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxAutoStopInterval }}
  DAYTONA_SANDBOX_AUTO_STOP_INTERVAL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxAutoArchiveInterval }}
  DAYTONA_SANDBOX_AUTO_ARCHIVE_INTERVAL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxAutoDeleteInterval }}
  DAYTONA_SANDBOX_AUTO_DELETE_INTERVAL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sandboxNamePrefix }}
  DAYTONA_SANDBOX_NAME_PREFIX: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sharedVolumeName }}
  DAYTONA_SHARED_VOLUME_NAME: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.volumeNamePrefix }}
  DAYTONA_VOLUME_NAME_PREFIX: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.workspaceMountPath }}
  DAYTONA_WORKSPACE_MOUNT_PATH: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.dataMountPath }}
  DAYTONA_DATA_MOUNT_PATH: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.runtimeWorkspacePath }}
  DAYTONA_RUNTIME_WORKSPACE_PATH: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.runtimeDataPath }}
  DAYTONA_RUNTIME_DATA_PATH: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.sidecarDir }}
  DAYTONA_SIDECAR_DIR: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.openworkPort }}
  DAYTONA_OPENWORK_PORT: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.opencodePort }}
  DAYTONA_OPENCODE_PORT: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.createTimeoutSeconds }}
  DAYTONA_CREATE_TIMEOUT_SECONDS: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.deleteTimeoutSeconds }}
  DAYTONA_DELETE_TIMEOUT_SECONDS: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.daytona.healthcheckTimeoutMs }}
  DAYTONA_HEALTHCHECK_TIMEOUT_MS: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.inference.openRouterWorkspaceId }}
  OPENROUTER_WORKSPACE_ID: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.inference.stripeInferencePriceId }}
  STRIPE_INFERENCE_PRICE_ID: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.inference.openRouterUpstreamUrl }}
  OPENROUTER_UPSTREAM_URL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.inference.creditsPerDollar }}
  INFERENCE_CREDITS_PER_DOLLAR: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.public.openworkAppConnectUrl }}
  DEN_WEB_OPENWORK_APP_CONNECT_URL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.public.openworkWebUrl }}
  DEN_WEB_OPENWORK_WEB_URL: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.web.posthogKey }}
  DEN_WEB_POSTHOG_KEY: {{ . | quote }}
  {{ end }}
  {{ with .Values.config.web.posthogHost }}
  DEN_WEB_POSTHOG_HOST: {{ . | quote }}
  {{ end }}
