Skip to content

Commit 0d5700f

Browse files
authored
use t3-env for WORKFLOWS_RPC_URL (#1197)
* use t3-env for WORKFLOWS_RPC_URL * fix types
1 parent b200fe4 commit 0d5700f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

apps/web/lib/server.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import "server-only";
22

33
import { decrypt } from "@cap/database/crypto";
4+
import { serverEnv } from "@cap/env";
45
import {
56
AwsCredentials,
67
Database,
@@ -36,7 +37,6 @@ import {
3637
Redacted,
3738
} from "effect";
3839
import { cookies } from "next/headers";
39-
4040
import { allowedOrigins } from "@/utils/cors";
4141
import { layerTracer } from "./tracing";
4242

@@ -56,10 +56,9 @@ const CookiePasswordAttachmentLive = Layer.effect(
5656
class WorkflowRpcSecret extends Effect.Service<WorkflowRpcSecret>()(
5757
"WorkflowRpcSecret",
5858
{
59-
effect: Effect.map(
60-
Config.redacted(Config.string("WORKFLOWS_RPC_SECRET")),
61-
(v) => ({ authSecret: v }),
62-
),
59+
sync: () => ({
60+
authSecret: Redacted.make(serverEnv().WORKFLOWS_RPC_SECRET),
61+
}),
6362
},
6463
) {}
6564

packages/env/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ function createServerEnv() {
6767
S3_PUBLIC_ENDPOINT: z.string().optional(),
6868
S3_INTERNAL_ENDPOINT: z.string().optional(),
6969
VERCEL_AWS_ROLE_ARN: z.string().optional(),
70-
REMOTE_WORKFLOW_URL: z.string().optional(),
71-
REMOTE_WORKFLOW_SECRET: z.string().optional(),
70+
WORKFLOWS_RPC_URL: z.string().optional(),
71+
WORKFLOWS_RPC_SECRET: z.string(),
7272
},
7373
experimental__runtimeEnv: {
7474
...process.env,

0 commit comments

Comments
 (0)