Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/rules/sim-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contracts, and demonstrated regressions.
| Suffix | Needs | Run with | In CI |
|--------|-------|----------|-------|
| `*.test.ts(x)` | nothing; global mocks from `vitest.setup.ts` | `bun run --cwd <workspace> test` | `test` jobs |
| `*.integration.ts` | real PostgreSQL (`TEST_DATABASE_URL`) and Redis (`TEST_REDIS_URL`: required by `apps/sim` and `apps/realtime`; `packages/db` runs without it locally and requires it in CI) | `bun run --cwd <workspace> test --mode integration` | `integration` jobs, by glob (sharded per provisioning path) |
| `*.integration.ts` | real PostgreSQL (`TEST_DATABASE_URL`) and Redis (`TEST_REDIS_URL`: required by `apps/sim`, `apps/realtime`, and `packages/db`; `apps/sim` needs a non-zero database index) | `bun run --cwd <workspace> test --mode integration` | `integration` jobs, by glob (sharded per provisioning path) |
| `*.live.test.ts` | provider APIs, hosted sandboxes, local runtimes, or sibling checkouts | `bun run --cwd apps/sim test --mode live <file>` | never |
| `apps/desktop/e2e/*.spec.ts` | the packaged Electron app | Playwright | desktop E2E workflow |
| `apps/sim/scripts/test-*-e2e.ts` | a running app over HTTP | its `package.json` script when one exists (`bun run test:scim:e2e`; `test:workflow-version-compare:e2e` adds `--no-env-file`), else `bun scripts/test-<suite>-e2e.ts` from apps/sim | `e2e` jobs (`.github/scripts/http-e2e.sh`) |
Expand Down
2 changes: 1 addition & 1 deletion .cursor/rules/sim-testing.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contracts, and demonstrated regressions.
| Suffix | Needs | Run with | In CI |
|--------|-------|----------|-------|
| `*.test.ts(x)` | nothing; global mocks from `vitest.setup.ts` | `bun run --cwd <workspace> test` | `test` jobs |
| `*.integration.ts` | real PostgreSQL (`TEST_DATABASE_URL`) and Redis (`TEST_REDIS_URL`: required by `apps/sim` and `apps/realtime`; `packages/db` runs without it locally and requires it in CI) | `bun run --cwd <workspace> test --mode integration` | `integration` jobs, by glob (sharded per provisioning path) |
| `*.integration.ts` | real PostgreSQL (`TEST_DATABASE_URL`) and Redis (`TEST_REDIS_URL`: required by `apps/sim`, `apps/realtime`, and `packages/db`; `apps/sim` needs a non-zero database index) | `bun run --cwd <workspace> test --mode integration` | `integration` jobs, by glob (sharded per provisioning path) |
| `*.live.test.ts` | provider APIs, hosted sandboxes, local runtimes, or sibling checkouts | `bun run --cwd apps/sim test --mode live <file>` | never |
| `apps/desktop/e2e/*.spec.ts` | the packaged Electron app | Playwright | desktop E2E workflow |
| `apps/sim/scripts/test-*-e2e.ts` | a running app over HTTP | its `package.json` script when one exists (`bun run test:scim:e2e`; `test:workflow-version-compare:e2e` adds `--no-env-file`), else `bun scripts/test-<suite>-e2e.ts` from apps/sim | `e2e` jobs (`.github/scripts/http-e2e.sh`) |
Expand Down
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
CRON_SECRET=$(openssl rand -hex 32)
POSTGRES_PASSWORD=$(openssl rand -hex 24)
EOF

