diff --git a/src/apps.js b/src/apps.js index 1ade74f72..d5865a96b 100644 --- a/src/apps.js +++ b/src/apps.js @@ -30,7 +30,7 @@ exports = module.exports = { checkManifestConstraints: checkManifestConstraints, - autoupdateApps: autoupdateApps, + updateApps: updateApps, restoreInstalledApps: restoreInstalledApps, configureInstalledApps: configureInstalledApps, @@ -793,8 +793,9 @@ function exec(appId, options, callback) { }); } -function autoupdateApps(updateInfo, callback) { // updateInfo is { appId -> { manifest } } +function updateApps(updateInfo, auditSource, callback) { // updateInfo is { appId -> { manifest } } assert.strictEqual(typeof updateInfo, 'object'); + assert.strictEqual(typeof auditSource, 'object'); assert.strictEqual(typeof callback, 'function'); function canAutoupdateApp(app, newManifest) { @@ -829,7 +830,7 @@ function autoupdateApps(updateInfo, callback) { // updateInfo is { appId -> { ma } update(appId, false /* force */, updateInfo[appId].manifest, app.portBindings, - null /* icon */, { userId: null, username: 'cron' }, function (error) { + null /* icon */, auditSource, function (error) { if (error) debug('Error initiating autoupdate of %s. %s', appId, error.message); iteratorDone(null); diff --git a/src/cron.js b/src/cron.js index 28192794b..83cea6229 100644 --- a/src/cron.js +++ b/src/cron.js @@ -158,7 +158,7 @@ function autoupdatePatternChanged(pattern) { cloudron.updateToLatest(AUDIT_SOURCE, NOOP_CALLBACK); } else if (updateInfo.apps) { debug('Starting app update to %j', updateInfo.apps); - apps.autoupdateApps(updateInfo.apps, NOOP_CALLBACK); + apps.updateApps(updateInfo.apps, AUDIT_SOURCE, NOOP_CALLBACK); } else { debug('No auto updates available'); }