Revert "Notify admins on app update"
We will instead create eventlog entries
This reverts commit 22efb96f66.
This commit is contained in:
@@ -36,7 +36,6 @@ var addons = require('./addons.js'),
|
||||
ejs = require('ejs'),
|
||||
fs = require('fs'),
|
||||
manifestFormat = require('cloudron-manifestformat'),
|
||||
mailer = require('./mailer.js'),
|
||||
mkdirp = require('mkdirp'),
|
||||
net = require('net'),
|
||||
os = require('os'),
|
||||
@@ -48,7 +47,6 @@ var addons = require('./addons.js'),
|
||||
shell = require('./shell.js'),
|
||||
superagent = require('superagent'),
|
||||
sysinfo = require('./sysinfo.js'),
|
||||
users = require('./users.js'),
|
||||
util = require('util'),
|
||||
_ = require('underscore');
|
||||
|
||||
@@ -782,22 +780,6 @@ function update(app, callback) {
|
||||
function (callback) {
|
||||
debugApp(app, 'updated');
|
||||
updateApp(app, { installationState: appdb.ISTATE_INSTALLED, installationProgress: '', health: null, updateConfig: null, updateTime: new Date() }, callback);
|
||||
},
|
||||
|
||||
function notifyAdminsAboutUpdate(callback) {
|
||||
if (app.installationState === appdb.ISTATE_PENDING_FORCE_UPDATE) return callback(null);
|
||||
|
||||
users.getAllAdmins(function (error, admins) {
|
||||
if (error) {
|
||||
console.error('Failed to get admins to send update done notification:', error);
|
||||
return callback(); // this is not fatal
|
||||
}
|
||||
|
||||
async.eachSeries(admins, (admin, done) => mailer.appUpdateDone(admin.email, app, done), function (error) {
|
||||
if (error) console.error('Failed to send update done notification:', error);
|
||||
callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
], function seriesDone(error) {
|
||||
if (error && error.backupError) {
|
||||
|
||||
@@ -6,7 +6,6 @@ exports = module.exports = {
|
||||
adminChanged: adminChanged,
|
||||
passwordReset: passwordReset,
|
||||
appUpdateAvailable: appUpdateAvailable,
|
||||
appUpdateDone: appUpdateDone,
|
||||
sendDigest: sendDigest,
|
||||
|
||||
sendInvite: sendInvite,
|
||||
@@ -336,35 +335,6 @@ function appUpdateAvailable(mailTo, app, hasSubscription, info, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function appUpdateDone(mailTo, app, callback) {
|
||||
assert.strictEqual(typeof mailTo, 'string');
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
getMailConfig(function (error, mailConfig) {
|
||||
if (error) return debug('Error getting mail details:', error);
|
||||
|
||||
var templateData = {
|
||||
webadminUrl: config.adminOrigin(),
|
||||
app: app,
|
||||
cloudronName: mailConfig.cloudronName,
|
||||
cloudronAvatarUrl: config.adminOrigin() + '/api/v1/cloudron/avatar'
|
||||
};
|
||||
|
||||
var templateDataText = JSON.parse(JSON.stringify(templateData));
|
||||
templateDataText.format = 'text';
|
||||
|
||||
var mailOptions = {
|
||||
from: mailConfig.notificationFrom,
|
||||
to: mailTo,
|
||||
subject: util.format('App %s was updated', app.fqdn),
|
||||
text: render('app_update_done.ejs', templateDataText)
|
||||
};
|
||||
|
||||
sendMail(mailOptions, callback);
|
||||
});
|
||||
}
|
||||
|
||||
function sendDigest(mailTo, info, callback) {
|
||||
assert.strictEqual(typeof mailTo, 'string');
|
||||
assert.strictEqual(typeof info, 'object');
|
||||
|
||||
Reference in New Issue
Block a user