cross-seed 6.0.0-9 → 6.0.1
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/action.js +177 -68
- package/dist/action.js.map +1 -1
- package/dist/arr.js +62 -54
- package/dist/arr.js.map +1 -1
- package/dist/clients/Deluge.js +70 -46
- package/dist/clients/Deluge.js.map +1 -1
- package/dist/clients/QBittorrent.js +110 -68
- package/dist/clients/QBittorrent.js.map +1 -1
- package/dist/clients/RTorrent.js +45 -22
- package/dist/clients/RTorrent.js.map +1 -1
- package/dist/clients/TorrentClient.js +14 -1
- package/dist/clients/TorrentClient.js.map +1 -1
- package/dist/clients/Transmission.js +29 -9
- package/dist/clients/Transmission.js.map +1 -1
- package/dist/cmd.js +46 -23
- package/dist/cmd.js.map +1 -1
- package/dist/config.template.cjs +60 -63
- package/dist/config.template.cjs.map +1 -1
- package/dist/configSchema.js +89 -25
- package/dist/configSchema.js.map +1 -1
- package/dist/configuration.js +4 -1
- package/dist/configuration.js.map +1 -1
- package/dist/constants.js +69 -10
- 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 +231 -146
- package/dist/decide.js.map +1 -1
- package/dist/diff.js +13 -3
- package/dist/diff.js.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/indexers.js +94 -33
- package/dist/indexers.js.map +1 -1
- package/dist/inject.js +448 -0
- package/dist/inject.js.map +1 -0
- package/dist/jobs.js +13 -6
- package/dist/jobs.js.map +1 -1
- package/dist/logger.js +27 -9
- package/dist/logger.js.map +1 -1
- package/dist/migrations/00-initialSchema.js.map +1 -1
- package/dist/migrations/05-caps.js.map +1 -1
- 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 +4 -0
- 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 +224 -108
- package/dist/pipeline.js.map +1 -1
- package/dist/preFilter.js +122 -55
- package/dist/preFilter.js.map +1 -1
- package/dist/pushNotifier.js +7 -5
- package/dist/pushNotifier.js.map +1 -1
- package/dist/searchee.js +198 -17
- package/dist/searchee.js.map +1 -1
- package/dist/server.js +106 -54
- package/dist/server.js.map +1 -1
- package/dist/startup.js +16 -7
- package/dist/startup.js.map +1 -1
- package/dist/torrent.js +100 -37
- package/dist/torrent.js.map +1 -1
- package/dist/torznab.js +323 -153
- package/dist/torznab.js.map +1 -1
- package/dist/utils.js +228 -43
- package/dist/utils.js.map +1 -1
- package/package.json +11 -6
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!
|
@@ -31,30 +30,30 @@ module.exports = {
|
|
31
30
|
* URL(s) to your Sonarr instance(s), included in the same way as torznab
|
32
31
|
* URLs but for your Sonarr: note that api is not at the end. see below.
|
33
32
|
*
|
34
|
-
* You should order these in most likely to match -> least likely order.
|
33
|
+
* You should order these in most likely to match -> the least likely order.
|
35
34
|
* They are searched sequentially as they are listed.
|
36
35
|
*
|
37
36
|
* This apikey parameter comes from Sonarr
|
38
37
|
*
|
39
38
|
* Example: sonarr: ["http://sonarr:8989/?apikey=12345"],
|
40
39
|
*
|
41
|
-
*
|
42
|
-
*
|
40
|
+
* sonarr: ["http://sonarr:8989/?apikey=12345",
|
41
|
+
* "http://sonarr4k:8989/?apikey=12345"],
|
43
42
|
*/
|
44
43
|
sonarr: undefined,
|
45
44
|
/**
|
46
45
|
* URL(s) to your Radarr instance(s), included in the same way as torznab
|
47
|
-
* URLs but for your
|
46
|
+
* URLs but for your Radarr: note that api is not at the end. see below.
|
48
47
|
*
|
49
|
-
* You should order these in most likely to match -> least likely order.
|
48
|
+
* You should order these in most likely to match -> the least likely order.
|
50
49
|
* They are searched sequentially as they are listed.
|
51
50
|
*
|
52
|
-
* This apikey parameter comes from
|
51
|
+
* This apikey parameter comes from Radarr
|
53
52
|
*
|
54
53
|
* Example: radarr: ["http://radarr:7878/?apikey=12345"],
|
55
54
|
*
|
56
|
-
*
|
57
|
-
*
|
55
|
+
* radarr: ["http://radarr:7878/?apikey=12345",
|
56
|
+
* "http://radarr4k:7878/?apikey=12345"],
|
58
57
|
*/
|
59
58
|
radarr: undefined,
|
60
59
|
/**
|
@@ -111,33 +110,33 @@ module.exports = {
|
|
111
110
|
/**
|
112
111
|
* Pause at least this many seconds in between each search. Higher is safer
|
113
112
|
* for you and friendlier for trackers.
|
114
|
-
* Minimum value of
|
113
|
+
* Minimum value of 30.
|
115
114
|
*/
|
116
115
|
delay: 30,
|
117
116
|
/**
|
118
|
-
* To search with already downloaded data, you can enter
|
117
|
+
* To search with already downloaded data, you can enter the directories
|
119
118
|
* to your downloaded torrent data to find matches, rather than relying
|
120
119
|
* entirely on the .torrent files themselves for matching.
|
121
120
|
*
|
122
|
-
* If directories are entered, they must all be
|
121
|
+
* If directories are entered, they must all be in a single option, and they
|
123
122
|
* need to be surrounded by brackets.
|
123
|
+
*
|
124
124
|
* Windows users will need to use double backslash in all paths in this
|
125
125
|
* config.
|
126
126
|
*
|
127
127
|
* example:
|
128
128
|
* dataDirs: ["/downloads/movies", "/downloads/packs"],
|
129
|
-
* or for
|
129
|
+
* or for Windows users
|
130
130
|
* dataDirs: ["C:\\My Data\\Downloads\\Movies"],
|
131
131
|
*/
|
132
132
|
dataDirs: [],
|
133
133
|
/**
|
134
134
|
* Defines what qBittorrent or Deluge category to set on linked torrents
|
135
|
-
* Default is "cross-seed-link".
|
136
135
|
*
|
137
136
|
* qBittorrent: If you have linking enabled, all torrents will be injected
|
138
137
|
* to this category.
|
139
138
|
*
|
140
|
-
* Default is "cross-seed-
|
139
|
+
* Default is "cross-seed-link".
|
141
140
|
*/
|
142
141
|
linkCategory: "cross-seed-link",
|
143
142
|
/**
|
@@ -155,24 +154,24 @@ module.exports = {
|
|
155
154
|
* USING THE SAME PATH.
|
156
155
|
*
|
157
156
|
* We recommend reading the following FAQ entry:
|
158
|
-
* https://www.cross-seed.org/docs/
|
157
|
+
* https://www.cross-seed.org/docs/tutorials/linking
|
159
158
|
*/
|
160
159
|
linkDir: undefined,
|
161
160
|
/**
|
162
161
|
* cross-seed will use links of this type to inject data-based matches into
|
163
162
|
* your client. We recommend reading the following FAQ entry:
|
164
|
-
* https://www.cross-seed.org/docs/
|
163
|
+
* https://www.cross-seed.org/docs/tutorials/linking#hardlinks-vs-symlinks
|
165
164
|
* Options: "symlink", "hardlink".
|
166
165
|
*/
|
167
166
|
linkType: "hardlink",
|
168
167
|
/**
|
169
168
|
* Enabling this will link files using v5's flat folder style.
|
170
169
|
*
|
171
|
-
* Each individual Torznab tracker's cross-seeds, otherwise, will have
|
170
|
+
* Each individual Torznab tracker's cross-seeds, otherwise, will have its
|
172
171
|
* own folder with the tracker's name and it's links within it.
|
173
172
|
*
|
174
173
|
* If using Automatic Torrent Management in qBittorrent, please read:
|
175
|
-
* https://www.cross-seed.org/docs/
|
174
|
+
* https://www.cross-seed.org/docs/basics/options#flatlinking
|
176
175
|
*
|
177
176
|
* Default: false.
|
178
177
|
*/
|
@@ -187,7 +186,8 @@ module.exports = {
|
|
187
186
|
* Options: "safe", "risky", "partial".
|
188
187
|
*
|
189
188
|
* We recommend reading the following FAQ entry:
|
190
|
-
* https://www.cross-seed.org/docs/basics/
|
189
|
+
* https://www.cross-seed.org/docs/basics/options#matchmode
|
190
|
+
* https://www.cross-seed.org/docs/tutorials/linking#hardlinks-vs-symlinks
|
191
191
|
*/
|
192
192
|
matchMode: "safe",
|
193
193
|
/**
|
@@ -195,7 +195,7 @@ module.exports = {
|
|
195
195
|
* searchees. Setting this to higher values will result in more searchees
|
196
196
|
* and more API hits to your indexers.
|
197
197
|
*/
|
198
|
-
maxDataDepth:
|
198
|
+
maxDataDepth: 2,
|
199
199
|
/**
|
200
200
|
* Directory containing .torrent files.
|
201
201
|
* For qBittorrent, this is BT_Backup.
|
@@ -214,47 +214,39 @@ module.exports = {
|
|
214
214
|
*/
|
215
215
|
outputDir: ".",
|
216
216
|
/**
|
217
|
-
* Whether to
|
218
|
-
* packs.
|
219
|
-
* This option overrides includeSingleEpisodes when set to true.
|
220
|
-
*/
|
221
|
-
includeEpisodes: false,
|
222
|
-
/**
|
223
|
-
* Whether to include single episode torrents in the search (not those from
|
217
|
+
* Whether to include single episode torrents in a search (not those from
|
224
218
|
* season packs).
|
225
|
-
*
|
219
|
+
*
|
220
|
+
* This setting does not affect matching episodes from rss and
|
221
|
+
* announce.
|
226
222
|
*/
|
227
223
|
includeSingleEpisodes: false,
|
228
224
|
/**
|
229
|
-
* Include torrents which
|
230
|
-
* This option does not override includeEpisodes or includeSingleEpisodes.
|
225
|
+
* Include torrents which are comprised of non-video files.
|
231
226
|
*
|
232
|
-
* If this option is set to false, any folders or torrents
|
233
|
-
*
|
227
|
+
* If this option is set to false, any folders or torrents whose
|
228
|
+
* totalNonVideoFilesSize / totalSize > fuzzySizeThreshold
|
229
|
+
* will be excluded.
|
234
230
|
*
|
235
|
-
* For example, if you have .srt or .nfo files inside
|
236
|
-
*
|
231
|
+
* For example, if you have .srt or .nfo files inside a torrent, using
|
232
|
+
* false will still allow the torrent to be considered for cross-seeding
|
233
|
+
* while disallowing torrents that are music, games, books, etc.
|
237
234
|
* For full disc based folders (not .ISO) you may wish to set this as true.
|
238
|
-
* You may also want to set this as false to exclude things like music,
|
239
|
-
* games, or books.
|
240
|
-
*
|
241
|
-
* To search for everything except episodes, use:
|
242
235
|
*
|
243
|
-
*
|
244
|
-
* includeSingleEpisodes: false
|
245
|
-
* includeNonVideos: true
|
236
|
+
* To search for all video media except individual episodes, use:
|
246
237
|
*
|
247
|
-
*
|
238
|
+
* includeSingleEpisodes: false
|
239
|
+
* includeNonVideos: false
|
248
240
|
*
|
249
|
-
*
|
250
|
-
* includeNonVideos: true
|
241
|
+
* To search for all video media including individual episodes, use:
|
251
242
|
*
|
252
|
-
*
|
243
|
+
* includeSingleEpisodes: true
|
244
|
+
* includeNonVideos: false
|
253
245
|
*
|
254
|
-
*
|
255
|
-
*
|
256
|
-
* includeNonVideos: true
|
246
|
+
* To search for absolutely ALL types of content, including non-video, configure
|
247
|
+
* your episode settings based on the above examples and use:
|
257
248
|
*
|
249
|
+
* includeNonVideos: true
|
258
250
|
*/
|
259
251
|
includeNonVideos: false,
|
260
252
|
/**
|
@@ -272,9 +264,10 @@ module.exports = {
|
|
272
264
|
/**
|
273
265
|
* Exclude torrents first seen by cross-seed more than this long ago.
|
274
266
|
* Examples:
|
275
|
-
* "
|
276
|
-
* "
|
277
|
-
*
|
267
|
+
* "5 days"
|
268
|
+
* "2 weeks"
|
269
|
+
*
|
270
|
+
* This value must be in the range of 2-5 times your excludeRecentSearch
|
278
271
|
*/
|
279
272
|
excludeOlder: "2 weeks",
|
280
273
|
/**
|
@@ -283,11 +276,13 @@ module.exports = {
|
|
283
276
|
* Doesn't exclude previously failed searches.
|
284
277
|
* Examples:
|
285
278
|
* "2 days"
|
286
|
-
* "
|
279
|
+
* "5 days"
|
280
|
+
*
|
281
|
+
* This value must be 2-5x less than excludeOlder.
|
287
282
|
*/
|
288
283
|
excludeRecentSearch: "3 days",
|
289
284
|
/**
|
290
|
-
*
|
285
|
+
* Which action to take upon a match being found.
|
291
286
|
* Options: "save", "inject".
|
292
287
|
*/
|
293
288
|
action: "inject",
|
@@ -298,7 +293,7 @@ module.exports = {
|
|
298
293
|
*
|
299
294
|
* qBittorrent: This will apply the category's original category as a tag.
|
300
295
|
*
|
301
|
-
* Example: if you have
|
296
|
+
* Example: if you have an original label/category called "Movies", this will
|
302
297
|
* automatically inject cross-seeds to "Movies.cross-seed".
|
303
298
|
*/
|
304
299
|
duplicateCategories: false,
|
@@ -316,6 +311,8 @@ module.exports = {
|
|
316
311
|
* Examples:
|
317
312
|
* "2 weeks"
|
318
313
|
* "3 days"
|
314
|
+
*
|
315
|
+
* This value must be at least 3x less than your excludeRecentSearch
|
319
316
|
*/
|
320
317
|
searchCadence: "1 day",
|
321
318
|
/**
|
@@ -325,7 +322,7 @@ module.exports = {
|
|
325
322
|
* "30 seconds"
|
326
323
|
* null
|
327
324
|
*/
|
328
|
-
snatchTimeout:
|
325
|
+
snatchTimeout: "30 seconds",
|
329
326
|
/**
|
330
327
|
* Fail search requests that haven't responded after this long.
|
331
328
|
* Set to null for an infinite timeout.
|
@@ -333,7 +330,7 @@ module.exports = {
|
|
333
330
|
* "30 seconds"
|
334
331
|
* null
|
335
332
|
*/
|
336
|
-
searchTimeout:
|
333
|
+
searchTimeout: "2 minutes",
|
337
334
|
/**
|
338
335
|
* The number of searches to make in one run/batch.
|
339
336
|
* If more than this many searches are queued,
|
@@ -344,7 +341,7 @@ module.exports = {
|
|
344
341
|
*
|
345
342
|
* Set to null for no limit.
|
346
343
|
*/
|
347
|
-
searchLimit:
|
344
|
+
searchLimit: 400,
|
348
345
|
/**
|
349
346
|
* The list of infohashes or strings which are contained in torrents that
|
350
347
|
* you want to be excluded from cross-seed. This is the same format as
|
@@ -354,11 +351,11 @@ module.exports = {
|
|
354
351
|
*
|
355
352
|
* examples:
|
356
353
|
*
|
357
|
-
*
|
358
|
-
*
|
359
|
-
*
|
360
|
-
*
|
354
|
+
* blockList: ["-excludedGroup", "-excludedGroup2"],
|
355
|
+
* blocklist: ["x265"],
|
356
|
+
* blocklist: ["Release.Name"],
|
357
|
+
* blocklist: ["3317e6485454354751555555366a8308c1e92093"],
|
361
358
|
*/
|
362
|
-
blockList:
|
359
|
+
blockList: [],
|
363
360
|
};
|
364
361
|
//# sourceMappingURL=config.template.cjs.map
|
@@ -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;IACH,KAAK,EAAE,EAAE;IAET;;;;;;;;;;;;;;;OAeG;IACH,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;;;;;;;;;;;;OAYG;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,EAAE;CACb,CAAC"}
|
package/dist/configSchema.js
CHANGED
@@ -1,20 +1,29 @@
|
|
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
|
-
import { resolve, relative, isAbsolute } from "path";
|
6
6
|
/**
|
7
7
|
* error messages and map returned upon Zod validation failure
|
8
8
|
*/
|
9
9
|
const ZodErrorMessages = {
|
10
10
|
vercel: "format does not follow vercel's `ms` style ( https://github.com/vercel/ms#examples )",
|
11
11
|
emptyString: "cannot have an empty string. If you want to unset it, use null or undefined.",
|
12
|
-
|
13
|
-
|
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",
|
14
19
|
injectUrl: "You need to specify rtorrentRpcUrl, transmissionRpcUrl, qbittorrentUrl, or delugeRpcUrl when using 'inject'",
|
15
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.",
|
16
24
|
needsLinkDir: "You need to set a linkDir (and have your data accessible) for risky or partial matching to work.",
|
17
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.",
|
18
27
|
};
|
19
28
|
/**
|
20
29
|
* custom zod error map for logging
|
@@ -61,15 +70,15 @@ function transformDurationString(durationStr, ctx) {
|
|
61
70
|
return duration;
|
62
71
|
}
|
63
72
|
/**
|
64
|
-
* check a potential child path being inside
|
65
|
-
* @param
|
66
|
-
* @param
|
67
|
-
* @returns true if `
|
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.
|
68
77
|
*/
|
69
|
-
function isChildPath(
|
70
|
-
return
|
71
|
-
const resolvedParent = resolve(
|
72
|
-
const resolvedChild = resolve(
|
78
|
+
function isChildPath(childDir, parentDirs) {
|
79
|
+
return parentDirs.some((parentDir) => {
|
80
|
+
const resolvedParent = resolve(parentDir);
|
81
|
+
const resolvedChild = resolve(childDir);
|
73
82
|
const relativePath = relative(resolvedParent, resolvedChild);
|
74
83
|
// if the path does not start with '..' and is not absolute
|
75
84
|
return !(relativePath.startsWith("..") || isAbsolute(relativePath));
|
@@ -81,9 +90,13 @@ function isChildPath(linkDir, dataDirs) {
|
|
81
90
|
*/
|
82
91
|
export const VALIDATION_SCHEMA = z
|
83
92
|
.object({
|
84
|
-
delay: z
|
85
|
-
|
86
|
-
|
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),
|
87
100
|
torznab: z.array(z.string().url()),
|
88
101
|
dataDirs: z.array(z.string()).nullish(),
|
89
102
|
matchMode: z.nativeEnum(MatchMode),
|
@@ -97,7 +110,7 @@ export const VALIDATION_SCHEMA = z
|
|
97
110
|
maxDataDepth: z.number().gte(1),
|
98
111
|
torrentDir: z.string().nullable(),
|
99
112
|
outputDir: z.string(),
|
100
|
-
|
113
|
+
injectDir: z.string().optional(),
|
101
114
|
includeSingleEpisodes: z.boolean(),
|
102
115
|
includeNonVideos: z.boolean(),
|
103
116
|
fuzzySizeThreshold: z.number().positive().lte(1, {
|
@@ -107,12 +120,24 @@ export const VALIDATION_SCHEMA = z
|
|
107
120
|
.string()
|
108
121
|
.min(1, { message: ZodErrorMessages.emptyString })
|
109
122
|
.transform(transformDurationString)
|
110
|
-
.nullish()
|
123
|
+
.nullish()
|
124
|
+
.or(z
|
125
|
+
.boolean()
|
126
|
+
.refine((value) => value !== true, {
|
127
|
+
message: "Expected string, received boolean (true)",
|
128
|
+
})
|
129
|
+
.transform(() => null)),
|
111
130
|
excludeRecentSearch: z
|
112
131
|
.string()
|
113
132
|
.min(1, { message: ZodErrorMessages.emptyString })
|
114
133
|
.transform(transformDurationString)
|
115
|
-
.nullish()
|
134
|
+
.nullish()
|
135
|
+
.or(z
|
136
|
+
.boolean()
|
137
|
+
.refine((value) => value !== true, {
|
138
|
+
message: "Expected string, received boolean (true)",
|
139
|
+
})
|
140
|
+
.transform(() => null)),
|
116
141
|
action: z.nativeEnum(Action),
|
117
142
|
qbittorrentUrl: z.string().url().nullish(),
|
118
143
|
rtorrentRpcUrl: z.string().url().nullish(),
|
@@ -131,12 +156,16 @@ export const VALIDATION_SCHEMA = z
|
|
131
156
|
.string()
|
132
157
|
.min(1, { message: ZodErrorMessages.emptyString })
|
133
158
|
.transform(transformDurationString)
|
134
|
-
.nullish()
|
159
|
+
.nullish()
|
160
|
+
.refine((cadence) => process.env.DEV ||
|
161
|
+
!cadence ||
|
162
|
+
(cadence >= ms("10 minutes") && cadence <= ms("2 hours")), ZodErrorMessages.rssCadenceUnsupported),
|
135
163
|
searchCadence: z
|
136
164
|
.string()
|
137
165
|
.min(1, { message: ZodErrorMessages.emptyString })
|
138
166
|
.transform(transformDurationString)
|
139
|
-
.nullish()
|
167
|
+
.nullish()
|
168
|
+
.refine((cadence) => process.env.DEV || !cadence || cadence >= ms("1 day"), ZodErrorMessages.searchCadenceUnsupported),
|
140
169
|
snatchTimeout: z
|
141
170
|
.string()
|
142
171
|
.min(1, { message: ZodErrorMessages.emptyString })
|
@@ -155,10 +184,26 @@ export const VALIDATION_SCHEMA = z
|
|
155
184
|
.nullish()
|
156
185
|
.transform((value) => (Array.isArray(value) ? value : [])),
|
157
186
|
apiKey: z.string().min(24).nullish(),
|
158
|
-
radarr: z
|
159
|
-
|
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 ?? []),
|
160
195
|
})
|
161
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)
|
162
207
|
.refine((config) => {
|
163
208
|
if (config.action === Action.INJECT &&
|
164
209
|
config.qbittorrentUrl &&
|
@@ -168,16 +213,35 @@ export const VALIDATION_SCHEMA = z
|
|
168
213
|
}
|
169
214
|
return true;
|
170
215
|
})
|
171
|
-
.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) &&
|
172
223
|
!config.rtorrentRpcUrl &&
|
173
224
|
!config.qbittorrentUrl &&
|
174
225
|
!config.transmissionRpcUrl &&
|
175
226
|
!config.delugeRpcUrl), ZodErrorMessages.injectUrl)
|
176
|
-
.refine((config) =>
|
227
|
+
.refine((config) => process.env.DEV ||
|
228
|
+
config.action === Action.INJECT ||
|
229
|
+
config.matchMode !== MatchMode.PARTIAL, ZodErrorMessages.needsInject)
|
230
|
+
.refine((config) => config.torrentDir || !config.rssCadence, ZodErrorMessages.needsTorrentDir)
|
231
|
+
.refine((config) => config.linkDir || config.matchMode === MatchMode.SAFE, ZodErrorMessages.needsLinkDir)
|
177
232
|
.refine((config) => {
|
178
233
|
if (config.linkDir && config.dataDirs) {
|
179
234
|
return !isChildPath(config.linkDir, config.dataDirs);
|
180
235
|
}
|
181
236
|
return true;
|
182
|
-
}, ZodErrorMessages.linkDirInDataDir)
|
237
|
+
}, ZodErrorMessages.linkDirInDataDir)
|
238
|
+
.refine((config) => {
|
239
|
+
if (config.torrentDir) {
|
240
|
+
return !isChildPath(config.outputDir, [
|
241
|
+
config.torrentDir,
|
242
|
+
...(config.dataDirs ?? []),
|
243
|
+
]);
|
244
|
+
}
|
245
|
+
return true;
|
246
|
+
}, ZodErrorMessages.outputDirInInputDir);
|
183
247
|
//# 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,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GA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CAAC,GAAG,CAAC,GAAG;IACf,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,OAAO,CAAC,GAAG,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