PYAE1994's picture
Upload folder using huggingface_hub
dd480ef verified
/**
* Scripts: Validate Environment
* Checks all required env vars before deployment
*/
const REQUIRED_SIMULATOR_VARS = [
'OPENAI_API_KEY',
'N8N_BASE_URL',
'N8N_API_KEY',
'INTERNAL_API_SECRET',
];
const REQUIRED_WORKER_SECRETS = [
'OPENAI_API_KEY',
'N8N_API_KEY',
'INTERNAL_API_SECRET',
];
let hasError = false;
console.log('[ValidateEnv] Checking Simulator service environment variables...');
for (const key of REQUIRED_SIMULATOR_VARS) {
if (!process.env[key]) {
console.error(` βœ— Missing: ${key}`);
hasError = true;
} else {
console.log(` βœ“ ${key}`);
}
}
console.log('');
console.log('[ValidateEnv] Cloudflare Worker secrets (set via wrangler secret put):');
for (const key of REQUIRED_WORKER_SECRETS) {
console.log(` β†’ wrangler secret put ${key}`);
}
if (hasError) {
console.error('\n[ValidateEnv] βœ— Environment validation failed. Set missing variables before deploying.');
process.exit(1);
} else {
console.log('\n[ValidateEnv] βœ“ All environment variables present.');
}