Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions snapserver/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ ports:
1705/tcp: 1705
1780/tcp: 1780
4953/tcp: 4953
ports_description:
1704/tcp: "Snapcast Stream"
1705/tcp: "Snapcast JSON RPC"
1780/tcp: "Snapcast HTTP controller"
4953/tcp: "Snapcast HA TCP input"
ingress: true
ingress_port: 1780
panel_icon: "mdi:cast-audio"
panel_title: "Snapcast"
panel_admin: false
webui: "http://[HOST]:[PORT:1780]/"
11 changes: 11 additions & 0 deletions snapserver/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ echo "sampleformat = ${sampleformat}" >> "${config}"
http=$(bashio::config 'http_enabled')
echo "[http]" >> "${config}"
echo "enabled = ${http}" >> "${config}"
echo "bind_to_address = 0.0.0.0" >> "${config}"
echo "bind_to_address = ::" >> "${config}"

# Datadir
datadir=$(bashio::config 'server_datadir')
echo "doc_root = ${datadir}" >> "${config}"
Expand All @@ -76,5 +78,14 @@ echo "[server]" >> "${config}"
threads=$(bashio::config 'server_threads')
echo "threads = ${threads}" >> "${config}"

# Modify snapweb websocket for ingress
bashio::log.info "Adding ingress config to snapweb in ${datadir}/config.js..."
cat > ${datadir}/config.js <<EOF
"use strict";
let config = {
baseUrl: (window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host + window.location.pathname.replace(/\/$/, '')
}
EOF

bashio::log.info "Starting SnapServer..."
exec snapserver