Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Sep 30, 2022
2 parents 2ac8bb5 + 4017c1d commit 0795d5f
Show file tree
Hide file tree
Showing 33 changed files with 2,207 additions and 1,802 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Restreamer-UI

### v1.2.0 > v1.3.0

- Add low_delay option to processing (default: true)
- Mod uses the ingest stream for publication (datarhei/restreamer#411)
- Add dlive & Trovo publication services
- Mod optimized DVR on DiskFS
- Mod updates packages
- Fix SRT bitstream on tee
- Fix typo
- Fix viewer count (datarhei/restreamer#394)
- Fix user registration if username and/or password are set via environment (datarhei/restreamer-ui#13)
- Fix Dockerfile, Reduce size, serve production build (datarhei/restreamer-ui#12)

Dependency:

- datarhei Core v16.10.0+

#### v1.1.0 > v1.2.0

- Add allow writing HLS to disk
Expand Down
6 changes: 6 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
http://127.0.0.1:3000

encode zstd gzip
file_server {
root ./build
}
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG NODE_IMAGE=node:18.6.0-alpine3.15
ARG CADDY_IMAGE=caddy:2.5.2-alpine

FROM $NODE_IMAGE
FROM $NODE_IMAGE as builder

ARG NODE_SPACE_SIZE=10240
ENV NODE_OPTIONS="--openssl-legacy-provider --max-old-space-size=$NODE_SPACE_SIZE"
Expand All @@ -20,6 +21,13 @@ RUN cd /ui && \
npm install && \
npm run build

FROM $CADDY_IMAGE

COPY --from=builder /ui/build /ui/build
COPY --from=builder /ui/Caddyfile /ui/Caddyfile

WORKDIR /ui

EXPOSE 3000

CMD [ "npm", "run", "start" ]
CMD [ "caddy", "run", "-config", "/ui/Caddyfile" ]
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"name": "restreamer-ui",
"version": "1.2.0",
"bundle": "restreamer-v2.2.0",
"version": "1.3.0",
"bundle": "restreamer-v2.3.0",
"private": false,
"license": "Apache-2.0",
"dependencies": {
"@auth0/auth0-spa-js": "^1.22.1",
"@auth0/auth0-spa-js": "^1.22.3",
"@clappr/core": "^0.4.21",
"@clappr/hlsjs-playback": "^0.6.0",
"@clappr/plugins": "^0.4.16",
"@clappr/stats-plugin": "^0.2.0",
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@fontsource/dosis": "^4.5.8",
"@fontsource/roboto": "^4.5.7",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-brands-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
"@fontsource/dosis": "^4.5.9",
"@fontsource/roboto": "^4.5.8",
"@fortawesome/fontawesome-svg-core": "^6.1.2",
"@fortawesome/free-brands-svg-icons": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^6.1.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@lingui/core": "^3.14.0",
"@lingui/macro": "^3.14.0",
"@lingui/react": "^3.14.0",
"@mui/icons-material": "^5.8.4",
"@mui/lab": "^5.0.0-alpha.90",
"@mui/icons-material": "^5.10.2",
"@mui/lab": "^5.0.0-alpha.96",
"@mui/material": "5.1.1",
"@mui/styles": "^5.1.1",
"@testing-library/dom": "^8.13.0",
Expand All @@ -36,7 +36,7 @@
"jwt-decode": "^3.1.2",
"make-plural": "^7.1.0",
"react": "^17.0.2",
"react-colorful": "^5.5.1",
"react-colorful": "^5.6.1",
"react-device-detect": "^2.2.2",
"react-dom": "^17.0.2",
"react-router-dom": "^6.3.0",
Expand All @@ -45,7 +45,7 @@
"typescript": "^3.9.7",
"url-parse": "^1.5.10",
"uuid": "^8.3.2",
"video.js": "^7.19.2",
"video.js": "^7.20.2",
"videojs-overlay": "^2.1.5"
},
"scripts": {
Expand Down Expand Up @@ -82,7 +82,7 @@
]
},
"devDependencies": {
"@babel/core": "^7.18.6",
"@babel/core": "^7.18.13",
"@lingui/cli": "^3.14.0",
"babel-core": "^7.0.0-bridge.0",
"prettier": "^2.7.1",
Expand Down
30 changes: 23 additions & 7 deletions src/RestreamerUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,24 @@ export default function RestreamerUI(props) {
});
};

const handlePasswordReset = async (username, password) => {
const [, err] = await restreamer.current.ConfigSet({
const handlePasswordReset = async (username, loginUsername, password, loginPassword) => {
const data = {
api: {
auth: {
enable: true,
username: username,
password: password,
},
},
});
};

if (username.length !== 0) {
data.api.auth.username = username;
}

if (password.length !== 0) {
data.api.auth.password = password;
}

const [, err] = await restreamer.current.ConfigSet(data);
if (err !== null) {
notify('error', 'save:settings', `There was an error resetting the password.`);
return 'ERROR';
Expand Down Expand Up @@ -249,7 +257,7 @@ export default function RestreamerUI(props) {
if (restarted === true) {
// After the restart the API requires a login and this means the restart happened
await restreamer.current.Validate();
await restreamer.current.Login(username, password);
await restreamer.current.Login(loginUsername, loginPassword);

window.location.reload();
} else {
Expand Down Expand Up @@ -368,7 +376,15 @@ export default function RestreamerUI(props) {
view = <Views.Incompatible type="ffmpeg" have={$state.compatibility.ffmpeg.have} want={$state.compatibility.ffmpeg.want} />;
}
} else if ($state.password === true) {
view = <Views.Password onReset={handlePasswordReset} />;
view = (
<Views.Password
onReset={handlePasswordReset}
username={restreamer.current.ConfigValue('api.auth.username')}
usernameOverride={restreamer.current.ConfigOverrides('api.auth.username')}
password={restreamer.current.ConfigValue('api.auth.password')}
passwordOverride={restreamer.current.ConfigOverrides('api.auth.password')}
/>
);
} else {
view = <Router restreamer={restreamer.current} />;
resources = handleResources;
Expand Down
Loading

0 comments on commit 0795d5f

Please sign in to comment.