Skip to content

Commit c86e3d8

Browse files
committed
add bundle only option for docker
1 parent 9979b39 commit c86e3d8

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ COPY scripts/ ./scripts/
1313
COPY config.default.js ./config.default.js
1414
COPY plugins/ ./plugins/
1515

16-
RUN npm install --no-save esbuild postject rcedit && node scripts/build.js
16+
RUN npm install --no-save esbuild && BUNDLE_ONLY=1 node scripts/build.js
1717

1818
# Stage 2: Runner - Minimal image with bundled output
1919
FROM node:25-alpine

scripts/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ if (fs.existsSync(mediaplexPkgDir)) {
101101
}
102102
}
103103

104+
if (process.env.BUNDLE_ONLY) {
105+
console.log('Bundle-only mode: skipping SEA binary creation.')
106+
process.exit(0)
107+
}
108+
104109
const filesToEmbed = {}
105110
function scanDir(dir, base = '') {
106111
for (const file of fs.readdirSync(dir)) {

src/managers/externalApiManager.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,27 @@ export default class ExternalApiManager {
8989
if (!entry?.arl || typeof entry.arl !== 'string') continue
9090
if (!entry?.api_key || typeof entry.api_key !== 'string') continue
9191

92-
// check if license is string or json string with "license_token" field
92+
// check if license is a JSON string containing "license_token" (possibly nested)
9393
if (entry?.license && typeof entry.license === 'string' && entry.license.startsWith('{')) {
9494
try {
95-
const parsed = JSON.parse(entry.license);
96-
if (parsed.license_token) {
97-
entry.license = parsed.license_token;
95+
const parsed = JSON.parse(entry.license)
96+
const token = parsed.license_token || parsed.LICENCE?.OPTIONS?.license_token
97+
98+
if (token) {
99+
entry.license = token
98100
} else {
99101
logger('warn', 'ExternalAPI', `Deezer ARL entry has invalid license format, missing "license_token" field: ${entry.arl.slice(0, 8)}...`)
100-
logger('debug', 'ExternalAPI', `Full license content: ${entry.license}`)
101102
continue
102103
}
103104
} catch (e) {
104105
logger('warn', 'ExternalAPI', `Deezer ARL entry has invalid license format, not a valid JSON: ${entry.arl.slice(0, 8)}...`)
105-
logger('debug', 'ExternalAPI', `Full license content: ${entry.license}`)
106106
continue
107107
}
108108
}
109109

110110
if (!entry?.license || typeof entry.license !== 'string') {
111111
if (this.nodelink.options.sources.deezer.decryptionKey) {
112-
entry.license = this.nodelink.options.sources.deezer.decryptionKey;
112+
entry.license = this.nodelink.options.sources.deezer.decryptionKey
113113
} else {
114114
continue
115115
}

0 commit comments

Comments
 (0)