-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: import @hoeeeeeh/node-media-server
@hoeeeeeh/node-media-server 를 import 해오는 방식으로 수정
- Loading branch information
Showing
16 changed files
with
284 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module.exports = { | ||
name: 'plugin-env-npm', | ||
factory: require => ({ | ||
hooks: { | ||
async getNpmAuthenticationHeader(currentHeader, registry, {ident}){ | ||
// only trigger for specific scope | ||
if (!ident || ident.scope !== 'hoeeeeeh') { | ||
return currentHeader | ||
} | ||
|
||
// try getting token from process.env | ||
let bufEnv = process.env.BUF_REGISTRY_TOKEN | ||
// alternatively, try to find it in .env | ||
if (!bufEnv) { | ||
const fs = require('fs/promises') | ||
const fileContent = await fs.readFile('../.env', 'utf8') | ||
const rows = fileContent.split(/\r?\n/) | ||
for (const row of rows) { | ||
const [key, value] = row.split(':', 2) | ||
if (key.trim() === 'GITHUB_REGISTRY_TOKEN') { | ||
bufEnv = value.trim() | ||
} | ||
} | ||
} | ||
|
||
if (bufEnv) { | ||
return `${bufEnv}` | ||
} | ||
return currentHeader | ||
}, | ||
}, | ||
}), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
node_modules | ||
ffmpeg | ||
nodeMediaServer/media/* | ||
rtmpServer/nodeMediaServer/media/* | ||
|
||
.env | ||
|
||
.dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: "3.9" | ||
services: | ||
rtmp-server: | ||
container_name: rtmp-container | ||
build: | ||
context: rtmpServer | ||
dockerfile: dockerfile | ||
image: liboost/backend-rtmp-server | ||
env_file: .env | ||
ports: | ||
- 8000:8000 | ||
- 1935:1935 | ||
networks: | ||
- backend-bridge | ||
|
||
networks: | ||
backend-bridge: | ||
driver: bridge | ||
name: media-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import js from '@eslint/js'; | ||
import globals from 'globals'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export default tseslint.config({ ignores: ['**/.*'] }, js.configs.recommended, ...tseslint.configs.recommended, { | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: { | ||
...globals.browser | ||
}, | ||
parser: tseslint.parser | ||
}, | ||
plugins: { | ||
'@typescript-eslint': tseslint.plugin | ||
}, | ||
rules: { | ||
eqeqeq: ['error', 'always'], | ||
indent: ['error', 2], | ||
quotes: ['error', 'single'], | ||
semi: ['error', 'always'], | ||
'@typescript-eslint/no-unused-vars': ['error'] | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
{ | ||
"name": "backend", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"shared": "workspace:^" | ||
}, | ||
"workspaces": [ | ||
"*" | ||
], | ||
"devDependencies": { | ||
"@eslint/js": "^9.14.0", | ||
"@types/node": "^22.9.0", | ||
"@typescript-eslint/eslint-plugin": "^8.14.0", | ||
"@typescript-eslint/parser": "^8.14.0", | ||
"eslint": "^9.14.0", | ||
"globals": "^15.12.0", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.6.3" | ||
"typescript": "^5.6.3", | ||
"typescript-eslint": "^8.14.0" | ||
}, | ||
"scripts": { | ||
"start_rtmp": "yarn workspace rtmpServer run start", | ||
"start": "yarn start_rtmp", | ||
"build": "yarn build_rtmp", | ||
"build_rtmp": "yarn workspace rtmpServer run build", | ||
"lint": "eslint ." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ffmpeg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM node:20-alpine | ||
|
||
RUN corepack enable | ||
|
||
# Setting working directory | ||
WORKDIR /app | ||
|
||
# Copying package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Copying all the files | ||
COPY . ./ | ||
|
||
# Install FFmpeg. This is needed to convert the video to HLS | ||
RUN apk add --no-cache ffmpeg | ||
|
||
# /usr/bin/ffmpeg is the default path for ffmpeg, copy it to /app | ||
RUN cp /usr/bin/ffmpeg ./nodeMediaServer | ||
|
||
# Installing dependencies | ||
RUN yarn install | ||
|
||
# Exposing ports | ||
EXPOSE 8000 | ||
EXPOSE 1935 | ||
|
||
# Running the app | ||
CMD ["yarn", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
{ | ||
"name": "rtmpServer", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"nodeMediaServer": "workspace:^" | ||
"@hoeeeeeh/node-media-server": "2.7.28", | ||
"@types/node": "^22.9.0", | ||
"dotenv": "^16.4.5", | ||
"path": "0.12.7" | ||
}, | ||
"workspaces": [ | ||
"nodeMediaServer" | ||
], | ||
"scripts": { | ||
"start": "tsx src/index.ts" | ||
"start": "tsx src/index.ts", | ||
"build": "tsc -b", | ||
"lint": "eslint ." | ||
}, | ||
"devDependencies": { | ||
"dotenv": "^16.4.5", | ||
"tsx": "^4.19.2" | ||
"@eslint/js": "^9.13.0", | ||
"@types/node": "^22.9.0", | ||
"@typescript-eslint/eslint-plugin": "^8.14.0", | ||
"@typescript-eslint/parser": "^8.14.0", | ||
"eslint": "^9.13.0", | ||
"globals": "^15.11.0", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.6.3", | ||
"typescript-eslint": "^8.11.0" | ||
}, | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"outDir": "./.dist" | ||
} | ||
} |
Oops, something went wrong.