Madsonic
jls
jexec 18 tcsh
Inside the jail
Optional: give root a password
passwd
adduser
Username: subsonic Full name: Subsonic Uid: (1011) Login group: (default) Login group is urbackup. Invite urbackup into other groups: wheel Login class: (default) Shell: tcsh Home directory: (default) Home directory permissions: (default) Use password-based authentication: no Lock out the account after creation: (default) OK?: yes Add another user?: no
mkdir /music
chown -R subsonic:subsonic /music
su - subsonic
mkdir /home/subsonic/install
Add storage to /music in the NAS gui
exit
pkg update
pkg upgrade
pkg install madsonic-standalone
echo 'madsonic_enable="YES"' >> /etc/rc.conf
service madsonic start
Now open a web browser and go to http://10.0.0.26:4040
mkdir -p /usr/local/madsonic && cd /usr/local/madsonic
wget -Omadsonic.tar.gz http://madsonic.org/download/6.0/20160122_madsonic-6.0.7960-standalone.zip
tar -zxvf madsonic.tar.gz
rm madsonic.tar.gz
chown -R media:media /usr/local/madsonic
vi /usr/local/etc/rc.d/madsonic
# Use the file "madsonic" attached below
chmod a+x /usr/local/etc/rc.d/madsonic
sysrc madsonic_enable=YES
sysrc madsonic_user=media
sysrc madsonic_group=media
sysrc madsonic_bin=/usr/local/madsonic/madsonic.sh
sysrc madsonic_podcast_folder=/mnt/media/music/podcasts
sysrc madsonic_playlist_folder=/mnt/media/music/playlists
Here is the madsonic launch script to use.
Source: https://project.altservice.com/issues/761 Install openssl and zip:
pkg install openssl zip
Generate a strong SSL key and a CSR to send for signing by a CA:
cd /usr/local/etc
openssl req -sha512 -out madsonic.example.com.csr -new -newkey rsa:4096 -nodes -keyout madsonic.example.com.key
Combine the SSL key, certificate, and CA intermediate certificate files together into a madsonic-bundle.crt file:
cat madsonic.example.com.key madsonic.example.com.crt startcom.class1.bundle > madsonic-bundle.crt
Next convert it to a format madsonic understands:
openssl pkcs12 -in madsonic-bundle.crt -export -out madsonic-bundle.pkcs12
When prompted enter madsonic as export password. Now you should have a madsonic-bundle.pkcs12 file, we need to import this into a keystore for Madsonic to use:
keytool -importkeystore -srckeystore madsonic-bundle.pkcs12 -destkeystore madsonic.keystore -srcstoretype PKCS12 -srcstorepass madsonic -srcalias 1 -destalias madsonic
When prompted enter madsonic as the password. Finally we need to put the keystore into the file Madsonic uses to boot:
zip /usr/local/madsonic-standalone/madsonic-booter-jar-with-dependencies.jar madsonic.keystore
Now set the madsonic_https_port in the rc.conf file and restart madsonic:
echo 'madsonic_https_port="4443"' >> /etc/rc.conf
service madsonic restart