@@ -6,39 +6,38 @@ dotenv.config()
66 * @returns {Object } 包含apiKeys数组和adminKey的对象
77 */
88const parseApiKeys = ( ) => {
9- const apiKeyEnv = process . env . API_KEY
10- if ( ! apiKeyEnv ) {
11- return { apiKeys : [ ] , adminKey : null }
12- }
9+ const apiKeyEnv = process . env . API_KEY
10+ if ( ! apiKeyEnv ) {
11+ return { apiKeys : [ ] , adminKey : null }
12+ }
1313
14- const keys = apiKeyEnv . split ( ',' ) . map ( key => key . trim ( ) ) . filter ( key => key . length > 0 )
15- return {
16- apiKeys : keys ,
17- adminKey : keys . length > 0 ? keys [ 0 ] : null
18- }
14+ const keys = apiKeyEnv . split ( ',' ) . map ( key => key . trim ( ) ) . filter ( key => key . length > 0 )
15+ return {
16+ apiKeys : keys ,
17+ adminKey : keys . length > 0 ? keys [ 0 ] : null
18+ }
1919}
2020
2121const { apiKeys, adminKey } = parseApiKeys ( )
2222
2323const config = {
24- dataSaveMode : process . env . DATA_SAVE_MODE || "none" ,
25- apiKeys : apiKeys ,
26- adminKey : adminKey ,
27- simpleModelMap : process . env . SIMPLE_MODEL_MAP === 'true' ? true : false ,
28- listenAddress : process . env . LISTEN_ADDRESS || null ,
29- listenPort : process . env . SERVICE_PORT || 3000 ,
30- searchInfoMode : process . env . SEARCH_INFO_MODE === 'table' ? "table" : "text" ,
31- outThink : process . env . OUTPUT_THINK === 'true' ? true : false ,
32- redisURL : process . env . REDIS_URL || null ,
33- autoRefresh : true ,
34- autoRefreshInterval : 6 * 60 * 60 ,
35- cacheMode : process . env . CACHE_MODE || "default" ,
36- logLevel : process . env . LOG_LEVEL || "INFO" ,
37- enableFileLog : process . env . ENABLE_FILE_LOG === 'true' ,
38- logDir : process . env . LOG_DIR || "./logs" ,
39- maxLogFileSize : parseInt ( process . env . MAX_LOG_FILE_SIZE ) || 10 ,
40- maxLogFiles : parseInt ( process . env . MAX_LOG_FILES ) || 5 ,
41- ssxmodItna : process . env . SSXMOD_ITNA || "mqUxRDBDnD00I4eKYIxAK0QD2W3nDAQDRDl4Bti=GgexFqAPqDHI63vYWtiiY0DjOxqbVji84D/I7eGzDiMPGhDBeEHzKtg5xKFIWrEx4qICCGxK3OGYZeqK0Ge2Nq3vwn0XX3NyzZiPYxGLDY=DCqqqYorbDYAEDBYD74G+DDeDixGmQeDSDxD9DGPdglTi2eDEDYPdxA3Di4D+jebDmd4DGuo4x7QaRmxD0ux58mDz8aF46PmzMeqOVRbDjTPD/R+LO0RC2FkKYa9AV8amGeGyi5GuDPmb=jHORnniHpeY0d0hbGedW4qTBq=DYx+DP24FGDBirCht5B5QYipOYameDD3bWD+GNbADKpt9gtBoNbGGwiDmmIafRPx2Uem2i44Gb1mGz0pNlqV=Gxlqk8xP2DxD"
24+ dataSaveMode : process . env . DATA_SAVE_MODE || "none" ,
25+ apiKeys : apiKeys ,
26+ adminKey : adminKey ,
27+ simpleModelMap : process . env . SIMPLE_MODEL_MAP === 'true' ? true : false ,
28+ listenAddress : process . env . LISTEN_ADDRESS || null ,
29+ listenPort : process . env . SERVICE_PORT || 3000 ,
30+ searchInfoMode : process . env . SEARCH_INFO_MODE === 'table' ? "table" : "text" ,
31+ outThink : process . env . OUTPUT_THINK === 'true' ? true : false ,
32+ redisURL : process . env . REDIS_URL || null ,
33+ autoRefresh : true ,
34+ autoRefreshInterval : 6 * 60 * 60 ,
35+ cacheMode : process . env . CACHE_MODE || "default" ,
36+ logLevel : process . env . LOG_LEVEL || "INFO" ,
37+ enableFileLog : process . env . ENABLE_FILE_LOG === 'true' ,
38+ logDir : process . env . LOG_DIR || "./logs" ,
39+ maxLogFileSize : parseInt ( process . env . MAX_LOG_FILE_SIZE ) || 10 ,
40+ maxLogFiles : parseInt ( process . env . MAX_LOG_FILES ) || 5 ,
4241}
4342
4443module . exports = config
0 commit comments