cross-seed 6.0.0-4 → 6.0.0-40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Result.js +17 -11
- package/dist/Result.js.map +1 -1
- package/dist/action.js +188 -74
- package/dist/action.js.map +1 -1
- package/dist/arr.js +197 -0
- package/dist/arr.js.map +1 -0
- package/dist/clients/Deluge.js +78 -55
- package/dist/clients/Deluge.js.map +1 -1
- package/dist/clients/QBittorrent.js +98 -67
- package/dist/clients/QBittorrent.js.map +1 -1
- package/dist/clients/RTorrent.js +39 -12
- package/dist/clients/RTorrent.js.map +1 -1
- package/dist/clients/TorrentClient.js +1 -1
- package/dist/clients/TorrentClient.js.map +1 -1
- package/dist/clients/Transmission.js +31 -11
- package/dist/clients/Transmission.js.map +1 -1
- package/dist/cmd.js +37 -23
- package/dist/cmd.js.map +1 -1
- package/dist/config.template.cjs +88 -52
- package/dist/config.template.cjs.map +1 -1
- package/dist/configSchema.js +102 -14
- package/dist/configSchema.js.map +1 -1
- package/dist/configuration.js +4 -1
- package/dist/configuration.js.map +1 -1
- package/dist/constants.js +114 -6
- package/dist/constants.js.map +1 -1
- package/dist/dataFiles.js +4 -5
- package/dist/dataFiles.js.map +1 -1
- package/dist/db.js +2 -1
- package/dist/db.js.map +1 -1
- package/dist/decide.js +282 -167
- package/dist/decide.js.map +1 -1
- package/dist/diff.js +13 -3
- package/dist/diff.js.map +1 -1
- package/dist/errors.js +5 -2
- package/dist/errors.js.map +1 -1
- package/dist/indexers.js +96 -16
- package/dist/indexers.js.map +1 -1
- package/dist/inject.js +410 -0
- package/dist/inject.js.map +1 -0
- package/dist/jobs.js +9 -2
- package/dist/jobs.js.map +1 -1
- package/dist/logger.js +29 -9
- package/dist/logger.js.map +1 -1
- package/dist/migrations/00-initialSchema.js.map +1 -1
- package/dist/migrations/05-caps.js +16 -0
- package/dist/migrations/05-caps.js.map +1 -0
- package/dist/migrations/06-uniqueDecisions.js +29 -0
- package/dist/migrations/06-uniqueDecisions.js.map +1 -0
- package/dist/migrations/07-limits.js +12 -0
- package/dist/migrations/07-limits.js.map +1 -0
- package/dist/migrations/migrations.js +13 -1
- package/dist/migrations/migrations.js.map +1 -1
- package/dist/parseTorrent.js +6 -0
- package/dist/parseTorrent.js.map +1 -1
- package/dist/pipeline.js +225 -116
- package/dist/pipeline.js.map +1 -1
- package/dist/preFilter.js +130 -52
- package/dist/preFilter.js.map +1 -1
- package/dist/pushNotifier.js +7 -5
- package/dist/pushNotifier.js.map +1 -1
- package/dist/runtimeConfig.js.map +1 -1
- package/dist/searchee.js +200 -19
- package/dist/searchee.js.map +1 -1
- package/dist/server.js +79 -32
- package/dist/server.js.map +1 -1
- package/dist/startup.js +17 -6
- package/dist/startup.js.map +1 -1
- package/dist/torrent.js +117 -51
- package/dist/torrent.js.map +1 -1
- package/dist/torznab.js +374 -146
- package/dist/torznab.js.map +1 -1
- package/dist/utils.js +252 -33
- package/dist/utils.js.map +1 -1
- package/package.json +10 -5
package/dist/config.template.cjs
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
// If you find yourself always using the same command-line flag, you can set it
|
3
3
|
// here as a default.
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
5
4
|
module.exports = {
|
6
5
|
/**
|
7
6
|
* WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
|
@@ -27,6 +26,36 @@ module.exports = {
|
|
27
26
|
* and separate them with commas, and surround the entire set in brackets.
|
28
27
|
*/
|
29
28
|
torznab: [],
|
29
|
+
/**
|
30
|
+
* URL(s) to your Sonarr instance(s), included in the same way as torznab
|
31
|
+
* URLs but for your Sonarr: note that api is not at the end. see below.
|
32
|
+
*
|
33
|
+
* You should order these in most likely to match -> the least likely order.
|
34
|
+
* They are searched sequentially as they are listed.
|
35
|
+
*
|
36
|
+
* This apikey parameter comes from Sonarr
|
37
|
+
*
|
38
|
+
* Example: sonarr: ["http://sonarr:8989/?apikey=12345"],
|
39
|
+
*
|
40
|
+
* sonarr: ["http://sonarr:8989/?apikey=12345",
|
41
|
+
* "http://sonarr4k:8989/?apikey=12345"],
|
42
|
+
*/
|
43
|
+
sonarr: undefined,
|
44
|
+
/**
|
45
|
+
* URL(s) to your Radarr instance(s), included in the same way as torznab
|
46
|
+
* URLs but for your Radarr: note that api is not at the end. see below.
|
47
|
+
*
|
48
|
+
* You should order these in most likely to match -> the least likely order.
|
49
|
+
* They are searched sequentially as they are listed.
|
50
|
+
*
|
51
|
+
* This apikey parameter comes from Radarr
|
52
|
+
*
|
53
|
+
* Example: radarr: ["http://radarr:7878/?apikey=12345"],
|
54
|
+
*
|
55
|
+
* radarr: ["http://radarr:7878/?apikey=12345",
|
56
|
+
* "http://radarr4k:7878/?apikey=12345"],
|
57
|
+
*/
|
58
|
+
radarr: undefined,
|
30
59
|
/**
|
31
60
|
* Bind to a specific host address.
|
32
61
|
* Example: "127.0.0.1"
|
@@ -51,6 +80,10 @@ module.exports = {
|
|
51
80
|
/**
|
52
81
|
* The url of your qBittorrent webui.
|
53
82
|
* Only relevant with action: "inject".
|
83
|
+
*
|
84
|
+
* If using Automatic Torrent Management, please read:
|
85
|
+
* https://www.cross-seed.org/docs/v6-migration#qbittorrent
|
86
|
+
*
|
54
87
|
* Supply your username and password inside the url like so:
|
55
88
|
* "http://username:password@localhost:8080"
|
56
89
|
*/
|
@@ -77,33 +110,33 @@ module.exports = {
|
|
77
110
|
/**
|
78
111
|
* Pause at least this many seconds in between each search. Higher is safer
|
79
112
|
* for you and friendlier for trackers.
|
80
|
-
* Minimum value of
|
113
|
+
* Minimum value of 30.
|
81
114
|
*/
|
82
115
|
delay: 30,
|
83
116
|
/**
|
84
|
-
* To search with already downloaded data, you can enter
|
117
|
+
* To search with already downloaded data, you can enter the directories
|
85
118
|
* to your downloaded torrent data to find matches, rather than relying
|
86
119
|
* entirely on the .torrent files themselves for matching.
|
87
120
|
*
|
88
|
-
* If directories are entered, they must all be
|
121
|
+
* If directories are entered, they must all be in a single option, and they
|
89
122
|
* need to be surrounded by brackets.
|
123
|
+
*
|
90
124
|
* Windows users will need to use double backslash in all paths in this
|
91
125
|
* config.
|
92
126
|
*
|
93
127
|
* example:
|
94
128
|
* dataDirs: ["/downloads/movies", "/downloads/packs"],
|
95
|
-
* or for
|
129
|
+
* or for Windows users
|
96
130
|
* dataDirs: ["C:\\My Data\\Downloads\\Movies"],
|
97
131
|
*/
|
98
132
|
dataDirs: [],
|
99
133
|
/**
|
100
134
|
* Defines what qBittorrent or Deluge category to set on linked torrents
|
101
|
-
* Default is "cross-seed-link".
|
102
135
|
*
|
103
136
|
* qBittorrent: If you have linking enabled, all torrents will be injected
|
104
137
|
* to this category.
|
105
138
|
*
|
106
|
-
* Default is "cross-seed-
|
139
|
+
* Default is "cross-seed-link".
|
107
140
|
*/
|
108
141
|
linkCategory: "cross-seed-link",
|
109
142
|
/**
|
@@ -119,11 +152,14 @@ module.exports = {
|
|
119
152
|
* IF YOU ARE USING HARDLINKS, THIS MUST BE UNDER THE SAME VOLUME AS YOUR
|
120
153
|
* DATADIRS. THIS PATH MUST ALSO BE ACCESSIBLE VIA YOUR TORRENT CLIENT
|
121
154
|
* USING THE SAME PATH.
|
155
|
+
*
|
156
|
+
* We recommend reading the following FAQ entry:
|
157
|
+
* https://www.cross-seed.org/docs/basics/faq-troubleshooting#what-linktype-should-i-use
|
122
158
|
*/
|
123
159
|
linkDir: undefined,
|
124
160
|
/**
|
125
161
|
* cross-seed will use links of this type to inject data-based matches into
|
126
|
-
* your client.
|
162
|
+
* your client. We recommend reading the following FAQ entry:
|
127
163
|
* https://www.cross-seed.org/docs/basics/faq-troubleshooting#what-linktype-should-i-use
|
128
164
|
* Options: "symlink", "hardlink".
|
129
165
|
*/
|
@@ -131,11 +167,11 @@ module.exports = {
|
|
131
167
|
/**
|
132
168
|
* Enabling this will link files using v5's flat folder style.
|
133
169
|
*
|
134
|
-
* Each individual Torznab tracker's cross-seeds, otherwise, will have
|
170
|
+
* Each individual Torznab tracker's cross-seeds, otherwise, will have its
|
135
171
|
* own folder with the tracker's name and it's links within it.
|
136
172
|
*
|
137
|
-
*
|
138
|
-
*
|
173
|
+
* If using Automatic Torrent Management in qBittorrent, please read:
|
174
|
+
* https://www.cross-seed.org/docs/v6-migration#qbittorrent
|
139
175
|
*
|
140
176
|
* Default: false.
|
141
177
|
*/
|
@@ -148,6 +184,9 @@ module.exports = {
|
|
148
184
|
* "partial" is like risky but allows matches if they are missing small
|
149
185
|
* files like .nfo/.srt.
|
150
186
|
* Options: "safe", "risky", "partial".
|
187
|
+
*
|
188
|
+
* We recommend reading the following FAQ entry:
|
189
|
+
* https://www.cross-seed.org/docs/basics/faq-troubleshooting#what-linktype-should-i-use
|
151
190
|
*/
|
152
191
|
matchMode: "safe",
|
153
192
|
/**
|
@@ -155,7 +194,7 @@ module.exports = {
|
|
155
194
|
* searchees. Setting this to higher values will result in more searchees
|
156
195
|
* and more API hits to your indexers.
|
157
196
|
*/
|
158
|
-
maxDataDepth:
|
197
|
+
maxDataDepth: 2,
|
159
198
|
/**
|
160
199
|
* Directory containing .torrent files.
|
161
200
|
* For qBittorrent, this is BT_Backup.
|
@@ -174,47 +213,39 @@ module.exports = {
|
|
174
213
|
*/
|
175
214
|
outputDir: ".",
|
176
215
|
/**
|
177
|
-
* Whether to
|
178
|
-
* packs.
|
179
|
-
* This option overrides includeSingleEpisodes when set to true.
|
180
|
-
*/
|
181
|
-
includeEpisodes: false,
|
182
|
-
/**
|
183
|
-
* Whether to include single episode torrents in the search (not those from
|
216
|
+
* Whether to include single episode torrents in a search (not those from
|
184
217
|
* season packs).
|
185
|
-
*
|
218
|
+
*
|
219
|
+
* This setting does not affect matching episodes from rss and
|
220
|
+
* announce.
|
186
221
|
*/
|
187
222
|
includeSingleEpisodes: false,
|
188
223
|
/**
|
189
|
-
* Include torrents which
|
190
|
-
* This option does not override includeEpisodes or includeSingleEpisodes.
|
224
|
+
* Include torrents which are comprised of non-video files.
|
191
225
|
*
|
192
|
-
* If this option is set to false, any folders or torrents
|
193
|
-
*
|
226
|
+
* If this option is set to false, any folders or torrents whose
|
227
|
+
* totalNonVideoFilesSize / totalSize > fuzzySizeThreshold
|
228
|
+
* will be excluded.
|
194
229
|
*
|
195
|
-
* For example, if you have .srt or .nfo files inside
|
196
|
-
*
|
230
|
+
* For example, if you have .srt or .nfo files inside a torrent, using
|
231
|
+
* false will still allow the torrent to be considered for cross-seeding
|
232
|
+
* while disallowing torrents that are music, games, books, etc.
|
197
233
|
* For full disc based folders (not .ISO) you may wish to set this as true.
|
198
|
-
* You may also want to set this as false to exclude things like music,
|
199
|
-
* games, or books.
|
200
|
-
*
|
201
|
-
* To search for everything except episodes, use:
|
202
234
|
*
|
203
|
-
*
|
204
|
-
* includeSingleEpisodes: false
|
205
|
-
* includeNonVideos: true
|
235
|
+
* To search for all video media except individual episodes, use:
|
206
236
|
*
|
207
|
-
*
|
237
|
+
* includeSingleEpisodes: false
|
238
|
+
* includeNonVideos: false
|
208
239
|
*
|
209
|
-
*
|
210
|
-
* includeNonVideos: true
|
240
|
+
* To search for all video media including individual episodes, use:
|
211
241
|
*
|
212
|
-
*
|
242
|
+
* includeSingleEpisodes: true
|
243
|
+
* includeNonVideos: false
|
213
244
|
*
|
214
|
-
*
|
215
|
-
*
|
216
|
-
* includeNonVideos: true
|
245
|
+
* To search for absolutely ALL types of content, including non-video, configure
|
246
|
+
* your episode settings based on the above examples and use:
|
217
247
|
*
|
248
|
+
* includeNonVideos: true
|
218
249
|
*/
|
219
250
|
includeNonVideos: false,
|
220
251
|
/**
|
@@ -232,9 +263,10 @@ module.exports = {
|
|
232
263
|
/**
|
233
264
|
* Exclude torrents first seen by cross-seed more than this long ago.
|
234
265
|
* Examples:
|
235
|
-
* "
|
236
|
-
* "
|
237
|
-
*
|
266
|
+
* "5 days"
|
267
|
+
* "2 weeks"
|
268
|
+
*
|
269
|
+
* This value must be in the range of 2-5 times your excludeRecentSearch
|
238
270
|
*/
|
239
271
|
excludeOlder: "2 weeks",
|
240
272
|
/**
|
@@ -243,11 +275,13 @@ module.exports = {
|
|
243
275
|
* Doesn't exclude previously failed searches.
|
244
276
|
* Examples:
|
245
277
|
* "2 days"
|
246
|
-
* "
|
278
|
+
* "5 days"
|
279
|
+
*
|
280
|
+
* This value must be 2-5x less than excludeOlder.
|
247
281
|
*/
|
248
282
|
excludeRecentSearch: "3 days",
|
249
283
|
/**
|
250
|
-
*
|
284
|
+
* Which action to take upon a match being found.
|
251
285
|
* Options: "save", "inject".
|
252
286
|
*/
|
253
287
|
action: "inject",
|
@@ -258,7 +292,7 @@ module.exports = {
|
|
258
292
|
*
|
259
293
|
* qBittorrent: This will apply the category's original category as a tag.
|
260
294
|
*
|
261
|
-
* Example: if you have
|
295
|
+
* Example: if you have an original label/category called "Movies", this will
|
262
296
|
* automatically inject cross-seeds to "Movies.cross-seed".
|
263
297
|
*/
|
264
298
|
duplicateCategories: false,
|
@@ -276,6 +310,8 @@ module.exports = {
|
|
276
310
|
* Examples:
|
277
311
|
* "2 weeks"
|
278
312
|
* "3 days"
|
313
|
+
*
|
314
|
+
* This value must be at least 3x less than your excludeRecentSearch
|
279
315
|
*/
|
280
316
|
searchCadence: "1 day",
|
281
317
|
/**
|
@@ -285,7 +321,7 @@ module.exports = {
|
|
285
321
|
* "30 seconds"
|
286
322
|
* null
|
287
323
|
*/
|
288
|
-
snatchTimeout:
|
324
|
+
snatchTimeout: "30 seconds",
|
289
325
|
/**
|
290
326
|
* Fail search requests that haven't responded after this long.
|
291
327
|
* Set to null for an infinite timeout.
|
@@ -293,7 +329,7 @@ module.exports = {
|
|
293
329
|
* "30 seconds"
|
294
330
|
* null
|
295
331
|
*/
|
296
|
-
searchTimeout:
|
332
|
+
searchTimeout: "2 minutes",
|
297
333
|
/**
|
298
334
|
* The number of searches to make in one run/batch.
|
299
335
|
* If more than this many searches are queued,
|
@@ -314,10 +350,10 @@ module.exports = {
|
|
314
350
|
*
|
315
351
|
* examples:
|
316
352
|
*
|
317
|
-
*
|
318
|
-
*
|
319
|
-
*
|
320
|
-
*
|
353
|
+
* blockList: ["-excludedGroup", "-excludedGroup2"],
|
354
|
+
* blocklist: ["x265"],
|
355
|
+
* blocklist: ["Release.Name"],
|
356
|
+
* blocklist: ["3317e6485454354751555555366a8308c1e92093"],
|
321
357
|
*/
|
322
358
|
blockList: undefined,
|
323
359
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.template.cjs","sourceRoot":"","sources":["../src/config.template.cjs"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,qBAAqB
|
1
|
+
{"version":3,"file":"config.template.cjs","sourceRoot":"","sources":["../src/config.template.cjs"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,qBAAqB;AAErB,MAAM,CAAC,OAAO,GAAG;IAChB;;;;;;;;QAQI;IAEJ;;;;;OAKG;IACH,MAAM,EAAE,SAAS;IAEjB;;;;;;OAMG;IACH,OAAO,EAAE,EAAE;IAEX;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,SAAS;IAEjB;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,SAAS;IAEjB;;;;OAIG;IACH,IAAI,EAAE,SAAS;IAEf;;OAEG;IACH,IAAI,EAAE,IAAI;IAEV;;;OAGG;IACH,sBAAsB,EAAE,SAAS;IAEjC;;;;OAIG;IACH,cAAc,EAAE,SAAS;IAEzB;;;;;;;;;OASG;IACH,cAAc,EAAE,SAAS;IAEzB;;;;;;OAMG;IACH,kBAAkB,EAAE,SAAS;IAE7B;;;;;;OAMG;IACH,YAAY,EAAE,SAAS;IAEvB;;OAEG;IAEH;;;;OAIG;IAEH,KAAK,EAAE,EAAE;IAET;;;;;;;;;;;;;;;OAeG;IAEH,QAAQ,EAAE,EAAE;IAEZ;;;;;;;OAOG;IACH,YAAY,EAAE,iBAAiB;IAE/B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,EAAE,SAAS;IAElB;;;;;OAKG;IACH,QAAQ,EAAE,UAAU;IAEpB;;;;;;;;;;OAUG;IACH,WAAW,EAAE,KAAK;IAElB;;;;;;;;;;;OAWG;IACH,SAAS,EAAE,MAAM;IAEjB;;;;OAIG;IACH,YAAY,EAAE,CAAC;IAEf;;;;;;;;;OASG;IACH,UAAU,EAAE,2BAA2B;IAEvC;;;;OAIG;IACH,SAAS,EAAE,GAAG;IAEd;;;;;;OAMG;IACH,qBAAqB,EAAE,KAAK;IAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gBAAgB,EAAE,KAAK;IAEvB;;;;;;OAMG;IACH,kBAAkB,EAAE,IAAI;IAExB;;;OAGG;IAEH;;;;;;;OAOG;IACH,YAAY,EAAE,SAAS;IAEvB;;;;;;;;;OASG;IACH,mBAAmB,EAAE,QAAQ;IAE7B;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;;;;;;;OASG;IACH,mBAAmB,EAAE,KAAK;IAE1B;;;;;;OAMG;IACH,UAAU,EAAE,YAAY;IAExB;;;;;;;;OAQG;IACH,aAAa,EAAE,OAAO;IAEtB;;;;;;OAMG;IACH,aAAa,EAAE,YAAY;IAE3B;;;;;;OAMG;IACH,aAAa,EAAE,WAAW;IAE1B;;;;;;;;;OASG;IACH,WAAW,EAAE,GAAG;IAEhB;;;;;;;;;;;;;OAaG;IACH,SAAS,EAAE,SAAS;CACpB,CAAC"}
|
package/dist/configSchema.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import ms from "ms";
|
2
|
+
import { isAbsolute, relative, resolve } from "path";
|
2
3
|
import { z } from "zod";
|
3
|
-
import { Action, LinkType, MatchMode } from "./constants.js";
|
4
|
+
import { Action, LinkType, MatchMode, NEWLINE_INDENT } from "./constants.js";
|
4
5
|
import { logger } from "./logger.js";
|
5
6
|
/**
|
6
7
|
* error messages and map returned upon Zod validation failure
|
@@ -8,11 +9,21 @@ import { logger } from "./logger.js";
|
|
8
9
|
const ZodErrorMessages = {
|
9
10
|
vercel: "format does not follow vercel's `ms` style ( https://github.com/vercel/ms#examples )",
|
10
11
|
emptyString: "cannot have an empty string. If you want to unset it, use null or undefined.",
|
11
|
-
|
12
|
-
|
12
|
+
delayNegative: "delay is in seconds, you can't travel back in time.",
|
13
|
+
delayUnsupported: `delay must be 30 seconds to 1 hour.${NEWLINE_INDENT}To even out search loads please see the following documentation:${NEWLINE_INDENT}(https://www.cross-seed.org/docs/basics/daemon#set-up-periodic-searches)`,
|
14
|
+
rssCadenceUnsupported: "rssCadence must be 10-120 minutes",
|
15
|
+
searchCadenceUnsupported: "searchCadence must be at least 1 day.",
|
16
|
+
searchCadenceExcludeRecent: "excludeRecentSearch must be at least 3x searchCadence.",
|
17
|
+
excludeRecentOlder: "excludeOlder and excludeRecentSearch must be defined for searching. excludeOlder must be 2-5x excludeRecentSearch.",
|
18
|
+
fuzzySizeThreshold: "fuzzySizeThreshold must be between 0 and 1 with a maximum of 0.1 when using searchCadence or rssCadence",
|
13
19
|
injectUrl: "You need to specify rtorrentRpcUrl, transmissionRpcUrl, qbittorrentUrl, or delugeRpcUrl when using 'inject'",
|
14
|
-
qBitAutoTMM: "
|
20
|
+
qBitAutoTMM: "If using Automatic Torrent Management in qBittorrent, please read: https://www.cross-seed.org/docs/v6-migration#qbittorrent",
|
21
|
+
includeSingleEpisodes: "includeSingleEpisodes is not recommended when using announce, please read: https://www.cross-seed.org/docs/v6-migration#updated-includesingleepisodes-behavior",
|
22
|
+
needsTorrentDir: "You need to set torrentDir for rss and announce matching to work.",
|
23
|
+
needsInject: "You need to use the 'inject' action for partial matching.",
|
15
24
|
needsLinkDir: "You need to set a linkDir (and have your data accessible) for risky or partial matching to work.",
|
25
|
+
linkDirInDataDir: "You cannot have your linkDir inside of your dataDirs. Please adjust your paths to correct this.",
|
26
|
+
outputDirInInputDir: "You cannot have your outputDir inside of your torrentDir/dataDirs. Please adjust your paths to correct this.",
|
16
27
|
};
|
17
28
|
/**
|
18
29
|
* custom zod error map for logging
|
@@ -58,15 +69,34 @@ function transformDurationString(durationStr, ctx) {
|
|
58
69
|
}
|
59
70
|
return duration;
|
60
71
|
}
|
72
|
+
/**
|
73
|
+
* check a potential child path being inside an array of parent paths
|
74
|
+
* @param childDir path of the potential child (e.g. linkDir)
|
75
|
+
* @param parentDirs array of parentDir paths (e.g. dataDirs)
|
76
|
+
* @returns true if `childDir` is inside any `parentDirs` at any nesting level, false otherwise.
|
77
|
+
*/
|
78
|
+
function isChildPath(childDir, parentDirs) {
|
79
|
+
return parentDirs.some((parentDir) => {
|
80
|
+
const resolvedParent = resolve(parentDir);
|
81
|
+
const resolvedChild = resolve(childDir);
|
82
|
+
const relativePath = relative(resolvedParent, resolvedChild);
|
83
|
+
// if the path does not start with '..' and is not absolute
|
84
|
+
return !(relativePath.startsWith("..") || isAbsolute(relativePath));
|
85
|
+
});
|
86
|
+
}
|
61
87
|
/**
|
62
88
|
* an object of the zod schema
|
63
89
|
* each are named after what they are intended to validate
|
64
90
|
*/
|
65
91
|
export const VALIDATION_SCHEMA = z
|
66
92
|
.object({
|
67
|
-
delay: z
|
68
|
-
|
69
|
-
|
93
|
+
delay: z
|
94
|
+
.number()
|
95
|
+
.nonnegative({
|
96
|
+
message: ZodErrorMessages.delayNegative,
|
97
|
+
})
|
98
|
+
.gte(process.env.DEV ? 0 : 30, ZodErrorMessages.delayUnsupported)
|
99
|
+
.lte(3600, ZodErrorMessages.delayUnsupported),
|
70
100
|
torznab: z.array(z.string().url()),
|
71
101
|
dataDirs: z.array(z.string()).nullish(),
|
72
102
|
matchMode: z.nativeEnum(MatchMode),
|
@@ -80,7 +110,7 @@ export const VALIDATION_SCHEMA = z
|
|
80
110
|
maxDataDepth: z.number().gte(1),
|
81
111
|
torrentDir: z.string().nullable(),
|
82
112
|
outputDir: z.string(),
|
83
|
-
|
113
|
+
injectDir: z.string().optional(),
|
84
114
|
includeSingleEpisodes: z.boolean(),
|
85
115
|
includeNonVideos: z.boolean(),
|
86
116
|
fuzzySizeThreshold: z.number().positive().lte(1, {
|
@@ -90,12 +120,24 @@ export const VALIDATION_SCHEMA = z
|
|
90
120
|
.string()
|
91
121
|
.min(1, { message: ZodErrorMessages.emptyString })
|
92
122
|
.transform(transformDurationString)
|
93
|
-
.nullish()
|
123
|
+
.nullish()
|
124
|
+
.or(z
|
125
|
+
.boolean()
|
126
|
+
.refine((value) => value !== true, {
|
127
|
+
message: "Expected string, received boolean (true)",
|
128
|
+
})
|
129
|
+
.transform(() => null)),
|
94
130
|
excludeRecentSearch: z
|
95
131
|
.string()
|
96
132
|
.min(1, { message: ZodErrorMessages.emptyString })
|
97
133
|
.transform(transformDurationString)
|
98
|
-
.nullish()
|
134
|
+
.nullish()
|
135
|
+
.or(z
|
136
|
+
.boolean()
|
137
|
+
.refine((value) => value !== true, {
|
138
|
+
message: "Expected string, received boolean (true)",
|
139
|
+
})
|
140
|
+
.transform(() => null)),
|
99
141
|
action: z.nativeEnum(Action),
|
100
142
|
qbittorrentUrl: z.string().url().nullish(),
|
101
143
|
rtorrentRpcUrl: z.string().url().nullish(),
|
@@ -114,12 +156,16 @@ export const VALIDATION_SCHEMA = z
|
|
114
156
|
.string()
|
115
157
|
.min(1, { message: ZodErrorMessages.emptyString })
|
116
158
|
.transform(transformDurationString)
|
117
|
-
.nullish()
|
159
|
+
.nullish()
|
160
|
+
.refine((cadence) => process.env.DEV ||
|
161
|
+
!cadence ||
|
162
|
+
(cadence >= ms("10 minutes") && cadence <= ms("2 hours")), ZodErrorMessages.rssCadenceUnsupported),
|
118
163
|
searchCadence: z
|
119
164
|
.string()
|
120
165
|
.min(1, { message: ZodErrorMessages.emptyString })
|
121
166
|
.transform(transformDurationString)
|
122
|
-
.nullish()
|
167
|
+
.nullish()
|
168
|
+
.refine((cadence) => process.env.DEV || !cadence || cadence >= ms("1 day"), ZodErrorMessages.searchCadenceUnsupported),
|
123
169
|
snatchTimeout: z
|
124
170
|
.string()
|
125
171
|
.min(1, { message: ZodErrorMessages.emptyString })
|
@@ -138,8 +184,26 @@ export const VALIDATION_SCHEMA = z
|
|
138
184
|
.nullish()
|
139
185
|
.transform((value) => (Array.isArray(value) ? value : [])),
|
140
186
|
apiKey: z.string().min(24).nullish(),
|
187
|
+
radarr: z
|
188
|
+
.array(z.string().url())
|
189
|
+
.nullish()
|
190
|
+
.transform((value) => value ?? []),
|
191
|
+
sonarr: z
|
192
|
+
.array(z.string().url())
|
193
|
+
.nullish()
|
194
|
+
.transform((value) => value ?? []),
|
141
195
|
})
|
142
196
|
.strict()
|
197
|
+
.refine((config) => !config.searchCadence ||
|
198
|
+
!config.excludeRecentSearch ||
|
199
|
+
3 * config.searchCadence <= config.excludeRecentSearch, ZodErrorMessages.searchCadenceExcludeRecent)
|
200
|
+
.refine((config) => !config.searchCadence ||
|
201
|
+
(config.excludeOlder &&
|
202
|
+
config.excludeRecentSearch &&
|
203
|
+
config.excludeOlder >= 2 * config.excludeRecentSearch &&
|
204
|
+
config.excludeOlder <= 5 * config.excludeRecentSearch), ZodErrorMessages.excludeRecentOlder)
|
205
|
+
.refine((config) => config.fuzzySizeThreshold <= 0.1 ||
|
206
|
+
(!config.searchCadence && !config.rssCadence), ZodErrorMessages.fuzzySizeThreshold)
|
143
207
|
.refine((config) => {
|
144
208
|
if (config.action === Action.INJECT &&
|
145
209
|
config.qbittorrentUrl &&
|
@@ -149,10 +213,34 @@ export const VALIDATION_SCHEMA = z
|
|
149
213
|
}
|
150
214
|
return true;
|
151
215
|
})
|
152
|
-
.refine((config) =>
|
216
|
+
.refine((config) => {
|
217
|
+
if (config.includeSingleEpisodes && config.rssCadence) {
|
218
|
+
logger.warn(ZodErrorMessages.includeSingleEpisodes);
|
219
|
+
}
|
220
|
+
return true;
|
221
|
+
})
|
222
|
+
.refine((config) => !((config.action === Action.INJECT || config.injectDir) &&
|
153
223
|
!config.rtorrentRpcUrl &&
|
154
224
|
!config.qbittorrentUrl &&
|
155
225
|
!config.transmissionRpcUrl &&
|
156
226
|
!config.delugeRpcUrl), ZodErrorMessages.injectUrl)
|
157
|
-
.refine((config) => config.
|
227
|
+
.refine((config) => config.action === Action.INJECT ||
|
228
|
+
config.matchMode !== MatchMode.PARTIAL, ZodErrorMessages.needsInject)
|
229
|
+
.refine((config) => config.torrentDir || !config.rssCadence, ZodErrorMessages.needsTorrentDir)
|
230
|
+
.refine((config) => config.linkDir || config.matchMode === MatchMode.SAFE, ZodErrorMessages.needsLinkDir)
|
231
|
+
.refine((config) => {
|
232
|
+
if (config.linkDir && config.dataDirs) {
|
233
|
+
return !isChildPath(config.linkDir, config.dataDirs);
|
234
|
+
}
|
235
|
+
return true;
|
236
|
+
}, ZodErrorMessages.linkDirInDataDir)
|
237
|
+
.refine((config) => {
|
238
|
+
if (config.torrentDir) {
|
239
|
+
return !isChildPath(config.outputDir, [
|
240
|
+
config.torrentDir,
|
241
|
+
...(config.dataDirs ?? []),
|
242
|
+
]);
|
243
|
+
}
|
244
|
+
return true;
|
245
|
+
}, ZodErrorMessages.outputDirInInputDir);
|
158
246
|
//# sourceMappingURL=configSchema.js.map
|
package/dist/configSchema.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../src/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAA8B,CAAC,EAA2B,MAAM,KAAK,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../src/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EAA8B,CAAC,EAA2B,MAAM,KAAK,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7E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B;KACA,MAAM,CACN,CAAC,MAAM,EAAE,EAAE,CACV,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM;IAC/B,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,OAAO,EACvC,gBAAgB,CAAC,WAAW,CAC5B;KACA,MAAM,CACN,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,UAAU,EACnD,gBAAgB,CAAC,eAAe,CAChC;KACA,MAAM,CACN,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,EACjE,gBAAgB,CAAC,YAAY,CAC7B;KACA,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;IAClB,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACvC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;KACpC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;IAClB,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;YACrC,MAAM,CAAC,UAAU;YACjB,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;SAC1B,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,CAAC"}
|
package/dist/configuration.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import chalk from "chalk";
|
2
|
-
import { accessSync, copyFileSync, existsSync, mkdirSync
|
2
|
+
import { accessSync, constants, copyFileSync, existsSync, mkdirSync } from "fs";
|
3
3
|
import { createRequire } from "module";
|
4
4
|
import path from "path";
|
5
5
|
import { pathToFileURL } from "url";
|
@@ -23,6 +23,9 @@ export function appDir() {
|
|
23
23
|
accessSync(appDir, constants.R_OK | constants.W_OK);
|
24
24
|
}
|
25
25
|
catch (e) {
|
26
|
+
if (e.code === "ENOENT") {
|
27
|
+
return appDir;
|
28
|
+
}
|
26
29
|
const dockerMessage = process.env.DOCKER_ENV === "true"
|
27
30
|
? ` Use chown to set the owner to ${process.getuid()}:${process.getgid()}`
|
28
31
|
: "";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAwClD,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;CAOxC,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,UAAU,MAAM;IACrB,MAAM,MAAM,GACX,OAAO,CAAC,GAAG,CAAC,UAAU;QACtB,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO;YAC5B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,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