mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-23 23:59:17 +01:00
fix(backup): ignore some important configure items in browser source code
//ignore backup settings cfg.backup = undefined; //ignore ircAnnounce settings cfg.ircAnnounce = undefined; //ignore password settings cfg.password = undefined; //ignore trace settings cfg.trace = undefined; //ignore tmdbConfig.key settings cfg.tmdbConfig.key = undefined; #20
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
vm.user = Authentication.user;
|
||||
vm.DLS = DownloadService;
|
||||
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
|
||||
vm.backupConfig = MeanTorrentConfig.meanTorrentConfig.backup;
|
||||
|
||||
vm.deleteList = [];
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ exports.renderIndex = function (req, res) {
|
||||
res.render('modules/core/server/views/index', {
|
||||
user: JSON.stringify(safeUserObject),
|
||||
sharedConfig: JSON.stringify(config.shared),
|
||||
meanTorrentConfig: JSON.stringify(config.meanTorrentConfig)
|
||||
meanTorrentConfig: JSON.stringify(getSafeMeanTorrentConfig(config.meanTorrentConfig)),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ exports.renderServerError = function (req, res) {
|
||||
res.status(500).render('modules/core/server/views/500', {
|
||||
user: JSON.stringify(safeUserObject),
|
||||
sharedConfig: JSON.stringify(config.shared),
|
||||
meanTorrentConfig: JSON.stringify(config.meanTorrentConfig),
|
||||
meanTorrentConfig: JSON.stringify(getSafeMeanTorrentConfig(config.meanTorrentConfig)),
|
||||
error: 'Oops! Something went wrong...'
|
||||
});
|
||||
};
|
||||
@@ -48,7 +48,7 @@ exports.renderNotFound = function (req, res) {
|
||||
res.render('modules/core/server/views/404', {
|
||||
user: JSON.stringify(safeUserObject),
|
||||
sharedConfig: JSON.stringify(config.shared),
|
||||
meanTorrentConfig: JSON.stringify(config.meanTorrentConfig),
|
||||
meanTorrentConfig: JSON.stringify(getSafeMeanTorrentConfig(config.meanTorrentConfig)),
|
||||
url: req.originalUrl
|
||||
});
|
||||
},
|
||||
@@ -62,3 +62,27 @@ exports.renderNotFound = function (req, res) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* getSafeMeanTorrentConfig
|
||||
* @param cfg
|
||||
* @returns {*}
|
||||
*/
|
||||
function getSafeMeanTorrentConfig(cfg){
|
||||
//ignore backup settings
|
||||
cfg.backup = undefined;
|
||||
|
||||
//ignore ircAnnounce settings
|
||||
cfg.ircAnnounce = undefined;
|
||||
|
||||
//ignore password settings
|
||||
cfg.password = undefined;
|
||||
|
||||
//ignore trace settings
|
||||
cfg.trace = undefined;
|
||||
|
||||
//ignore tmdbConfig.key settings
|
||||
cfg.tmdbConfig.key = undefined;
|
||||
|
||||
return cfg;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user