forked from coop-cloud/icecast
Compare commits
4
Commits
main
...
test/receta-viva
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5667799907 | ||
|
|
e312d0737f | ||
|
|
16643e05ee | ||
|
|
b546d2a742 |
+35
-2
@@ -4,8 +4,41 @@ DOMAIN=icecast.example.com
|
||||
|
||||
LETS_ENCRYPT_ENV=production
|
||||
|
||||
ICECAST_SOURCE_PASSWORD=changeme
|
||||
|
||||
#####################################################################
|
||||
# Icecast server #
|
||||
#####################################################################
|
||||
|
||||
ICECAST_LOCATION="Cyberspace"
|
||||
ICECAST_ADMIN_EMAIL=admin@example.com
|
||||
ICECAST_ADMIN_USERNAME=admin
|
||||
|
||||
#####################################################################
|
||||
# Icecast passwords #
|
||||
#####################################################################
|
||||
|
||||
ICECAST_SOURCE_PASSWORD=changeme
|
||||
ICECAST_RELAY_PASSWORD=changeme
|
||||
ICECAST_ADMIN_PASSWORD=changeme
|
||||
|
||||
ICECAST_LOCATION=Cyberspace
|
||||
#####################################################################
|
||||
# Icecast limits #
|
||||
#####################################################################
|
||||
|
||||
ICECAST_MAX_CLIENTS=1000
|
||||
ICECAST_MAX_SOURCES=10
|
||||
|
||||
#####################################################################
|
||||
# Icecast mounts #
|
||||
#####################################################################
|
||||
|
||||
# One mount per line: mount|username|password|max-listeners
|
||||
# Example:
|
||||
|
||||
# ICECAST_MOUNTS="
|
||||
# /radio1|alias1|changeme|100
|
||||
# /radio2|alias2|changeme|150
|
||||
# /radio3|alias3|changeme|200
|
||||
# "
|
||||
|
||||
ICECAST_MOUNTS=""
|
||||
|
||||
@@ -1,30 +1,17 @@
|
||||
# icecast
|
||||
# Icecast
|
||||
|
||||
> Icecast + Co-op Cloud = 🤘
|
||||
## 🧪 Rama de pruebas
|
||||
|
||||
<!-- metadata -->
|
||||
Esta rama del fork de **Escuela Común** se utiliza para realizar **pruebas reales con Icecast + Co-op Cloud** y reunir mejoras que estamos evaluando antes de que sean incorporadas —o no— a la receta oficial.
|
||||
|
||||
* **Category**: Apps
|
||||
* **Status**: 0
|
||||
* **Image**: [`icecast`](https://hub.docker.com/r/icecast), 4, upstream
|
||||
* **Healthcheck**: No
|
||||
* **Backups**: No
|
||||
* **Email**: No
|
||||
* **Tests**: No
|
||||
* **SSO**: No
|
||||
### ✨ Incluye
|
||||
|
||||
<!-- endmetadata -->
|
||||
- Más opciones configurables desde el `.env`:
|
||||
- usuario y correo administrador;
|
||||
- contraseña de relay;
|
||||
- límite máximo de clientes;
|
||||
- límite máximo de fuentes.
|
||||
|
||||
## Quick start
|
||||
- 📻 Soporte para declarar **varias radios** desde `ICECAST_MOUNTS`, cada una con su propio usuario, contraseña y límite de oyentes.
|
||||
|
||||
* `abra app new icecast --secrets`
|
||||
* `abra app config <app-name>`
|
||||
* `abra app deploy <app-name>`
|
||||
|
||||
After the app has finished deploying, you should be able to access the web
|
||||
interface on https://icecast.example.com.
|
||||
|
||||
To stream, connect to http://icecast.example.com:8000 (note: encryption is not
|
||||
currently supported for streaming, see #2
|
||||
|
||||
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
||||
⚠️ **Esta no es la receta oficial de Co-op Cloud.**
|
||||
+19
-2
@@ -4,13 +4,25 @@ version: "3.8"
|
||||
services:
|
||||
app:
|
||||
image: libretime/icecast:2.5-beta3
|
||||
entrypoint: /coopcloud-entrypoint.sh
|
||||
command: ["icecast", "-c", "/etc/icecast.xml"]
|
||||
configs:
|
||||
- source: icecast_entrypoint
|
||||
target: /coopcloud-entrypoint.sh
|
||||
mode: 0555
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
- ICECAST_HOSTNAME=$DOMAIN
|
||||
- ICECAST_SOURCE_PASSWORD
|
||||
- ICECAST_ADMIN_PASSWORD
|
||||
- ICECAST_LOCATION
|
||||
- ICECAST_ADMIN_EMAIL
|
||||
- ICECAST_ADMIN_USERNAME
|
||||
- ICECAST_SOURCE_PASSWORD
|
||||
- ICECAST_RELAY_PASSWORD
|
||||
- ICECAST_ADMIN_PASSWORD
|
||||
- ICECAST_MAX_CLIENTS
|
||||
- ICECAST_MAX_SOURCES
|
||||
- ICECAST_MOUNTS
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
@@ -43,3 +55,8 @@ services:
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
configs:
|
||||
icecast_entrypoint:
|
||||
name: ${STACK_NAME}_icecast_entrypoint_${ICECAST_ENTRYPOINT_VERSION}
|
||||
file: entrypoint.sh
|
||||
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
CONFIG=/etc/icecast.xml
|
||||
BEGIN_MARKER="<!-- BEGIN COOP-CLOUD MOUNTS -->"
|
||||
END_MARKER="<!-- END COOP-CLOUD MOUNTS -->"
|
||||
|
||||
xml_escape() {
|
||||
printf '%s' "$1" | sed \
|
||||
-e 's/&/\&/g' \
|
||||
-e 's/</\</g' \
|
||||
-e 's/>/\>/g' \
|
||||
-e 's/"/\"/g' \
|
||||
-e "s/'/\'/g"
|
||||
}
|
||||
|
||||
# Remove mounts generated by a previous run.
|
||||
awk '
|
||||
/<!-- BEGIN COOP-CLOUD MOUNTS -->/ { skip=1; next }
|
||||
/<!-- END COOP-CLOUD MOUNTS -->/ { skip=0; next }
|
||||
!skip { print }
|
||||
' "$CONFIG" > /tmp/icecast.xml
|
||||
|
||||
cat /tmp/icecast.xml > "$CONFIG"
|
||||
|
||||
if [ -n "${ICECAST_MOUNTS:-}" ]; then
|
||||
MOUNTS=/tmp/icecast-mounts.xml
|
||||
|
||||
printf '%s\n' "$BEGIN_MARKER" > "$MOUNTS"
|
||||
|
||||
printf '%s\n' "$ICECAST_MOUNTS" |
|
||||
while IFS='|' read -r mount username password max_listeners; do
|
||||
[ -z "$mount" ] && continue
|
||||
|
||||
case "$mount" in
|
||||
\#*) continue ;;
|
||||
/*) ;;
|
||||
*)
|
||||
echo "Invalid Icecast mount: $mount must start with /" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$username" ]; then
|
||||
echo "Invalid Icecast mount $mount: username is required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$password" ]; then
|
||||
echo "Invalid Icecast mount $mount: password is required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$max_listeners" in
|
||||
''|*[!0-9]*)
|
||||
echo "Invalid max-listeners for $mount: $max_listeners" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
mount=$(xml_escape "$mount")
|
||||
username=$(xml_escape "$username")
|
||||
password=$(xml_escape "$password")
|
||||
max_listeners=$(xml_escape "$max_listeners")
|
||||
|
||||
cat >> "$MOUNTS" <<MOUNT
|
||||
<mount>
|
||||
<mount-name>${mount}</mount-name>
|
||||
<username>${username}</username>
|
||||
<password>${password}</password>
|
||||
<max-listeners>${max_listeners}</max-listeners>
|
||||
<authentication>
|
||||
<role type="anonymous" match-method="source,put" deny-all="*" />
|
||||
</authentication>
|
||||
</mount>
|
||||
MOUNT
|
||||
done
|
||||
|
||||
printf '%s\n' "$END_MARKER" >> "$MOUNTS"
|
||||
|
||||
awk '
|
||||
/<\/icecast>/ {
|
||||
while ((getline line < "/tmp/icecast-mounts.xml") > 0)
|
||||
print line
|
||||
close("/tmp/icecast-mounts.xml")
|
||||
}
|
||||
{ print }
|
||||
' "$CONFIG" > /tmp/icecast.xml
|
||||
|
||||
cat /tmp/icecast.xml > "$CONFIG"
|
||||
fi
|
||||
|
||||
exec /usr/local/bin/docker-entrypoint "$@"
|
||||
Reference in New Issue
Block a user