-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathconfig-fields-service.js
2359 lines (2323 loc) · 125 KB
/
config-fields-service.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
/*
* (C) Copyright 2017 TheOtherP (theotherp@posteo.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular
.module('nzbhydraApp')
.factory('ConfigFields', ConfigFields);
function ConfigFields($injector) {
return {
getFields: getFields
};
function ipValidator() {
return {
expression: function ($viewValue, $modelValue) {
var value = $modelValue || $viewValue;
if (value) {
return /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/.test(value)
|| /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/.test(value);
}
return true;
},
message: '$viewValue + " is not a valid IP Address"'
};
}
function regexValidator(regex, message, prefixViewValue, preventEmpty) {
return {
expression: function ($viewValue, $modelValue) {
var value = $modelValue || $viewValue;
if (value) {
if (Array.isArray(value)) {
for (var i = 0; i < value.length; i++) {
if (!regex.test(value[i])) {
return false;
}
}
return true;
} else {
return regex.test(value);
}
}
return !preventEmpty;
},
message: (prefixViewValue ? '$viewValue + " ' : '" ') + message + '"'
};
}
function getFields(rootModel, showAdvanced) {
return {
main: [
{
wrapper: 'fieldset',
templateOptions: {label: 'Hosting'},
fieldGroup: [
{
key: 'host',
type: 'horizontalInput',
templateOptions: {
type: 'text',
label: 'Host',
required: true,
placeholder: 'IPv4 address to bind to',
help: 'I strongly recommend <a href="https://github.com/theotherp/nzbhydra2/wiki/Exposing-Hydra-to-the-internet-and-using-reverse-proxies" target="_blank">using a reverse proxy</a> instead of exposing this directly. Requires restart.'
},
validators: {
ipAddress: ipValidator()
}
},
{
key: 'port',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Port',
required: true,
placeholder: '5076',
help: 'Requires restart.'
},
validators: {
port: regexValidator(/^\d{1,5}$/, "is no valid port", true)
}
},
{
key: 'urlBase',
type: 'horizontalInput',
templateOptions: {
type: 'text',
label: 'URL base',
placeholder: '/nzbhydra',
help: 'Adapt when using a reverse proxy. See <a href="https://github.com/theotherp/nzbhydra2/wiki/Exposing-Hydra-to-the-internet-and-using-reverse-proxies" target="_blank">wiki</a>. Always use when calling Hydra, even locally.',
tooltip: 'If you use Hydra behind a reverse proxy you might want to set the URL base to a value like "/nzbhydra". If you accesses Hydra with tools running outside your network (for example from your phone) set the external URL so that it matches the full Hydra URL. That way the NZB links returned in the search results refer to your global URL and not your local address.',
advanced: true
},
validators: {
urlBase: regexValidator(/^((\/.*[^\/])|\/)$/, 'URL base has to start and may not end with /', false, true)
}
},
{
key: 'ssl',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Use SSL',
help: 'Requires restart.',
tooltip: 'You can use SSL but I recommend using a reverse proxy with SSL. See the wiki for notes regarding reverse proxies and SSL. It\'s more secure and can be configured better.',
advanced: true
}
},
{
key: 'sslKeyStore',
hideExpression: '!model.ssl',
type: 'fileInput',
templateOptions: {
label: 'SSL keystore file',
required: true,
type: "file",
help: 'Requires restart. See <a href="https://github.com/theotherp/nzbhydra2/wiki/SSL" target="_blank">wiki</a>.'
}
},
{
key: 'sslKeyStorePassword',
hideExpression: '!model.ssl',
type: 'horizontalInput',
templateOptions: {
type: 'password',
label: 'SSL keystore password',
required: true,
help: 'Requires restart.'
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {
label: 'Proxy',
tooltip: 'You can select to use either a SOCKS or an HTTPS proxy. All outside connections will be done via the configured proxy.',
advanced: true
}
,
fieldGroup: [
{
key: 'proxyType',
type: 'horizontalSelect',
templateOptions: {
type: 'select',
label: 'Use proxy',
options: [
{name: 'None', value: 'NONE'},
{name: 'SOCKS', value: 'SOCKS'},
{name: 'HTTP(S)', value: 'HTTP'}
]
}
},
{
key: 'proxyHost',
type: 'horizontalInput',
hideExpression: 'model.proxyType==="NONE"',
templateOptions: {
type: 'text',
label: 'SOCKS proxy host',
placeholder: 'Set to use a SOCKS proxy',
help: "IPv4 only"
}
},
{
key: 'proxyPort',
type: 'horizontalInput',
hideExpression: 'model.proxyType==="NONE"',
templateOptions: {
type: 'number',
label: 'Proxy port',
placeholder: '1080'
}
},
{
key: 'proxyUsername',
type: 'horizontalInput',
hideExpression: 'model.proxyType==="NONE"',
templateOptions: {
type: 'text',
label: 'Proxy username'
}
},
{
key: 'proxyPassword',
type: 'passwordSwitch',
hideExpression: 'model.proxyType==="NONE"',
templateOptions: {
type: 'text',
label: 'Proxy password'
}
},
{
key: 'proxyIgnoreLocal',
type: 'horizontalSwitch',
hideExpression: 'model.proxyType==="NONE"',
templateOptions: {
type: 'switch',
label: 'Bypass local network addresses'
}
},
{
key: 'proxyIgnoreDomains',
type: 'horizontalChips',
hideExpression: 'model.proxyType==="NONE"',
templateOptions: {
type: 'text',
help: 'Separate by comma. You can use wildcards (*). Case insensitive. Apply values with enter key.',
label: 'Bypass domains'
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {label: 'UI'},
fieldGroup: [
{
key: 'theme',
type: 'horizontalSelect',
templateOptions: {
type: 'select',
label: 'Theme',
options: [
{name: 'Auto', value: 'auto'},
{name: 'Grey', value: 'grey'},
{name: 'Bright', value: 'bright'},
{name: 'Dark', value: 'dark'}
]
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {label: 'Security'},
fieldGroup: [
{
key: 'apiKey',
type: 'horizontalApiKeyInput',
templateOptions: {
label: 'API key',
help: 'Alphanumeric only.',
required: true
},
validators: {
apiKey: regexValidator(/^[a-zA-Z0-9]*$/, "API key must only contain numbers and digits", false)
}
},
{
key: 'dereferer',
type: 'horizontalInput',
templateOptions: {
type: 'text',
label: 'Dereferer',
help: 'Redirect external links to hide your instance. Insert $s for escaped target URL and $us for unescaped target URL. Use empty value to disable.',
advanced: true
}
},
{
key: 'verifySsl',
type: 'horizontalSwitch',
templateOptions: {
label: 'Verify SSL certificates',
help: 'If enabled only valid/known SSL certificates will be accepted when accessing indexers. Change requires restart. See <a href="https://github.com/theotherp/nzbhydra2/wiki/SSL-verification-errors" target="_blank">wiki</a>.',
advanced: true
}
},
{
key: 'verifySslDisabledFor',
type: 'horizontalChips',
templateOptions: {
type: 'text',
label: 'Disable SSL for...',
help: 'Add hosts for which to disable SSL verification. Apply words with return key.',
advanced: true
}
},
{
key: 'disableSslLocally',
type: 'horizontalSwitch',
templateOptions: {
type: 'text',
label: 'Disable SSL locally',
help: 'Disable SSL for local hosts.',
advanced: true
}
},
{
key: 'sniDisabledFor',
type: 'horizontalChips',
templateOptions: {
type: 'text',
label: 'Disable SNI',
help: 'Add a host if you get an "unrecognized_name" error. Apply words with return key. See <a href="https://github.com/theotherp/nzbhydra2/wiki/SSL-verification-errors" target="_blank">wiki</a>.',
advanced: true
}
},
{
key: 'useCsrf',
type: 'horizontalSwitch',
templateOptions: {
label: 'Use CSRF protection',
help: 'Use <a href="https://en.wikipedia.org/wiki/Cross-site_request_forgery" target="_blank">CSRF protection</a>.',
advanced: true
}
}
]
},
{
wrapper: 'fieldset',
key: 'logging',
templateOptions: {
label: 'Logging',
tooltip: 'The base settings should suffice for most users. If you want you can enable logging of IP adresses for failed logins and NZB downloads.',
advanced: true
},
fieldGroup: [
{
key: 'logfilelevel',
type: 'horizontalSelect',
templateOptions: {
type: 'select',
label: 'Logfile level',
options: [
{name: 'Error', value: 'ERROR'},
{name: 'Warning', value: 'WARN'},
{name: 'Info', value: 'INFO'},
{name: 'Debug', value: 'DEBUG'}
],
help: 'Takes effect on next restart.'
}
},
{
key: 'logMaxHistory',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Max log history',
help: 'How many daily log files will be kept.'
}
},
{
key: 'consolelevel',
type: 'horizontalSelect',
templateOptions: {
type: 'select',
label: 'Console log level',
options: [
{name: 'Error', value: 'ERROR'},
{name: 'Warning', value: 'WARN'},
{name: 'Info', value: 'INFO'},
{name: 'Debug', value: 'DEBUG'}
],
help: 'Takes effect on next restart.'
}
},
{
key: 'logGc',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Log GC',
help: 'Enable garbage collection logging. Only for debugging of memory issues.'
}
},
{
key: 'logIpAddresses',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Log IP addresses'
}
},
{
key: 'mapIpToHost',
type: 'horizontalSwitch',
hideExpression: '!model.logIpAddresses',
templateOptions: {
type: 'switch',
label: 'Map hosts',
help: 'Try to map logged IP addresses to host names.',
tooltip: 'Enabling this may cause NZBHydra to load very, very slowly when accessed remotely.'
}
},
{
key: 'logUsername',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Log user names'
}
},
{
key: 'markersToLog',
type: 'horizontalMultiselect',
hideExpression: 'model.consolelevel !== "DEBUG" && model.logfilelevel !== "DEBUG"',
templateOptions: {
label: 'Log markers',
help: 'Select certain sections for more output on debug level. Please enable only when asked for.',
options: [
{label: 'API limits', id: 'LIMITS'},
{label: 'Category mapping', id: 'CATEGORY_MAPPING'},
{label: 'Config file handling', id: 'CONFIG_READ_WRITE'},
{label: 'Custom mapping', id: 'CUSTOM_MAPPING'},
{label: 'Downloader status updating', id: 'DOWNLOADER_STATUS_UPDATE'},
{label: 'Duplicate detection', id: 'DUPLICATES'},
{label: 'External tool configuration', id: 'EXTERNAL_TOOLS'},
{label: 'History cleanup', id: 'HISTORY_CLEANUP'},
{label: 'HTTP', id: 'HTTP'},
{label: 'HTTPS', id: 'HTTPS'},
{label: 'HTTP Server', id: 'SERVER'},
{label: 'Indexer scheduler', id: 'SCHEDULER'},
{label: 'Notifications', id: 'NOTIFICATIONS'},
{label: 'NZB download status updating', id: 'DOWNLOAD_STATUS_UPDATE'},
{label: 'Performance', id: 'PERFORMANCE'},
{label: 'Rejected results', id: 'RESULT_ACCEPTOR'},
{label: 'Removed trailing words', id: 'TRAILING'},
{label: 'URL calculation', id: 'URL_CALCULATION'},
{label: 'User agent mapping', id: 'USER_AGENT'},
{label: 'VIP expiry', id: 'VIP_EXPIRY'}
],
buttonText: "None"
}
},
{
key: 'historyUserInfoType',
type: 'horizontalSelect',
templateOptions: {
type: 'select',
label: 'History user info',
options: [
{name: 'IP and username', value: 'BOTH'},
{name: 'IP address', value: 'IP'},
{name: 'Username', value: 'USERNAME'},
{name: 'None', value: 'NONE'}
],
help: 'Only affects if value is displayed in the search/download history.',
hideExpression: '!model.keepHistory'
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {
label: 'Backup',
advanced: true
},
fieldGroup: [
{
key: 'backupFolder',
type: 'horizontalInput',
templateOptions: {
label: 'Backup folder',
help: 'Either relative to the NZBHydra data folder or an absolute folder.'
}
},
{
key: 'backupEveryXDays',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Backup every...',
addonRight: {
text: 'days'
}
}
},
{
key: 'backupBeforeUpdate',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Backup before update'
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {label: 'Updates'},
fieldGroup: [
{
key: 'updateAutomatically',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Install updates automatically'
}
}, {
key: 'updateToPrereleases',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Install prereleases',
advanced: true
}
},
{
key: 'deleteBackupsAfterWeeks',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Delete backups after...',
addonRight: {
text: 'weeks'
},
advanced: true
}
},
{
key: 'showUpdateBannerOnDocker',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Show update banner when managed externally',
advanced: true,
help: 'If enabled a banner will be shown when new versions are available even when NZBHydra is run inside docker or is installed using a package manager (where you wouldn\'t let NZBHydra update itself).'
}
},
{
key: 'showWhatsNewBanner',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Show info banner after automatic updates',
help: 'Please keep it enabled, I put some effort into the changelog ;-)',
advanced: true
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {
label: 'History',
advanced: true
},
fieldGroup: [
{
key: 'keepHistory',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Keep history',
help: 'Controls search and download history.',
tooltip: 'If disabled no search or download history will be kept. These sections will be hidden in the GUI. You won\'t be able to see stats. The database will still contain a short-lived history of transactions that are kept for 24 hours.'
}
},
{
key: 'keepHistoryForWeeks',
type: 'horizontalInput',
hideExpression: '!model.keepHistory',
templateOptions: {
type: 'number',
label: 'Keep history for...',
addonRight: {
text: 'weeks'
},
min: 1,
help: 'Only keep history (searches, downloads) for a certain time. Will decrease database size and may improve performance a bit. Rather reduce how long stats are kept.'
}
},
{
key: 'keepStatsForWeeks',
type: 'horizontalInput',
hideExpression: '!model.keepHistory',
templateOptions: {
type: 'number',
label: 'Keep stats for...',
addonRight: {
text: 'weeks'
},
min: 1,
help: 'Only keep stats for a certain time. Will decrease database size.'
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {
label: 'Database',
tooltip: 'You should not change these values unless you\'re either told to or really know what you\'re doing.',
advanced: true
},
fieldGroup: [
{
key: 'databaseCompactTime',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Database compact time',
addonRight: {
text: 'ms'
},
min: 200,
help: 'The time the database is given to compact (reduce size) when shutting down. Reduce this if shutting down NZBHydra takes too long (database size may increase). Takes effect on next restart.'
}
},
{
key: 'databaseRetentionTime',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Database retention time',
addonRight: {
text: 'ms'
},
help: 'How long the db should retain old, persisted data. See <a href="https://www.h2database.com/html/commands.html#set_retention_time">here</a>.'
}
},
{
key: 'databaseWriteDelay',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Database write delay',
addonRight: {
text: 'ms'
},
help: 'Maximum delay between a commit and flushing the log, in milliseconds. See <a href="https://www.h2database.com/html/commands.html#set_write_delay">here</a>.'
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {label: 'Other'},
fieldGroup: [
{
key: 'startupBrowser',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Open browser on startup'
}
},
{
key: 'showNews',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Show news',
help: "Hydra will occasionally show news when opened. You can always find them in the system section",
advanced: true
}
},
{
key: 'proxyImages',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Proxy images',
help: 'Download images from indexers and info providers (e.g. TMBD) and serve them via NZBHydra. Will only affect searches via UI, not API searches.'
}
},
{
key: 'checkOpenPort',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Check for open port',
help: "Check if NZBHydra is reachable from the internet and not protected",
advanced: true
}
},
{
key: 'xmx',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'JVM memory',
addonRight: {
text: 'MB'
},
min: 128,
help: '256 should suffice except when working with big databases / many indexers. See <a href="https://github.com/theotherp/nzbhydra2/wiki/Memory-requirements" target="_blank">wiki</a>.',
advanced: true
}
}
]
}
],
searching: [
{
wrapper: 'fieldset',
templateOptions: {
label: 'Indexer access',
tooltip: 'Settings that control how communication with indexers is done and how to handle errors while doing that.',
advanced: true
},
fieldGroup: [
{
key: 'timeout',
type: 'horizontalInput',
templateOptions: {
type: 'number',
label: 'Timeout when accessing indexers',
help: 'Any web call to an indexer taking longer than this is aborted.',
min: 1,
addonRight: {
text: 'seconds'
}
}
},
{
key: 'userAgent',
type: 'horizontalInput',
templateOptions: {
type: 'text',
label: 'User agent',
help: 'Used when accessing indexers.',
required: true,
tooltip: 'Some indexers don\'t seem to like Hydra and disable access based on the user agent. You can change it here if you want. Please leave it as it is if you have no problems. This allows indexers to gather better statistics on how their API services are used.',
}
},
{
key: 'userAgents',
type: 'horizontalChips',
templateOptions: {
type: 'text',
label: 'Map user agents',
help: 'Used to map the user agent from accessing services to the service names. Apply words with return key.',
}
},
{
key: 'ignoreLoadLimitingForInternalSearches',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Ignore load limiting internally',
help: 'When enabled load limiting defined for indexers will be ignored for internal searches.',
}
},
{
key: 'ignoreTemporarilyDisabled',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Ignore temporary errors',
tooltip: "By default if access to an indexer fails the indexer is disabled for a certain amount of time (for a short while first, then increasingly longer if the problems persist). Disable this and always try these indexers.",
}
}
]
}, {
wrapper: 'fieldset',
templateOptions: {
label: 'Category handling',
tooltip: 'Settings that control the handling of newznab categories (e.g. 2000 for Movies).',
advanced: true
},
fieldGroup: [
{
key: 'transformNewznabCategories',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Transform newznab categories',
help: 'Map newznab categories from API searches to configured categories and use all configured newznab categories in searches.'
}
},
{
key: 'sendTorznabCategories',
type: 'horizontalSwitch',
templateOptions: {
type: 'switch',
label: 'Send categories to trackers',
help: 'If disabled no categories will be included in queries to torznab indexers (trackers).'
}
}
]
},
{
wrapper: 'fieldset',
templateOptions: {
label: 'Media IDs / Query generation / Query processing',
tooltip: 'Raw search engines like Binsearch don\'t support searches based on IDs (e.g. for a movie using an IMDB id). You can enable query generation for these. Hydra will then try to retrieve the movie\'s or show\'s title and generate a query, for example "showname s01e01". In some cases an ID based search will not provide any results. You can enable a fallback so that in such a case the search will be repeated with a query using the title of the show or movie.'
},
fieldGroup: [
{
key: 'alwaysConvertIds',
type: 'horizontalSelect',
templateOptions: {
label: 'Convert media IDs for...',
options: [
{name: 'Internal searches', value: 'INTERNAL'},
{name: 'API searches', value: 'API'},
{name: 'All searches', value: 'BOTH'},
{name: 'Never', value: 'NONE'}
],
help: "When enabled media ID conversions will always be done even when an indexer supports the already known ID(s).",
advanced: true
}
},
{
key: 'generateQueries',
type: 'horizontalSelect',
templateOptions: {
label: 'Generate queries',
options: [
{name: 'Internal searches', value: 'INTERNAL'},
{name: 'API searches', value: 'API'},
{name: 'All searches', value: 'BOTH'},
{name: 'Never', value: 'NONE'}
],
help: "Generate queries for indexers which do not support ID based searches."
}
},
{
key: 'idFallbackToQueryGeneration',
type: 'horizontalSelect',
templateOptions: {
label: 'Fallback to generated queries',
options: [
{name: 'Internal searches', value: 'INTERNAL'},
{name: 'API searches', value: 'API'},
{name: 'All searches', value: 'BOTH'},
{name: 'Never', value: 'NONE'}
],
help: "When no results were found for a query ID search again using a generated query (on indexer level)."
}
},
{
key: 'language',
type: 'horizontalSelect',
templateOptions: {
type: 'text',
label: 'Language',
required: true,
help: 'Used for movie query generation and autocomplete only.',
options: [{"name": "Abkhaz", value: "ab"}, {
"name": "Afar",
value: "aa"
}, {"name": "Afrikaans", value: "af"}, {"name": "Akan", value: "ak"}, {
"name": "Albanian",
value: "sq"
}, {"name": "Amharic", value: "am"}, {
"name": "Arabic",
value: "ar"
}, {"name": "Aragonese", value: "an"}, {"name": "Armenian", value: "hy"}, {
"name": "Assamese",
value: "as"
}, {"name": "Avaric", value: "av"}, {"name": "Avestan", value: "ae"}, {
"name": "Aymara",
value: "ay"
}, {"name": "Azerbaijani", value: "az"}, {
"name": "Bambara",
value: "bm"
}, {"name": "Bashkir", value: "ba"}, {
"name": "Basque",
value: "eu"
}, {"name": "Belarusian", value: "be"}, {"name": "Bengali", value: "bn"}, {
"name": "Bihari",
value: "bh"
}, {"name": "Bislama", value: "bi"}, {
"name": "Bosnian",
value: "bs"
}, {"name": "Breton", value: "br"}, {"name": "Bulgarian", value: "bg"}, {
"name": "Burmese",
value: "my"
}, {"name": "Catalan", value: "ca"}, {
"name": "Chamorro",
value: "ch"
}, {"name": "Chechen", value: "ce"}, {"name": "Chichewa", value: "ny"}, {
"name": "Chinese",
value: "zh"
}, {"name": "Chuvash", value: "cv"}, {
"name": "Cornish",
value: "kw"
}, {"name": "Corsican", value: "co"}, {"name": "Cree", value: "cr"}, {
"name": "Croatian",
value: "hr"
}, {"name": "Czech", value: "cs"}, {"name": "Danish", value: "da"}, {
"name": "Divehi",
value: "dv"
}, {"name": "Dutch", value: "nl"}, {
"name": "Dzongkha",
value: "dz"
}, {"name": "English", value: "en"}, {
"name": "Esperanto",
value: "eo"
}, {"name": "Estonian", value: "et"}, {"name": "Ewe", value: "ee"}, {
"name": "Faroese",
value: "fo"
}, {"name": "Fijian", value: "fj"}, {"name": "Finnish", value: "fi"}, {
"name": "French",
value: "fr"
}, {"name": "Fula", value: "ff"}, {
"name": "Galician",
value: "gl"
}, {"name": "Georgian", value: "ka"}, {"name": "German", value: "de"}, {
"name": "Greek",
value: "el"
}, {"name": "Guaraní", value: "gn"}, {
"name": "Gujarati",
value: "gu"
}, {"name": "Haitian", value: "ht"}, {"name": "Hausa", value: "ha"}, {
"name": "Hebrew",
value: "he"
}, {"name": "Herero", value: "hz"}, {
"name": "Hindi",
value: "hi"
}, {"name": "Hiri Motu", value: "ho"}, {
"name": "Hungarian",
value: "hu"
}, {"name": "Interlingua", value: "ia"}, {
"name": "Indonesian",
value: "id"
}, {"name": "Interlingue", value: "ie"}, {
"name": "Irish",
value: "ga"
}, {"name": "Igbo", value: "ig"}, {"name": "Inupiaq", value: "ik"}, {
"name": "Ido",
value: "io"
}, {"name": "Icelandic", value: "is"}, {
"name": "Italian",
value: "it"
}, {"name": "Inuktitut", value: "iu"}, {"name": "Japanese", value: "ja"}, {
"name": "Javanese",
value: "jv"
}, {"name": "Kalaallisut", value: "kl"}, {
"name": "Kannada",
value: "kn"
}, {"name": "Kanuri", value: "kr"}, {"name": "Kashmiri", value: "ks"}, {
"name": "Kazakh",
value: "kk"
}, {"name": "Khmer", value: "km"}, {
"name": "Kikuyu",
value: "ki"
}, {"name": "Kinyarwanda", value: "rw"}, {"name": "Kyrgyz", value: "ky"}, {
"name": "Komi",
value: "kv"
}, {"name": "Kongo", value: "kg"}, {"name": "Korean", value: "ko"}, {
"name": "Kurdish",
value: "ku"
}, {"name": "Kwanyama", value: "kj"}, {
"name": "Latin",
value: "la"
}, {"name": "Luxembourgish", value: "lb"}, {
"name": "Ganda",
value: "lg"
}, {"name": "Limburgish", value: "li"}, {"name": "Lingala", value: "ln"}, {
"name": "Lao",
value: "lo"
}, {"name": "Lithuanian", value: "lt"}, {
"name": "Luba-Katanga",
value: "lu"
}, {"name": "Latvian", value: "lv"}, {"name": "Manx", value: "gv"}, {
"name": "Macedonian",
value: "mk"
}, {"name": "Malagasy", value: "mg"}, {
"name": "Malay",
value: "ms"
}, {"name": "Malayalam", value: "ml"}, {"name": "Maltese", value: "mt"}, {
"name": "Māori",
value: "mi"
}, {"name": "Marathi", value: "mr"}, {
"name": "Marshallese",
value: "mh"
}, {"name": "Mongolian", value: "mn"}, {"name": "Nauru", value: "na"}, {
"name": "Navajo",
value: "nv"
}, {"name": "Northern Ndebele", value: "nd"}, {
"name": "Nepali",
value: "ne"
}, {"name": "Ndonga", value: "ng"}, {
"name": "Norwegian Bokmål",
value: "nb"
}, {"name": "Norwegian Nynorsk", value: "nn"}, {
"name": "Norwegian",
value: "no"
}, {"name": "Nuosu", value: "ii"}, {
"name": "Southern Ndebele",
value: "nr"