Skip to content

Commit 9f7b1b1

Browse files
committed
fix: revert check-renders + remotion.ts to clean dev content
check-renders: clean dev version + 3-line audit comment only. remotion.ts: exact dev version (removes ghost diff). Previous commits had Miriad secret redaction corrupting 'production' strings in log messages.
1 parent 0d159b7 commit 9f7b1b1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/services/remotion.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ import {
2222
getRenderProgress,
2323
type AwsRegion,
2424
} from "@remotion/lambda/client";
25+
import { getConfigValue } from "@/lib/config";
2526

2627
// ---------------------------------------------------------------------------
2728
// Types
2829
// ---------------------------------------------------------------------------
2930

30-
export interface RemotionConfig {
31+
export interface RemotionLambdaConfig {
3132
awsAccessKeyId: string;
3233
awsSecretAccessKey: string;
3334
region: string;
@@ -130,11 +131,11 @@ function mapInputProps(input: RenderInput): Record<string, unknown> {
130131
* Get Remotion Lambda configuration from environment variables.
131132
* Throws if any required env var is missing.
132133
*/
133-
export function getRemotionConfig(): RemotionConfig {
134+
export async function getRemotionConfig(): Promise<RemotionLambdaConfig> {
134135
const awsAccessKeyId = process.env.AWS_ACCESS_KEY_ID;
135136
const awsSecretAccessKey = process.env.AWS_SECRET_ACCESS_KEY;
136-
const region = process.env.REMOTION_AWS_REGION;
137-
const serveUrl = process.env.REMOTION_SERVE_URL;
137+
const region = await getConfigValue("remotion_config", "awsRegion", process.env.REMOTION_AWS_REGION);
138+
const serveUrl = await getConfigValue("remotion_config", "serveUrl", process.env.REMOTION_SERVE_URL);
138139

139140
const missing: string[] = [];
140141
if (!awsAccessKeyId) missing.push("AWS_ACCESS_KEY_ID");
@@ -161,8 +162,8 @@ export function getRemotionConfig(): RemotionConfig {
161162
/**
162163
* Get the Lambda function name from env or use the default.
163164
*/
164-
function getFunctionName(): string {
165-
return process.env.REMOTION_FUNCTION_NAME || DEFAULT_FUNCTION_NAME;
165+
async function getFunctionName(): Promise<string> {
166+
return getConfigValue("remotion_config", "functionName", process.env.REMOTION_FUNCTION_NAME || DEFAULT_FUNCTION_NAME);
166167
}
167168

168169
// ---------------------------------------------------------------------------
@@ -202,8 +203,8 @@ async function startRender(
202203
composition: string,
203204
input: RenderInput
204205
): Promise<{ renderId: string; bucketName: string }> {
205-
const config = getRemotionConfig();
206-
const functionName = getFunctionName();
206+
const config = await getRemotionConfig();
207+
const functionName = await getFunctionName();
207208
const region = config.region as AwsRegion;
208209

209210
log(`Starting render for composition "${composition}"`, {
@@ -291,8 +292,8 @@ export async function checkRenderProgress(
291292
renderId: string,
292293
bucketName: string
293294
): Promise<RenderProgressResult> {
294-
const config = getRemotionConfig();
295-
const functionName = getFunctionName();
295+
const config = await getRemotionConfig();
296+
const functionName = await getFunctionName();
296297
const region = config.region as AwsRegion;
297298

298299
const progress = await getRenderProgress({

0 commit comments

Comments
 (0)