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
3 changes: 3 additions & 0 deletions packages/stack/src/services/Studio.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -53,6 +54,8 @@ export const makeSpec = (): ProcessRecipeSpec<Creation> => ({
const values: Record<string, string> = {
...(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,
Comment thread
7ttp marked this conversation as resolved.
Resolved
};
if (creation.config.databaseUrl !== undefined) {
// Studio encrypts a connection string from these for pg-meta; the bootstrap gives the
Expand Down
11 changes: 11 additions & 0 deletions packages/stack/src/services/Studio.unit.test.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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,
});
}),
);
Loading