Skip to content

Commit 5db246c

Browse files
authored
Merge pull request #145 from PerformanC/dev
merge: v3 <- dev
2 parents 524f618 + 8943a31 commit 5db246c

File tree

104 files changed

+13937
-3168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+13937
-3168
lines changed

Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Builder - Install dependencies
2-
FROM node:20-alpine AS builder
2+
FROM node:25-alpine AS builder
33

44
# Install git (required for npm to install dependencies from GitHub)
55
RUN apk add --no-cache git
@@ -9,15 +9,15 @@ WORKDIR /app
99

1010
# Copy package.json and package-lock.json (if available) to leverage Docker cache
1111
# Use wildcards to ensure both package.json and package-lock.json (or yarn.lock/pnpm-lock.yaml) are copied
12-
COPY package*.json ./
12+
COPY package.json ./
1313

1414
# Install production dependencies
1515
# This command automatically handles package-lock.json if it exists, otherwise it creates one.
1616
# For Bun, you might use 'bun install --production'.
1717
RUN npm install
1818

1919
# Stage 2: Runner - Copy application code and run
20-
FROM node:20-alpine
20+
FROM node:25-alpine
2121

2222
# Set working directory
2323
WORKDIR /app
@@ -30,10 +30,6 @@ COPY --from=builder /app/node_modules ./node_modules
3030
COPY src/ ./src/
3131
COPY config.default.js ./config.default.js
3232
COPY package.json ./package.json
33-
COPY biome.json ./biome.json
34-
COPY commitlint.config.mjs ./commitlint.config.mjs
35-
COPY LICENSE ./LICENSE
36-
COPY README.md ./README.md
3733

3834
# Expose the port the application listens on (default is 3000 from config.default.js)
3935
EXPOSE 3000

