diff --git a/bin/server b/bin/server index 10c49d966..2a6121f3e 100755 --- a/bin/server +++ b/bin/server @@ -62,6 +62,7 @@ const queueWebhookEnabled = convertToBool(config.get('queueWebhook').enabled); // Default cluster environment variable const clusterEnvConfig = config.get('build').environment; // readonly const clusterEnv = { ...clusterEnvConfig }; +const artifactsMaxDownloadSize = config.get('build').artifacts.maxDownloadSize; Object.keys(clusterEnv).forEach(k => { clusterEnv[k] = String(clusterEnv[k]); @@ -304,7 +305,8 @@ datastore.setup(datastoreConfig.ddlSyncEnabled).then(() => executor, queueWebhookEnabled }, - unzipArtifactsEnabled + unzipArtifactsEnabled, + artifactsMaxDownloadSize }) .then(instance => logger.info('Server running at %s', instance.info.uri)) .catch(err => { diff --git a/lib/server.js b/lib/server.js index 63c8d9125..d74fb57f6 100644 --- a/lib/server.js +++ b/lib/server.js @@ -82,6 +82,7 @@ function prettyPrintErrors(request, h) { * @param {Object} config.builds.authConfig Configuration for auth * @param {Object} config.builds.externalJoin Flag to allow external join * @param {Object} config.unzipArtifactsEnabled Flag to allow unzip artifacts + * @param {Object} config.artifactsMaxDownloadSize Maximum download size for artifacts * @param {Function} callback Callback to invoke when server has started. * @return {http.Server} A listener: NodeJS http.Server object */ @@ -211,8 +212,7 @@ module.exports = async config => { expiresIn ); server.app.buildFactory.executor.tokenGen = server.app.buildFactory.tokenGen; - server.app.buildFactory.maxDownloadSize = - parseInt(config.build.artifacts.maxDownloadSize, 10) * 1024 * 1024 * 1024; + server.app.buildFactory.maxDownloadSize = parseInt(config.artifactsMaxDownloadSize, 10) * 1024 * 1024 * 1024; server.app.jobFactory.apiUri = server.info.uri; server.app.jobFactory.tokenGen = (username, metadata, scmContext, scope = ['user']) =>