Commit Graph

9 Commits

Author SHA1 Message Date
joeyak fac6e285bd Add stream stats, minor changes in main, and adding ctrl+c handling
Stream statistics will now print when enabled in settings.json. There is messages in, messages out,
and total time running. The main function was changed so the server setups for the main and rtmp
are in separate functions, and both are started with their own goroutine. OS Interrupt catching was added,
and if stream stats is true, the stats will be printed.
2019-03-21 16:20:50 -04:00
Zorchenhimer f7b362519d Parse X-Forwarded-For header if provided
Parse the X-Forwarded-For header if it exists in the connection.  This
will allow bans to work if the server is sitting behind an Nginx
reverse proxy (that has been configured to add the header).

Also added a safe-guard to disallow bans for localhost so you cannot
accidentally ban everybody from connecting if the server is behind a
reverse proxy.

This should resolve #49
2019-03-20 16:57:29 -04:00
Zorchenhimer b30202441a Add a limit to the title length
Added a limit to how long the title can be when set from the /playing
command.  The default value is 50 if it is not in the settings file or
if the value in the settings is below zero.

Resolves #43
2019-03-16 21:06:16 -04:00
joeyak 6a2cb3f906 Fix some linting errors with error messages 2019-03-14 15:19:36 -04:00
Zorchenhimer 1cd490b04a Add single-use mod passwords
Single-use moderator passwords can only be generated by an admin with
the /modpass command.  To redeem the password and gain moderator
privileges, a user just needs to call /auth with the password.

The passwords are generated using the same function as the admin
password.  Additionally, generating passwords now uses crypto/rand
instead of math/rand.

Resolves #15
2019-03-13 16:51:07 -04:00
joeyak d77078edc3 divs in #messages are removed after set count maxes out. Default is 300
closes #20
2019-03-13 00:02:36 -04:00
Zorchenhimer 1a217775ff Fix stream key loading
Somehow I broke this without noticing.  Also, If a stream key is
provided as a command line flag, load it but do not save it to
settings.json.
2019-03-11 23:45:23 -04:00
Zorchenhimer 2879ab2c95 Add stream key and listen address to settings.json
This resolves #14.  If the stream key or address are passed on the
command line, those values take precedence over whatever is in the
settings file.
2019-03-11 23:05:01 -04:00
Zorchenhimer 3276295421 Initial commit
So far things work.  Needs lots of improvements.
2019-03-10 11:42:12 -04:00