feat: install LiveKit via Homebrew et simplifie configuration
- Remplace téléchargement binaire par installation Homebrew - Utilise clés par défaut devkey/secret en mode --dev - Supprime flags incompatibles (--rtc-port-range-*, --port) - Ajoute détection/mise à jour LiveKit existant - Simplifie lancement automatique depuis Node.js 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+35
-40
@@ -38,46 +38,41 @@ fi
|
||||
echo -e "${GREEN}✅ npm $(npm -v)${NC}"
|
||||
echo ""
|
||||
|
||||
# Télécharger LiveKit Server
|
||||
LIVEKIT_VERSION="v1.7.2"
|
||||
LIVEKIT_URL="https://github.com/livekit/livekit/releases/download/${LIVEKIT_VERSION}/livekit_${LIVEKIT_VERSION}_darwin_amd64.tar.gz"
|
||||
LIVEKIT_ARM_URL="https://github.com/livekit/livekit/releases/download/${LIVEKIT_VERSION}/livekit_${LIVEKIT_VERSION}_darwin_arm64.tar.gz"
|
||||
|
||||
echo "📥 Téléchargement LiveKit Server ${LIVEKIT_VERSION}..."
|
||||
|
||||
# Détecter architecture (Intel vs Apple Silicon)
|
||||
ARCH=$(uname -m)
|
||||
if [ "$ARCH" = "arm64" ]; then
|
||||
echo " Architecture: Apple Silicon (ARM64)"
|
||||
DOWNLOAD_URL=$LIVEKIT_ARM_URL
|
||||
else
|
||||
echo " Architecture: Intel (AMD64)"
|
||||
DOWNLOAD_URL=$LIVEKIT_URL
|
||||
# Vérifier Homebrew
|
||||
echo "🍺 Vérification Homebrew..."
|
||||
if ! command -v brew &> /dev/null; then
|
||||
echo -e "${RED}❌ Homebrew n'est pas installé${NC}"
|
||||
echo " Installez Homebrew depuis https://brew.sh"
|
||||
echo " Ou exécutez :"
|
||||
echo " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd server/bin
|
||||
|
||||
if [ -f "livekit-server" ]; then
|
||||
echo -e "${YELLOW}⚠️ LiveKit Server déjà présent, suppression...${NC}"
|
||||
rm -f livekit-server
|
||||
fi
|
||||
|
||||
# Télécharger et extraire
|
||||
curl -L -o livekit.tar.gz "$DOWNLOAD_URL"
|
||||
tar -xzf livekit.tar.gz
|
||||
rm livekit.tar.gz
|
||||
|
||||
# Rendre exécutable
|
||||
chmod +x livekit-server
|
||||
|
||||
echo -e "${GREEN}✅ LiveKit Server installé${NC}"
|
||||
echo -e "${GREEN}✅ Homebrew $(brew --version | head -n 1)${NC}"
|
||||
echo ""
|
||||
|
||||
cd ../..
|
||||
# Installer LiveKit Server via Homebrew
|
||||
echo "📥 Installation LiveKit Server..."
|
||||
if command -v livekit-server &> /dev/null; then
|
||||
CURRENT_VERSION=$(livekit-server --version 2>&1 | head -n 1 || echo "version inconnue")
|
||||
echo -e "${YELLOW}⚠️ LiveKit Server déjà installé ($CURRENT_VERSION)${NC}"
|
||||
read -p " Mettre à jour ? (o/N) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Oo]$ ]]; then
|
||||
brew upgrade livekit
|
||||
echo -e "${GREEN}✅ LiveKit Server mis à jour${NC}"
|
||||
else
|
||||
echo -e "${GREEN}✅ LiveKit Server existant conservé${NC}"
|
||||
fi
|
||||
else
|
||||
brew install livekit
|
||||
echo -e "${GREEN}✅ LiveKit Server installé${NC}"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Installer dépendances serveur
|
||||
echo "📦 Installation dépendances serveur..."
|
||||
cd server
|
||||
cd ../server
|
||||
npm install
|
||||
echo -e "${GREEN}✅ Dépendances serveur installées${NC}"
|
||||
echo ""
|
||||
@@ -91,17 +86,17 @@ echo ""
|
||||
|
||||
cd ..
|
||||
|
||||
# Générer clés API LiveKit
|
||||
echo "🔑 Génération clés API LiveKit..."
|
||||
API_KEY="APIkey$(openssl rand -hex 16)"
|
||||
API_SECRET=$(openssl rand -base64 32)
|
||||
|
||||
# Créer fichier .env
|
||||
echo "🔑 Génération configuration LiveKit..."
|
||||
|
||||
cat > server/.env << EOF
|
||||
USE_LOCAL_LIVEKIT=true
|
||||
|
||||
# LiveKit Configuration
|
||||
LIVEKIT_URL=ws://localhost:7880
|
||||
LIVEKIT_API_KEY=$API_KEY
|
||||
LIVEKIT_API_SECRET=$API_SECRET
|
||||
# En mode --dev, LiveKit utilise ces clés par défaut
|
||||
LIVEKIT_API_KEY=devkey
|
||||
LIVEKIT_API_SECRET=secret
|
||||
|
||||
# Server Configuration
|
||||
PORT=3000
|
||||
|
||||
Reference in New Issue
Block a user