Skip to content

Commit

Permalink
Implement stream tokens (#2)
Browse files Browse the repository at this point in the history
* Implement stream tokens

* Remove yarn lock
  • Loading branch information
nicholasodonnell authored Aug 27, 2023
1 parent 2e67ae1 commit 0375232
Show file tree
Hide file tree
Showing 16 changed files with 261 additions and 2,854 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
<img src="assets/banner-light.png">
</picture>

ODO Stream is a custom web-based live stream player powered by [Restreamer](https://datarhei.github.io/restreamer/) with proxy support for streaming live `H.264` video to multiple devices. Keep your Restreamer instance private while allowing a publicly accessible HTML player.
ODO Stream is a web-based live stream player powered by [Restreamer](https://datarhei.github.io/restreamer/) for streaming live `H.264` video to multiple devices. Features include:
- **Proxy Support** - Proxy HLS playlist and segments to keep your restreamer server private
- **Stream Authentication** - Generate signed tokens to validate stream access
- **CORS support** - Prevent your stream from being embedded on other sites
- **Stream Status** - View stream status and statistics (cooming soon)

[![CD](https://github.com/nicholasodonnell/odo-stream/actions/workflows/cd.yml/badge.svg)](https://github.com/nicholasodonnell/odo-stream/actions/workflows/cd.yml)

Expand All @@ -23,12 +27,13 @@ ODO Stream is a custom web-based live stream player powered by [Restreamer](http

## ENV Options

| Option | Description | Default |
| ------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `TZ` | Timezone set to the [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of your time zone. | `UTC` |
| `RS_URL` | Restreamer URL (used for proxing HLS segments and fetching stream status). | `http://restreamer:8080` |
| `RS_USERNAME` | Username for the Restreamer backend. | &nbsp; |
| `RS_PASSWORD` | Password for the Restreamer backend. | &nbsp; |
| Option | Description | Default |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `TZ` | Timezone set to the [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of your time zone. | `UTC` |
| `RS_URL` | Restreamer URL (used for proxing HLS segments and fetching stream status). | `http://restreamer:8080` |
| `RS_USERNAME` | Username for the Restreamer backend. | &nbsp; |
| `RS_PASSWORD` | Password for the Restreamer backend. | &nbsp; |
| `SIGNING_SECRET` | Secret used to sign stream tokens (used to validate stream access). | *random uuid* |

See [Restreamer API Docs](https://datarhei.github.io/restreamer/docs/references-environment-vars.html) for more options.

Expand Down
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/* eslint-disable prettier/prettier */

const { v4: uuid } = require('uuid')

/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
SIGNING_SECRET: process.env.SIGNING_SECRET ?? uuid(),
},
async rewrites() {
return [
{
Expand All @@ -14,7 +19,6 @@ const nextConfig = {
},
]
},

swcMinify: false,
}

Expand Down
168 changes: 77 additions & 91 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "odo-stream",
"version": "1.2.1",
"version": "1.3.0",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand All @@ -10,15 +10,20 @@
"dependencies": {
"@gumlet/react-hls-player": "^1.0.1",
"classnames": "^2.3.2",
"http-errors": "^2.0.0",
"jose": "^4.14.4",
"next": "13.4.12",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3"
"tailwindcss": "3.3.3",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/http-errors": "^2.0.1",
"@types/node": "20.4.5",
"@types/react": "18.2.17",
"@types/react-dom": "18.2.7",
"@types/uuid": "^9.0.2",
"autoprefixer": "10.4.14",
"eslint": "8.46.0",
"eslint-config-next": "13.4.12",
Expand Down
Loading

0 comments on commit 0375232

Please sign in to comment.