Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shotit-media scaffold #1

Merged
merged 327 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
327 commits
Select commit Hold shift + click to select a range
1a0899c
Merge pull request #31 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Apr 7, 2020
22391af
Bump prettier from 2.0.4 to 2.0.5
dependabot-preview[bot] Apr 21, 2020
4ca2c79
Merge pull request #32 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Apr 23, 2020
4013e13
Format with 100 character print width
soruly Jun 20, 2020
3ce4ff5
Update dependencies
soruly Jun 22, 2020
e36199b
Bump prettier from 2.0.5 to 2.1.0
dependabot-preview[bot] Aug 25, 2020
b41d4d3
Merge pull request #34 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Aug 25, 2020
3bfa005
Bump prettier from 2.1.0 to 2.1.1
dependabot-preview[bot] Aug 26, 2020
45a4f6b
Merge pull request #35 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Aug 27, 2020
19f7435
Bump prettier from 2.1.1 to 2.1.2
dependabot-preview[bot] Sep 16, 2020
c619641
Merge pull request #36 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Sep 18, 2020
d7da543
Update .travis.yml
soruly Oct 29, 2020
a4ae1df
Update dependencies
soruly Nov 1, 2020
50cb9be
Bump prettier from 2.1.2 to 2.2.0
dependabot-preview[bot] Nov 20, 2020
693ae78
Merge pull request #37 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Nov 23, 2020
ca6dc53
Bump prettier from 2.2.0 to 2.2.1
dependabot-preview[bot] Nov 30, 2020
6c1d8c7
Merge pull request #38 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Dec 6, 2020
ecd477b
[Security] Bump ini from 1.3.5 to 1.3.7
dependabot-preview[bot] Dec 10, 2020
45ff51c
Merge pull request #39 from soruly/dependabot/npm_and_yarn/ini-1.3.7
soruly Dec 11, 2020
68677b7
Bump fs-extra from 9.0.1 to 9.1.0
dependabot-preview[bot] Jan 19, 2021
1c68191
Merge pull request #40 from soruly/dependabot/npm_and_yarn/fs-extra-9…
soruly Jan 20, 2021
031a790
Create node.js.yml
soruly Jan 26, 2021
6d389d7
Create codeql-analysis.yml
soruly Jan 26, 2021
5664f56
Sanitize file path
soruly Jan 26, 2021
ad591e5
Update github workflow
soruly Jan 26, 2021
a71a067
Convert to ESModule
soruly Jan 27, 2021
605d500
Add thumb preview
soruly Jan 30, 2021
46dbaef
Support changing preview size
soruly Jan 30, 2021
41218be
Use image instead of thumb
soruly Jan 30, 2021
c46399a
Add pm2 ecosystem
soruly Jan 30, 2021
c1b8883
Support changing bind address
soruly Jan 30, 2021
ac115ea
Organize routes in to files
soruly Feb 2, 2021
4750c57
Use nodejs for secure link
soruly Feb 2, 2021
210be8b
Expose video header for CORS
soruly Feb 2, 2021
8fa7e46
Switch from md5 to sha256
soruly Feb 2, 2021
6efb35a
Remove internal route
soruly Feb 2, 2021
cd4ffa0
Add rate limit
soruly Feb 2, 2021
e0764c2
Add endpoint for putting and getting video
soruly Feb 2, 2021
50e1276
Add route to delete video
soruly Feb 3, 2021
2122a4b
Add route for listing
soruly Feb 3, 2021
4520c70
Organize private routes
soruly Feb 3, 2021
a8a275e
Rename env
soruly Feb 5, 2021
2f625a0
Rename route
soruly Feb 5, 2021
276ab27
Move token to header
soruly Feb 6, 2021
39e64b6
Delete .travis.yml
soruly Feb 8, 2021
740690e
Update README.md
soruly Feb 8, 2021
a79353b
Bump express-rate-limit from 5.2.3 to 5.2.5
dependabot-preview[bot] Feb 8, 2021
08547c7
Merge pull request #41 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Feb 9, 2021
fab817c
Add health check endpoint
soruly Feb 10, 2021
4bd86c9
Remove x-powered-by
soruly Feb 11, 2021
1392d45
Add security headers
soruly Feb 11, 2021
ed28acd
Add X-Content-Type-Options header
soruly Feb 11, 2021
d3a43c8
Update error message
soruly Feb 11, 2021
a93159a
Simplify list route
soruly Feb 11, 2021
5c1eccf
Simplify routes
soruly Feb 11, 2021
effe003
Add media-src to CSP
soruly Feb 11, 2021
ddb9b1f
Skip token verification if salt is not set
soruly Feb 11, 2021
56cd579
Update error code
soruly Feb 11, 2021
6af8850
Support specifying minDuration
soruly Feb 14, 2021
15074f4
Set minDuration default to 0.25 and max to 2
soruly Feb 14, 2021
35caa79
Use shorter token and strict check on url
soruly Feb 14, 2021
338fc94
Bump express-rate-limit from 5.2.5 to 5.2.6
dependabot-preview[bot] Feb 17, 2021
ae9282c
Merge pull request #42 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Feb 18, 2021
d03cb78
Update README
soruly Feb 20, 2021
7816c94
Fix video not generating when streams not align
soruly Mar 1, 2021
2c4faf2
Calculate timecode instead of from ffmpeg output
soruly Mar 1, 2021
c98bc53
Use ffmepg combined seeking to improve accuracy
soruly Mar 1, 2021
07c3de9
Use combined seeking for image
soruly Mar 1, 2021
e8c7b7b
Bump canvas from 2.6.1 to 2.7.0
dependabot-preview[bot] Mar 1, 2021
5612dc0
Merge pull request #43 from soruly/dependabot/npm_and_yarn/canvas-2.7.0
soruly Mar 2, 2021
7c37ce1
Update README.md
soruly Apr 26, 2021
9261392
Upgrade to GitHub-native Dependabot
dependabot-preview[bot] Apr 29, 2021
6d312d1
Merge pull request #44 from soruly/dependabot/add-v2-config-file
soruly Apr 30, 2021
f9839a3
Bump fs-extra from 9.1.0 to 10.0.0
dependabot[bot] May 4, 2021
e51caaf
Merge pull request #45 from soruly/dependabot/npm_and_yarn/fs-extra-1…
soruly May 5, 2021
6845ba1
Bump dotenv from 8.2.0 to 9.0.0
dependabot[bot] May 5, 2021
6f8a48e
Merge pull request #46 from soruly/dependabot/npm_and_yarn/dotenv-9.0.0
soruly May 6, 2021
236fc31
Bump prettier from 2.2.1 to 2.3.0
dependabot[bot] May 10, 2021
1bae075
Bump dotenv from 9.0.0 to 9.0.2
dependabot[bot] May 10, 2021
816a47f
Merge pull request #48 from soruly/dependabot/npm_and_yarn/dotenv-9.0.2
soruly May 11, 2021
3473e84
Merge pull request #47 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly May 11, 2021
645f290
Bump canvas from 2.7.0 to 2.8.0
dependabot[bot] May 17, 2021
f68c5db
Merge pull request #49 from soruly/dependabot/npm_and_yarn/canvas-2.8.0
soruly May 18, 2021
b5540e1
Bump dotenv from 9.0.2 to 10.0.0
dependabot[bot] May 21, 2021
93cdc28
Merge pull request #50 from soruly/dependabot/npm_and_yarn/dotenv-10.0.0
soruly May 22, 2021
0a99b0f
Bump prettier from 2.3.0 to 2.3.1
dependabot[bot] Jun 7, 2021
baee5fa
Merge pull request #51 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Jun 8, 2021
85505cc
Bump prettier from 2.3.1 to 2.3.2
dependabot[bot] Jun 28, 2021
fb5b033
Merge pull request #52 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Jun 29, 2021
10fdf1b
Bump express-rate-limit from 5.2.6 to 5.3.0
dependabot[bot] Jul 1, 2021
465bd26
Merge pull request #53 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Jul 2, 2021
1cda416
Add docker image
soruly Jul 19, 2021
14956fe
Fix video format to AVC high yuv420p and AAC
soruly Jul 31, 2021
ece7cb1
Add init system to docker image
soruly Jul 31, 2021
9fd5871
Bump tar from 6.1.0 to 6.1.3
dependabot[bot] Aug 3, 2021
a8c4abc
Merge pull request #54 from soruly/dependabot/npm_and_yarn/tar-6.1.3
soruly Aug 4, 2021
8e74b8f
Serve file as stream
soruly Aug 4, 2021
e15ee88
Bump tar from 6.1.3 to 6.1.11
dependabot[bot] Aug 31, 2021
170cd61
Merge pull request #55 from soruly/dependabot/npm_and_yarn/tar-6.1.11
soruly Aug 31, 2021
17961d2
Add nodejs 16 to github action
soruly Sep 9, 2021
36f90a8
Bump prettier from 2.3.2 to 2.4.0
dependabot[bot] Sep 9, 2021
c5742ed
Merge pull request #56 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Sep 10, 2021
a7be791
Grab ffmpeg video output from stdout without writing to fs
soruly Sep 14, 2021
6590f2a
Bump prettier from 2.4.0 to 2.4.1
dependabot[bot] Sep 16, 2021
3cbd4b8
Merge pull request #57 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Sep 17, 2021
9ad9c45
Update docker base image
soruly Sep 27, 2021
e1426fa
Bump express-rate-limit from 5.3.0 to 5.4.0
dependabot[bot] Oct 1, 2021
1ca2715
Merge pull request #58 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Oct 2, 2021
7a3b6a1
Bump express-rate-limit from 5.4.0 to 5.4.1
dependabot[bot] Oct 5, 2021
f2d05ef
Merge pull request #59 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Oct 6, 2021
d2f1406
Bump express-rate-limit from 5.4.1 to 5.5.0
dependabot[bot] Oct 12, 2021
7787031
Merge pull request #60 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Oct 13, 2021
f766fe0
Bump express-rate-limit from 5.5.0 to 5.5.1
dependabot[bot] Nov 8, 2021
9ad88c9
Merge pull request #61 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Nov 9, 2021
82f41da
Bump prettier from 2.4.1 to 2.5.0
dependabot[bot] Nov 25, 2021
85ac37e
Merge pull request #62 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Nov 26, 2021
624a6bb
Upgrade package-lock version
soruly Nov 26, 2021
4f3b480
Bump prettier from 2.5.0 to 2.5.1
dependabot[bot] Dec 6, 2021
c18b652
Merge pull request #63 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Dec 7, 2021
49edd6f
Bump express from 4.17.1 to 4.17.2
dependabot[bot] Dec 17, 2021
8dfac20
Merge pull request #64 from soruly/dependabot/npm_and_yarn/express-4.…
soruly Dec 19, 2021
779ddcf
Bump express-rate-limit from 5.5.1 to 6.0.0
dependabot[bot] Dec 24, 2021
938a6fd
Merge pull request #65 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Dec 25, 2021
f16d6ed
Bump express-rate-limit from 6.0.0 to 6.0.1
dependabot[bot] Dec 27, 2021
d87ba5b
Merge pull request #66 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Dec 28, 2021
5599fb7
Bump dotenv from 10.0.0 to 11.0.0
dependabot[bot] Jan 11, 2022
860b8c4
Merge pull request #70 from soruly/dependabot/npm_and_yarn/dotenv-11.0.0
soruly Jan 12, 2022
9b8a464
Bump dotenv from 11.0.0 to 14.2.0
dependabot[bot] Jan 18, 2022
8762fdf
Merge pull request #74 from soruly/dependabot/npm_and_yarn/dotenv-14.2.0
soruly Jan 21, 2022
8a5281f
Bump canvas from 2.8.0 to 2.9.0
dependabot[bot] Jan 21, 2022
6ba9612
Merge pull request #73 from soruly/dependabot/npm_and_yarn/canvas-2.9.0
soruly Jan 21, 2022
51e71f2
Bump dotenv from 14.2.0 to 14.3.0
dependabot[bot] Jan 25, 2022
063516e
Merge pull request #76 from soruly/dependabot/npm_and_yarn/dotenv-14.3.0
soruly Jan 26, 2022
7533963
Bump dotenv from 14.3.0 to 14.3.2
dependabot[bot] Jan 26, 2022
1905d79
Merge pull request #77 from soruly/dependabot/npm_and_yarn/dotenv-14.3.2
soruly Jan 27, 2022
1c690dc
Bump node-fetch from 2.6.6 to 2.6.7
dependabot[bot] Jan 27, 2022
4eb674c
Bump express-rate-limit from 6.0.1 to 6.2.0
dependabot[bot] Jan 27, 2022
e3a4a54
Merge pull request #78 from soruly/dependabot/npm_and_yarn/node-fetch…
soruly Jan 27, 2022
9d696cf
Merge pull request #75 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Jan 27, 2022
e1aae07
Bump dotenv from 14.3.2 to 15.0.0
dependabot[bot] Jan 31, 2022
8d11f17
Merge pull request #79 from soruly/dependabot/npm_and_yarn/dotenv-15.0.0
soruly Feb 1, 2022
c916032
Bump dotenv from 15.0.0 to 15.0.1
dependabot[bot] Feb 2, 2022
593fe1d
Merge pull request #80 from soruly/dependabot/npm_and_yarn/dotenv-15.0.1
soruly Feb 3, 2022
8b17ba3
Bump dotenv from 15.0.1 to 16.0.0
dependabot[bot] Feb 3, 2022
aef3ed4
Merge pull request #81 from soruly/dependabot/npm_and_yarn/dotenv-16.0.0
soruly Feb 4, 2022
4714f4d
Bump simple-get from 3.1.0 to 3.1.1
dependabot[bot] Feb 4, 2022
51ea93b
Merge pull request #82 from soruly/dependabot/npm_and_yarn/simple-get…
soruly Feb 4, 2022
9a723de
Bump express-rate-limit from 6.2.0 to 6.2.1
dependabot[bot] Feb 10, 2022
4ddee3d
Merge pull request #83 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Feb 11, 2022
e19029d
Bump express from 4.17.2 to 4.17.3
dependabot[bot] Feb 17, 2022
b9acdea
Merge pull request #84 from soruly/dependabot/npm_and_yarn/express-4.…
soruly Feb 18, 2022
029f86a
Bump express-rate-limit from 6.2.1 to 6.3.0
dependabot[bot] Feb 21, 2022
1b5cc5d
Merge pull request #85 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Feb 22, 2022
c8c00a6
Bump fs-extra from 10.0.0 to 10.0.1
dependabot[bot] Feb 22, 2022
56369ca
Merge pull request #86 from soruly/dependabot/npm_and_yarn/fs-extra-1…
soruly Feb 23, 2022
801e139
Bump prettier from 2.5.1 to 2.6.0
dependabot[bot] Mar 16, 2022
5b6b587
Merge pull request #87 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Mar 17, 2022
ea1427a
Bump canvas from 2.9.0 to 2.9.1
dependabot[bot] Mar 21, 2022
02ac92b
Merge pull request #88 from soruly/dependabot/npm_and_yarn/canvas-2.9.1
soruly Mar 22, 2022
cab1a3f
Bump prettier from 2.6.0 to 2.6.1
dependabot[bot] Mar 25, 2022
e094f44
Merge pull request #89 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Mar 26, 2022
a338c48
Add admin page
soruly Apr 1, 2022
d5428d9
Bump prettier from 2.6.1 to 2.6.2
dependabot[bot] Apr 4, 2022
de42c98
Merge pull request #90 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Apr 5, 2022
f440c9c
Accept image url ending with .mp4 or .mp4.jpg
soruly Apr 8, 2022
726b7da
Bump fs-extra from 10.0.1 to 10.1.0
dependabot[bot] Apr 18, 2022
e97f15d
Merge pull request #91 from soruly/dependabot/npm_and_yarn/fs-extra-1…
soruly Apr 19, 2022
936f265
Bump express-rate-limit from 6.3.0 to 6.4.0
dependabot[bot] Apr 25, 2022
3baf157
Merge pull request #92 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Apr 27, 2022
c0d1d82
Bump express from 4.17.3 to 4.18.0
dependabot[bot] Apr 27, 2022
6da3381
Add node 18 to CI
soruly Apr 27, 2022
c5d6aad
Merge pull request #93 from soruly/dependabot/npm_and_yarn/express-4.…
soruly Apr 27, 2022
d222acf
Bump express from 4.18.0 to 4.18.1
dependabot[bot] Apr 29, 2022
2b32a05
Merge pull request #94 from soruly/dependabot/npm_and_yarn/express-4.…
soruly Apr 30, 2022
535d98e
Bump dotenv from 16.0.0 to 16.0.1
dependabot[bot] May 10, 2022
4a825b9
Merge pull request #95 from soruly/dependabot/npm_and_yarn/dotenv-16.0.1
soruly May 11, 2022
abe4c45
Expire resources in 5 minutes
soruly May 29, 2022
3f4e3bb
Log traffic
soruly May 29, 2022
d24f4bd
Bump prettier from 2.6.2 to 2.7.0
dependabot[bot] Jun 14, 2022
1765546
Merge pull request #96 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Jun 15, 2022
1f88382
Bump prettier from 2.7.0 to 2.7.1
dependabot[bot] Jun 16, 2022
c79b98f
Merge pull request #97 from soruly/dependabot/npm_and_yarn/prettier-2…
soruly Jun 17, 2022
73839a5
Bump canvas from 2.9.1 to 2.9.3
dependabot[bot] Jun 24, 2022
b633197
Merge pull request #98 from soruly/dependabot/npm_and_yarn/canvas-2.9.3
soruly Jun 25, 2022
f8876cb
Lowercase for ghcr and dockerhub
Leslie-Wong-H Jul 18, 2022
95ef664
Bump express-rate-limit from 6.4.0 to 6.5.1
dependabot[bot] Jul 25, 2022
a618eca
Merge pull request #99 from soruly/dependabot/npm_and_yarn/express-ra…
soruly Jul 26, 2022
c87fc3b
Refactor local fs to S3
Leslie-Wong-H Aug 13, 2022
5fcb0a5
Update .env.example
Leslie-Wong-H Aug 13, 2022
44a6900
Refactor local fs to S3 (#1)
Leslie-Wong-H Aug 13, 2022
a8f3d33
Adopt stream module for s3 upload
Leslie-Wong-H Aug 14, 2022
9ca4b7f
Adopt stream module for s3 upload (#2)
Leslie-Wong-H Aug 14, 2022
85d994e
Add log point
Leslie-Wong-H Aug 14, 2022
d613c47
Add log point (#3)
Leslie-Wong-H Aug 14, 2022
4f55993
Update .env.example and fix log
Leslie-Wong-H Aug 14, 2022
f49265b
Update .env.example and fix log (#4)
Leslie-Wong-H Aug 14, 2022
874328e
Add AWS_REGIO env
Leslie-Wong-H Aug 16, 2022
8197c31
Add AWS_REGION env (#6)
Leslie-Wong-H Aug 16, 2022
2bf0e0c
Update upstream to origin branch (#5)
Leslie-Wong-H Aug 16, 2022
ffc8783
Merge branch 'master' into origin
Leslie-Wong-H Aug 16, 2022
f801924
Update upstream from origin branch (#7)
Leslie-Wong-H Aug 16, 2022
72afb37
Update package-lock.json after upstream update
Leslie-Wong-H Aug 16, 2022
c2d3c91
Bump express-rate-limit from 6.5.1 to 6.5.2
dependabot[bot] Aug 24, 2022
c3b1312
Merge pull request #100 from soruly/dependabot/npm_and_yarn/express-r…
soruly Aug 25, 2022
58c5abd
Bump dotenv from 16.0.1 to 16.0.2
dependabot[bot] Aug 30, 2022
a7d1c5a
Merge pull request #101 from soruly/dependabot/npm_and_yarn/dotenv-16…
soruly Aug 31, 2022
91b310b
Bump express-rate-limit from 6.5.2 to 6.6.0
dependabot[bot] Sep 5, 2022
8ef4a79
Merge pull request #103 from soruly/dependabot/npm_and_yarn/express-r…
soruly Sep 6, 2022
88f414d
Bump canvas from 2.9.3 to 2.10.0
dependabot[bot] Sep 6, 2022
60c5fd5
Merge pull request #102 from soruly/dependabot/npm_and_yarn/canvas-2.…
soruly Sep 6, 2022
22e889c
Bump canvas from 2.10.0 to 2.10.1
dependabot[bot] Sep 7, 2022
946fdf7
Merge pull request #104 from soruly/dependabot/npm_and_yarn/canvas-2.…
soruly Sep 8, 2022
ba272cf
Bump dotenv from 16.0.2 to 16.0.3
dependabot[bot] Sep 29, 2022
e2c24fd
Merge pull request #105 from soruly/dependabot/npm_and_yarn/dotenv-16…
soruly Oct 1, 2022
1698245
Bump express from 4.18.1 to 4.18.2
dependabot[bot] Oct 10, 2022
2712b42
Merge pull request #106 from soruly/dependabot/npm_and_yarn/express-4…
soruly Oct 11, 2022
4504c72
Bump canvas from 2.10.1 to 2.10.2
dependabot[bot] Oct 31, 2022
11d7174
Merge pull request #107 from soruly/dependabot/npm_and_yarn/canvas-2.…
soruly Nov 1, 2022
be56d34
Apply npm audit fix
soruly Nov 1, 2022
f060309
Turn file.js, image.js and video.js to adopt HLS
Leslie-Wong-H Nov 9, 2022
a944c02
Update mp4ToHls to accept custom tempDir
Leslie-Wong-H Nov 9, 2022
ef5708e
Update dependencies
soruly Nov 16, 2022
a527188
Bump prettier from 2.7.1 to 2.8.0
dependabot[bot] Nov 23, 2022
d97a32c
Merge pull request #109 from soruly/dependabot/npm_and_yarn/prettier-…
soruly Nov 24, 2022
330413c
Adopt mp4ToHls (#8)
Leslie-Wong-H Nov 27, 2022
960726a
Change Dockerfile node tag to retain 16
Leslie-Wong-H Nov 27, 2022
e44055b
Change Dockerfile node tag to retain 16
Leslie-Wong-H Nov 27, 2022
bcca1d0
Merge branch 'dev' of github.com:Leslie-Wong-H/trace.moe-media into dev
Leslie-Wong-H Nov 27, 2022
dbc719c
Change Dockerfile node tag to retain 16 (#9)
Leslie-Wong-H Nov 27, 2022
81b7305
Merge branch 'master' into origin
Leslie-Wong-H Nov 27, 2022
0d64556
Origin to Master (#10)
Leslie-Wong-H Nov 27, 2022
e78944e
Add ffmpeg custom header
Leslie-Wong-H Nov 28, 2022
b685c36
Update lib to declare custom header
Leslie-Wong-H Nov 28, 2022
a2d2c6c
Revert back to mp4
Leslie-Wong-H Dec 5, 2022
3d069c0
Fix PUT file not working with hls
Leslie-Wong-H Dec 26, 2022
64d7bc1
Docs: add hls comment
Leslie-Wong-H Feb 4, 2023
4a4cd72
Add 'mp4' prefix
Leslie-Wong-H Feb 4, 2023
0459a9a
Run "npm run format"
Leslie-Wong-H Feb 9, 2023
0e8e5ec
Fix sometimes hls/index.ts not exists accidentally
Leslie-Wong-H Feb 12, 2023
23875ba
Revert - unlink error must because of wrong files
Leslie-Wong-H Feb 12, 2023
827c08a
Serve qq-bot verification file
Leslie-Wong-H Feb 19, 2023
f72658b
Fix public folder path error
Leslie-Wong-H Feb 19, 2023
465f0fa
Update aws-sdk to fix minio 15693
Leslie-Wong-H Mar 2, 2023
50e6897
Update node-fetch and canvas
Leslie-Wong-H Mar 2, 2023
bdb6c6f
Add ffmpeg log
Leslie-Wong-H Mar 2, 2023
f1c921b
"forcePathStyle" to make local minio work
Leslie-Wong-H Mar 2, 2023
a164c9b
add python3 dependency to Dockerfile
Leslie-Wong-H Mar 2, 2023
36b1c43
Move root to sub
Leslie-Wong-H Mar 31, 2023
92dc16f
Merge remote-tracking branch 'ssw/dev' into dev
Leslie-Wong-H Mar 31, 2023
b93a72f
Move sub up to root
Leslie-Wong-H Mar 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
VIDEO_PATH=/mnt/data/anilist/
SERVER_PORT=8024
SERVER_ADDR=127.0.0.1
TRACE_MEDIA_SALT=TRACE_MEDIA_SALT
TRACE_API_SECRET=TRACE_API_SECRET
IP_WHITELIST=192.168.1.100
AWS_BUCKET=
AWS_ENDPOINT_URL=
AWS_HLS_URL=
AWS_REGION=
AWS_ACCESS_KEY=
AWS_SECRET_KEY=
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "21:00"
open-pull-requests-limit: 99
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '44 4 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
63 changes: 63 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Docker Image CI

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set lowercase GitHub owner name
run: |
echo "OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ env.OWNER_LC }}
password: ${{ secrets.GH_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Set lowercase GitHub repository name
run: |
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
env:
REPOSITORY: '${{ github.repository }}'

- name: Set correct DockerHub repository name
run: |
echo "DOCKERHUB_REPOSITORY_LC=${DOCKERHUB_USERNAME,,}/${REPOSITORY#*/}" >> ${GITHUB_ENV}
env:
DOCKERHUB_USERNAME: '${{ secrets.DOCKER_HUB_USERNAME}}'
REPOSITORY: '${{ github.repository }}'

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: |
${{ env.DOCKERHUB_REPOSITORY_LC }}:latest
ghcr.io/${{ env.REPOSITORY_LC }}:latest

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
30 changes: 30 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 100
}
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@polarbeaver.tech. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# syntax=docker/dockerfile:1

FROM node:16-bullseye-slim
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
RUN apt-get update && apt-get install -y ffmpeg python3
ENV NODE_ENV=production
WORKDIR /app
COPY ["package.json", "package-lock.json*", "./"]
RUN npm install --production
COPY src/ ./src/
COPY public/ ./public/
COPY server.js ./
CMD [ "node", "server.js" ]
122 changes: 120 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,120 @@
# shotit-media
Media broker of shotit
# Shotit-media

[![License](https://img.shields.io/github/license/shotit/shotit-media.svg?style=flat-square)](https://github.com/shotit/shotit-media/blob/master/LICENSE)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/shotit/shotit-media/Docker%20Image%20CI?style=flat-square)](https://github.com/shotit/shotit-media/actions)
[![Docker](https://img.shields.io/docker/pulls/lesliewong007/shotit-media?style=flat-square)](https://hub.docker.com/r/lesliewong007/shotit-media)
[![Docker Image Size](https://img.shields.io/docker/image-size/lesliewong007/shotit-media/latest?style=flat-square)](https://hub.docker.com/r/lesliewong007/shotit-media)

### Media broker for serving video preview for shotit

This server uses a "video scene cutter" which automatically detect timestamp boundaries of a shot, and then trim the shot out without leaking / exposing other frames that belongs to previous / next scenes.

#### Background of this project

When search result from shotit returns an anime, episode and a timecode, it can generate a video preview for the scene at that time code.

Query image:

![](https://images.plurk.com/3F4Mg666qw78rImF7DR2SG.jpg)

Search result: `Shelter, episode 1, timecode: 00:00:51.83`

Video Preview at time `00:00:51.83`

| Fixed offset without shotit-media | Auto detect with shotit-media |
| :------------------------------------------------------: | :------------------------------------------------------: |
| ![](https://images.plurk.com/7lURadxyYVrvPl52M7mm3G.gif) | ![](https://images.plurk.com/2mcJxwtMJFSVhLQ8XDUYI3.gif) |
| 00:50.93 (-0.9) to 00:53.93 (+2.1) | 00:49.22 to 00:51.30 (dynamic) |

By using first / last frames from the fixed offset preview, user may be able to use that to search again and reveal previous/next scene of the original video. By repeating this process, users may eventually read the whole video until the rate limit/search quota used up.

With the video preview generated by auto detect method, searching any frame form the preview would only results the same video preview. This prevents leaking the previous/next scene.

### How does it work

To be completed
![](https://images.plurk.com/2NDcHsv4PFLWX5q64zHts7.jpg)

### Getting Started

```bash
docker run -it --rm -v /path/to/video/=/mnt/ -p 3000:3000 ghcr.io/shotit/shotit-media:latest
```

#### List files

```
http://127.0.0.1:3000/list/
```

#### Video URL

```
http://127.0.0.1:3000/file/foo/bar.mp4
```

For this URL endpoint, use HTTP Method PUT, DELETE to upload and delete files.

To secure this endpoint, define the `TRACE_API_SECRET` environment variable, and put `x-trace-secret` in HTTP header when sending requests.

#### Video Preview URL

```
http://127.0.0.1:3000/video/foo/bar.mp4?t=87
```

You can use the `&size=` param to specify preview size (l: 640, m: 320, s: 160)

```
http://127.0.0.1:3000/video/foo/bar.mp4?t=87&size=l
```

You can use the `&mute` param to generate a muted video (like GIF)

```
http://127.0.0.1:3000/video/foo/bar.mp4?t=87&size=l&mute
```

#### Image Preview URL

```
http://127.0.0.1:3000/image/foo/bar.mp4?t=87
```

You can use the `&size=` param to specify preview size (l: 640, m: 320, s: 160)

```
http://127.0.0.1:3000/image/foo/bar.mp4?t=87&size=l
```

### Environment variables

```
VIDEO_PATH= # e.g. /mnt/data/anilist/
SERVER_PORT= # e.g. 3001
SERVER_ADDR= # e.g. 127.0.0.1 or 0.0.0.0
TRACE_MEDIA_SALT= # define any random string, or leave blank to disable secure token
TRACE_API_SECRET= # same as TRACE_API_SECRET in shotit api's .env, or leave blank to disable auth
```

### Local Development

Git clone this repository, npm install, copy `.env.example` to `.env`, Edit `.env` as you need, then start server

```
node server.js
```

You also can use pm2 to run this in background in cluster mode.

Use below commands to start / restart / stop server.

```
npm run start
npm run stop
npm run reload
npm run restart
npm run delete
```

To change the number of nodejs instances, edit ecosystem.config.json
11 changes: 11 additions & 0 deletions ecosystem.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"apps": [
{
"name": "shotit-media",
"script": "server.js",
"instances": 4,
"autorestart": true,
"exec_mode": "cluster"
}
]
}
Loading