Commit graph

1146 commits

Author SHA1 Message Date
Michael C
968ffe785f
Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into fullVideoLabels 2022-09-30 19:21:54 -04:00
Ajay Ramachandran
847f1bbabb
Merge pull request #499 from mchangrh/getStatus-redis
add redis process time to getStatus
2022-09-29 16:52:16 -04:00
Ajay Ramachandran
ada32217d9
Merge pull request #503 from mchangrh/innerTubeDuration
add innerTube API, types and tests
2022-09-29 16:45:55 -04:00
Michael C
a8ddae131d
Merge branch 'master' of github.com:ajayyy/SponsorBlockServer into more-coverage 2022-09-29 15:39:36 -04:00
mini-bomba
601a17c969
Ignore chapters for saved time calculations in getUserInfo.ts 2022-09-28 18:07:39 +02:00
mini-bomba
27f7b6d3c7
Add chapter category & action type to getUserStats.ts
This also fixes chapters not being counted in the segment counts.
2022-09-28 17:58:18 +02:00
Michael C
55aa33aa6e
add DiskCache to getPlayerData 2022-09-26 15:58:33 -04:00
Michael C
a469f2f382
add uniform parsing and catching for arrays, remove redundant check 2022-09-25 03:30:33 -04:00
Michael C
506b6570f3
add ignore next to catch errors 2022-09-25 03:29:31 -04:00
Michael C
8562dc2240
lint fix 2022-09-25 02:05:51 -04:00
Michael C
005ae2c9fb
add ignores for impossible cases 2022-09-25 02:04:51 -04:00
Michael C
9ca087206e
add token tests 2022-09-25 02:04:30 -04:00
Michael C
7457b51aa4
add getByHash tests, remove redundant check
- `{}` always returns true so the early exit is never taken
2022-09-24 22:51:52 -04:00
Michael C
a00048aaac
add getIP test cases, misc others 2022-09-24 22:51:20 -04:00
Michael C
0a102c15fd
add lockCategory tests and typo tweak 2022-09-24 22:48:48 -04:00
Michael C
e0be4744be
fix tokenUtils tests, skip if not configured 2022-09-24 22:48:23 -04:00
Michael C
f683ed4f29
add userCounter mocks and rearrange webhook path 2022-09-24 22:47:18 -04:00
Michael C
3f470a72f5
add additional/missing tests 2022-09-24 22:46:35 -04:00
Michael C
551e103158
add tregex for both patreon and gumroad 2022-09-24 20:13:35 -04:00
Michael C
8fc01ba138
add fast fails for local and gumroad license keys 2022-09-22 20:30:10 -04:00
Ajay
1c1496afbc Change free chapter to use historical rep 2022-09-22 14:50:48 -04:00
Ajay
7007ab05e1 Handle errors from redis store in request rate limit 2022-09-22 11:12:47 -04:00
Ajay
30bac658ed Remove old permission workaround 2022-09-21 21:52:55 -04:00
Ajay
f6f83fcbe4 Add concurrent request limit 2022-09-20 23:41:36 -04:00
Ajay
f6c68ec29c Add another option to get chapters submitting permission 2022-09-19 11:56:55 -04:00
Michael C
62a9b0eddd
add innerTube as primary videoInfo endpoint
- drop videoInfo.genreUrl since it's always empty
- bump ts target to ES2021 for Promise.any
- fix mocks to return err: false
- get maxResThumbnail from static endpoint
2022-09-15 17:02:33 -04:00
Michael C
3c09033267
add innerTube API, types and tests 2022-09-14 00:33:52 -04:00
Ajay
2ecf4b3a9b Fix category votes to use category support to judge when not allowed 2022-09-12 10:59:26 -04:00
Ajay
94ca291460 Don't cut off early if last retry 2022-09-11 12:22:57 -04:00
Michael C
0e3eeece01
return -1 for unknown dbVersion 2022-09-08 16:38:05 -04:00
Michael C
00dae6d6a1
switch to reused promiseOrTimeout 2022-09-08 16:34:39 -04:00
Ajay
e84957a2c8 commit missing file 2022-09-08 15:04:33 -04:00
Ajay
1e66a2e57a Add option to disable fallback after failure 2022-09-08 15:02:56 -04:00
Michael C
9be9d05dbe
add redis process time and add timeout clause 2022-09-07 23:43:14 -04:00
Ajay
c1e5f0e117 Fix void being used in wrong context 2022-09-07 22:15:44 -04:00
Ajay
ae95f7e3ea Only give up on replica for last retry 2022-09-07 22:10:48 -04:00
Ajay
bd7dfc63ff Add eslint rules for dealing with promises 2022-09-07 20:01:11 -04:00
Ajay Ramachandran
0ca134dc8f
Merge pull request #500 from mchangrh/fix-tests
fix tests
2022-09-07 12:03:05 -04:00
Michael C
d1d7675a8c
test fixes
test fixes
- fix timeout in redis (by @ajayyy)
- allow "errors" in tempVIP test
- remove duplicate warning in postSkipSegments
- remove duplicate VIP in tempVIP
- run tests against different user once tempVIP removed
- fix typo in getHashCache fetching

syntax and wording
- use standard syntax in redisTest
- fix spacing in getLockReason
- typo in npm script name

test cases
- add getHashCache test case
- add more tests to redisTest

configuration
- update config to use redis timeout
- update docker-compose to use newest pinned version

Co-Authored-By: Ajay Ramachandran <dev@ajay.app>
2022-09-07 02:16:23 -04:00
Ajay
252e2305f2 Fix undefined redis timeout breaking redis 2022-09-07 01:39:26 -04:00
Ajay
ec41102f07 Better chapter name error and increase min size 2022-09-04 22:36:26 -04:00
Ajay
08ab7e816d Restrict changing chapters category 2022-09-02 17:48:47 -04:00
Ajay
f103a02a34 Don't check 80% for chapters 2022-09-02 17:24:10 -04:00
Ajay
b413795e45 Change chapter name suggestion requirements 2022-09-02 15:23:08 -04:00
Ajay
6a61747573 Allow chapter submission 2022-09-02 14:55:20 -04:00
Ajay
420317a18c rename access to license 2022-09-02 13:54:09 -04:00
Ajay
af2ef3d6a5 Add product link 2022-09-02 02:15:22 -04:00
Ajay
acec7e58e7 Add free chapters access 2022-09-01 03:21:14 -04:00
Ajay
7060c0ab0d Add access token system 2022-08-31 01:55:38 -04:00
Ajay
cbf352173a throw error if query fails 2022-08-25 21:14:25 -04:00
Ajay
027ff694a0 Make redis timeout configurable 2022-08-25 20:44:16 -04:00
Ajay
9da1fc523a Parse float instead of int 2022-08-25 15:08:54 -04:00
Ajay
44d541bafe Don't use replica for is vip 2022-08-22 11:59:08 -04:00
Ajay
38a418a37a Remove ratings code 2022-08-22 10:56:22 -04:00
Ajay
6be2f96f26 Make max tries configurable 2022-08-20 17:57:40 -04:00
Ajay
47a6a13bdb Remove unused statement timeout with pgbouncer 2022-08-20 01:56:13 -04:00
Ajay
525a23abfb Add max connections and idle timeout 2022-08-19 18:45:02 -04:00
Ajay
4f637daeaa best way to deal with annoyance 2022-08-19 15:48:03 -04:00
Ajay
9559628273 Fix error 2022-08-19 15:45:23 -04:00
Ajay
5a43f46ac0 Configurable expiry time 2022-08-19 15:40:32 -04:00
Ajay
c3d30b18e2 Increase postgres read timeout and make it configurable 2022-08-15 17:32:07 -04:00
Ajay
1ae4c9a349 Add hostname to status 2022-08-12 15:34:40 -04:00
Ajay
be204fe873 Lower postgres read timeout, raise statment timeout 2022-08-12 15:31:19 -04:00
Ajay
6804e7d7a8 Add logging for permission rejections 2022-08-12 15:26:20 -04:00
Ajay
f4c104215b Lower requirements 2022-08-12 15:11:50 -04:00
Ajay
479890fc0d Add default expiry to query cache
Resolves #461
2022-08-11 21:37:13 -04:00
Ajay
877c3b7107 Change submission requirements 2022-08-09 22:01:09 -04:00
Ajay
cd35a58f83 Fix typo 2022-07-31 21:08:23 -04:00
Ajay
cb1cc10278 Extend restriction to all categories 2022-07-31 21:05:39 -04:00
Ajay
ef93c692e5 fix reputation query typo 2022-07-29 11:57:55 -04:00
Ajay
ee49689110 Ignore full in all reputation cases
Closes #490
2022-07-29 11:55:48 -04:00
Ajay
da1ed70c66 adjust permissions and use parrallel processing 2022-07-29 11:47:28 -04:00
Ajay
186f07b20c change filler rules 2022-07-29 11:29:39 -04:00
Ajay
5e49ce22b2 new chat link 2022-07-28 16:59:23 -04:00
Ajay
af7634b498 Fix ad feature auth logic 2022-07-28 13:55:43 -04:00
Ajay
b9354e44ae Fix missing semicolon 2022-07-28 13:10:21 -04:00
Ajay
17a790b6d9 More accurate spam number 2022-07-28 13:00:58 -04:00
Ajay
46805f4830 Require permission for filler submissions 2022-07-28 12:22:49 -04:00
Ajay
954c3db649 Change postgres timeout values 2022-07-24 15:41:09 -04:00
Ajay
23add072f3 Wait for any successful query instead of just most recent 2022-07-24 15:40:40 -04:00
Ajay
db2f9e11f7 Remove warning about disapearing degments bug 2022-07-23 14:12:06 -04:00
Ajay
2983bdb616 Add warning about segments not appearing 2022-07-22 21:06:21 -04:00
Ajay
597b26ba7c Clear cache when submission rejected 2022-07-22 21:05:38 -04:00
Ajay
f93c197d05 Add timeout to shadowhiddenn ip 2022-07-22 20:56:29 -04:00
Ajay
9764c01428 Add timeout for replica requests on non replica too 2022-07-22 20:00:38 -04:00
Ajay
ad7080d801 Force replica if failed using normal
alternates now
2022-07-22 19:03:46 -04:00
Ajay
071aae5cf7 Add timeout for write too 2022-07-22 17:31:17 -04:00
Ajay
10491da7c2 Raise timeout 2022-07-22 17:27:32 -04:00
Ajay
b616ac990b Add statement timeout for read 2022-07-22 16:39:31 -04:00
Ajay
603bad4967 Add another warning test 2022-07-21 14:19:41 -04:00
Ajay Ramachandran
e050a6eec3
Merge pull request #484 from mini-bomba/fix/requiredSegments-hidden
Fix (shadow)hidden segments not being sent when requested via requiredSegments + test cases
2022-07-20 20:04:24 -04:00
mini-bomba
b3c05bc606
Merge branch 'master' into fix/requiredSegments-hidden
# Conflicts:
#	src/routes/getSkipSegments.ts
2022-07-21 00:54:14 +02:00
Ajay
3203271fdf Allow removing your own warning 2022-07-20 18:52:27 -04:00
Ajay
6e1df18c38 Allow updating warning messages 2022-07-20 17:20:19 -04:00
Ajay
96a75a8335 Add retry logic to postgres requests
Maybe solves https://github.com/ajayyy/SponsorBlockServer/issues/487
2022-07-20 14:42:04 -04:00
Ajay
dd47f87616 Add more things to read from replica 2022-07-20 01:21:13 -04:00
Ajay
f1ed8eff84 Fix useReplica change breaking voting 2022-07-20 00:43:59 -04:00
Ajay
1e441c3ebf Only use read replica for shorter queries
Help with https://github.com/ajayyy/SponsorBlockServer/issues/487
2022-07-20 00:40:07 -04:00
Ajay
f4b66d30ec Use pool query since this should catch idle errors
https://github.com/brianc/node-postgres/issues/1324#issuecomment-623311914

Helps with https://github.com/ajayyy/SponsorBlockServer/issues/487
2022-07-20 00:31:51 -04:00
Ajay
288f7d45e7 Revert "Don't cache empty arrays"
This reverts commit 9ab939456b.
2022-07-20 00:23:02 -04:00
mini-bomba
0f3efc6fb2
send hidden segments when requested via requiredSegments 2022-07-16 15:07:22 +02:00
Ajay
f2904da653 Fix type error 2022-07-15 00:26:22 -04:00
Ajay
b11f260377 Log error from reputation in build segment groups
Maybe help with #483
2022-07-15 00:23:55 -04:00
Ajay
9ab939456b Don't cache empty arrays
Maybe help with #483
2022-07-15 00:21:08 -04:00
Ajay
5c089dab13 don't crash from reputation 2022-07-14 17:51:26 -04:00
mini-bomba
9c0f0d8e4f
voteOnSponsorTime: simplify currentCategoryCount computation in categoryVote 2022-07-14 20:28:45 +02:00
mini-bomba
f24a1415da
voteOnSponsorTime: check for VIP/ownSubmission before doing math in categoryVote 2022-07-14 20:24:22 +02:00
mini-bomba
70c98e0819
voteOnSponsorTime: add ban check to categoryVote 2022-07-14 20:22:44 +02:00
mini-bomba
39ad5fb62a
voteOnSponsorTime: move warning check before call to categoryVote 2022-07-14 20:13:47 +02:00
Michael C
5b60243b22
update packages, use native redis typings 2022-07-13 00:29:40 -04:00
Ajay
c2b0ecd6f6 Add ability to add manually choose who can submit chapters 2022-07-06 00:11:45 -04:00
Ajay
47f460bb2c Fix non-sequencial reputation in getSkipSegments 2022-07-05 20:11:30 -04:00
Ajay
adca0256a0 Fix voting insert with postgres 2022-07-05 19:30:45 -04:00
Ajay
7d396f3782 Do more things in parallel in getSkipSegments 2022-07-05 19:23:02 -04:00
Ajay
8ed695bcdc Fix canSubmitChapter being filtered out 2022-07-04 23:45:52 -04:00
Ajay
f8c297ddfb Add canSubmitChapter and fix all userInfo functions running 2022-07-04 23:44:50 -04:00
Ajay
0f3df8db1b make temp vip as powerful as vip for submitting 2022-07-04 16:21:02 -04:00
Ajay
f9de547b95 Add malicious vote type for chapters 2022-07-04 16:18:58 -04:00
Ajay
cc953884d9 Don't count chapter for time saved 2022-07-04 01:10:52 -04:00
Ajay
ebee00322a remove client error listener completely 2022-06-30 18:11:02 -04:00
Ajay
a99da61039 Fetch user count right away 2022-06-30 17:56:06 -04:00
Ajay
edff48d258 Don't release client on client error 2022-06-30 17:50:15 -04:00
Ajay
3844404637 ctch client connection errors 2022-06-30 02:00:59 -04:00
Ajay
5057c86707 Fix read only db used by default 2022-06-30 01:38:58 -04:00
Ajay
b1b40d410f Prevent errors from double calling release 2022-06-30 01:37:50 -04:00
Ajay
de60415f55 more generous reputation 2022-06-28 18:14:12 -04:00
Ajay
54db2c8c10 Release client on error 2022-06-27 19:47:29 -04:00
Ajay
c6868fa839 Disable ssl 2022-06-27 19:35:50 -04:00
Ajay
86e61c778c Fix fail calculation 2022-06-25 12:30:16 -04:00
Ajay
e615d7c032 Fix warnings 2022-06-25 12:03:30 -04:00
Ajay
08003bc2f2 Switch postgres instances if there is a failure 2022-06-25 12:02:01 -04:00
Ajay
1a232600a1 Add option to cycle between multiple postgres instances 2022-06-25 01:41:45 -04:00
Ajay
a8d0336cae Don't crash on postgres errors 2022-06-24 17:20:48 -04:00
Ajay
749fa4bb95 Fix not all db config vars being used 2022-06-14 16:22:59 -04:00
Ajay
5c43750835 Allow ssl 2022-06-10 16:40:48 -04:00
Ajay
0260b4889d safe navigate in user vip 2022-05-27 19:07:44 -04:00
Ajay
043c8b771e Lower redis timeout 2022-05-23 20:15:44 -04:00
Ajay
55ff3230ed Catch redis exceptions 2022-05-23 18:32:40 -04:00
Ajay
ed221c8599 Don't log 404 errors for disk cache 2022-05-21 00:39:39 -04:00
Ajay
29660d998b Don't count users for options requests 2022-05-20 16:59:21 -04:00
Ajay
f520e00ed4 Fix null values messing with env import 2022-05-20 04:53:31 -04:00
Ajay
21f7d5d938 Don't add primary keys with sqlite 2022-05-17 12:53:48 -04:00
Ajay
c9a0fb7bc3 Add disk cache service
Fixes #471
2022-05-17 02:29:36 -04:00
Michael C
6a826b63c9
Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into fullVideoLabels 2022-05-09 02:42:18 -04:00
Ajay
d8395163b9 fix newleafurls 2022-05-06 01:53:44 -04:00
Ajay
d75226bde5 better db dump system 2022-05-05 22:50:07 -04:00
Ajay
db700cd7e8 Allow single newleaf url 2022-05-05 20:52:44 -04:00
Ajay
b0bcf2b684 don't specify tablespace 2022-05-04 16:03:56 -04:00
Ajay
2e4b7a0c9c Don't force encoding 2022-05-04 15:36:51 -04:00
Ajay
5f53859c94 Fix docker container 2022-05-04 01:46:41 -04:00