refactor(media): ♻️ Massively simplify media pipeline with Bun.S3

This commit is contained in:
Jesse Wierzbinski 2025-01-29 17:21:40 +01:00
parent 29cbe7d293
commit 9ba6237f13
No known key found for this signature in database
21 changed files with 197 additions and 1005 deletions

View file

@ -276,14 +276,7 @@ export const configValidator = z
public_url: zUrl,
})
.strict()
.default({
endpoint: "",
access_key: "",
secret_access_key: "",
region: undefined,
bucket_name: "versia",
public_url: "https://cdn.example.com",
}),
.optional(),
validation: z
.object({
max_displayname_size: z.number().int().default(50),
@ -854,6 +847,11 @@ export const configValidator = z
.strict()
.optional(),
})
.strict();
.strict()
.refine(
// If media backend is S3, s3 config must be set
(arg) => arg.media.backend === MediaBackendType.Local || !!arg.s3,
"S3 config must be set when using S3 media backend",
);
export type Config = z.infer<typeof configValidator>;