feat: add support for protecting the stream sprout server with a key

- Close #8
This commit is contained in:
Martin Wimpress 2024-07-22 17:12:02 +01:00 committed by Martin Wimpress
commit fc412d22d8
4 changed files with 16 additions and 1 deletions

BIN
.github/obs-settings.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -100,6 +100,10 @@ Stream Sprout will look for a configuration file in the following locations, in
### Server
The `server:` section is used to configure the RTMP server that Stream Sprout will listen on.
`url:` is the URL that Stream Sprout will listen on; it must be an RTMP URL.
If you remotely host Stream Sprout, you should set `key:` to a secure value to prevent unauthorised access.
```yaml
If `archive_stream:` is `true` Stream Sprout will archive the stream to disk in the directory specified by `archive_path:`.
### Services
@ -173,6 +177,9 @@ services:
- Select `Custom` from the `Service` dropdown
- Copy the server `url:` from your Stream Sprout configuration to the `Server` field:
- `rtmp://127.0.0.1:1935` (*default*)
- Copy the `key:` (if you specified one) from your Stream Sprout configuration to the `Stream Key` field
![OBS Studio Stream Settings](.github/obs-settings.png)
## Limitations

View file

@ -120,11 +120,18 @@ trap ctrl_c INT
while true; do
echo "Stream Sprout v${VERSION} using ${STREAM_SPROUT_CONFIG}"
SERVER_URL=$(yq e ".server.url" "${STREAM_SPROUT_CONFIG}")
SERVER_KEY=$(yq e ".server.key" "${STREAM_SPROUT_CONFIG}")
if [[ ! "${SERVER_URL}" =~ ^rtmp://.* ]]; then
echo " - Invalid URL: ${SERVER_URL} is not a valid RTMP URL."
exit 1
fi
echo " - Server: ${SERVER_URL}"
echo -n " - Server: ${SERVER_URL}"
if [ "${SERVER_KEY}" != "null" ]; then
SERVER_URL+="/${SERVER_KEY}"
echo " (key required)"
else
echo ""
fi
STREAM_TEE=""
get_stream_tee
ffmpeg \

View file

@ -1,5 +1,6 @@
server:
url: "rtmp://127.0.0.1:1935"
key: "<insert your own key here>"
archive_stream: false
archive_path: "${HOME}/Streams"