This is a summary of the previous "Installing a proper SSL certificate chain" thread and aims systems as specified above. It should work pretty straight forward.
Important: When using Artist Info within the browser, files like artist image and cover are not transferred securely. They are linked directly and not gathered by the server before transfer, so in case you don't want anybody to know what you are doing, you might consider switching off Artist Info within settings. In Safari for example, the "Lock" will disappear as soon you are opening an album and downloading Artist Pictures.
1. Create certificates using Let's Encrypt.
2. Run this script provided by IwishIcanFLighT (just copy/paste code into a txt file ending with .sh and run it: root@ExampleServer:~ # sh MyLittleScript.sh
- Code: Select all
# Color output
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
# CHANGE THIS LINE, DON'T FORGET THE DASH AT THE END
certpath="/etc/letsencrypt/live/domain.org/"
echo "${green}Generate as PKCS12 key file${reset}"
echo "Enter a password 2 times:"
openssl pkcs12 -inkey "${certpath}privkey.pem" -in "${certpath}cert.pem" -export -out subsonic.pkcs12
echo "${green}subsonic.pkcs12 key generated.${reset}"
echo "\n${green}Loading the key to a keystore.${reset}"
echo "${green}Please re-type the same password 3 times:${reset}"
keytool -importkeystore -srckeystore subsonic.pkcs12 -srcstoretype PKCS12 -destkeystore subsonic_cert.keystore
echo "${red}Deleting the PKCS12 file not needed anymore${reset}"
rm subsonic.pkcs12
echo "\n${green}### subsonic_cert.keystore successfully generated! :) ### ${reset}\n"
echo "\n${green}You can now copy the keystore file into Subsonic's main folder.${reset}\n"
echo "${green}Usual path is: /var/subsonic${reset}"
echo "\n${red}Make sure that subsonic.sh contains the following lines:${reset}\n"
echo "\n${red}Usual Path to config file: /usr/bin/subsonic${reset}\n"
echo "-Dsubsonic.ssl.keystore=subsonic_cert.keystore \ "
echo "-Dsubsonic.ssl.password=yourpassword \ "
3. If you haven't done so far, add the following strings to /usr/bin/subsonic. Scroll down till the end.
-Dsubsonic.ssl.keystore=/var/subsonic/subsonic_cert.keystore \
-Dsubsonic.ssl.password=subsonic \
The specific part should look like this:
- Code: Select all
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
-Dsubsonic.home=${SUBSONIC_HOME} \
-Dsubsonic.host=${SUBSONIC_HOST} \
-Dsubsonic.port=${SUBSONIC_PORT} \
-Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
-Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
-Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
-Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
-Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
-Dsubsonic.ssl.keystore=/var/subsonic/subsonic_cert.keystore \
-Dsubsonic.ssl.password=subsonic \
-Djava.awt.headless=true \
-verbose:gc \
-jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &
4. If you haven't done so, move subsonic_cert.keystore to /var/subsonic/
5. In case you are running subsonic as another user as root, you must change ownership of subsonic_cert.keystore. Adjust the path accordingly.
- Code: Select all
chown user:user /var/subsonic/subsonic_cert.keystore
6. Edit /etc/default/subsonic and adjust the ports accordingly to your preferences. Mine looks like this:
- Code: Select all
SUBSONIC_ARGS="--max-memory=150 --https-port=4030 --port=0"
7. Restart Subsonic Service.
- Code: Select all
service subsonic restart
Hope that helps, enjoy !
BIG Thank You to everybody involved in this project !