User Tools

Site Tools


nomades:sa_web_radio

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

nomades:sa_web_radio [2015/08/30 22:55] – created - external edit 127.0.0.1nomades:sa_web_radio [2026/02/25 10:33] (current) julien
Line 1: Line 1:
 ====== Comment faire sa web radio ====== ====== Comment faire sa web radio ======
  
-===== by thenoiser =====+**by thenoiser**
  
-mis à part les solutions du type vlc ou icestream : http://sourceforge.net/projects/icestream/ ou encore airtime qui à l'air vraiment pas mal : http://www.sourcefabric.org/en/airtime/download/+===== install Icecast =====
  
-voilà une solution simple pour jouer vos fichiers audio en random à travers votre propre webradio live  avec ezstream (install facile sur toutes les distro easyuser) :+===== reverse proxy Nginx (:8000) =====
  
-tout d'abord créer votre propre playlist en mode random  
  
-aprés avoir bien installé : randomize-lines (pour rl)+===== pages admin/status ===== 
 + 
 + 
 +===== SSL Let’s Encrypt DNS-01 ===== 
 + 
 + 
 +==== Renouvellement manuel du certificat SSL Let's Encrypt pour la radio (Icecast + Nginx) ==== 
 + 
 +===== Objectif ===== 
 + 
 +Renouveler manuellement le certificat SSL/TLS Let's Encrypt utilisé par Nginx pour ''radio.example.org:8000'', sans interrompre Icecast. 
 + 
 +<note important> 
 +Ce tutoriel concerne un certificat Let's Encrypt créé en mode manuel DNS-01 (challenge DNSavec Gandi. 
 +Dans ce mode, le renouvellement n'est pas automatique (sans script/hook). 
 +</note> 
 + 
 +===== Contexte ===== 
 + 
 +* Domaine : ''radio.example.org'' 
 +* Certificat utilisé par Nginx : 
 + 
 +  * ''/etc/letsencrypt/live/radio.example.org/fullchain.pem'' 
 +  * ''/etc/letsencrypt/live/radio.example.org/privkey.pem'' 
 +* Nginx sert le HTTPS sur le port ''8000'' 
 +* Icecast tourne en local (proxy derrière Nginx) 
 +* Validation Let's Encrypt par TXT DNS : ''_acme-challenge.radio.example.org'' 
 + 
 +===== 1. Vérifier l'état du certificat =====
  
 <code> <code>
-find /home/monhome/music/ -iname *.mp3 -o -iname *.ogg -o -iname *.flac | rl > playlist.m3u+sudo certbot certificates
 </code> </code>
  
-à partir de là suivre ce très bon tuto http://koorenneef.nl/content/run-your-own-online-radio-station-icecast2-and-ezstream-howto+Vérifier notamment :
  
-et si vous souhaitez réencoder à la volé vos morceaux, bien pensé à prendre l'exemple ezstream_reencode_mp3.xml et avoir aussi installé madplay & lame.+''Certificate Nameradio.example.org'' 
 +* ''Expiry Date: ...''
  
 +===== 2. Lancer le renouvellement manuel (DNS-01) =====
  
 +<code>
 +sudo certbot certonly \
 +  --manual \
 +  --preferred-challenges dns \
 +  --key-type ecdsa \
 +  -d radio.example.org
 +</code>
  
 +Certbot affiche alors :
  
-===== by gepeto =====+* le nom du TXT à créer : ''_acme-challenge.radio.example.org'' 
 +* une valeur TXT (chaîne aléatoire) à copier
  
-juste pour commencer un petit script tres pratique, fait sous LadyBug, il vous faut au prealable installer +<note warning> 
-  * qjackctl +La valeur change à chaque tentative. 
-  * icecast2 +Si une tentative échoue, il faut remplacer l'ancienne valeur TXT par la nouvelle valeur affichée par Certbot. 
-  * ices +</note> 
-  audacious + 
-  audacious-jack , je l'ai trouvé là [[http://rpms.mandrivaclub.com/rpms/G%C3%B6tz_Waschk__waschk_mandriva.org_.html]] mais il est surement ailleurs aussi +===== 3. Ajouter / mettre à jour le TXT dans Gandi ===== 
-  * gxmessage+ 
 +Dans l'interface DNS Gandi de ''example.org''
 + 
 +**Type** : ''TXT'' 
 +**Nom** : ''_acme-challenge.radio'
 +* **Valeur** (la chaîne fournie par Certbot) 
 +* **TTL** ''300'' (recommandé) 
 + 
 +<note tip> 
 +Dans la zone DNS ''example.org'', le nom ''_acme-challenge.radio'' correspond au FQDN ''_acme-challenge.radio.example.org''
 +</note> 
 + 
 +===== 4. Vérifier la propagation DNS avant de valider Certbot ===== 
 + 
 +Avant d'appuyer sur Entrée dans Certbot, vérifier que le TXT est bien visible publiquement.
  
-voila le script 
 <code> <code>
-#!/bin/bash +dig +short TXT _acme-challenge.radio.example.org @8.8.8.8
-gksu -k "/usr/local/bin/icecast2.sh " +
-title="ices_cream icecast ogg jack client Streaming avec ices" +
-ask_ices="Lancez la radio  ?" +
-gxmessage -center -title "$title" -button Oui,Non "$ask_ices" +
-RET=$? +
-if [ "$RET" = "102" ];then +
-        exit 0 +
-fi +
-if [ "$RET" = "101" ];then +
-        ps -C qjackctl>/dev/null +
-        PID=$? +
-        if [ "$PID" == "1" ]; then +
-                killall -9 jackd +
-                killall -9 audacious +
-                /usr/bin/qjackctl & +
-                sleep 6 +
-        fi +
-        /usr/bin/ices /etc/ices.xml & +
-        sleep 2 +
-        /usr/bin/audacious.sh +
-        exit 0 +
-fi+
 </code> </code>
  
-et le code de icecast2.sh+Ou : 
 <code> <code>
-..+nslookup -type=TXT _acme-challenge.radio.example.org 8.8.8.8
 </code> </code>
 +
 +Le résultat doit afficher exactement la valeur demandée par Certbot.
 +
 +Exemple :
 +
 +<code>
 +"CG6n8bpQEakfUmjM3EMZsOzxGOl2cwOFkAtsgpMuGBc"
 +</code>
 +
 +<note important>
 +N'appuyer sur Entrée dans Certbot qu'après avoir vérifié la bonne valeur TXT.
 +</note>
 +
 +===== 5. Valider dans Certbot =====
 +
 +Revenir dans le terminal où Certbot attend et appuyer sur Entrée.
 +
 +Si tout est correct, message attendu :
 +
 +<code>
 +Successfully received certificate.
 +Certificate is saved at: /etc/letsencrypt/live/radio.example.org/fullchain.pem
 +Key is saved at:         /etc/letsencrypt/live/radio.example.org/privkey.pem
 +</code>
 +
 +===== 6. Recharger Nginx pour prendre le nouveau certificat =====
 +
 +<code>
 +sudo nginx -t
 +sudo systemctl reload nginx
 +</code>
 +
 +<note>
 +Icecast n'a pas besoin d'être redémarré pour cette opération.
 +Seul Nginx doit être rechargé.
 +</note>
 +
 +===== 7. Vérifier la nouvelle date d'expiration =====
 +
 +<code>
 +sudo certbot certificates
 +</code>
 +
 +La date d'expiration doit être repoussée (environ 90 jours).
 +
 +===== Erreurs fréquentes =====
 +
 +==== Certbot échoue avec un TXT "incorrect" ====
 +
 +Cause fréquente :
 +
 +* ancienne valeur TXT encore présente
 +* nouvelle tentative Certbot = nouvelle valeur
 +* validation trop rapide
 +
 +Solution :
 +
 +* remplacer la valeur TXT par la nouvelle
 +* vérifier avec ''dig''
 +* puis appuyer sur Entrée
 +
 +==== ''certbot renew'' ne marche pas ====
 +
 +Erreur typique :
 +
 +<code>
 +The manual plugin is not working...
 +An authentication script must be provided with --manual-auth-hook
 +</code>
 +
 +C'est normal avec un certificat créé en mode manuel DNS-01 sans hook.
 +
 +===== Checklist rapide (urgence) =====
 +
 +<code>
 +sudo certbot certificates
 +</code>
 +
 +<code>
 +sudo certbot certonly \
 +  --manual \
 +  --preferred-challenges dns \
 +  --key-type ecdsa \
 +  -d radio.example.org
 +</code>
 +
 +* Mettre à jour le TXT ''_acme-challenge.radio'' dans Gandi
 +* Vérifier la propagation DNS :
 +
 +<code>
 +dig +short TXT _acme-challenge.radio.example.org @8.8.8.8
 +</code>
 +
 +* Appuyer sur Entrée dans Certbot
 +* Recharger Nginx :
 +
 +<code>
 +sudo nginx -t && sudo systemctl reload nginx
 +</code>
 +
 +* Vérifier :
 +
 +<code>
 +sudo certbot certificates
 +</code>
 +
 +===== À faire plus tard (automatisation) =====
 +
 +* Automatiser le DNS-01 avec l'API Gandi (hook Certbot ou plugin DNS)
 +* Ajouter un reload Nginx automatique après renouvellement
 +* Mettre en place un contrôle périodique (cron/systemd timer)
 +
 +===== monitoring / stats / logs / watchdog =====
 +
nomades/sa_web_radio.txt · Last modified: 2026/02/25 10:33 by julien