feat: add admin menu, persistent json config, multi-provider support, and custom model fallback revolver
This commit is contained in:
parent
637a3cf255
commit
1c955619e7
21 changed files with 3742 additions and 388 deletions
|
|
@ -1,12 +1,14 @@
|
|||
import dotenv from 'dotenv';
|
||||
import path from 'path';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
export const config = {
|
||||
apiPassword: process.env.API_PASSWORD,
|
||||
geminiApiKeys: (process.env.GEMINI_API_KEYS || '').split(',').filter(key => key.trim()),
|
||||
geminiApiKeys: (process.env.GEMINI_API_KEYS || '').split(',').map(k => k.trim()).filter(Boolean),
|
||||
port: parseInt(process.env.PORT || '3000', 10),
|
||||
logDir: process.env.LOG_DIR || './logs',
|
||||
configFilePath: process.env.CONFIG_FILE || path.join(process.cwd(), 'data', 'revolver-config.json'),
|
||||
model: 'gemini-flash-lite-latest',
|
||||
rateLimitDurationMs: parseInt(process.env.RATE_LIMIT_DURATION_MS || '60000', 10)
|
||||
};
|
||||
|
|
@ -14,7 +16,3 @@ export const config = {
|
|||
if (!config.apiPassword) {
|
||||
throw new Error('API_PASSWORD is required. Please set it in .env file');
|
||||
}
|
||||
|
||||
if (config.geminiApiKeys.length === 0) {
|
||||
throw new Error('No Gemini API keys configured. Please set GEMINI_API_KEYS in .env file');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue