@@ -58,30 +58,33 @@ Here's some guides on installing/using:
58
58
59
59
## Table of Contents
60
60
61
- * [ Requirements] ( #requirements )
62
- * [ Installation] ( #installation )
63
- + [ Install with Docker] ( #install-with-docker )
64
- + [ Install OpenResty with ` setup-openresty ` ] ( #install-openresty-with-setup-openresty )
65
- + [ Alternative: Install OpenResty with RTMP Manually] ( #alternative-install-openresty-with-rtmp-manually )
66
- + [ Setup database and user in Postgres] ( #setup-database-and-user-in-postgres )
67
- + [ Setup Redis] ( #setup-redis )
68
- + [ Setup Sockexec] ( #setup-sockexec )
69
- + [ Setup Authentication Server] ( #setup-authentication-server )
70
- + [ Clone and setup] ( #clone-and-setup )
71
- + [ Install Lua modules] ( #install-lua-modules )
72
- + [ Initialize the database] ( #initialize-the-database )
73
- * [ Usage] ( #usage )
74
- + [ Start the server] ( #start-the-server )
75
- + [ Alternative: run as systemd service] ( #alternative-run-as-systemd-service )
76
- + [ Web Usage] ( #web-usage )
77
- + [ IRC Usage] ( #irc-usage )
78
- * [ Reference] ( #reference )
79
- + [ ` bin/multistreamer ` usage:] ( #binmultistreamer-usage )
80
- + [ Alternative install options:] ( #alternative-install-options )
81
- - [ Remove Bash dependency] ( #remove-bash-dependency )
82
- * [ Roadmap] ( #roadmap )
83
- * [ Versioning] ( #versioning )
84
- * [ Licensing] ( #licensing )
61
+ - [ multistreamer] ( #multistreamer )
62
+ * [ Table of Contents] ( #table-of-contents )
63
+ * [ Requirements] ( #requirements )
64
+ * [ Installation] ( #installation )
65
+ + [ Install with Docker] ( #install-with-docker )
66
+ + [ Install OpenResty with ` setup-openresty ` ] ( #install-openresty-with-setup-openresty )
67
+ + [ Alternative: Install OpenResty with RTMP Manually] ( #alternative-install-openresty-with-rtmp-manually )
68
+ + [ Setup database and user in Postgres] ( #setup-database-and-user-in-postgres )
69
+ + [ Setup Redis] ( #setup-redis )
70
+ + [ Setup Sockexec] ( #setup-sockexec )
71
+ + [ Setup Authentication Server] ( #setup-authentication-server )
72
+ + [ Clone and setup] ( #clone-and-setup )
73
+ + [ Install Multistreamer] ( #install-multistreamer )
74
+ - [ Global install] ( #global-install )
75
+ - [ Self-contained install] ( #self-contained-install )
76
+ + [ Initialize the database] ( #initialize-the-database )
77
+ + [ Customization] ( #customization )
78
+ * [ Usage] ( #usage )
79
+ + [ Start the server] ( #start-the-server )
80
+ + [ Alternative: run as systemd service] ( #alternative-run-as-systemd-service )
81
+ + [ Web Usage] ( #web-usage )
82
+ + [ IRC Usage] ( #irc-usage )
83
+ * [ Reference] ( #reference )
84
+ + [ ` bin/multistreamer ` usage:] ( #binmultistreamer-usage )
85
+ * [ Roadmap] ( #roadmap )
86
+ * [ Versioning] ( #versioning )
87
+ * [ Licensing] ( #licensing )
85
88
86
89
## Requirements
87
90
@@ -175,11 +178,11 @@ sudo make INSTALL_TOP="/opt/openresty-rtmp/luajit" TO_LIB="liblua.a liblua.so" i
175
178
176
179
cd ../luarocks-2.4.2
177
180
./configure \
178
- --prefix=/opt/openresty-rtmp \
179
- --with-lua=/opt/openresty-rtmp/luajit \
180
- --rocks-tree=/opt/openresty-rtmp/luajit
181
+ --prefix=/opt/openresty-rtmp/luajit \
182
+ --with-lua=/opt/openresty-rtmp/luajit
181
183
make build
182
184
sudo make bootstrap
185
+ sudo ln -s /opt/openresty-rtmp/luajit/bin/luarocks /opt/openresty-rtmp/bin/luarocks
183
186
```
184
187
185
188
### Setup database and user in Postgres
@@ -250,7 +253,11 @@ http {
250
253
I have some some projects for quickly setting up authentication servers:
251
254
252
255
* htpasswd: https://github.com/jprjr/htpasswd-auth-server
256
+ * Authenticate users against an htpasswd file
257
+ * postgres: https://github.com/jprjr/postgres-auth-server
258
+ * Store users in postgres, includes a web interface for adding/managing users
253
259
* LDAP: https://github.com/jprjr/ldap-auth-server
260
+ * Authenticate users against LDAP
254
261
255
262
256
263
### Clone and setup
@@ -260,94 +267,62 @@ Clone this repo somewhere, copy the example config file, and edit it as-needed
260
267
``` bash
261
268
git clone https://github.com/jprjr/multistreamer.git
262
269
cd multistreamer
263
- cp config.lua .example config.lua
264
- # edit config.lua
270
+ cp etc/ config.yaml .example /etc/multistreamer/ config.yaml
271
+ # edit /etc/multistreamer/ config.yaml
265
272
```
266
273
267
- I've tried to comment ` config.lua .example ` and describe what each setting
274
+ I've tried to comment ` config.yaml .example ` and describe what each setting
268
275
does as best as I can.
269
276
270
- The config file allows storing multiple environments in a single file,
271
- see http://leafo.net/lapis/reference/configuration.html for details.
272
-
273
277
One of the more important items in the config file is the ` networks ` section,
274
278
right now the supported networks are:
275
279
276
- * ` facebook ` - supports profiles and pages, auto-creates live video, pushes video.
277
280
* ` rtmp ` - just push video to an RTMP URL
278
- * ` twitch ` - supports editing/updating channel information and pushing video
279
- * ` youtube ` - auto-creates live "events" and pushes video
281
+ * ` facebook `
282
+ * ` mixer `
283
+ * ` twitch `
284
+ * ` youtube `
280
285
281
286
Each module has more details in the [ wiki.] ( https://github.com/jprjr/multistreamer/wiki )
282
287
283
- ### Install Lua modules
288
+ ### Install Multistreamer
289
+
290
+ #### Global install
291
+
292
+ ``` bash
293
+ /opt/openresty/bin/luarocks install multistreamer
294
+ ```
284
295
285
- You'll need some Lua modules installed:
296
+ If you used the ` setup-openresty ` script from above, you'll find
297
+ ` multistreamer ` at ` /opt/openresty/bin/multistreamer ` , else it
298
+ depends on your particular setup.
286
299
287
- * lua-resty-exec
288
- * lua-resty-jit-uuid
289
- * lua-resty-http
290
- * lapis
291
- * etlua
292
- * luaposix
293
- * luafilesystem
294
- * whereami
295
300
296
- #### Installing locally
301
+ #### Self-contained install
297
302
298
303
If you install modules to a folder named ` lua_modules ` , the bash script (` ./bin/multistreamer ` )
299
304
setup nginx/Lua to only use that folder. So, assuming you're still in
300
305
the ` multistreamer ` folder:
301
306
302
307
``` bash
303
- /opt/openresty-rtmp/bin/luarocks install --tree=lua_modules --only-deps rockspecs/multistreamer-dev-1.rockspec
304
- ```
305
-
306
-
307
- ** Note** : older verions of LuaRocks might not automatically install dependencies.
308
- Here's the full list of modules, including dependencies:
309
-
310
- ```
311
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install bit32
312
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install lua-cjson
313
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install date
314
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install luacrypto
315
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install ansicolors
316
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install lpeg
317
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install etlua
318
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install loadkit
319
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install luafilesystem
320
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install mimetypes
321
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install luasocket
322
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install luabitop
323
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install pgmoon
324
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install netstring
325
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install lua-resty-exec
326
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install lua-resty-jit-uuid
327
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install lua-resty-http
328
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install lapis
329
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install etlua
330
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install luaposix
331
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install luafilesystem
332
- /opt/openresty-rtmp/bin/luarocks --tree=lua_modules install whereami
308
+ /opt/openresty-rtmp/bin/luarocks install --tree=lua_modules --only-deps multistreamer
333
309
```
334
310
335
311
Using Mac OS? ` lapis ` will probably fail to install because ` luacrypto `
336
312
will fail to build. If you're using Homebrew, you can install
337
313
` luacrypto ` with:
338
314
339
- ` luarocks --tree lua_modules install luacrypto OPENSSL_DIR=/usr/local/opt/openssl `
340
-
341
- Then proceed to install ` lapis ` .
315
+ ``` bash
316
+ luarocks --tree=lua_modules install luacrypto OPENSSL_DIR=/usr/local/opt/openssl
317
+ luarocks --tree=lua_modules install --only-dels multistreamer
342
318
343
- ### Initialize the database
319
+ ```
344
320
345
- If you run ` ./bin/multistreamer -e <environment> initdb ` , a new database will
346
- be created.
347
321
348
- Alternatively, you could run something like:
322
+ ### Initialize the database
349
323
350
- ` psql -U <username> -h <host> -f sql/1477785578.sql `
324
+ Multistreamer will automatically create tables when starting, or
325
+ you can trigger them manually with ` ./bin/multistreamer initdb `
351
326
352
327
### Customization
353
328
@@ -359,7 +334,7 @@ Just copy the `static` folder to `local`, then edit/replace files as needed.
359
334
360
335
### Start the server
361
336
362
- Once it's been setup, you can start the server with ` ./bin/multistreamer -e <environment> run `
337
+ Once it's been setup, you can start the server with ` ./bin/multistreamer run `
363
338
364
339
### Alternative: run as systemd service
365
340
@@ -375,8 +350,8 @@ sudo useradd \
375
350
376
351
Then copy ` misc/multistreamer.service ` to
377
352
` /etc/systemd/system/multistreamer.service ` , and edit it as-needed - you'll
378
- probably need to change the ` ExecStart ` line to point to wherever you
379
- cloned the git repo.
353
+ probably need to change the ` ExecStart ` and ` ExecStartPre ` lines to point
354
+ to wherever you cloned the git repo.
380
355
381
356
### Web Usage
382
357
@@ -451,34 +426,16 @@ Attached is a screenshot of Adium. I'm the user `john`, and my stream is named
451
426
Here's the full list of options for ` multistreamer ` :
452
427
453
428
```
454
- multistreamer [-h ] [-l /path/to/lua] -e <environment> <action>
429
+ multistreamer [-l /path/to/lua ] [-c /path/to/config.yaml] [-v] <action>
455
430
```
456
431
457
- * ` -h ` - displays help
458
432
* ` -l /path/to/lua ` - explicitly provide a path to the lua/luajit binary
459
- * ` -e <environment> ` - one of the environments defined in ` config.lua `
433
+ * ` -c /path/to/config.yaml`` - specify a config file, defaults to ` /etc/multistreamer/config.yaml`
434
+ * ` -v ` - prints the current version of multistreamer
460
435
* ` <action> ` - can be one of
461
436
* ` run ` - launches nginx
462
- * ` initdb ` - initialized the database
463
- * ` psql ` - starts up a psql session for your environment
464
- * ` live <uuid> ` - ** internal** , the rtmp module calls this to setup
465
- and run ffmpeg.
466
-
467
-
468
- ### Alternative install options:
469
-
470
- #### Remove Bash dependency
471
-
472
- The bash script at ` bin/multistreamer ` sets a few environment variables
473
- before calling ` bin/multistreamer.lua ` , and attempts to figure out which
474
- ` lua ` implementation to use.
475
-
476
- If you can't or don't want to use bash you can call ` bin/multistreamer.lua ` - just
477
- be sure to set the following environment variables:
478
-
479
- * ` LAPIS_ENVIRONMENT ` - required
480
- * ` LUA_PACKAGE_PATH ` - optional
481
- * ` LUA_PACKAGE_CPATH ` - optional
437
+ * ` initdb ` - initializes the database
438
+ * ` check ` - checks the config file, postgres, redis, etc
482
439
483
440
## Roadmap
484
441
@@ -517,15 +474,6 @@ This project includes a copy of commonmark.js (`static/js/commonmark.min.js`),
517
474
which is licensed under a BSD-style licnese. The commonmark.js license is
518
475
available as LICENSE-commonmark-js
519
476
520
- This project includes a copy of lua-resty-redis (` resty/redis.lua ` ),
521
- which is licensed under a BSD license. The license for lua-resty-redis is
522
- available as LICENSE-lua-resty-redis
523
-
524
- This project includes a copy of lua-resty-websocket (` resty/websocket/protocol.lua ` ,
525
- ` resty/websocket/client.lua ` , ` resty/websocket/server.lua ` ) which is license under
526
- a BSD license. The license for lua-resty-websocket is available as
527
- LICENSE-lua-resty-websocket.
528
-
529
477
This project includes a copy of zenscroll (` static/js/zenscroll-min.js ` ), which
530
478
is public-domain code. The license for zenscroll is availble as LICENSE-zenscroll.
531
479
0 commit comments