[FreeNAS 9 Plugin] Subsonic

Status
Not open for further replies.

ripdog

Cadet
Joined
Feb 24, 2015
Messages
3
Thanks so much for this plugin, it works great. Can you please update it to 5.2? Cheers!

Oh, all I have to do to preserve config is to move /var/db/subsonic outside the jail and mount it inside?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks so much for this plugin, it works great. Can you please update it to 5.2? Cheers!

Oh, all I have to do to preserve config is to move /var/db/subsonic outside the jail and mount it inside?
you all the program data is in there. if you do change any options in the freenas interface (port / webroot / https) you'd need to also re-configure those.

I didn't even know it was out! I'm on it, hopefully I can get something out tomorrow.
 

ripdog

Cadet
Joined
Feb 24, 2015
Messages
3
Thanks :) One more question, how do I access this mythical plugin configuration interface? I noticed it running when I first looked at the process list to determine which damn port subsonic was running on, but accessing http://jail_ip:12346 just leads to an infinite spinner. Switching the port to 4040 yields a working subsonic install, so that's fine.

Is there any documentation for your plugins?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks :) One more question, how do I access this mythical plugin configuration interface? I noticed it running when I first looked at the process list to determine which damn port subsonic was running on, but accessing http://jail_ip:12346 just leads to an infinite spinner. Switching the port to 4040 yields a working subsonic install, so that's fine.

Is there any documentation for your plugins?
in the freenas interface, left side, under plugins. click the subsonic icon.
 

vpl

Cadet
Joined
Mar 11, 2015
Messages
1
Here's a short write-up on how I got SSL going with LDAPS against AD for authentication. I used the plugin and am working out of / in the jail.
keytool is located at /usr/pbi/subsonic-amd64/bin

1) Create a cnf file to be used for generating the csr.
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = v3_req
x509_extensions = v3_req

[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = US
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Texas
localityName = Locality Name (eg, city)
localityName_default = San Antonio
0.organizationName = Organization Name (eg, company)
0.organizationName_default = Company
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = Department
commonName = Common Name (hostname)
commonName_default = subsonic
commonName_max = 64
emailAddress = Email Address
emailAddress_default = email@domain.com
emailAddress_max = 64

[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName=@alt_names

[alt_names]
DNS.1 = subsonic
DNS.2 = subsonic.domain.com
IP.1 = 192.168.0.1

2) Generate the csr and private key
openssl req -new -sha256 -out subsonic.csr -config subsonic.cnf -newkey rsa:2048 -nodes -keyout subsonic.key

3) Submit the CSR to your CA. I used a Windows CA and received the subsonic.cer certificate.

4) Generate a PKCS12 file to be used for the Web SSL Java Keystore. I could not get this working using the sytem keystore, so this one is just for https.
openssl pkcs12 -export -out subsonic.pfx -inkey subsonic.key -in subsonic.cer -certfile CA-Certificate.cer

5) Create the Java Keystore to be used for SSL access.
./keytool -importkeystore -srckeystore subsonic.pfx -destkeystore subsonic.keystore -srcstoretype PKCS12 -srcalias 1 -destalias subsonic.domain.com

6) Add your CA certificate to the system Java Keystore as well. This will be used for LDAPS authentication. The default password is 'changeit' You should probably change that as well.
./keytool -import -trustcacerts -alias CA-domain.com -file /CA-Certificate.cer -keystore /usr/pbi/subsonic-amd64/openjdk7/jre/lib/security/cacerts
7) Enable LDAP Authentcation under Settings\Advanced
LDAP URL: ldaps://server.domain.com:636/dc=domain,dc=com
LDAP search filter: (&(sAMAccountName={0})(&(objectCategory=user)(memberof=cn=subsonic,ou=groups,dc=domain,dc=com)))
LDAP Manager: DOMAIN\user (non privileged!)

8) The default user cache is too high. Edit it in /var/db/subsonic/jetty/4427/webapp/WEB-INF/classes/ehcache.xml
<cache name="userCache"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="3600"
overflowToDisk="false"
diskSpoolBufferSizeMB="1"
statistics="true"/>
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
Is there an easy way to upgrade this plugin to the latest Subsonic version 6.1.1? Or just update through the shell would be fine with me but since I did not roll my own install I can't make heads or tails of it.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
ideally i would need to update the PBI first.
but if you want to work around that you can replace the subsonic-booter-jar-with-dependencies.jar in /usr/pbi/subsonic-amd64/share/subsonic
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
ideally i would need to update the PBI first.
but if you want to work around that you can replace the subsonic-booter-jar-with-dependencies.jar in /usr/pbi/subsonic-amd64/share/subsonic
Works fine after replacing subsonic-booter-jar-with-dependencies.jar and subsonic.war.
One hiccup that may manifest itself for others, I had to re-enable access to the music folder for admin and users. Use the subsonic server >> settings >> users and tick the check mark to allow access to your music library.
 

SeaFox

Explorer
Joined
Aug 6, 2013
Messages
98
ideally i would need to update the PBI first.
but if you want to work around that you can replace the subsonic-booter-jar-with-dependencies.jar in /usr/pbi/subsonic-amd64/share/subsonic

This may sound like a dumb question, but -- replace it with what? I know I can go to the Subsonic repo and get the current .war, but I don't know where to get a new subsonic-booter-jar-with-dependencies.jar

Version 6.1.3 was just released and it addresses a song-loss issue I think I've been experiencing.
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
This may sound like a dumb question, but -- replace it with what? I know I can go to the Subsonic repo and get the current .war, but I don't know where to get a new subsonic-booter-jar-with-dependencies.jar

Version 6.1.3 was just released and it addresses a song-loss issue I think I've been experiencing.
If you want 6.1.3 then download subsonic-6.1.3-standalone from the main website and unpack it, inside you will find both the needed files. Copy over the existing ones for the plugin and all should be well.
 
Last edited:

SeaFox

Explorer
Joined
Aug 6, 2013
Messages
98
If you want 6.1.3 then download subsonic-6.1.3-standalone from the main website and unpack it, inside you will find both the needed files. Copy over the existing ones for the plugin and all should be well.

Ah, thanks. It was in the standalone archive. I thought I was missing something obvious.

I couldn't get an SSH connection for some reason, but I got it done. I have my music folder on a CIFS share for syncing new files into the NAS, so I just copied the new subsonic-booter-jar-with-dependencies.jar and subsonic.war files into that folder, and then opened a shell in the specific jail and mv'd the files into the right directory after renaming the existing ones.
 
Status
Not open for further replies.
Top