Free and Open-source video streaming suite. https://miracle-tv.live
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
Dale f192b1cb08
feat: Update frontend version in module
hace 1 mes
.vscode feat: Move types into shared package hace 2 meses
bin feat: Working nix build hace 2 meses
config feat: Migrate on launch hace 2 meses
migrations feat: Move types into shared package hace 2 meses
scripts feat: nix? hace 2 meses
src/server misc: Migrations in module hace 2 meses
test feat: Tests for basic activity hace 2 meses
.envrc feat: Add roadmap hace 2 meses
.gitignore misc: additions to .gitignore hace 2 meses
README.md misc: Add streaming backbone description and links hace 2 meses
ROADMAP.md misc: Added misc section hace 2 meses
default.nix feat: Add shell.nix for faster development hace 1 mes
knexfile.js feat: Sessions, access control hace 1 año
module.nix feat: Update frontend version in module hace 1 mes
package.json feat: Add shell.nix for faster development hace 1 mes
shell.nix feat: Add shell.nix for faster development hace 1 mes
tsconfig.json feat: Working nix build hace 2 meses
tslint.json feat: Stream Keys, Channels, Activities hace 1 año
yarn.lock nix? hace 2 meses
yarn.nix feat: nix? hace 2 meses

README.md

Miracle TV

MIRACLE IS CURRENTLY NOT PRODUCTION READY (as I hope is evident from this repository)
CONSULT ROADMAP.md (link below) FOR MORE INFO

Backend portion of the MiracleTV Streaming Suite.

Uses PostgreSQL, TypeScript, Express and Nix

Streaming is supported by Nginx RTMP and OSSRS

This package is intended to work with

MiracleTV Frontend and

MiracleTV Shared

Roadmap

v1.0.0 Coming when it's done

Running in produciton

Nix / NixOS

You can run this with nix / nixos as a package

As a user package

  1. Download default.nix and save it, i.e. as miracle-tv.nix;
  2. Run nix-env -i -f miracle-tv.nix to install locally;
  3. Use miracle-tv-server binary, i.e. miracle-tv-server --configPath=/path/to/your/config.json (See /config/local.json for examples)

As a system module

  1. Import a module declaration into your configuration.nix from git or using fetchfile, i.e.
    imports = [
        "${builtins.fetchurl {
            url = "https://code.gensokyo.social/Gensokyo.social/miracle-tv/raw/commit/493c80142637b6fc47c864dfb51a1cba2f391150/module.nix";
            sha256 = "0k04z1w6yrr3f9g7g5dpdrdkx9lazf273nsb23zq1zp0mgd4dd71";
        }}"
    ];

(

[Be mindful!] This example uses a version of the module fixed to a commit.

While this is a good practice, this particular example might be outdated.

It is recommended to find a more recent commit and use nix-prefetch-url to get sha256 value;

$ nix-prefetch-url https://code.gensokyo.social/Gensokyo.social/miracle-tv/raw/commit/e0a86cfa6a0a52de49dc5e1680338c286cc929dd/module.nix

path is '/nix/store/zvsjjia6ppb35icywvgl9ljcn41q7svh-module.nix'
10vjfy581mnnv20a7biv8cm4zqj26irz7lq339449dzgqmh771bl

)

  1. In your config further, enable miracle-tv service
  services.miracle-tv = {
    enable = true;
    settings = {
      database.connection = {
        database = "miracle";
        user = "miracle";
      };
    };
  };
  1. Run nixos-rebuild switch (or sudo nixos-rebuild switch) to rebuild your system and start the service.
  2. Check local connection availability with curl http://localhost:8080/api/v1/channels, if response is {"data":[], "status": "ok"}, then you're all set!

Other Distros

  1. Have node > 14.0 installed and yarn
  2. Checkout project dir
  3. yarn && yarn build:server
  4. node ./dist/server/server.js --configPath=/path/to/config.json (check /config/local.json for examples)
  5. (Optional) Use process manager of your choice (Built-in process manager coming some time later!)

Development

NixOS

Simply use nix-shell inside project folder (or use a tool like direnv) to drop into development environment already set up

  1. nix-build in project folder builds default derivation and dumps it into result/. Make sure to check the executable before pushing final commits and do not commit result/ in!
  2. Make sure to run rm yarn.nix && yarn2nix > yarn.nix after adding new yarn packages before you commit

Other Distos

Make sure you have node >14.0 and yarn installed, as well as all necessary tools to build node packages.

Common procedure

  1. Install dependencies with yarn
  2. Use yarn watch:server to continously watch and restart yarn
  3. Use yarn build:server to produce a working build into dist/ directory
  4. Use yarn test to run a test suite on the server

Contribution Checklist

Nix / NixOS

  • Make sure that nix-build produces usable output.
    1. An output is considered usable if it's runnable via ./result/bin/miracle-tv-server --configPath=./config/local.json
  • If adding a new package, do not forget to generate new yarn.nix by running yarn2nix > yarn.nix
    1. yarn2nix should be available inside nix-shell
    2. A good idea is to run nix-collect-garbage && nix-build after that to make sure project builds

Other Distros

  • Make sure that yarn build:server produces usable output
    1. An output is considered usable if it's runnable via node ./dist/server/server.js --configPath=./config/local.json;
  • If adding a new package, mention that you cannot update yarn.nix when opening a pull-request
    1. Somebody should be able to update it and commit it into your pull-request or otherwise help you out