config.default.js

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,36 @@ export default {
99
enabled: true, // active cluster (or use env CLUSTER_ENABLED)
1010
workers: 0, // 0 => uses os.cpus().length, or specify a number (1 = 2 processes total: master + 1 worker)
1111
minWorkers: 1, // Minimum workers to keep alive (improves availability during bursts)
12+
specializedSourceWorker: {
13+
enabled: true, // If true, source loading (search, lyrics, etc.) is delegated to dedicated workers to prevent voice worker lag
14+
count: 1, // Number of separate process clusters for source operations
15+
microWorkers: 2, // Number of worker threads per process cluster
16+
tasksPerWorker: 32, // Number of parallel tasks each micro-worker can handle before queuing
17+
silentLogs: true // If true, micro-workers will only log warnings and errors
18+
},
1219
commandTimeout: 6000, // Timeout for heavy operations like loadTracks (6s)
1320
fastCommandTimeout: 4000, // Timeout for player commands like play/pause (4s)
1421
maxRetries: 2, // Number of retry attempts on timeout or worker failure
22+
hibernation: {
23+
enabled: true,
24+
timeoutMs: 1200000
25+
},
1526
scaling: {
16-
// New object to group scaling configurations
27+
//scaling configurations
1728
maxPlayersPerWorker: 20, // Reference capacity for utilization calculation
1829
targetUtilization: 0.7, // Target utilization for scaling up/down
1930
scaleUpThreshold: 0.75, // Utilization threshold to scale up
2031
scaleDownThreshold: 0.3, // Utilization threshold to scale down
2132
checkIntervalMs: 5000, // Interval to check for scaling needs
2233
idleWorkerTimeoutMs: 60000, // Time in ms an idle worker should wait before being removed
23-
queueLengthScaleUpFactor: 5 // How many commands in queue per active worker trigger scale up
34+
queueLengthScaleUpFactor: 5, // How many commands in queue per active worker trigger scale up
35+
lagPenaltyLimit: 60, // Event loop lag threshold (ms) to penalize worker cost
36+
cpuPenaltyLimit: 0.85 // CPU usage threshold (85% of a core) to force scale up
37+
},
38+
endpoint: {
39+
patchEnabled: true,
40+
allowExternalPatch: false,
41+
code: 'CAPYBARA'
2442
}
2543
},
2644
logging: {
@@ -55,10 +73,12 @@ export default {
5573
maxSearchResults: 10,
5674
maxAlbumPlaylistLength: 100,
5775
playerUpdateInterval: 2000,
76+
statsUpdateInterval: 30000,
5877
trackStuckThresholdMs: 10000,
5978
zombieThresholdMs: 60000,
6079
enableHoloTracks: false,
6180
enableTrackStreamEndpoint: false,
81+
enableLoadStreamEndpoint: false,
6282
resolveExternalLinks: false,
6383
fetchChannelInfo: false,
6484
filters: {
@@ -79,9 +99,23 @@ export default {
7999
timescale: true
80100
}
81101
},
82-
defaultSearchSource: 'youtube',
102+
defaultSearchSource: ['youtube', 'soundcloud'],
83103
unifiedSearchSources: ['youtube', 'soundcloud'],
84104
sources: {
105+
vkmusic: {
106+
enabled: true,
107+
userToken: '', // (optional) get from vk in browser devtools -> reqs POST /?act=web_token HTTP/2 - headers -> response -> access_token
108+
userCookie: '' // (required without userToken) get from vk in browser devtools -> reqs POST /?act=web_token HTTP/2 - headers -> request -> cookie (copy full cookie header)
109+
},
110+
amazonmusic: {
111+
enabled: true
112+
},
113+
mixcloud: {
114+
enabled: true
115+
},
116+
audiomack: {
117+
enabled: true
118+
},
85119
deezer: {
86120
// arl: '',
87121
// decryptionKey: '',
@@ -91,7 +125,8 @@ export default {
91125
enabled: true
92126
},
93127
soundcloud: {
94-
enabled: true
128+
enabled: true,
129+
// clientId: ""
95130
},
96131
local: {
97132
enabled: true,
@@ -104,6 +139,23 @@ export default {
104139
// Note: not 100% of the songs are currently working (but most should.), because i need to code a different extractor for every year (2010, 2011, etc. not all are done)
105140
enabled: true,
106141
},
142+
telegram: {
143+
enabled: true
144+
},
145+
shazam: {
146+
enabled: true,
147+
allowExplicit: true
148+
},
149+
bilibili: {
150+
enabled: true,
151+
sessdata: '' // Optional, improves access to some videos (premium and 4k+)
152+
},
153+
genius: {
154+
enabled: true
155+
},
156+
pinterest: {
157+
enabled: true
158+
},
107159
flowery: {
108160
enabled: true,
109161
voice: 'Salli',
@@ -118,6 +170,14 @@ export default {
118170
artistLoadLimit: 20
119171
// "secretKey": "38346591" // Optional, defaults to standard key
120172
},
173+
gaana: {
174+
enabled: true,
175+
apiUrl: 'https://gaana.1lucas1apk.fun/api', // if you want to host your server https://github.com/notdeltaxd/Gaana-API
176+
streamQuality: 'high',
177+
playlistLoadLimit: 100,
178+
albumLoadLimit: 100,
179+
artistLoadLimit: 100
180+
},
121181
"google-tts": {
122182
enabled: true,
123183
language: 'en-US'
@@ -157,6 +217,7 @@ export default {
157217
enabled: true,
158218
clientId: '',
159219
clientSecret: '',
220+
externalAuthUrl: 'http://get.1lucas1apk.fun/spotify/gettoken', // URL to external token provider (e.g. http://localhost:8080/api/token - use https://github.com/topi314/spotify-tokener or https://github.com/1Lucas1apk/gettoken)
160221
market: 'US',
161222
playlistLoadLimit: 1, // 0 means no limit (loads all tracks), 1 = 100 tracks, 2 = 100 and so on!
162223
playlistPageLoadConcurrency: 10, // How many pages to load simultaneously
@@ -185,7 +246,8 @@ export default {
185246
enabled: true,
186247
// Optional, setting this manually can help unblocking countries (since pandora is US only.). May need to be updated periodically.
187248
// fetching manually: use a vpn connected to US, go on pandora.com, open devtools, Network tab, first request to appear and copy the 2nd csrfToken= value.
188-
// csrfToken: ''
249+
// csrfToken: '',
250+
remoteTokenUrl: 'https://get.1lucas1apk.fun/pandora/gettoken' // URL to a remote provider that returns { success: true, authToken: "...", csrfToken: "...", expires_in_seconds: ... } //https://github.com/1Lucas1apk/gettoken
189251
},
190252
nicovideo: {
191253
enabled: true
@@ -212,6 +274,9 @@ export default {
212274
lrclib: {
213275
enabled: true
214276
},
277+
bilibili: {
278+
enabled: true
279+
},
215280
applemusic: {
216281
enabled: true,
217282
advanceSearch: true // Uses YTMusic to fetch the correct title and artists instead of relying on messy YouTube video titles, improving lyrics accuracy
@@ -222,6 +287,10 @@ export default {
222287
encryption: 'aead_aes256_gcm_rtpsize',
223288
resamplingQuality: 'best' // best, medium, fastest, zero order holder, linear
224289
},
290+
voiceReceive: {
291+
enabled: false,
292+
format: 'opus' // pcm_s16le, opus
293+
},
225294
routePlanner: {
226295
strategy: 'RotateOnBan', // RotateOnBan, RoundRobin, LoadBalance
227296
bannedIpCooldown: 600000, // 10 minutes
@@ -282,10 +351,10 @@ export default {
282351
autoCleanup: true
283352
},
284353
plugins: [
285-
/* {
286-
name: 'nodelink-sample-plugin',
287-
source: 'local'
288-
} */
354+
/* {
355+
name: 'nodelink-sample-plugin',
356+
source: 'local'
357+
} */
289358
],
290359
pluginConfig: {}
291-
}
360+
}

0 commit comments

Comments
 (0)