-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.js
More file actions
148 lines (136 loc) · 4.68 KB
/
Copy pathconfig.example.js
File metadata and controls
148 lines (136 loc) · 4.68 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Enhanced ToolThreads V2 Configuration (EXAMPLE TEMPLATE)
// NOTE: Replace placeholders with your own values.
const ENHANCED_CONFIG = {
// Firebase Configuration - New Project
firebase: {
apiKey: "REPLACE_WITH_FIREBASE_API_KEY",
authDomain: "REPLACE_WITH_FIREBASE_AUTH_DOMAIN",
projectId: "REPLACE_WITH_FIREBASE_PROJECT_ID",
storageBucket: "REPLACE_WITH_FIREBASE_STORAGE_BUCKET",
messagingSenderId: "REPLACE_WITH_FIREBASE_SENDER_ID",
appId: "REPLACE_WITH_FIREBASE_APP_ID",
measurementId: "REPLACE_WITH_FIREBASE_MEASUREMENT_ID"
},
// Cloud Functions Endpoint
apiEndpoint: "REPLACE_WITH_CLOUD_FUNCTIONS_API_ENDPOINT",
// Enhanced Features Configuration
presets: {
maxPresets: 100,
maxMediaSize: 10 * 1024 * 1024, // 10MB
maxMediaPerPreset: 4,
supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
supportedVideoTypes: ['video/mp4', 'video/webm']
},
// Setup Mode Configuration
setupMode: {
enabled: true,
profilePicture: {
maxSize: 5 * 1024 * 1024, // 5MB
supportedTypes: ['image/jpeg', 'image/png']
},
welcomePosts: {
post1: {
caption: "Welcome to Threads! 🧵 Excited to be here and connect with this amazing community. #ThreadsWelcome",
media: []
},
post2: {
caption: "Here's a little introduction about what you can expect from my account. Check out the link in my bio for more! 🔗",
media: [], // Will be populated with 2 images
includeLink: true
}
},
// Warm-Up System Configuration
warmupSession: {
enabled: true,
// Action probabilities (must sum to <= 1.0)
probabilities: {
SCROLL_TIMELINE: 0.70,
OPEN_TWEET: 0.10,
LIKE_TWEET: 0.05,
OPEN_PROFILE: 0.05,
OPEN_NOTIFICATIONS: 0.05,
IDLE: 0.05
},
// Timing configuration (in milliseconds)
timings: {
scrollDelay: { min: 1000, max: 3000 },
actionDelay: { min: 2000, max: 5000 },
readingTime: { min: 5000, max: 15000 },
idleDuration: { min: 10000, max: 30000 }
},
// Limits per session
limits: {
maxLikes: 20,
maxProfiles: 10,
maxTweetsOpened: 30
}
}
},
// Admin Dashboard Configuration
adminDashboard: {
enabled: true,
syncInterval: 9000000, // 2.5 hours (150 minutes) - optimized for cost reduction
pushUpdates: true,
manualSyncEnabled: true // Allow manual sync from dashboard
},
// License Management Configuration
licensing: {
enabled: true,
validateOnStartup: true,
validationInterval: 43200000, // 12 hours (was 1 hour) - optimized for cost reduction
storageKey: 'toolthreads_license_data',
endpoints: {
validate: '/extension/validateLicense',
getPresets: '/extension/getPresets'
},
gracePeriod: 24 * 60 * 60 * 1000 // 24 hours in case of temporary network issues
},
// Firebase Real-time Listeners Configuration
// Replaces polling to reduce Firestore read costs by 99.7%
firebaseListeners: {
enabled: true, // Set to false to use legacy polling
instantPosts: {
enabled: true,
queryLimit: 10, // Max instant posts to fetch per query
fallbackPollingInterval: 10800000, // 3 hours (only as fallback, real-time listener is primary)
delayedStart: true, // Wait for Firestore connection before starting listener
startDelay: 10000 // Wait 10 seconds for connection to stabilize
},
syncSignals: {
enabled: true,
signalTimeout: 60000, // 1 minute (signals older than this are ignored)
fallbackPollingInterval: 60000 // 60 seconds (fallback if listener fails)
},
presetVersion: {
enabled: true,
fallbackPollingInterval: 9000000 // 2.5 hours (same as admin sync)
},
reconnection: {
maxAttempts: 5,
initialDelay: 1000, // 1 second
maxDelay: 30000, // 30 seconds
exponentialBackoff: true
},
serviceWorker: {
keepaliveEnabled: false, // Set to true only if needed (increases battery usage)
keepaliveInterval: 25000 // 25 seconds (keeps service worker alive)
}
},
// Version and Compatibility
version: "2.0.0",
compatibilityCheck: true,
// Development/Debug Settings
debug: false,
logging: true
};
// Export configuration
if (typeof module !== 'undefined' && module.exports) {
module.exports = ENHANCED_CONFIG;
} else if (typeof window !== 'undefined') {
window.ENHANCED_CONFIG = ENHANCED_CONFIG;
} else if (typeof self !== 'undefined') {
self.ENHANCED_CONFIG = ENHANCED_CONFIG;
} else {
globalThis.ENHANCED_CONFIG = ENHANCED_CONFIG;
}
console.log('[Enhanced Config] Configuration loaded - Version', ENHANCED_CONFIG.version);