diff --git a/packages/stack/src/services/Studio.ts b/packages/stack/src/services/Studio.ts index 30a57e44e9..47368ae45e 100644 --- a/packages/stack/src/services/Studio.ts +++ b/packages/stack/src/services/Studio.ts @@ -1,4 +1,5 @@ import { Effect, Schema } from "effect"; +import { DEFAULT_LOCAL_S3_ACCESS_KEY_ID, DEFAULT_LOCAL_S3_SECRET_ACCESS_KEY } from "../Defaults.ts"; import { EndpointIntent, serviceCreation } from "./Recipe.ts"; import { databaseConnection, serviceJwt } from "./ServiceConfig.ts"; import { type ProcessRecipeSpec } from "./ProcessRecipe.ts"; @@ -53,6 +54,8 @@ export const makeSpec = (): ProcessRecipeSpec => ({ const values: Record = { ...(http === undefined ? {} : { PORT: String(http.port) }), HOSTNAME: container ? "0.0.0.0" : "127.0.0.1", + S3_PROTOCOL_ACCESS_KEY_ID: DEFAULT_LOCAL_S3_ACCESS_KEY_ID, + S3_PROTOCOL_ACCESS_KEY_SECRET: DEFAULT_LOCAL_S3_SECRET_ACCESS_KEY, }; if (creation.config.databaseUrl !== undefined) { // Studio encrypts a connection string from these for pg-meta; the bootstrap gives the diff --git a/packages/stack/src/services/Studio.unit.test.ts b/packages/stack/src/services/Studio.unit.test.ts index 3df34ffb7f..f259e10664 100644 --- a/packages/stack/src/services/Studio.unit.test.ts +++ b/packages/stack/src/services/Studio.unit.test.ts @@ -1,5 +1,6 @@ import { expect, it } from "@effect/vitest"; import { Effect } from "effect"; +import { DEFAULT_LOCAL_S3_ACCESS_KEY_ID, DEFAULT_LOCAL_S3_SECRET_ACCESS_KEY } from "../Defaults.ts"; import { makeSpec, type Creation } from "./Studio.ts"; import { selection } from "../../tests/pins.ts"; @@ -42,3 +43,13 @@ it.effect("mounts the snippets folder read-write and names it per runtime", () = ]); }), ); + +it.effect("gives Studio the local S3 protocol keys that Storage accepts", () => + Effect.gen(function* () { + const env = yield* makeSpec().env(creation({}), new Map(), false); + expect(env).toMatchObject({ + S3_PROTOCOL_ACCESS_KEY_ID: DEFAULT_LOCAL_S3_ACCESS_KEY_ID, + S3_PROTOCOL_ACCESS_KEY_SECRET: DEFAULT_LOCAL_S3_SECRET_ACCESS_KEY, + }); + }), +);