Wiki > Supysonic
Supysonic is a Python implementation of the Subsonic server API.
Install
-
Connect to your slot through SSH
-
Create a Python 3 virtualenv with the instructions found here or use an existing one.
-
With your virtualenv activated, install Supysonic and its dependencies
git clone https://github.com/spl0k/supysonic.git cd supysonic pip install . uwsgi
-
Add
~/supysonic/bin
to your shell's PATH.echo "PATH=\$PATH:\$HOME/supysonic/bin" >> ~/.bashrc && source ~/.bashrc
-
Create some required directories:
mkdir -p ~/.config/supysonic ~/.config/supysonic/webcache
-
Create the
~/.supysonic
file with the following contents. You can usenano ~/.supysonic
to edit the file.[base] database_uri = sqlite:////home/user/.config/supysonic/library.db [webapp] cache_dir = /home/user/.config/supysonic/webcache [transcoding] transcoder_mp3_mp3 = lame --quiet --mp3input -b %outrate %srcpath - transcoder = ffmpeg -i %srcpath -ab %outratek -v 0 -f %outfmt - decoder_mp3 = mpg123 --quiet -w - %srcpath decoder_ogg = oggdec -o %srcpath decoder_flac = flac -d -c -s %srcpath encoder_mp3 = lame --quiet -b %outrate - - encoder_ogg = oggenc2 -q -M %outrate - [daemon] socket = /home/user/.config/supysonic/socket run_watcher = yes wait_delay = 5 log_file = /home/user/.config/supysonic/supysonic-daemon.log log_level = INFO
-
Run
supysonic-cli
then run the following commands to configure supysonic for use. Make sure to replacepassword
with the password you would like to use.user add user -p password -a folder add files /home/user/files exit
-
Start supysonic's daemon and web interface. Port 30170 has been automatically generated for you, but you may use another 5 digit port between 10000 and 65535.
screen -dmS supysonic-daemon ~/virtualenv3/bin/supysonic-daemon screen -dmS supysonic-uwsgi ~/virtualenv3/bin/uwsgi --http 0.0.0.0:30170 --wsgi-file ~/supysonic/cgi-bin/supysonic.wsgi
-
Scan your library by browsing to http://server.whatbox.ca:30170/folder/scan
-
(Optional) Add supysonic to cron
The following lines can be added to your crontab to make sure supysonic launches automatically on a server restart:
@reboot . /home/user/virtualenv/bin/activate && screen -S supysonic-daemon /home/user/virtualenv/bin/python /home/user/virtualenv/bin/supysonic-daemon @reboot . /home/user/virtualenv/bin/activate && screen -S supysonic-uwsgi /home/user/virtualenv/bin/python /home/user/virtualenv/bin/uwsgi --http 0.0.0.0:30170 --wsgi-file /home/user/supysonic/cgi-bin/supysonic.wsgi
Adding additional folders
-
Connect to your seedbox through SSH
-
Activate your virtualenv with the instructions found here.
-
Run
supysonic-cli
to configure supysonic with extra folders:folder add files /home/user/files exit
-
Rescan your library
Visit http://server.whatbox.ca:30170/folder/scan to refresh your library.
Web Interface
You may use the web interface by going to http://server.whatbox.ca:30170/.