# Start Sim
Expand Down Expand Up @@ -237,7 +238,7 @@ If you prefer not to use Docker. **All commands run from the repository root unl
cp packages/db/.env.example packages/db/.env
```

At minimum, each `.env` needs `DATABASE_URL`. `apps/sim/.env` and `apps/realtime/.env` additionally need matching values for `BETTER_AUTH_URL`, `BETTER_AUTH_SECRET`, `INTERNAL_API_SECRET`, and `NEXT_PUBLIC_APP_URL`. `apps/sim/.env` also needs `ENCRYPTION_KEY` and `API_ENCRYPTION_KEY`. Generate any 32-char secrets with `openssl rand -hex 32`.
At minimum, each `.env` needs `DATABASE_URL`. `apps/sim/.env` and `apps/realtime/.env` additionally need matching values for `BETTER_AUTH_URL`, `BETTER_AUTH_SECRET`, `INTERNAL_API_SECRET`, `NEXT_PUBLIC_APP_URL`, and `REDIS_URL`: both services refuse to start without Redis (for a local one, run `docker run -d -p 127.0.0.1:6379:6379 redis:7-alpine` and set `REDIS_URL=redis://localhost:6379`). `apps/sim/.env` also needs `ENCRYPTION_KEY` and `API_ENCRYPTION_KEY`. Generate any 32-char secrets with `openssl rand -hex 32`.

The same `BETTER_AUTH_SECRET`, `INTERNAL_API_SECRET`, and `DATABASE_URL` must appear in both `apps/sim/.env` and `apps/realtime/.env` so the two services share auth and DB. After editing `apps/sim/.env`, you can mirror the shared subset into the realtime env in one shot:

