From 67a994fa220f080aaa916ebc9b989e889b9d53b3 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 30 Dec 2018 01:02:30 -0200 Subject: Working setup --- files/airsonic-download | 19 +++++++++++++++++++ files/airsonic.conf | 31 +++++++++++++++++++++++++++++++ files/airsonic.service | 23 +++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100755 files/airsonic-download create mode 100644 files/airsonic.conf create mode 100644 files/airsonic.service (limited to 'files') diff --git a/files/airsonic-download b/files/airsonic-download new file mode 100755 index 0000000..4cce24a --- /dev/null +++ b/files/airsonic-download @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Download and check airsonic. +# + +# Parameters +DEST="/var/lib/airsonic/airsonic.war" +HASH="738c0614a113f692d75f62d9a74efab1580e3ba8c683feb8d6bfded80240f342" + +# Download +/usr/bin/wget https://github.com/airsonic/airsonic/releases/download/v10.1.2/airsonic.war --output-document=$DEST || exit 1 + +# Check integrity +if [ "`sha256sum $DEST`" != "$HASH $DEST"]; then + rm -f $DEST + exit 1 +else + chown airsonic:airsonic $DEST +fi diff --git a/files/airsonic.conf b/files/airsonic.conf new file mode 100644 index 0000000..5836f2f --- /dev/null +++ b/files/airsonic.conf @@ -0,0 +1,31 @@ +# Set the location of the standalone war to use +JAVA_JAR=/var/lib/airsonic/airsonic.war + +# Set any java opts separated by spaces +#JAVA_OPTS=-Xmx700m + +# Set a different location for airsonic home. +# If this path is /var/libresonic or even contains "libresonic", +# the data from a previous libresonic can be used as is (i.e. without +# renaming libresonic.properties,db/libresonic*,etc +AIRSONIC_HOME=/var/lib/airsonic + +# Change the port to listen on +PORT=8200 + +# Change the path that is listened on +#CONTEXT_PATH=/airsonic + +# Add any java args. These are different than JAVA_OPTS in that +# they are passed directly to the program. The default is empty: +#JAVA_ARGS= + +# Note that there are several settings for spring boot, not explicitly listed +# here, but can be used in either JAVA_OPTS or JAVA_ARGS. The full list +# can be found here: +# https://docs.spring.io/spring-boot/docs/1.4.5.RELEASE/reference/htmlsingle/#common-application-properties +# For example to set debug across the board: +#JAVA_ARGS=--debug + +# Or to change the ip address that is listened on: +#JAVA_ARGS=--server.address=127.0.0.1 diff --git a/files/airsonic.service b/files/airsonic.service new file mode 100644 index 0000000..b3f16ff --- /dev/null +++ b/files/airsonic.service @@ -0,0 +1,23 @@ +[Unit] +Description=Airsonic Media Server +After=remote-fs.target network.target +AssertPathExists=/var/lib/airsonic + +[Service] +Type=simple +Environment="JAVA_JAR=/var/lib/airsonic/airsonic.war" +Environment="JAVA_OPTS=-Xmx700m" +Environment="AIRSONIC_HOME=/var/lib/airsonic" +Environment="PORT=8200" +Environment="JAVA_ARGS=" +EnvironmentFile=-/etc/sysconfig/airsonic +ExecStart=/usr/bin/java \ + $JAVA_OPTS \ + -Dairsonic.home=${AIRSONIC_HOME} \ + -Dserver.port=${PORT} \ + -jar ${JAVA_JAR} $JAVA_ARGS +User=airsonic +Group=airsonic + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3