-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
88 lines (85 loc) · 2.69 KB
/
Copy pathconfig.js
File metadata and controls
88 lines (85 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import dotenv from 'dotenv';
dotenv.config();
const defaultLanguage = process.env.DEFAULT_LANGUAGE || 'en';
const fallbackLanguage = process.env.FALLBACK_LANGUAGE || 'en';
const configuredMaxRideMessagesPerChatThread = Number(process.env.MAX_RIDE_MESSAGES_PER_CHAT_THREAD);
const maxRideMessagesPerChatThread = Number.isInteger(configuredMaxRideMessagesPerChatThread) &&
configuredMaxRideMessagesPerChatThread > 0
? configuredMaxRideMessagesPerChatThread
: 5;
export const config = {
isDev: process.env.NODE_ENV === 'development',
debugLogMessages: process.env.DEBUG_LOG_MESSAGES === 'true',
i18n: {
defaultLanguage,
fallbackLanguage
},
bot: {
token: process.env.BOT_TOKEN,
webhookDomain: process.env.WEBHOOK_DOMAIN,
webhookPath: '/webhook',
useWebhook: process.env.USE_WEBHOOK === 'true' || false,
// Port for the webhook server to listen on
webhookPort: parseInt(process.env.WEBHOOK_PORT, 10) || 8080
},
mongodb: {
uri: process.env.MONGODB_URI || 'mongodb://localhost:27017/bikebot'
},
dateFormat: {
locale: 'en-GB',
date: {
weekday: 'short',
day: '2-digit',
month: 'short',
year: 'numeric'
},
time: {
hour: '2-digit',
minute: '2-digit'
},
// Default timezone for date/time conversions (e.g., 'Europe/London', 'America/New_York')
// If not set, the server's local timezone will be used
defaultTimezone: process.env.DEFAULT_TIMEZONE || null
},
routeProviders: {
strava: {
domain: 'strava.com',
patterns: [
/https?:\/\/(?:www\.)?strava\.com\/routes\/\d+/,
/https?:\/\/(?:www\.)?strava\.com\/activities\/\d+/
]
},
ridewithgps: {
domain: 'ridewithgps.com',
patterns: [
/https?:\/\/(?:www\.)?ridewithgps\.com\/routes\/\d+/,
/https?:\/\/(?:www\.)?ridewithgps\.com\/trips\/\d+/
]
},
komoot: {
domain: 'komoot.com',
patterns: [
/https?:\/\/(?:www\.)?komoot\.com\/tour\/\d+/
]
},
garmin: {
domain: 'connect.garmin.com',
patterns: [
/https?:\/\/connect\.garmin\.com\/modern\/activity\/\d+/,
/https?:\/\/connect\.garmin\.com\/modern\/course\/\d+/,
/https?:\/\/connect\.garmin\.com\/app\/activity\/\d+/,
/https?:\/\/connect\.garmin\.com\/app\/course\/\d+/
]
}
},
maxParticipantsDisplay: parseInt(process.env.MAX_PARTICIPANTS_DISPLAY, 10) || 20,
maxRideMessagesPerChatThread,
strava: {
clientId: process.env.STRAVA_CLIENT_ID || null,
clientSecret: process.env.STRAVA_CLIENT_SECRET || null,
refreshToken: process.env.STRAVA_REFRESH_TOKEN || null,
},
anthropic: {
apiKey: process.env.ANTHROPIC_API_KEY || null,
}
};