snapcast icon indicating copy to clipboard operation
snapcast copied to clipboard

Cover Art URI schema

Open cuthulino opened this issue 2 months ago • 2 comments

Describe the bug I am serving snapweb with an reverse proxy to get https. The frontend and all controls are working as desired.

But the coverart does not work.

To me it looks like it is hardcoded to load http://<hostname_from_config>:1780. For my config this would be correct: https://<hostname_from_config>.

It would be great, to get an additional config, to configure the cover art url. Or even better, build the url dependen on the url the UI is loaded.

Steps to Reproduce

  1. Serve Snapweb via reverse Proxy with https
  2. Open Snapweb and Dev-Console
  3. See logs in console

Environment details

  • OS: debian
  • Snapcast version: 0.28.0
  • Installed from .deb package

Attach logfile if applicable grafik

cuthulino avatar May 01 '24 09:05 cuthulino

Related to #1139

badaix avatar May 08 '24 08:05 badaix

FYI: the tls branch supports HTTPS out of the box. If you want to test it, you can use a snapshot from the CI built: https://github.com/badaix/snapcast/actions/runs/9043310893

The snapserver.conf has a new section ssl, where you have to configure your certificate and key:

# Secure Socket Layer #########################################################
#
[ssl]
# https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/
# https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309

# Certificate file in PEM format
# certificate = 

# Private key file in PEM format
# private_key = 

# Password for decryption of the private_key (only needed for encrypted private_key file)
# key_password =

#
###############################################################################

And ssl_enabled must be set to true in the HTTP settings:

# HTTP RPC ####################################################################
#
[http]
# enable HTTP Json RPC (HTTP POST and websockets)
#enabled = true

# address to listen on, can be specified multiple times
# use "0.0.0.0" to bind to any IPv4 address or :: to bind to any IPv6 address
# or "127.0.0.1" or "::1" to bind to localhost IPv4 or IPv6, respectively
# use the address of a specific network interface to just listen to and accept
# connections from that interface
#bind_to_address = 0.0.0.0

# which port the server should listen to
#port = 1780

# enable HTTPS Json RPC (HTTPS POST and ssl websockets)
# ssl_enabled = false

# same as 'bind_to_address' but for SSL
# ssl_bind_to_address = 0.0.0.0

# same as 'port' but for SSL
# ssl_port = 1788

# serve a website from the doc_root location
# disabled if commented or empty
doc_root = /usr/share/snapserver/snapweb

# Hostname or IP under which clients can reach this host
# used to serve cached cover art
# use <hostname> as placeholder for your actual host name  
#host = <hostname>

#
###############################################################################

This is still work in progress, but I'm already using it and it's nice to see that Snapweb can be installed as PWA now, where the page is served via HTTPS.

badaix avatar May 11 '24 14:05 badaix