diff --git a/package-lock.json b/package-lock.json index 50ba74b42..9794e6211 100644 --- a/package-lock.json +++ b/package-lock.json @@ -814,9 +814,9 @@ } }, "cloudron-manifestformat": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cloudron-manifestformat/-/cloudron-manifestformat-3.0.0.tgz", - "integrity": "sha512-mI/Xmft1jelxjGFMhtJolOfIiFx4v1IFjpoRe2YiBSiIvISnW98N6T62bl6PemzikY2ZXDuba0zse1CvmY2LOA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cloudron-manifestformat/-/cloudron-manifestformat-4.0.0.tgz", + "integrity": "sha512-St/Quu8ofQOf0rUAMaIsOL0u0dZ46irweU8rYVMvAXU0CGwSD9KDaeLW5NjGRg3FVjNzladUDVUE/BGD4rwEvA==", "requires": { "cron": "^1.7.2", "java-packagename-regex": "^1.0.0", diff --git a/package.json b/package.json index 89afeef3b..d380ba7de 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "async": "^2.6.2", "aws-sdk": "^2.476.0", "body-parser": "^1.19.0", - "cloudron-manifestformat": "^3.0.0", + "cloudron-manifestformat": "^4.0.0", "connect": "^3.7.0", "connect-ensure-login": "^0.1.1", "connect-lastmile": "^1.2.1", diff --git a/src/apphealthmonitor.js b/src/apphealthmonitor.js index 5db8dc720..956ec5f47 100644 --- a/src/apphealthmonitor.js +++ b/src/apphealthmonitor.js @@ -26,7 +26,7 @@ let gLastOomMailTime = Date.now() - (5 * 60 * 1000); // pretend we sent email 5 function debugApp(app) { assert(typeof app === 'object'); - debug(app.fqdn + ' ' + app.manifest.id + ' ' + util.format.apply(util, Array.prototype.slice.call(arguments, 1)) + ' - ' + app.id); + debug(app.fqdn + ' ' + util.format.apply(util, Array.prototype.slice.call(arguments, 1)) + ' - ' + app.id); } function setHealth(app, health, callback) { @@ -188,7 +188,7 @@ function processApp(callback) { var alive = result .filter(function (a) { return a.installationState === apps.ISTATE_INSTALLED && a.runState === apps.RSTATE_RUNNING && a.health === apps.HEALTH_HEALTHY; }) - .map(function (a) { return (a.location || 'naked_domain') + '|' + a.manifest.id; }).join(', '); + .map(function (a) { return (a.location || 'naked_domain') + '|' + (a.manifest.id || 'customapp'); }).join(', '); debug('apps alive: [%s]', alive); diff --git a/src/apps.js b/src/apps.js index 890749e30..239b2ac9a 100644 --- a/src/apps.js +++ b/src/apps.js @@ -775,7 +775,7 @@ function install(data, user, auditSource, callback) { if (error && error.reason === BoxError.ALREADY_EXISTS) return callback(getDuplicateErrorDetails(error.message, locations, domainObjectMap, portBindings)); if (error) return callback(error); - purchaseApp({ appId: appId, appstoreId: appStoreId, manifestId: manifest.id }, function (error) { + purchaseApp({ appId: appId, appstoreId: appStoreId, manifestId: manifest.id || 'customapp' }, function (error) { if (error) return callback(error); // save cert to boxdata/certs @@ -1551,7 +1551,7 @@ function clone(appId, data, user, auditSource, callback) { if (error && error.reason === BoxError.ALREADY_EXISTS) return callback(getDuplicateErrorDetails(error.message, locations, domainObjectMap, portBindings)); if (error) return callback(error); - purchaseApp({ appId: newAppId, appstoreId: app.appStoreId, manifestId: manifest.id }, function (error) { + purchaseApp({ appId: newAppId, appstoreId: app.appStoreId, manifestId: manifest.id || 'customapp' }, function (error) { if (error) return callback(error); const restoreConfig = { backupId: backupId, backupFormat: backupInfo.format, oldManifest: null }; @@ -1590,7 +1590,7 @@ function uninstall(appId, auditSource, callback) { error = checkAppState(app, exports.ISTATE_PENDING_UNINSTALL); if (error) return callback(error); - appstore.unpurchaseApp(appId, { appstoreId: app.appStoreId, manifestId: app.manifest.id }, function (error) { + appstore.unpurchaseApp(appId, { appstoreId: app.appStoreId, manifestId: app.manifest.id || 'customapp' }, function (error) { if (error) return callback(error); const task = { diff --git a/src/docker.js b/src/docker.js index 8b43fda38..4c156ad2a 100644 --- a/src/docker.js +++ b/src/docker.js @@ -153,22 +153,22 @@ function pullImage(manifest, callback) { // is emitted as a chunk stream.on('data', function (chunk) { var data = safe.JSON.parse(chunk) || { }; - debug('pullImage %s: %j', manifest.id, data); + debug('pullImage: %j', data); // The data.status here is useless because this is per layer as opposed to per image if (!data.status && data.error) { - debug('pullImage error %s: %s', manifest.id, data.errorDetail.message); + debug('pullImage error %s: %s', manifest.dockerImage, data.errorDetail.message); } }); stream.on('end', function () { - debug('downloaded image %s of %s successfully', manifest.dockerImage, manifest.id); + debug('downloaded image %s', manifest.dockerImage); callback(null); }); stream.on('error', function (error) { - debug('error pulling image %s of %s: %j', manifest.dockerImage, manifest.id, error); + debug('error pulling image %s: %j', manifest.dockerImage, error); callback(new BoxError(BoxError.DOCKER_ERROR, error.message)); }); @@ -180,12 +180,12 @@ function downloadImage(manifest, callback) { assert.strictEqual(typeof manifest, 'object'); assert.strictEqual(typeof callback, 'function'); - debug('downloadImage %s %s', manifest.id, manifest.dockerImage); + debug('downloadImage %s', manifest.dockerImage); var attempt = 1; async.retry({ times: 10, interval: 15000 }, function (retryCallback) { - debug('Downloading image %s %s. attempt: %s', manifest.id, manifest.dockerImage, attempt++); + debug('Downloading image %s. attempt: %s', manifest.dockerImage, attempt++); pullImage(manifest, function (error) { if (error) console.error(error);