feat: Add ICECAST_HOSTNAME config for YP directory registration

- Add hostname substitution in icecast-entrypoint.sh
- Update environment.sh.template with ICECAST_HOSTNAME option
- Defaults to localhost for dev, production sets ice.asteroid.radio
- Fixes YP directories showing localhost:8000 as stream URL
This commit is contained in:
glenneth 2026-01-02 11:52:53 +03:00
parent 5d2449a7d5
commit 1920ad9c66
2 changed files with 12 additions and 1 deletions

View File

@ -16,3 +16,8 @@ export ASTEROID_DB_PASSWORD=asteroid_db_2025
# Set to 'true' ONLY on production (asteroid.radio)
# Leave unset or 'false' for development to avoid polluting public listings
# export ICECAST_ENABLE_YP=true
# Icecast Hostname (reported to YP directories)
# Production should set this to the public hostname
# Dev defaults to 'localhost' if unset
# export ICECAST_HOSTNAME=ice.asteroid.radio

View File

@ -1,10 +1,16 @@
#!/bin/sh
# Generate icecast.xml from base config
# If ICECAST_ENABLE_YP=true, insert YP directory blocks
# - Substitute hostname (defaults to localhost for dev)
# - If ICECAST_ENABLE_YP=true, insert YP directory blocks
cp /etc/icecast.xml.base /etc/icecast.xml
# Set hostname (defaults to localhost if not specified)
ICECAST_HOSTNAME=${ICECAST_HOSTNAME:-localhost}
echo "Icecast hostname: $ICECAST_HOSTNAME"
sed -i "s|<hostname>localhost</hostname>|<hostname>$ICECAST_HOSTNAME</hostname>|" /etc/icecast.xml
if [ "$ICECAST_ENABLE_YP" = "true" ]; then
echo "YP directory publishing ENABLED"
# Insert YP config before closing </icecast> tag