diff --git a/config/env/torrents.js b/config/env/torrents.js index 8906748f..9a78c370 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -16,7 +16,7 @@ module.exports = { */ app: { name: 'CHD.im', - domain: 'http://chd.im:3000', + domain: 'http://127.0.0.1:3000', showDemoWarningPopup: true, cronTimeZone: 'Asia/Shanghai', showDebugLog: true @@ -56,37 +56,36 @@ module.exports = { * tracker server announce settings * NOTE: you can change these value at anytime if you understand it * - * @url: announce url, download client will request this url to report uploads and downloads data - * @comment: used in admin tools, auto replace torrent make group info with this setting - * @announceInterval: interval of twice announce request - * @announcePrefix: prefix of torrent file name, is will auto add when user download the torrent files - * @admin: site admin mail address - * @baseUrl: torrent announce url base url, system will check it when user upload torrent file - * @clientBlackListUrl: forbidden download client list url, user can view this list to check forbidden client software - * @privateTorrentCmsMode: meanTorrent default tracker server mode is private (value true), the tracker server only accept private mode. - * but, you can set this value to false to make a public torrent cms web site without tracker server and announce function. - * if this value is false(public mode), server can scrape all torrent status from owner tracker server - * @downloadCheck: announce download(leech) settings - * @ratio: if less than this value, can not download(leech) - * @checkAfterSignupDays: all users download check start {value} days after signup, so the newest register user has {value} days to upgrade his ratio value, - * after {value} days, if less then setting of here, can not download(leech) any things, but can continue seed, unit of day - * @announceCheck: announce seed/leech numbers settings + * @url: announce url, download client will request this url to report uploads and downloads data + * @comment: used in admin tools, auto replace torrent make group info with this setting + * @announceInterval: interval of twice announce request + * @announcePrefix: prefix of torrent file name, is will auto add when user download the torrent files + * @admin: site admin mail address + * @clientBlackListUrl: forbidden download client list url, user can view this list to check forbidden client software + * @privateTorrentCmsMode: meanTorrent default tracker server mode is private (value true), the tracker server only accept private mode. + * but, you can set this value to false to make a public torrent cms web site without tracker server and announce function. + * if this value is false(public mode), server can scrape all torrent status from owner tracker server + * @downloadCheck: announce download(leech) settings + * @ratio: if less than this value, can not download(leech) + * @checkAfterSignupDays: all users download check start {value} days after signup, so the newest register user has {value} days to upgrade his ratio value, + * after {value} days, if less then setting of here, can not download(leech) any things, but can continue seed, unit of day + * @announceCheck: announce seed/leech numbers settings * @maxLeechNumberPerUserPerTorrent: settings the max leech numbers of same user on same torrent - * @maxSeedNumberPerUserPerTorrent: settings the max seed numbers of same user on same torrent - * @peersCheck: send peers list of downloading announce request settings - * @peersSendListIncludeOwnSeed: settings whether include own seed peer in download announce request - * NOTE: the best value is false, In order to prevent cheating, user can not download data from own seeding. - * @ghostCheck - * @ghostPeersIdleTime: setting idle time more than this value is a ghost peer(died), remove it - * @ghostCompletesIdleTime: setting check users H&R warning interval time, unit of hours, default to 2 + * @maxSeedNumberPerUserPerTorrent: settings the max seed numbers of same user on same torrent + * @peersCheck: send peers list of downloading announce request settings + * @peersSendListIncludeOwnSeed: settings whether include own seed peer in download announce request + * NOTE: the best value is false, In order to prevent cheating, user can not download data from own seeding. + * @ghostCheck: + * @ghostPeersIdleTime: setting idle time more than this value is a ghost peer(died), remove it + * @warningCheck: + * @userHnrWarningCheckInterval: setting check users H&R warning interval time, unit of hours, default to 2 */ announce: { - url: 'http://chd.im:3000/announce', + url: '/announce', comment: 'meanTorrent group', announceInterval: 60 * 1000 * 5, announcePrefix: '{CHD.im}.', admin: 'admin@chd.im', - baseUrl: 'http://chd.im:3000', clientBlackListUrl: '/about/black', privateTorrentCmsMode: true, downloadCheck: { @@ -108,6 +107,31 @@ module.exports = { } }, + /** + * @rss + * + * rss field value settings + * + * @title: setting title info of rss document + * @description: setting description info of rss document + * @copyright: setting copyright info of rss document + * @managingEditor: setting managingEditor info of rss document + * @webMaster: setting webMaster info of rss document + * @generator: setting generator info of rss document + * @ttl: setting ttl info of rss document + * @image_url: setting image_url info of rss document + */ + rss: { + title: '[%s] - RSS torrents', + description: 'Latest torrents from [%s]', + copyright: 'Copyright (c) [%s] 2012-2017, all rights reserved', + managingEditor: 'admin@chd.im (%s Admin)', + webMaster: 'webmaster@chd.im (%s Webmaster)', + generator: 'meanTorrent RSS Generator', + ttl: 60, + image_url: '/modules/core/client/img/rss.jpeg' + }, + /** * @scrapeTorrentsStatus * @@ -163,8 +187,8 @@ module.exports = { userName: 'meanTorrent', realName: 'IRC announce client', channel: '#chdAnnounce', - defaultMsgFormat: '%s upload - torrent: %s, type: %s, size: %d, sale: %s, at %s', - tvserialMsgFormat: '%s upload - torrent: %s, type: %s, size: %d, seasons: %d, episodes: %s, sale: %s, at %s', + defaultMsgFormat: '%s uploaded - torrent: %s, type: %s, size: %d, sale: %s, url: %s, at %s', + tvserialMsgFormat: '%s uploaded - torrent: %s, type: %s, size: %d, seasons: %d, episodes: %s, sale: %s, url: %s, at %s', showErrors: true, autoRejoin: true, autoConnect: true, diff --git a/modules/announce/server/controllers/announces.server.controller.js b/modules/announce/server/controllers/announces.server.controller.js index 4a0a9028..5722c7fa 100644 --- a/modules/announce/server/controllers/announces.server.controller.js +++ b/modules/announce/server/controllers/announces.server.controller.js @@ -22,6 +22,7 @@ var scoreConfig = config.meanTorrentConfig.score; var hnrConfig = config.meanTorrentConfig.hitAndRun; var signConfig = config.meanTorrentConfig.sign; var announceConfig = config.meanTorrentConfig.announce; +var appConfig = config.meanTorrentConfig.app; var mtDebug = require(path.resolve('./config/lib/debug')); @@ -36,14 +37,14 @@ const FAILURE_REASONS = { 151: 'Invalid peerid: peerid is not 20 bytes long', 152: 'Invalid numwant. Client requested more peers than allowed by tracker', 153: 'Passkey length error (length=32)', - 154: 'Invalid passkey, if you changed you passkey, please redownload the torrent file from ' + announceConfig.baseUrl, + 154: 'Invalid passkey, if you changed you passkey, please redownload the torrent file from ' + appConfig.domain, 160: 'Invalid torrent info_hash', 161: 'No torrent with that info_hash has been found', 170: 'your account status is banned', 171: 'your account status is inactive', - 172: 'your client is not allowed, here is the blacklist: ' + announceConfig.baseUrl + announceConfig.clientBlackListUrl, + 172: 'your client is not allowed, here is the blacklist: ' + appConfig.domain + announceConfig.clientBlackListUrl, 173: 'this torrent status is not reviewed by administrators, try again later', 174: 'this torrent is only for VIP members', 175: 'your account status is idle', diff --git a/modules/torrents/client/controllers/torrents.client.controller.js b/modules/torrents/client/controllers/torrents.client.controller.js index 3cd0e951..73953fc1 100644 --- a/modules/torrents/client/controllers/torrents.client.controller.js +++ b/modules/torrents/client/controllers/torrents.client.controller.js @@ -5,16 +5,17 @@ .module('torrents') .controller('TorrentsController', TorrentsController); - TorrentsController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'Notification', 'TorrentsService', + TorrentsController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'Notification', 'TorrentsService', 'getStorageLangService', 'MeanTorrentConfig', 'DownloadService', '$window', 'ScrapeService', 'DebugConsoleService', 'TorrentGetInfoServices', 'ResourcesTagsServices']; - function TorrentsController($scope, $state, $translate, $timeout, Authentication, Notification, TorrentsService, MeanTorrentConfig, + function TorrentsController($scope, $state, $translate, $timeout, Authentication, Notification, TorrentsService, getStorageLangService, MeanTorrentConfig, DownloadService, $window, ScrapeService, mtDebug, TorrentGetInfoServices, ResourcesTagsServices) { var vm = this; vm.DLS = DownloadService; vm.TGI = TorrentGetInfoServices; vm.user = Authentication.user; vm.RTS = ResourcesTagsServices; + vm.lang = getStorageLangService.getLang(); vm.announce = MeanTorrentConfig.meanTorrentConfig.announce; vm.scrapeConfig = MeanTorrentConfig.meanTorrentConfig.scrapeTorrentStatus; vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags; @@ -323,7 +324,8 @@ //make rss url vm.rssUrl = vm.appConfig.domain; vm.rssUrl += '/api/rss'; - vm.rssUrl += '?passkey=' + vm.user.passkey; + vm.rssUrl += '/' + vm.user.passkey; + vm.rssUrl += '?language=' + vm.lang; vm.rssUrl += '&limit=' + vm.torrentItemsPerPage; vm.rssUrl += vm.searchKey.trim() ? '&keys=' + vm.searchKey.trim() : ''; vm.rssUrl += '&torrent_type=' + vm.torrentType; diff --git a/modules/torrents/client/views/list-torrents.client.view.html b/modules/torrents/client/views/list-torrents.client.view.html index 251bd8d4..c0a555c0 100644 --- a/modules/torrents/client/views/list-torrents.client.view.html +++ b/modules/torrents/client/views/list-torrents.client.view.html @@ -147,7 +147,7 @@
{{'CA_MAKE_RSS_URL' | translate}}:
{{'DESC_MAKE_RSS_URL' | translate}}
- {{vm.rssUrl}} + {{vm.rssUrl}}