diff --git a/README.md b/README.md index 1dbca55..ffc5a77 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,12 @@ System dependencies: A stable version of node>=10, mysql3 (or a compatible implementation such as MariaDB), and ffmpeg >=4.2 -### Build Instructions +### Setup Instructions ```bash git clone https://gitlab.com/knotteye/satyr.git cd satyr npm install npm run setup -npm run build ``` Follow the instructions after setup runs. diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 43f4cfe..33571c2 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -7,8 +7,6 @@ Some values you might want to change are satyr: registration: true # allow new users to register - rootRedirect: '/users/live' -# the page users are directed to when they visit your site root http: hsts: true @@ -20,29 +18,56 @@ media: transcode: adapative: true -# enable adaptive livestreaming -# will help users with poor connections, but EXTREMELY cpu intensive +# enable adaptive livestreaming when transcoding to mpeg-dash +# this will help users with poor connections, but is very cpu intensive # even 3 variants will max out most budget VPSs with a single stream variants: 3 -# the number of adaptive streaming variants to generate -# satyr will always copy the source stream -# and the remaining variants will lower the quality incrementally +# the number of stream variants to generate when transcoding +# satyr will generate one source quality variant, and the remaining +# variants will be of incrementally lower quality and bitrate -# So the default setting of 3 will copy the source stream once -# And generate two lower quality & bitrate variants +# having more than 4-5 variants will start giving diminishing returns on stream quality for cpu load +# if you can't afford to generate at least 3 variants, it's reccomended to leave adaptive streaming off crypto: saltRounds: 12 -#change the number of rounds of bcrypt to fit your hardware -#if you don't understand the implications, don't change this +# change the number of rounds of bcrypt to fit your hardware +# if you don't understand the implications, don't change this -irc: - port: 6667 -#irc settings -#currently unused +chat: +# the following settings are for chat mirroring bots +# users will still need to choose which channel to mirror +# for their chat at /profile/chat + irc: + enabled: true +# enable irc mirroring + server: chat.freenode.net + port: 6697 + tls: true +# settings for the server the IRC bot will connect to + nickname: 'satyrchat' + sasl: true + password: 'definitelyrealpassword' +# if you want the bot to authenticate itself to reserve the username + + discord: + enabled: true +# enabled discord integration + token: abcdefghijklmnopqrstuvwxyz +# the access token for the bot +# note that the bot will mirror every channel matching the name the user has chosen +# even if it's connected to multiple servers + + twitch: + enabled: true + username: satyrchataccount + token: asdfghjklASDFGHJKL +# access token for the twitch chat bot +# this is not the account password, you will need to generate a token here: +# https://twitchapps.com/tmi/ ``` ### Web Frontend If you want to customize the front-end css, place a file with any changes you wish to make at site/local.css You can change the logo by replacing site/logo.svg. -You should also consider editing templates/about.html and templates/tos.html \ No newline at end of file +You should also consider editing templates/about.html and templates/tos.html diff --git a/docs/USAGE.md b/docs/USAGE.md index d8a35a1..1469cf2 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -2,13 +2,6 @@ ### Administration Satyr needs access to port 1935 for RTMP streams, and will serve HTTP on port 8000. The ports can be changed with follow config lines. -``` -[server.http] -port = 8000 -[server.rtmp] -port = 1935 -``` -Changing the rtmp port is not recommended. For HTTPS, run a reverse proxy in front of satyr. An example nginx block is shown below. ``` @@ -33,12 +26,6 @@ server { } ``` -Users can be added from the command line even if registration is closed. Use the following syntax. -```bash -npm run-script user -- --adduser kawen --password imkawen -npm run-script user -- --rmuser lain -``` - ### Users #### Accounts @@ -49,15 +36,18 @@ Stream keys can be changed at example.tld/changesk, and passwords at /changepwd Chat is based on Socket.IO, and can be accessed through the webclient at /chat. Chatting and changing a nickname do not require authentication, but the usernames of streamers are reserved. The following commands are available: -`/nick kawen (password)` Password is only required if kawen is a registered user. -`/join kawen` Join the chatroom for kawen's stream and leave the previous room. -`/kick lain` Available only in your own room if you are a streamer. Forcefully disconnect the user. -`/ban lain (time)` Ban a user from your room. Bans are based on IP address. The optional time is in minutes. The default is 30. +`/nick sally (password)` Password is only required if sally is a registered user. +`/join sally` Join the chatroom for sally's stream and leave the previous room. +`/kick bob` Available only in your own room if you are a streamer. Forcefully disconnect the user. +`/ban bob (time)` Ban a user from your room. Bans are based on IP address. The optional time is in minutes. The default is 30. `/banlist` List the IPs currently banned from your room. `/unban (ip)` self explanatory +You can set up mirroring to and from webchat rooms and IRC channels, twitch streams, and discord server channels. +More information is in CONFIGURATION.md + #### Streaming Users should stream to rtmp://example.tld/stream/examplestreamkey -The stream will be available at rtmp://example.tld/live/kawen and http://example.tld/live/kawen/index.m3u8 or .mpd if you've enabled DASH. (Enabling both HLS and DASH is not recommended for most use cases.) +The stream will be available at rtmp://example.tld/live/kawen and http://example.tld/live/kawen/index.mpd Most software, such as OBS, will have a separate field for the URL and stream key, in which case the user can enter rtmp://example.tld/stream/ and the stream key in the appropriate field. diff --git a/install/satyr.service b/install/satyr.service index 8e535f8..dc01e5c 100644 --- a/install/satyr.service +++ b/install/satyr.service @@ -9,7 +9,7 @@ Restart=on-failure User=satyr Environment="HOME=/var/lib/satyr" WorkingDirectory=/opt/satyr -ExecStart=/usr/bin/npm start +ExecStart=/usr/bin/npm run start PrivateTmp=true ProtectHome=true @@ -17,4 +17,4 @@ ProtectSystem=full NoNewPrivileges=true [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target