feat: Enable video, autoconfigure video (#262)

This commit was made without the use of generative AI.

Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
This commit is contained in:
Jacob Schlecht
2026-03-08 18:23:21 -06:00
committed by GitHub
parent 0871fb8e9b
commit ba4751ce4c
3 changed files with 30 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ This repository contains configurations and instructions that can be used for de
- [KeyDB Compatibility](#keydb-compatibility)
- [Making Your Instance Invite-only](#making-your-instance-invite-only)
- [Why ports 7881 and 50000-50100/udp aren't in the Caddyfile](#why-ports-7881-and-50000-50100udp-arent-in-the-caddyfile)
- [Getting kicked on video enabled instances when turning on video](#getting-kicked-on-video-enabled-instances-when-turning-on-video)
- [Notices](#notices)
- [Security Advisories](#security-advisories)
@@ -337,6 +338,10 @@ db.invites.insertOne({ _id: "enter_an_invite_code_here" })
Livekit requires ports 7881/tcp and 50000-50100/udp to be openly accessible on the internet. These ports are used for the RTC protocol. Caddy does not support RTC without significant configuration changes that are out of scope of this repo.
### Getting kicked on video enabled instances when turning on video
Due to an incomplete implementation, Stoat will kick any user that attempts to stream a video that is larger than the maximum size defined in `Revolt.toml`. If you would like to increase the maximum size allowed on your Stoat instance, you can do so by modifying the `video_resolution` field under `[features.limits.new_user]` and `[features.limits.default]` to a larger value in your `Revolt.toml`. For example, 4k would be : `[3996, 2160]`.
## Notices
<details>

View File

@@ -213,6 +213,6 @@ services:
# Web App
web:
image: ghcr.io/stoatchat/for-web:addb6b7
image: ghcr.io/stoatchat/for-web:103d2bf
restart: always
env_file: .env.web

View File

@@ -3,6 +3,7 @@
SECRETS_FOUND=0
IS_OVERWRITING=0
DOMAIN=
VIDEO_ENABLED=
usage() {
echo "Usage: ./generate_config.sh [--overwrite] DOMAIN"
@@ -92,6 +93,14 @@ else
echo "STOAT_DOMAIN=$DOMAIN" > .env
fi
read -rp "Would you like to enable camera and screen sharing? [Y/n]: "
if [ "$REPLY" = "n" ] || [ "$REPLY" = "N" ]; then
echo "No received. Not configuring video."
else
echo "Yes received. Configuring video."
VIDEO_ENABLED=true
fi
# Generate secrets
echo "Generating secrets..."
if [ "$PUSHD_VAPID_PRIVATEKEY" = "" ]; then
@@ -156,6 +165,7 @@ echo "VITE_API_URL=https://$DOMAIN/api" >> .env.web
echo "VITE_WS_URL=wss://$DOMAIN/ws" >> .env.web
echo "VITE_MEDIA_URL=https://$DOMAIN/autumn" >> .env.web
echo "VITE_PROXY_URL=https://$DOMAIN/january" >> .env.web
echo "VITE_CFG_ENABLE_VIDEO=$VIDEO_ENABLED" >> .env.web
# hostnames
echo "[hosts]" > Revolt.toml
@@ -212,6 +222,20 @@ echo "lon = 0.0" >> Revolt.toml
echo "key = \"$LIVEKIT_WORLDWIDE_KEY\"" >> Revolt.toml
echo "secret = \"$LIVEKIT_WORLDWIDE_SECRET\"" >> Revolt.toml
# Video config
# We need to address issue https://github.com/stoatchat/stoatchat/issues/588 until we adopt a backend version later than 0.12.0
# We'll enable 1080p video by default, that should be high enough for most users.
if [[ -n "$VIDEO_ENABLED" ]]; then
echo "" >> Revolt.toml
echo "[features.limits.new_user]" >> Revolt.toml
echo "video_resolution = [1920, 1080]" >> Revolt.toml
echo "video_aspect_ratio = [0.3, 10]" >> Revolt.toml
echo "" >> Revolt.toml
echo "[features.limits.default]" >> Revolt.toml
echo "video_resolution = [1920, 1080]" >> Revolt.toml
echo "video_aspect_ratio = [0.3, 10]" >> Revolt.toml
fi
if [[ $IS_OVERWRITING -eq 1 ]]; then
echo "Overwrote existing config. If any custom configuration was present in old Revolt.toml, you may now copy it over from Revolt.toml.old."
fi