Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/add-celld-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@workflow/web': patch
---

Add `@ewhauser/world-celld` to `worlds-manifest.json` as an experimental, self-hosted community World. Allow the web UI to report its connection metadata while redacting the shared secret.
30 changes: 29 additions & 1 deletion packages/web/app/server/workflow-server-actions.server.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { AnalyticsEvent, Hook } from '@workflow/world';
import { describe, expect, it } from 'vitest';
import { afterEach, describe, expect, it, vi } from 'vitest';
import {
analyticsEventToEvent,
getPublicServerConfig,
hookToListItem,
} from './workflow-server-actions.server';

Expand Down Expand Up @@ -100,3 +101,30 @@ describe('hookToListItem', () => {
expect('token' in listItem).toBe(false);
});
});

describe('getPublicServerConfig', () => {
afterEach(() => {
vi.unstubAllEnvs();
});

it('redacts the celld shared secret while exposing connection metadata', async () => {
vi.stubEnv('WORKFLOW_TARGET_WORLD', '@ewhauser/world-celld');
vi.stubEnv('CELLD_FLEET_URL', 'http://fleet.internal:8080');
vi.stubEnv('CELLD_WORLD_SECRET', 'super-secret');
vi.stubEnv('WORKFLOW_BASE_URL', 'https://workflow.example.com');

const config = await getPublicServerConfig();

expect(config).toMatchObject({
backendDisplayName: 'world-celld',
backendId: '@ewhauser/world-celld',
publicEnv: {
WORKFLOW_TARGET_WORLD: '@ewhauser/world-celld',
CELLD_FLEET_URL: 'http://fleet.internal:8080',
WORKFLOW_BASE_URL: 'https://workflow.example.com',
},
sensitiveEnvKeys: ['CELLD_WORLD_SECRET'],
});
expect(config.publicEnv).not.toHaveProperty('CELLD_WORLD_SECRET');
});
});
7 changes: 7 additions & 0 deletions packages/web/app/server/workflow-server-actions.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ const WORLD_ENV_ALLOWLIST_BY_TARGET_WORLD: Record<string, string[]> = {
'JAZZ_WORKER_ACCOUNT',
'JAZZ_WORKER_SECRET',
],
'@ewhauser/world-celld': [
'WORKFLOW_TARGET_WORLD',
'CELLD_FLEET_URL',
'CELLD_WORLD_SECRET',
'WORKFLOW_BASE_URL',
],
};

function getAllowedEnvKeysForBackend(backendId: string): string[] {
Expand All @@ -247,6 +253,7 @@ const WORLD_SENSITIVE_ENV_KEYS = new Set<string>([
'WORKFLOW_REDIS_URI',
'JAZZ_API_KEY',
'JAZZ_WORKER_SECRET',
'CELLD_WORLD_SECRET',
]);

function isSet(value: string | undefined): value is string {
Expand Down
20 changes: 20 additions & 0 deletions worlds-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,26 @@
"requiresCredentials": true,
"credentialsNote": "Requires JAZZ_API_KEY, JAZZ_WORKER_ACCOUNT, and JAZZ_WORKER_SECRET from Jazz Cloud"
},
{
"id": "celld",
"type": "community",
"package": "@ewhauser/world-celld",
"name": "celld",
"description": "Experimental self-hosted World backed by celld Durable Objects for durable workflow storage, queues, and streams",
"repository": "https://github.com/ewhauser/world-celld",
"docs": "https://github.com/ewhauser/world-celld#readme",
"features": [],
"env": {
"WORKFLOW_TARGET_WORLD": "@ewhauser/world-celld",
"CELLD_FLEET_URL": "http://fleet.internal:8080",
"CELLD_WORLD_SECRET": "",
"WORKFLOW_BASE_URL": "https://workflow.example.com"
},
"services": [],
"requiresCredentials": true,
"credentialsNote": "Requires a deployed celld fleet and CELLD_WORLD_SECRET matching the fleet's WORLD_SECRET",
"requiresDeployment": true
},
{
"id": "fantasticfour-redis",
"type": "community",
Expand Down