Expand Down
2 changes: 0 additions & 2 deletions apps/desktop/src/renderer/offline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
AuthRoot,
AuthShellView,
AuthTextLink,
AuthWordmark,
AuthButton as Chip,
AuthStatusContent as StatusPageContent,
} from '@sim/auth-ui'
Expand Down Expand Up @@ -71,7 +70,6 @@ function OfflinePage({ isSimCloud }: OfflinePageProps) {
<AuthRoot>
<AuthShellView
homeHref='https://sim.ai'
logo={<AuthWordmark />}
titlebar={<div data-auth-titlebar='' aria-hidden='true' />}
footer={
<AuthTextLink
Expand Down
2 changes: 0 additions & 2 deletions apps/docs/content/docs/platform/enterprise/self-hosted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ Each feature is one server variable. Permission groups also turn on organization

A Sandbox entitlement also requires a remote execution provider with credentials and an immutable Function base image. Until the server verifies readiness, the Function block offers no **Shell** language, and **Settings → Sandboxes** shows an upgrade notice instead of a sandbox list.

The Function block's **Sandbox** selector appears once the server confirms both the entitlement and a ready provider. There is no browser variable to set.

JavaScript without `import`, `require`, a selected sandbox, or a sandbox file-path reference runs in local Node child workers in the app container when Sandbox flags are off. Python, Shell, JavaScript with external imports, and selected custom Sandboxes require the remote Function base and fail with a configuration error until it is ready. See [Sandboxes](/platform/self-hosting/sandboxes).

## Verify the setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Or enable SSO alone:
SSO_ENABLED=true
```

Each is a server variable; the login page and settings read the server's setting, so there is no browser counterpart. Register providers under **Settings → Organization → Single sign-on**. A provider can belong to an organization or be registered without one.
Restart the app after changing either. Register providers under **Settings → Organization → Single sign-on**. A provider can belong to an organization or be registered without one.

Most other enterprise features read settings from the organization that owns a workspace. Set `INSTANCE_ORG_NAME` to place new members in one organization, or provision organizations through the Admin API. See [SSO](/platform/enterprise/sso) and [Self-hosted enterprise features](/platform/enterprise/self-hosted) for provider setup, organization patterns, and billing-enabled behavior.

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/platform/self-hosting/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ Recreate the app using the file that started your installation:

```bash
COMPOSE_FILE=docker-compose.prod.yml
# For a source-built stack, use docker-compose.local.yml. With bundled Ollama,
# add the overlay: -f docker-compose.prod.yml -f docker-compose.ollama.yml
# For a source-built stack, use docker-compose.local.yml. A stack running the
# Ollama overlay is a docker-compose.prod.yml install.
docker compose -f "$COMPOSE_FILE" up -d --force-recreate simstudio
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ On standard billing-disabled self-hosted deployments, configuration enables ente

| Variable | Description |
|----------|-------------|
| `ENTERPRISE_ENABLED` | Enable the whole enterprise feature set. Each feature is one server variable; the browser reads the server's settings, so no `NEXT_PUBLIC_` counterpart is needed |
| `ENTERPRISE_ENABLED` | Enable the whole enterprise feature set. Server variable only; see [the feature flag reference](/platform/enterprise/self-hosted#feature-flag-reference) |
| `SSO_ENABLED` | Enable SAML and OIDC single sign-on on its own. See [Authentication](/platform/self-hosting/authentication#sso-saml-and-oidc) |
| `SSO_SKIP_DOMAIN_VERIFICATION` | Skip the DNS challenge when an administrator clicks Verify on a domain. Off by default; self-hosted only. Trusts administrator claims for SSO and SCIM across the instance. See [Verified domains](/platform/enterprise/verified-domains#skip-dns-verification) |
| `SCIM_ENABLED` | Enable directory provisioning on its own. Needs SSO. See [Directory provisioning](/platform/enterprise/scim) |
Expand Down Expand Up @@ -260,7 +260,6 @@ Configure at least one. Every configured provider stays active and is tried in o
| `RESUME_EXECUTION_CONCURRENCY_LIMIT` | `50` | Trigger.dev resume task concurrency |
| `EGRESS_ALLOWED_HOSTS` | unset | Comma-separated hostnames outbound requests may reach on a private network. Leading wildcard allowed, e.g. `host.docker.internal,*.svc.cluster.local`. Not honored for URLs harvested from content or a third-party response, nor for an HTTP block's `proxyUrl` |
| `EGRESS_ALLOWED_IP_RANGES` | unset | Comma-separated CIDRs or IPs outbound requests may reach on a private network, e.g. `10.0.0.0/8`. Same exclusions |
| `ALLOW_PRIVATE_DATABASE_HOSTS` | unset | **Removed.** Has no effect; the app logs an error at startup if it is still set. Name each database, cache, or mail host in `EGRESS_ALLOWED_HOSTS` instead; a host reached by IP address, including any IPv6 literal (which `EGRESS_ALLOWED_HOSTS` rejects), takes a single-address entry such as `10.0.0.5/32` in `EGRESS_ALLOWED_IP_RANGES`. Do not allowlist whole private ranges, which would widen what workflow HTTP blocks can reach, or `localhost`, where Sim's own database and Redis listen |
| `DOMAIN_VERIFICATION_NAMESERVERS` | `1.1.1.1,8.8.8.8` | Comma-separated nameserver IPs that SSO domain verification sends its TXT lookup to. Set it when the network only allows DNS to an internal resolver. Entries that are not IP addresses are ignored |

A malformed entry in either allowlist stops the app at startup with a message naming the setting. See [the SSRF boundary](/platform/self-hosting/security#the-ssrf-boundary) for the accepted syntax and for what the allowlist does and does not reach.
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/platform/self-hosting/platforms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The [Sim deployment template](https://railway.com/new/template/sim-studio) provi
3. Retain generated secrets, set `API_ENCRYPTION_KEY`, and configure durable storage.
4. Configure your domain under **Settings → Networking**. Set `NEXT_PUBLIC_APP_URL` and `BETTER_AUTH_URL` to that app origin; match `NEXT_PUBLIC_SOCKET_URL` to the realtime endpoint.
5. Add a model provider key such as `OPENAI_API_KEY` and configure email if needed.
6. Check Redis and the scheduler rather than assuming the template includes them.
6. Confirm Redis and the scheduler rather than assuming the template includes them. Sim refuses to start without Redis, and the app and realtime services share one `REDIS_URL`.

<Callout type="warn">
Railway Cron Jobs run no more often than every five minutes. They cannot reproduce Sim's bundled minute-level scheduler cadence. Use a continuously running Sim scheduler service or another scheduler supporting the schedules in [Background jobs](/platform/self-hosting/background-jobs). See [Railway's cron requirements](https://docs.railway.com/cron-jobs).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Use `helm/sim/examples/values-gcp.yaml` as a starting point. It configures Persi
| ManagedCertificate | Created before the first deploy — nothing in the chart creates it. The example values reference `simstudio-ssl-cert`; match whatever name your ingress annotation uses |
| Cloud SQL for PostgreSQL | With `pgvector` |
| GCS buckets | One per file purpose. Every purpose-specific bucket falls back to the general one |
| Memorystore | Optional |
| Memorystore | Recommended for production; Sim requires Redis, and the bundled one is a supported alternative |

<Callout type="warn">
When using only a ManagedCertificate, keep `ingress.tls.enabled: false` so the chart does not reference a missing Secret. GCE Ingress also supports provisioned TLS Secrets and can retain self-managed certificates while a managed certificate becomes active. If you enable chart TLS, create the referenced Secret. See [Google's certificate setup and migration guide](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/secure-traffic-management).
Expand Down
10 changes: 4 additions & 6 deletions apps/docs/content/docs/platform/self-hosting/security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,10 @@ Workflows can execute user-authored JavaScript and Python. Know which sandbox yo
| **Daytona** | `SANDBOX_PROVIDER=daytona`, `DAYTONA_API_KEY`, `DAYTONA_FUNCTION_SNAPSHOT_ID` | Remote sandbox per execution. |

Python, Shell, JavaScript with external imports, and tooling-dependent blocks
require a remote sandbox provider. On a billing-free self-host the provider and
Function base are not sufficient on their own: `SANDBOXES_ENABLED` grants the
server-side entitlement (so does the `ENTERPRISE_ENABLED` master switch when `SANDBOXES_ENABLED`
is left unset), and without that entitlement a workspace offers no Shell language and the
Sandboxes settings page shows an upgrade notice even when the provider is configured correctly. JavaScript without `import` or `require`
continues to run in the local isolate when no remote provider is configured.
require a remote sandbox provider and, on a billing-disabled self-host, the sandbox
entitlement. See [Enable sandbox access and controls](/platform/self-hosting/sandboxes#enable-sandbox-access-and-controls).
JavaScript without `import` or `require` continues to run in the local isolate when
no remote provider is configured.

<Callout type="warn">
**The credential alone does not enable a remote sandbox.** Each provider also needs an *immutable* reference to the dedicated Function image, and Sim validates the format before it will use it — an old shell template or snapshot name is deliberately not accepted as a fallback:
Expand Down
18 changes: 17 additions & 1 deletion apps/docs/content/docs/platform/self-hosting/upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ One variable drives all three schema-coupled images, so they cannot drift apart.
</Tab>
</Tabs>

## Configuration changes by release [#configuration-changes]

Check the changes for every release between your current version and the target before upgrading. Each entry names the setting and what to do about it.

### Helm chart 1.15

| Change | What to do |
|---|---|
| **Redis is required.** Sim refuses to start without `REDIS_URL`; there is no PostgreSQL or in-memory fallback. | Keep the bundled Redis, or point `REDIS_URL` at a managed instance before upgrading. App and realtime must reach the same Redis. See [Redis](/platform/self-hosting/redis). |
| **`REGISTRATION_MODE` replaces `DISABLE_REGISTRATION`, `DISABLE_EMAIL_SIGNUP`, and `EMAIL_PASSWORD_SIGNUP_ENABLED`** (and its `NEXT_PUBLIC_` twin). The old variables are still honored as deprecated aliases, and the most restrictive setting wins. `NEXT_PUBLIC_EMAIL_PASSWORD_SIGNUP_ENABLED=false` now also disables email/password sign-in on the server. | Move to `REGISTRATION_MODE`. See [Control registration and sign-in](/platform/self-hosting/authentication#controlling-who-can-sign-up). |
| **Enterprise `NEXT_PUBLIC_*` flags and `NEXT_PUBLIC_SANDBOXES_ENABLED` are no longer read.** The browser reads the server's resolved settings. | Set the server variable for each feature. See the [feature flag reference](/platform/enterprise/self-hosted#feature-flag-reference). |
| **`ALLOW_PRIVATE_DATABASE_HOSTS` was removed.** The app logs an error at startup if it is still set. | Name your database, cache, and mail hosts in the egress allowlists. See [Upgrading from an earlier release](/platform/self-hosting/security#upgrading-from-an-earlier-release). |
| **White-labeling was removed.** `NEXT_PUBLIC_BRAND_*`, `NEXT_PUBLIC_CUSTOM_CSS_URL`, `NEXT_PUBLIC_SUPPORT_EMAIL`, `NEXT_PUBLIC_DOCUMENTATION_URL`, `NEXT_PUBLIC_TERMS_URL`, `NEXT_PUBLIC_PRIVACY_URL`, `WHITELABELING_ENABLED`, and `NEXT_PUBLIC_WHITELABELING_ENABLED` are ignored. | Remove them at your convenience; leaving them set is harmless. |
| **`docker-compose.ollama.yml` is now an overlay on `docker-compose.prod.yml`.** | A stack started from the previous standalone file needs its project name carried over, or it starts on an empty database. See [Migrating from the previous Ollama stack](/platform/self-hosting/docker#migrating-from-the-previous-ollama-stack). |
| **Helm chart 1.12 to 1.15 removed values.** `branding` (1.12), `monitoring.serviceMonitor` and `sharedStorage` (1.13), and the enterprise `NEXT_PUBLIC_*` keys (1.14) are gone; `sharedStorage.enabled: true` with volumes fails the render. | Read the chart's [upgrade notes](https://github.com/simstudioai/sim/blob/main/helm/sim/README.md#upgrading-to-1150) for each version you cross. |

## Upgrade procedure

Before applying an upgrade, configure a direct, non-pooled `MIGRATION_DATABASE_URL` on the migrator if the app uses a pooler. Session advisory locks do not survive transaction pooling. Pass the URL through the migrator's database Secret on Helm or its explicit environment on Compose; `app.env` or `.env` alone does not reach it. See [Migration environment](#migration-environment) for the exact setup.
Expand Down Expand Up @@ -170,7 +186,7 @@ docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile
docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile "$PROFILE" up -d
```

A stack started from the previous, standalone `docker-compose.ollama.yml` ran under the project name `sim-with-ollama`. Upgrading it to the overlay without carrying that name over starts Sim on an empty database: stop it with `docker compose -p sim-with-ollama down` (no `-v`), then set `COMPOSE_PROJECT_NAME=sim-with-ollama` and its `POSTGRES_PASSWORD` (`postgres` unless you set one) in `.env` before starting the overlay. See [Migrating from the previous Ollama stack](/platform/self-hosting/docker#migrating-from-the-previous-ollama-stack). Ollama is no longer published on host port `11434`; use `docker compose exec`.
Upgrading from the previous, standalone `docker-compose.ollama.yml`? Follow [Migrating from the previous Ollama stack](/platform/self-hosting/docker#migrating-from-the-previous-ollama-stack) first, or Sim starts on an empty database.

<Callout type="warn">
`sim-setup update` refuses two install kinds outright rather than doing something surprising:
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/platform/self-hosting/verify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Doctor is not a Helm runtime diagnostic. For Kubernetes, use the infrastructure
| 6 | Upload and download a small file in Files. | Storage works end to end. | Check signed-URL/CORS settings for cloud storage, or app/proxy logs for local storage. |
| 7 | Upload a file larger than 50 MiB and confirm completion. | Multipart upload works on cloud or local storage. | Read part-upload and completion errors in app logs. |

Two windows verify collaboration between clients. To establish cross-replica operation, also confirm their socket connections reach different realtime pods. A load balancer can send both windows to one process. Multi-replica operation requires `REDIS_URL` on the app and realtime services.
Two windows verify collaboration between clients. To establish cross-replica operation, also confirm their socket connections reach different realtime pods. A load balancer can send both windows to one process. Every replica of the app and realtime services must reach the same Redis through `REDIS_URL`.

Cloud uploads use multipart above 50 MiB; local uploads use it above 8 MiB. Local parts pass through Sim, while cloud parts use signed provider URLs. See [Object storage](/platform/self-hosting/object-storage).

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/openapi-v2-workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -18606,7 +18606,7 @@
},
"redisAvailable": {
"type": "boolean",
"description": "Whether the distributed cancellation channel was available."
"description": "Kept for compatibility. False only when a cancellation that must publish its cancellation event did not."
},
"durablyRecorded": {
"type": "boolean",
Expand Down
Loading
Loading