From b0dc67bccb39cd7175eb789e116f2e32cc9ce781 Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Wed, 18 Feb 2026 20:15:02 -0700 Subject: [PATCH] feat: Add a migration script to make upgrading to voice easier This commit was made without the use of generative AI. Signed-off-by: Jacob Schlecht --- README.md | 13 ++++++++- generate_config.sh | 2 ++ migrations/20260218-voice-config.sh | 45 +++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 migrations/20260218-voice-config.sh diff --git a/README.md b/README.md index bc54d99..ad4fe06 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ This repository contains configurations and instructions that can be used for de > [!WARNING] > If you are updating an instance from before November 28, 2024, please consult the [notices section](#notices) at the bottom. > If you are updating an instance from before October 5, 2025, please consult the [notices section](#notices) at the bottom. +> If you are updating an instance from before February 18, 2026, please consult the [notices section](#notices) at the bottom. > [!IMPORTANT] > A list of security advisories is [provided at the bottom](#security-advisories). @@ -421,9 +422,19 @@ db.invites.insertOne({ _id: "enter_an_invite_code_here" }) > These will NOT automatically be applied to your environment. > > You must run the environment with the old revolt name to apply the update. After you run `docker compose pull` during the upgrade procedure, you must run `docker compose -p revolt down`. You may then continue with the upgrade procedure. + +> [!IMPORTANT] +> As of February 18, 2026, livekit support and the new web app was added to the self host repo. In order to utilize the new voice features and the new web app, you must add configuration. +> +> Before beginning the upgrade process, please do the following: > > ```bash -> +> git pull +> chmod +x migrations/20260218-voice-config.sh +> ./migrations/20260218-voice-config.sh your.domain +> ``` +> +> This should append the new configurations to your existing configuration. Only run this migration once, as if you run it more than once your instance will fail to start. You may then continue with the upgrade procedure. ## Security Advisories diff --git a/generate_config.sh b/generate_config.sh index a16c974..3331fe7 100644 --- a/generate_config.sh +++ b/generate_config.sh @@ -26,6 +26,8 @@ echo "events = \"wss://$1/ws\"" >> Revolt.toml echo "autumn = \"https://$1/autumn\"" >> Revolt.toml echo "january = \"https://$1/january\"" >> Revolt.toml +# livekit hostname +echo "" >> Revolt.toml echo "[hosts.livekit]" >> Revolt.toml echo "worldwide = \"wss://$1/livekit\"" >> Revolt.toml diff --git a/migrations/20260218-voice-config.sh b/migrations/20260218-voice-config.sh new file mode 100644 index 0000000..9a746cb --- /dev/null +++ b/migrations/20260218-voice-config.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# +# This script is intended for appending the configuration values for livekit. +# Please run this script from the project directory like so: +# ./migrations/20260218-voice-config.sh your.domain + +# Append the new web environment variables to the .env.web +echo "Adding new environment variables to .env.web for new web app..." +echo "VITE_API_URL=https://$1/api" >> .env.web +echo "VITE_WS_URL=wss://$1/ws" >> .env.web +echo "VITE_MEDIA_URL=https://$1/autumn" >> .env.web +echo "VITE_PROXY_URL=https://$1/january" >> .env.web + +# Append the hosts.livekit configuration +echo "Adding livekit worldwide host to Revolt.toml..." +echo "" >> Revolt.toml +echo "[hosts.livekit]" >> Revolt.toml +echo "worldwide = \"wss://$1/livekit\"" >> Revolt.toml + +# Create livekit key and secret +livekit_key=$(openssl rand -hex 6) +livekit_secret=$(openssl rand -hex 24) + +# Append keys and webhook to livekit.yml +echo "Adding livekit key and webhook configuration to livekit.yml..." +echo "" >> livekit.yml +echo "keys:" >> livekit.yml +echo " $livekit_key: $livekit_secret" >> livekit.yml +echo "" >> livekit.yml +echo "webhook:" >> livekit.yml +echo " api_key: $livekit_key" >> livekit.yml +echo " urls:" >> livekit.yml +echo " - \"https://$1/ingress/worldwide\"" >> livekit.yml + +# Append livekit node configuration to Revolt.toml +echo "Adding livekit node configuration to Revolt.toml..." +echo "" >> Revolt.toml +echo "[api.livekit.nodes.worldwide]" >> Revolt.toml +echo "url = \"https://$1/livekit\"" >> Revolt.toml +echo "lat = 0.0" >> Revolt.toml +echo "lon = 0.0" >> Revolt.toml +echo "key = \"$livekit_key\"" >> Revolt.toml +echo "secret = \"$livekit_secret\"" >> Revolt.toml + +echo "Done! <3" \ No newline at end of file