Certbot ssl breaks widgets and album art

Hi All,

I noticed a few issues after setting up SSL for my Libretime instance using certbot. The widgets on the login page try and pull the content from my localhost, and subsequently cannot load:

The same error also seems to apply to the album art preview, but this is less regular and will switch between correctly display the currently playing album art, and displaying a broken link. I am able to resolve both of these issues by changing the base url in airtime.conf to the domain name rather than the default local ip, however this then causes the Libretime instance to be unable to connect to Icecast, killing my stream. I have attached my Apache host configs as I figured this was the most likely cause. I don’t have a ton of experience so am likely just making an obvious mistake here but wondered if anybody had any pointers on what config mistakes could be causing this behavior.

airtime.conf:

<VirtualHost *:80>
   ServerAdmin tech@purpleradio.co.uk
   DocumentRoot /usr/share/airtime/php/airtime_mvc/public/
   php_admin_value upload_tmp_dir /tmp
   php_value post_max_size 500M
   php_value upload_max_filesize 500M
   php_value request_order "GPC"
   php_value session.gc_probability 0
   php_value session.auto_start 0

   AddOutputFilterByType DEFLATE text/plain
   AddOutputFilterByType DEFLATE text/html
   AddOutputFilterByType DEFLATE text/xml
   AddOutputFilterByType DEFLATE text/css
   AddOutputFilterByType DEFLATE application/xml
   AddOutputFilterByType DEFLATE application/xhtml+xml
   AddOutputFilterByType DEFLATE application/rss+xml
   AddOutputFilterByType DEFLATE application/javascript
   AddOutputFilterByType DEFLATE application/x-javascript
   AddOutputFilterByType DEFLATE application/json

   SSLProxyEngine on
   ProxyPreserveHost On
   ProxyRequests Off
   ProxyPass "/stream" "http://localhost:8000/stream"
   ProxyPassReverse "/stream" "http://localhost:8000/stream"

  <Directory /usr/share/airtime/php/airtime_mvc/public/>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} -s [OR]
      RewriteCond %{REQUEST_FILENAME} -l [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^.*$ - [NC,L]
      RewriteRule ^.*$ index.php [NC,L]

      DirectoryIndex index.php
      AllowOverride all
      Order allow,deny
      Allow from all

      Require all granted
  </Directory>
RewriteCond %{SERVER_NAME} =radio.purpleradio.co.uk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

airtime-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerAdmin tech@purpleradio.co.uk
  DocumentRoot /usr/share/airtime/php/airtime_mvc/public/
  php_admin_value upload_tmp_dir /tmp
  php_value post_max_size 500M
  php_value upload_max_filesize 500M
  php_value request_order "GPC"
  php_value session.gc_probability 0
  php_value session.auto_start 0

  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/json

  SSLProxyEngine on
  ProxyPreserveHost On
  ProxyRequests Off
  ProxyPass /stream http://localhost:8000/stream
  ProxyPassReverse /stream http://localhost:8000/stream
  
  <Directory /usr/share/airtime/php/airtime_mvc/public/>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} -s [OR]
      RewriteCond %{REQUEST_FILENAME} -l [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^.*$ - [NC,L]
      RewriteRule ^.*$ index.php [NC,L]

      DirectoryIndex index.php
      AllowOverride all
      Order allow,deny
      Allow from all

      Require all granted
  </Directory>

ServerName radio.purpleradio.co.uk
SSLCertificateFile /etc/letsencrypt/live/radio.purpleradio.co.uk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/radio.purpleradio.co.uk/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

It looks like you need to set base_url and base_port in /etc/airtime/airtime.conf to reflect your real URL.

[general]
base_url = radio.purpleradio.co.uk
base_port = 443

The links to the widgets get generated based off of those values.