/
torrents.js
1742 lines (1657 loc) · 71.5 KB
/
torrents.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'use strict';
module.exports = {
/**------------------------------------------------------------------------------------------------
* !IMPORTANT
* MEANTORRENT CONFIG START
* PLEASE DO NOT MODIFY THE ABOVE LINES !!!
--------------------------------------------------------------------------------------------------*/
meanTorrentConfig: {
/**
* @app
*
* App & site settings
* NOTE: you can change these value at anytime if you understand it
*
* @name: site logo name
* @domain: site domain
* @admin: site admin mail address
* @showDemoWarningPopup: if is demo site, show warning popup whene home is opened for the first time.
* @cronTimeZone: timezone of cron
* @dbTimeZone: timezone of mongo db, in minute
* @showClientDebugLog: if true, will console.log all debug info at client side. when your site is prod env, please change this
* value to false, then console.log info is not output
* @writeServerDebugLog: if true, will console.log all debug info at server side. when your site is prod env, please change this
* value to false, then console.log info is not output
*/
app: {
name: 'MEAN.im',
domain: 'http://localhost:3000',
admin: 'admin@mean.im',
showDemoWarningPopup: true,
cronTimeZone: 'Asia/Shanghai',
dbTimeZone: 480,
showClientDebugLog: true,
writeServerDebugLog: true
},
/**
* @supported
*
* Support services settings
*
* @supportGroupName: site support group name, user can send message to this group
* @supportGroupNameDesc: desc of support group name, value of translate string
* @supportMailAddress: support group mail address
* @mailTicketSupportService: settings mailTicketSupportService status, true is enable, false is disable
* @messageTicketSupportService: settings messageTicketSupportService status, true is enable, false is disable
* @checkOpenedTicketsInterval: set check opened tickets interval, default 2 minutes
* @checkOpenedTicketsInterval_str: string desc of @checkOpenedTicketsInterval
*
* NOTE:
* =====
* If mailTicketSupportService is set to true, you MUST set the mailer options in file config/env/development.js and config/env/production.js
*/
support: {
supportGroupName: 'Support',
supportGroupNameDesc: 'SUPPORT_GROUP_NAME_DESC',
supportMailAddress: 'support@mean.im',
mailTicketSupportService: false,
messageTicketSupportService: true,
checkOpenedTicketsInterval: 60 * 1000 * 2,
checkOpenedTicketsInterval_str: '2m'
},
/**
* @backup
*
* @enable: if true, meanTorrent will backup mongo db database data with a named '/module/core/client/backup/*.tar'
* at midnight every day.
* @dir: backup files path
*/
backup: {
enable: true,
dir: './modules/backup/client/backup/'
},
/**
* @language
*
* Multilingual support settings
*
* @name: language name
* @index: list index in menu
* @class: flag icon class, can find flag icon at '/public/lib/flag-icon-css/flags'
* @title: language title show in menu item
* @enable: setting whether to enable or disable this language support, if false, user can not select it
*/
language: [
{name: 'en', index: 0, class: 'flag-icon-gb', title: 'English', enable: true},
{name: 'zh', index: 1, class: 'flag-icon-cn', title: '中文', enable: true},
{name: 'zh-tw', index: 2, class: 'flag-icon-tw', title: '繁體中文', enable: true}
],
/**
* @announce
*
* 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
* @announceInterval_str: string desc of @announceInterval
* @announceIdleTime: announce time over @announceInterval this value is inactive peer
* @announcePrefix: prefix of torrent file name, is will auto add when user download the torrent files
* @clientBlackListUrl: forbidden download client list url, user can view this list to check forbidden client software
* @announceLogDays: setting of days to write announce log to db, because the data is too more too big, do not to set a big value
* @userDaysLogDays: setting of days to write user days log
* @userMonthsLogMonths: setting of months to write user months log
* @seedingInFinishedCheck: settings to check whether can seeding an un-download finished torrent
* @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
* @ghostPeersIdleTime_str: string desc of @ghostPeersIdleTime
* @warningCheck:
* @userHnrWarningCheckInterval: setting check users H&R warning interval time, default to 2 hours
* @userHnrWarningCheckInterval_str: string desc of @userHnrWarningCheckInterval
* @debugAnnounceUser: setting of debug announce user, NOTE: enable this need @app.writeServerDebugLog must be true too
* @debugAll: if true, debug all announce user, else debug user in ids list below
* @ids: debug announce user id list
* @debugClientSideUser: setting of debug client side user
* @ids: debug user id list
*/
announce: {
url: 'http://localhost:3000/announce',
comment: 'MEAN.im GROUP',
announceInterval: 60 * 1000 * 10,
announceInterval_str: '10m',
announceIdleTime: 60 * 1000 * 3,
announcePrefix: '{MEAN}.',
sourceInfo: '{MEAN.im} Present by meanTorrent.',
clientBlackListUrl: '/about/black',
announceLogDays: 30,
userDaysLogDays: 30,
userMonthsLogMonths: 12,
seedingInFinishedCheck: true,
downloadCheck: {
ratio: 1,
checkAfterSignupDays: 30
},
announceCheck: {
maxLeechNumberPerUserPerTorrent: 1,
maxSeedNumberPerUserPerTorrent: 3
},
peersCheck: {
peersSendListIncludeOwnSeed: true
},
ghostCheck: {
ghostPeersIdleTime: 60 * 60 * 1000 * 24,
ghostPeersIdleTime_str: '24h'
},
warningCheck: {
userHnrWarningCheckInterval: 60 * 60 * 1000 * 2,
userHnrWarningCheckInterval_str: '2h'
},
debugAnnounceUser: {
debugAll: false,
ids: [
'59227f9095602327ea1d96ba',
'592280c464be9e281a1ec56e'
]
},
debugClientSideUser: {
ids: [
'59227f9095602327ea1d96ba'
]
}
},
/**
* @cache
*
* settings cache data of GET method from $resource
*
* @maxAge: The number of milliseconds until a newly inserted item expires
* @recycleFreq: Determines how often a cache will scan for expired items
* @storageMode: Determines the storage medium used by a cache, value of 'memory', 'localStorage' and 'sessionStorage'
*/
cache: {
maxAge: 60 * 1000 * 1,
recycleFreq: 60 * 1000,
storageMode: 'localStorage'
},
/**
* @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, unit of seconds
* @pageItemsNumber: setting the items number of rss per page
* @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@mean.im (%s Admin)',
webMaster: 'webmaster@mean.im (%s Webmaster)',
generator: '{MEAN.im} RSS Generator by meanTorrent',
ttl: 60,
pageItemsNumber: 30,
image_url: '/modules/core/client/img/rss.jpeg'
},
/**
* @ircAnnounce
*
* IRC announce server settings
* NOTE: you can change these value at anytime if you understand it
*
* @enable: enable irc announce
* @debug: debug mode, more info will log out by console
* @server: IRC server address
* @port: IRC server port
* @nick: IRC announce user nick name, needed with IRC protocol
* @userName: IRC announce user username, needed with IRC protocol
* @realName: IRC announce user realName, needed with IRC protocol
* @channel: IRC announce channel name, the message will send to the appointed channel
* @defaultMsgFormat: the default announce message format
* @tvserialMsgFormat: the custom announce message format of tv serial type torrent
* @showErrors: log and show error info when some error happened
* @autoRejoin: auto rejoin into the channel when some event happened cause user part the announce channel
* @autoConnect: auto connect & reconnect to IRC server when disconnect from IRC server
* @retryCount: reconnect retry times
* @retryDelay: reconnect retry delay time, unit in millisecond
* @encoding: IRC announce message encoding, default to 'UTF-8'
*/
ircAnnounce: {
enable: true,
debug: false,
server: 'irc.mean.im',
port: 16667,
nick: 'meanAnnouncer',
userName: 'meanTorrent',
realName: 'IRC announce client',
channel: '#meanAnnounce',
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,
retryCount: 86400,
retryDelay: 5000,
encoding: 'UTF-8'
},
/**
* @access
*
* setting ip access for site menu
*
* @admin: setting of access for admin center
* @limit: set whether to limit ip to access admin center
* @limitedIp: list all allow ip to access admin center, otherwise can not to access
* If you limited some vpn ip to access it, please add the vpn ip into the @limitedIp array
* If no limited ip, set the @limit to false
* @upload: setting of access for torrents uploader
* @limitToMakerGroup: setting whether limit the access to resources group for torrents uploader
* if false, everyone can upload torrent
*/
access: {
admin: {
limit: false,
limitedIp: ['127.0.0.1']
},
upload: {
limitToMakerGroup: false
}
},
/**
* @home
*
* settings for home page
*
* @showVipBanner: setting whether show vip AD banner
* @showForumNewTopicsAndNewestTorrents: setting whether show forum new topics and newest torrents in home page
* @showTopLevelTorrents: setting whether show top level torrents list
* @showAlbumsList: setting whether show albums list of home
* @backgroundImageFrom: setting home background image from torrent type
* @bodyBackgroundImage: background image url of home page body
* @buttonList: a function list area of home page
*/
home: {
showVipBanner: false,
showForumNewTopicsAndNewestTorrents: false,
showTopLevelTorrents: false,
showAlbumsList: true,
backgroundImageFrom: 'movie',
bodyBackgroundImage: 'https://image.tmdb.org/t/p/w1280/cnKAGbX1rDkAquF2V1wVkptHDJO.jpg',
buttonList: [
{
icon: 'fa fa-bars',
state: 'forums.list',
title: 'HOME.BUTTON_LIST.FUN_FORUM_TITLE',
desc: 'HOME.BUTTON_LIST.FUN_FORUM_DESC'
},
{
icon: 'fab fa-vimeo-v',
state: 'vip.list',
title: 'HOME.BUTTON_LIST.FUN_VIP_TITLE',
desc: 'HOME.BUTTON_LIST.FUN_VIP_DESC'
},
{
icon: 'fa fa-question-circle',
state: 'about.manual.userRules',
title: 'HOME.BUTTON_LIST.FUN_HELP_TITLE',
desc: 'HOME.BUTTON_LIST.FUN_HELP_DESC'
},
{
icon: 'fa fa-headphones',
state: 'tickets.supports',
title: 'HOME.BUTTON_LIST.FUN_SUPPORT_TITLE',
desc: 'HOME.BUTTON_LIST.FUN_SUPPORT_DESC'
}
]
},
/**
* @sign
*
* user register settings
* NOTE: you can change these value at anytime if you understand it
*
* @openSignup: set whether open the signup, if true, the user can signup(register) by herself,
* if you create a private web site, and only accept invite to join, please set it to false.
* @emailAllowable: allowable email address white list, only these address can be invited and sign up
* @signUpActiveTokenExpires: sign up account active expires time setting.
* @signUpActiveTokenExpires_str: string desc of @signUpActiveTokenExpires
* @allowSocialSignin: meanTorrent can accept social account to signin, like google, twitter, facebook etc.
* if you do not want them to login, please set it to false
*
* @showMenuHeaderForGuest: set whether show menu header for guest user(not sign in)
* @showFooterCountInfoForGuest: set whether show count info at home footer for guest user(not sign in)
* @showDemoSignMessage: if true, will show demo sign in message in sign in page, if your site is not demo site, please set it to false
*
* @idle: setting for account status of idle
* @accountIdleForTime: setting for how many time not login then change account status to idle
* @accountIdleForTime_str: string desc of @accountIdleForTime
* @activeIdleAccountBasicScore: user active idle account need basic score numbers
* @activeMoreScorePerDay: idle more than one day need extra score
* @activeMoreScorePerLevel: idle each level need extra score
* @notIdleSafeLevel: safe lavel, more than this level account not to be idle status
*/
sign: {
openSignup: true,
emailAllowable: ['gmail.com', 'qq.com'],
signUpActiveTokenExpires: 60 * 60 * 1000 * 24,
signUpActiveTokenExpires_str: '24h',
allowSocialSignin: false,
showMenuHeaderForGuest: true,
showFooterCountInfoForGuest: true,
showDemoSignMessage: true,
idle: {
accountIdleForTime: 60 * 60 * 1000 * 24 * 30, //30 days
accountIdleForTime_str: '30d',
activeIdleAccountBasicScore: 50000,
activeMoreScorePerDay: 100,
activeMoreScorePerLevel: 1000,
notIdleSafeLevel: 30
}
},
/**
* @password
*
* password setting
*
* @resetTokenExpires: reset password token expires time, default 1 hour
* @resetTokenExpires_str: string desc of @resetTokenExpires
* @resetTimeInterval: reset password time interval, default 24 hours, means only can do once in 24 hours.
* @resetTimeInterval_str: string desc of @resetTimeInterval
*/
password: {
resetTokenExpires: 60 * 60 * 1000 * 1,
resetTokenExpires_str: '1h',
resetTimeInterval: 60 * 60 * 1000 * 24,
resetTimeInterval_str: '24h'
},
/**
* @invite
*
* invite settings when sign.openSignup is false
* NOTE: you can change these value at anytime if you understand it
*
* @openInvite: if true, then any user can invite friends to join us, if false, only admin/oper can send invite mail
* @scoreExchange: if any user can send invite mail, the user must used score number to exchange an invite send qualifications, if the user has no
* enough score, then can not send invite mail too.
* @expires: if user exchange an invite send qualifications, then must send it out within the expiration time
* if user received an invite mail, must signin(register) within the expiration time
* if exceed the expiration time, the invite send qualifications will invalid and user also can not signin(register).
* @expires_str: string desc of @expires
* @banUserInviter: settings whether ban the user`s inviter when a user banned
* @banUserInviterVip: settings whether ban the user`s inviter if the inviter is a vip user
*
* @official: settings of official invitations
* @presentDays: settings of present official available days list
*/
invite: {
openInvite: true,
scoreExchange: 10000,
expires: 60 * 60 * 1000 * 24,
expires_str: '24h',
banUserInviter: true,
banUserInviterVip: true,
official: {
presentDays: [1, 7, 30, 90, 180]
}
},
/**
* @requests
*
* requests settings
*
* @scoreForAddRequest: score numbers for add one request, system deduct automatic, this score is not rewards for final accepted user
* @rewardsFormDefaultValue: setting default rewards value of request post form input control
* @requestExpires: request expires time setting, default 7 days
* @requestExpires_str: string desc of @requestExpires
*/
requests: {
scoreForAddRequest: 100,
rewardsFormDefaultValue: 1000,
requestExpires: 60 * 60 * 1000 * 24 * 7,
requestExpires_str: '7d'
},
/**
* @score
*
* score system settings
*
* @levelStep: value of each level step, default 500
* @scoreLogDays: setting of days to write score detail log to db, because the data is too more too big, do not to set a big value
* @transfer: setting of transfer score to inviter per month
* @enable: setting whether to enable transfer
* @deductFromUser: setting whether deduct the score from user
* @transRatio: setting transfer ratio, the user`s score of this ratio will be subtract and add into the inviter`s account if the @deductFromUser is true
* @action: score change action list
* @name: action name
* @value: action score value
* @enable: action enable status, if false, system will not change user`s score at this action
* NOTE: ENABLE VALUE OF DEFAULTACTION MUST BE TRUE
*/
score: {
levelStep: 1000,
scoreLogDays: 10,
transferToInviter: {
enable: true,
deductFromUser: false,
transRatio: 0.001
},
action: {
defaultAction: {name: 'defaultAction', content: 'DEFAULT_ACTION', value: 0, enable: true},
adminModify: {name: 'adminModify', content: 'ADMIN_MODIFY', value: 0, enable: true},
transferScoreIntoInviterFrom: {name: 'transferScoreIntoInviterFrom', content: 'TRANSFER_SCORE_INTO_INVITER_FROM', value: 0, enable: true},
transferScoreIntoInviterTo: {name: 'transferScoreIntoInviterTo', content: 'TRANSFER_SCORE_INTO_INVITER_TO', value: 0, enable: true},
uploadTorrent: {name: 'uploadTorrent', content: 'UPLOAD_TORRENT', value: 20, enable: true},
uploadTorrentBeDeleted: {name: 'uploadTorrentBeDeleted', content: 'UPLOAD_TORRENT_BE_DELETED', value: -20, enable: true},
uploadTorrentBeRecommend: {name: 'uploadTorrentBeRecommend', content: 'UPLOAD_TORRENT_BE_RECOMMEND', value: 5, enable: true},
uploadSubtitle: {name: 'uploadSubtitle', content: 'UPLOAD_SUBTITLE', value: 10, enable: true},
uploadSubtitleBeDeleted: {name: 'uploadSubtitleBeDeleted', content: 'UPLOAD_SUBTITLE_BE_DELETED', value: -10, enable: true},
thumbsUpScoreOfTorrentFrom: {name: 'thumbsUpScoreOfTorrentFrom', content: 'THUMBS_UP_SCORE_OF_TORRENT_FROM', value: -5, enable: true},
thumbsUpScoreOfTorrentTo: {name: 'thumbsUpScoreOfTorrentTo', content: 'THUMBS_UP_SCORE_OF_TORRENT_TO', value: 5, enable: true},
thumbsUpScoreOfTopicFrom: {name: 'thumbsUpScoreOfTopicFrom', content: 'THUMBS_UP_SCORE_OF_TOPIC_FROM', value: -5, enable: true},
thumbsUpScoreOfTopicTo: {name: 'thumbsUpScoreOfTopicTo', content: 'THUMBS_UP_SCORE_OF_TOPIC_TO', value: 5, enable: true},
requestPost: {name: 'requestPost', content: 'REQUEST_POST', value: 0, enable: true}, //value used requests.scoreForAddRequest
requestAcceptFrom: {name: 'requestAcceptFrom', content: 'REQUEST_ACCEPT_FROM', value: 0, enable: true}, //value form user setting
requestAcceptTo: {name: 'requestAcceptTo', content: 'REQUEST_ACCEPT_TO', value: 0, enable: true}, //value form user setting
scoreExchangeInvitation: {name: 'scoreExchangeInvitation', content: 'SCORE_EXCHANGE_INVITATION', value: 0, enable: true}, //value used invite.scoreExchange
scoreToRemoveWarning: {name: 'scoreToRemoveWarning', content: 'SCORETO_REMOVE_WARNING', value: 0, enable: true}, //value used hitAndRun.scoreToRemoveWarning
activeIdleAccount: {name: 'activeIdleAccount', content: 'ACTIVE_IDLE_ACCOUNT', value: 0, enable: true}, //value used sign.idle.activeIdleAccountBasicScore
dailyCheckIn: {
enable: true,
name: 'dailyCheckIn',
content: 'DAILY_CHECK_IN',
dailyBasicScore: 10,
dailyStepScore: 1,
dailyMaxScore: 100
},
seedUpDownload: {
name: 'seedUpDownload',
content: 'SEED_UP_DOWNLOAD',
additionSize: 1024 * 1024 * 1024 * 10, //10G
additionSize_str: '10G',
perlSize: 1024 * 1024 * 1024, //1G
perlSize_str: '1G',
uploadValue: 1,
uploadEnable: true,
downloadValue: 0.5,
downloadEnable: true,
vipRatio: 1.5,
uploaderRatio: 2,
enable: true
},
seedTimed: {
name: 'seedTimed',
content: 'SEED_TIMED',
additionTime: 60 * 60 * 1000,
additionTime_str: '1h',
timedValue: 0.5,
vipRatio: 1.5,
enable: true
},
seedSeederAndLife: {
name: 'seedSeederAndLife',
content: 'SEED_SEEDER_AND_LIFE',
seederBasicRatio: 1,
seederCoefficient: 0.1,
seederCount: 10,
lifeBasicRatio: 1,
lifeCoefficientOfDay: 0.001,
lifeMaxRatio: 2,
enable: true
}
}
},
/**
* @messages
*
* site message settings
*
* @type: messages type
* @name: name of messages type, used in $translate
* @value: messages type value list
* @name: type name
* @value: type value
* @checkUnreadInterval: set check unread message interval, default 2 minutes
* @checkUnreadInterval_str: string desc of @checkUnreadInterval
* @serverMessageExpires: setting server message expire time, old message will be delete automatic
* @serverMessageExpires_str: setting desc of @serverMessageExpires
*
* NOTE: the first value 'user' cannot be deleted
*/
messages: {
type: {
name: 'TYPE',
value: [
{name: 'USER', value: 'user', role: 'user'},
{name: 'SERVER', value: 'server', role: 'server'},
{name: 'SYSTEM', value: 'system', role: 'admin'},
{name: 'ADVERT', value: 'advert', role: 'admin'}
]
},
checkUnreadInterval: 60 * 1000 * 2,
checkUnreadInterval_str: '2m',
serverMessageExpires: 60 * 60 * 1000 * 24 * 10,
serverMessageExpires_str: '10d'
},
/**
* @inputLength
*
* input string length limit settings
*
* @uploadTorrentTitleLength: torrent title length on upload page
* @uploadTorrentSubTitleLength: torrent sub title length on upload page
*
* @userSignatureLength: user signature of forum string length limit
* @chatMessageMaxLength: chat room send message string length limit
*
* @messageTitleLength: user message send title length limit
* @messageBoxContentLength: user message send content length limit
* @messageBoxReplyLength: user message send reply content length limit
* @ticketContentLength: ticket content length limit
*
* @torrentCommentLength: torrent comment send content length limit
*
* @forumTopicTitleLength: forum topic title length limit
* @forumTopicContentLength: forum topic content length limit
* @forumReplyContentLength: forum reply content length limit
* @makerGroupDescLength: resources group desc content length limit
*
* @collectionsOverviewLength: movie collections overview content length limit
* @albumsOverviewLength: resource albums overview content length limit
*
* @requestDescLength: request description content length limit
* @requestCommentLength: request comment content length limit
*/
inputLength: {
uploadTorrentTitleLength: 128,
uploadTorrentSubTitleLength: 128,
userSignatureLength: 512,
chatMessageMaxLength: 512,
messageTitleLength: 128,
messageBoxContentLength: 1024,
messageBoxReplyLength: 512,
ticketContentLength: 2048,
torrentCommentLength: 512,
forumTopicTitleLength: 128,
forumTopicContentLength: 4096,
forumReplyContentLength: 2048,
makerGroupDescLength: 2048,
collectionsOverviewLength: 2048,
albumsOverviewLength: 2048,
requestDescLength: 1024,
requestCommentLength: 512
},
/**
* @serverNotice
*
* server auto notice settings
*
* @action: notice actions
* @title: notice title in translate string of SERVER_MESSAGE
* @content: notice content in translate string of SERVER_MESSAGE
* @enable: enable switch
*/
serverNotice: {
action: {
makerCreated: {title: 'TITLE_MAKER_CREATED', content: 'CONTENT_MAKER_CREATED', enable: true},
makerDeleted: {title: 'TITLE_MAKER_DELETED', content: 'CONTENT_MAKER_DELETED', enable: true},
makerUploadAccessChanged: {title: 'TITLE_MAKER_UPLOAD_ACCESS_CHANGED', content: 'CONTENT_MAKER_UPLOAD_ACCESS_CHANGED', enable: true},
makerAddMember: {title: 'TITLE_MAKER_ADD_MEMBER', content: 'CONTENT_MAKER_ADD_MEMBER', enable: true},
makerRemoveMember: {title: 'TITLE_MAKER_REMOVE_MEMBER', content: 'CONTENT_MAKER_REMOVE_MEMBER', enable: true},
userVipStatusChanged: {title: 'TITLE_USER_VIP_CHANGED_ADD', content: 'CONTENT_USER_VIP_CHANGED_ADD', enable: true},
userRoleChanged: {title: 'TITLE_USER_ROLE_CHANGED', content: 'CONTENT_USER_ROLE_CHANGED', enable: true},
userUploadAccessChanged: {title: 'TITLE_USER_UPLOAD_ACCESS_CHANGED', content: 'CONTENT_USER_UPLOAD_ACCESS_CHANGED', enable: true},
hnrWarningAddByAnnounce: {title: 'TITLE_HNR_WARNING_ADD', content: 'CONTENT_HNR_WARNING_ADD', enable: true},
hnrWarningRemoveByAnnounce: {title: 'TITLE_HNR_WARNING_REMOVE', content: 'CONTENT_HNR_WARNING_REMOVE', enable: true},
forumTopicNewReply: {title: 'TITLE_FORUM_NEW_TOPIC_REPLY', content: 'CONTENT_FORUM_NEW_TOPIC_REPLY', enable: true},
forumTopicThumbsUp: {title: 'TITLE_FORUM_TOPIC_THUMBS_UP', content: 'CONTENT_FORUM_TOPIC_THUMBS_UP', enable: true},
forumReplyThumbsUp: {title: 'TITLE_FORUM_REPLY_THUMBS_UP', content: 'CONTENT_FORUM_REPLY_THUMBS_UP', enable: true},
forumTopicDeleted: {title: 'TITLE_FORUM_TOPIC_DELETED', content: 'CONTENT_FORUM_TOPIC_DELETED', enable: true},
forumReplyDeleted: {title: 'TITLE_FORUM_REPLY_DELETED', content: 'CONTENT_FORUM_REPLY_DELETED', enable: true},
forumBecomeModerator: {title: 'TITLE_FORUM_BECOME_MODERATOR', content: 'CONTENT_FORUM_BECOME_MODERATOR', enable: true},
torrentNewComment: {title: 'TITLE_TORRENT_NEW_COMMENT', content: 'CONTENT_TORRENT_NEW_COMMENT', enable: true},
torrentCommentDeleted: {title: 'TITLE_TORRENT_COMMENT_DELETED', content: 'CONTENT_TORRENT_COMMENT_DELETED', enable: true},
torrentThumbsUp: {title: 'TITLE_TORRENT_THUMBS_UP', content: 'CONTENT_TORRENT_THUMBS_UP', enable: true},
torrentReviewed: {title: 'TITLE_TORRENT_REVIEWED', content: 'CONTENT_TORRENT_REVIEWED', enable: true},
torrentVipChanged: {title: 'TITLE_TORRENT_VIP_CHANGED', content: 'CONTENT_TORRENT_VIP_CHANGED', enable: true},
torrentTopChanged: {title: 'TITLE_TORRENT_TOP_CHANGED', content: 'CONTENT_TORRENT_TOP_CHANGED', enable: true},
torrentUniqueChanged: {title: 'TITLE_TORRENT_UNIQUE_CHANGED', content: 'CONTENT_TORRENT_UNIQUE_CHANGED', enable: true},
torrentHnRChanged: {title: 'TITLE_TORRENT_HNR_CHANGED', content: 'CONTENT_TORRENT_HNR_CHANGED', enable: true},
torrentSaleChanged: {title: 'TITLE_TORRENT_SALE_CHANGED', content: 'CONTENT_TORRENT_SALE_CHANGED', enable: true},
torrentDeleted: {title: 'TITLE_TORRENT_DELETED', content: 'CONTENT_TORRENT_DELETED', enable: true},
torrentSubtitleNew: {title: 'TITLE_TORRENT_SUBTITLE_NEW', content: 'CONTENT_TORRENT_SUBTITLE_NEW', enable: true},
torrentSubtitleDeleted: {title: 'TITLE_TORRENT_SUBTITLE_DELETED', content: 'CONTENT_TORRENT_SUBTITLE_DELETED', enable: true},
requestTorrentUpload: {title: 'TITLE_REQUEST_TORRENT_UPLOAD', content: 'CONTENT_REQUEST_TORRENT_UPLOAD', enable: true},
requestTorrentRespond: {title: 'TITLE_REQUEST_TORRENT_RESPOND', content: 'CONTENT_REQUEST_TORRENT_RESPOND', enable: true},
requestNewComment: {title: 'TITLE_REQUEST_NEW_COMMENT', content: 'CONTENT_REQUEST_NEW_COMMENT', enable: true},
requestCommentDeleted: {title: 'TITLE_REQUEST_COMMENT_DELETED', content: 'CONTENT_REQUEST_COMMENT_DELETED', enable: true}
}
},
/**
* @trace
*
* system trace logs settings
*
* @traceLogDays: setting trace log days, because data to more, do not to set a big value
* @action: trace action list
* @name: action name
* @enable: action enable status, if false, system will not to trace log this action
*
*/
trace: {
traceLogDays: 10,
action: {
adminUpdateUserRole: {name: 'adminUpdateUserRole', enable: true},
adminUpdateUserStatus: {name: 'adminUpdateUserStatus', enable: true},
adminUpdateUserScore: {name: 'adminUpdateUserScore', enable: true},
adminUpdateUserUploaded: {name: 'adminUpdateUserUploaded', enable: true},
adminUpdateUserDownloaded: {name: 'adminUpdateUserDownloaded', enable: true},
adminUpdateUserVIPData: {name: 'adminUpdateUserVIPData', enable: true},
adminBanUserInviter: {name: 'adminBanUserInviter', enable: true},
adminPresentUserInvitations: {name: 'adminPresentUserInvitations', enable: true},
adminRemoveUserHnrWarning: {name: 'adminRemoveUserHnrWarning', enable: true},
adminCreateUserMakerGroup: {name: 'adminCreateUserMakerGroup', enable: true},
adminUserDelete: {name: 'adminUserDelete', enable: true},
adminUserEdit: {name: 'adminUserEdit', enable: true},
adminMakerEdit: {name: 'adminMakerEdit', enable: true},
adminBanAllExaminationUnfinishedUsers: {name: 'adminBanAllExaminationUnfinishedUsers', enable: true},
userPasswordReset: {name: 'userPasswordReset', enable: true},
userSignUp: {name: 'userSignUp', enable: true},
userActiveAccount: {name: 'userActiveAccount', enable: true},
userUnIdle: {name: 'userUnIdle', enable: true},
adminTorrentDelete: {name: 'adminTorrentDelete', enable: true},
adminTorrentSetSaleType: {name: 'adminTorrentSetSaleType', enable: true},
adminTorrentSetRecommendLevel: {name: 'adminTorrentSetRecommendLevel', enable: true},
adminCollectionSetRecommendLevel: {name: 'adminCollectionSetRecommendLevel', enable: true},
adminAlbumSetRecommendLevel: {name: 'adminAlbumSetRecommendLevel', enable: true},
adminTorrentSetReviewedStatus: {name: 'adminTorrentSetReviewedStatus', enable: true},
adminCreateCollection: {name: 'adminCreateCollection', enable: true},
adminCreateAlbum: {name: 'adminCreateAlbum', enable: true},
adminDeleteBackupFiles: {name: 'adminDeleteBackupFiles', enable: true},
userInvitationExchange: {name: 'userInvitationExchange', enable: true},
userRemoveHnrWarning: {name: 'userRemoveHnrWarning', enable: true},
userSendInvitation: {name: 'userSendInvitation', enable: true},
adminSendOfficialInvitation: {name: 'adminSendOfficialInvitation', enable: true},
userAnnounceFinished: {name: 'userAnnounceFinished', enable: true},
forumDeleteTopic: {name: 'forumDeleteTopic', enable: true},
forumDeleteReply: {name: 'forumDeleteReply', enable: true}
}
},
/**
* @history
*
* settings of admin/oper operate history on user account
*
* @action: history action item
* @name: action name
* @content: action info of translate string, write into db, show in account detail manage page
* @enable: enabled status
*/
history: {
action: {
adminUpdateUserRole: {name: 'adminUpdateUserRole', content: 'ADMIN_UPDATE_USER_ROLE', enable: true},
adminUpdateUserStatus: {name: 'adminUpdateUserStatus', content: 'ADMIN_UPDATE_USER_STATUS', enable: true},
adminUpdateUserScore: {name: 'adminUpdateUserScore', content: 'ADMIN_UPDATE_USER_SCORE', enable: true},
adminUpdateUserUploaded: {name: 'adminUpdateUserUploaded', content: 'ADMIN_UPDATE_USER_UPLOADED', enable: true},
adminUpdateUserDownloaded: {name: 'adminUpdateUserDownloaded', content: 'ADMIN_UPDATE_USER_DOWNLOADED', enable: true},
adminUpdateUserVIPData: {name: 'adminUpdateUserVIPData', content: 'ADMIN_UPDATE_USER_VIP_DATA', enable: true},
adminPresentUserInvitations: {name: 'adminPresentUserInvitations', content: 'ADMIN_PRESENT_USER_INVITATIONS', enable: true},
adminRemoveUserHnrWarning: {name: 'adminRemoveUserHnrWarning', content: 'ADMIN_REMOVE_USER_HNR_WARNING', enable: true},
adminCreateUserMakerGroup: {name: 'adminCreateUserMakerGroup', content: 'ADMIN_CREATE_USER_MAKER_GROUP', enable: true},
adminBanUserInviter: {name: 'adminBanUserInviter', content: 'ADMIN_BAN_USER_INVITER', enable: true}
}
},
/**
* @torrentType
*
* torrent type settings
* if you need more torrent type, please add at here and config it, the system will add new type everywhere automatic
* NOTE: don`t change these value if you can not understand it
*
* @name: TYPE, do not change it
* @value: configure settings value of torrent type
*
* @enable: enable this type
* @name: name of type, used by $translate at TORRENT_TYPE_LABEL, will show translate result as torrent tag in torrent list
* @value: value of type, torrent type value in model, will write this value into mongodb and query torrents by this value
* @title: title of type, used by $translate at MENU_TORRENTS_SUB, will show translate result in header submenu item
* @role: role of type, limit none access users join
* @faIcon: fontawesome icon front of menu item
* @faClass: fontawesome icon class
* @divider: divider status of submenu item
* @position: position of submenu item(ordered index)
* @state: angular state of torrent type, this state value used in module route config
* @url: window location url of type
* @pageTitle: the page title string, used by translate at PAGETITLE
* @uploadTemplateID: view templateID in upload torrent page, when selected type is changed, then include the template by this id,
* all the template html is in file: modules/torrents/client/views/uploads-torrents.client.view.html
* @showSubtitleTabInDetailPage: setting whether show subtitle tab in torrent detail page
* @showTopListInHome: setting whether show the TOP list in site home page, if false, don`t show
* the 'other' type torrent always not show in home page
*
* if you add a config json item, please add translate string:
* MENU_TORRENTS_SUB
* TORRENT_TYPE_LABEL
* PAGETITLE.*
*/
torrentType: {
name: 'TYPE',
value: [
{
enable: true,
name: 'MOVIE',
value: 'movie',
title: 'MENU_TORRENTS_SUB.MOVIE',
role: 'user',
faIcon: 'fa-film',
faClass: 'text-mt',
divider: false,
position: 1,
state: 'torrents.movie',
url: '/movie',
pageTitle: 'MOVIE_LIST',
uploadTemplateID: 'movie',
showSubtitleTabInDetailPage: true,
showScreenshotsTabInDetailPage: true,
showTopListInHome: true
},
{
enable: true,
name: 'TVSERIAL',
value: 'tvserial',
title: 'MENU_TORRENTS_SUB.TVSERIAL',
role: 'user',
faIcon: 'fa-tv',
faClass: 'text-mt',
divider: false,
position: 2,
state: 'torrents.tvserial',
url: '/tv',
pageTitle: 'TV_LIST',
uploadTemplateID: 'tvserial',
showSubtitleTabInDetailPage: true,
showScreenshotsTabInDetailPage: true,
showTopListInHome: true
},
{
enable: true,
name: 'DOCUMENTARY',
value: 'documentary',
title: 'MENU_TORRENTS_SUB.DOCUMENTARY',
role: 'user',
faIcon: 'fa-globe',
faClass: 'text-mt',
divider: false,
position: 3,
state: 'torrents.documentary',
url: '/documentary',
pageTitle: 'DOCUMENTARY_LIST',
uploadTemplateID: 'default',
showSubtitleTabInDetailPage: true,
showScreenshotsTabInDetailPage: false,
showTopListInHome: true
},
{
enable: true,
name: 'MUSIC',
value: 'music',
title: 'MENU_TORRENTS_SUB.MUSIC',
role: 'user',
faIcon: 'fa-music',
faClass: 'text-mt',
divider: true,
position: 4,
state: 'torrents.music',
url: '/music',
pageTitle: 'MUSIC_LIST',
uploadTemplateID: 'music',
showSubtitleTabInDetailPage: false,
showScreenshotsTabInDetailPage: false,
showTopListInHome: true
},
{
enable: true,
name: 'SPORTS',
value: 'sports',
title: 'MENU_TORRENTS_SUB.SPORTS',
role: 'user',
faIcon: 'fa-futbol',
faClass: 'text-mt',
divider: false,
position: 5,
state: 'torrents.sports',
url: '/sports',
pageTitle: 'SPORTS_LIST',
uploadTemplateID: 'default',
showSubtitleTabInDetailPage: false,
showScreenshotsTabInDetailPage: false,
showTopListInHome: false
},
{
enable: true,
name: 'VARIETY',
value: 'variety',
title: 'MENU_TORRENTS_SUB.VARIETY',
role: 'user',
faIcon: 'fa-camera',
faClass: 'text-mt',
divider: false,
position: 6,
state: 'torrents.variety',
url: '/variety',
pageTitle: 'VARIETY_LIST',
uploadTemplateID: 'default',
showSubtitleTabInDetailPage: false,
showScreenshotsTabInDetailPage: false,
showTopListInHome: false
},
{
enable: true,
name: 'PICTURE',
value: 'picture',
title: 'MENU_TORRENTS_SUB.PICTURE',
role: 'user',
faIcon: 'fa-images',
faClass: 'text-mt',
divider: false,
position: 7,
state: 'torrents.picture',
url: '/picture',
pageTitle: 'PICTURE_LIST',
uploadTemplateID: 'default',
showSubtitleTabInDetailPage: false,
showScreenshotsTabInDetailPage: false,
showTopListInHome: false
},
{
enable: true,
name: 'GAME',
value: 'game',
title: 'MENU_TORRENTS_SUB.GAME',
role: 'user',
faIcon: 'fa-gamepad',
faClass: 'text-mt',
divider: true,
position: 8,
state: 'torrents.game',
url: '/game',
pageTitle: 'GAME_LIST',
uploadTemplateID: 'default',
showSubtitleTabInDetailPage: false,
showScreenshotsTabInDetailPage: false,
showTopListInHome: false
},
{
enable: true,
name: 'SOFTWARE',
value: 'software',
title: 'MENU_TORRENTS_SUB.SOFTWARE',
role: 'user',
faIcon: 'fa-hdd',
faClass: 'text-mt',
divider: false,
position: 9,
state: 'torrents.software',
url: '/software',
pageTitle: 'SOFTWARE_LIST',
uploadTemplateID: 'default',
showSubtitleTabInDetailPage: false,
showScreenshotsTabInDetailPage: false,
showTopListInHome: false
},
{
enable: true,
name: 'EBOOK',
value: 'ebook',
title: 'MENU_TORRENTS_SUB.EBOOK',
role: 'user',
faIcon: 'fa-book',
faClass: 'text-mt',
divider: false,
position: 10,
state: 'torrents.ebook',
url: '/ebook',
pageTitle: 'EBOOK_LIST',
uploadTemplateID: 'default',
showSubtitleTabInDetailPage: false,
showScreenshotsTabInDetailPage: false,
showTopListInHome: false
},
{
enable: true,
name: 'OTHER',
value: 'other',
title: 'MENU_TORRENTS_SUB.OTHER',
role: 'user',
faIcon: null,
faClass: null,
divider: true,
position: 11,