This commit is contained in:
jjbrunton committed 2026-01-05 00:17:06 +00:00
1 parent b780bff850
commit 7b3ea37127
1752 files changed
+1341 -166

No files matched your search

+12 -1
View File
@@ -12,10 +12,13 @@ export const ConfigSchema = z.object({
pollIntervalMs: z.number().default(120000),
userAgent: z.string().default('RedditBot/1.0'),
targetGenders: z.array(z.enum(['male', 'female', 'other', 'unknown'])).default(['female']),
username: z.string().optional(),
password: z.string().optional(),
}),
openrouter: z.object({
apiKey: z.string(),
model: z.string().default('google/gemini-3-flash-preview'),
imageAnalysisModel: z.string().default('google/gemini-3-flash-preview'),
chatModel: z.string().default('google/gemini-3-flash-preview'),
imageAnalysisPrompt: z.string(),
messageGenerationPrompt: z.string(),
}),
@@ -56,6 +59,14 @@ export function loadConfig(): Config {
}
rawConfig.openrouter.apiKey = process.env.OPENROUTER_API_KEY || rawConfig.openrouter.apiKey;
// Inject Reddit credentials from environment
if (process.env.REDDIT_USERNAME) {
rawConfig.reddit.username = process.env.REDDIT_USERNAME;
}
if (process.env.REDDIT_PASSWORD) {
rawConfig.reddit.password = process.env.REDDIT_PASSWORD;
}
// Override browser settings from environment
if (process.env.BROWSER_HEADLESS !== undefined) {
if (!rawConfig.browser) rawConfig.browser = {};