aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-12-30 01:02:30 -0200
committerSilvio Rhatto <rhatto@riseup.net>2018-12-30 01:02:30 -0200
commit67a994fa220f080aaa916ebc9b989e889b9d53b3 (patch)
treef97111d2850c658c8fcdca36c293de51420a6b91 /files
parent05e65a9eb890b72ab0c373915fcacab1b7c574ba (diff)
downloadpuppet-airsonic-67a994fa220f080aaa916ebc9b989e889b9d53b3.tar.gz
puppet-airsonic-67a994fa220f080aaa916ebc9b989e889b9d53b3.tar.bz2
Working setup
Diffstat (limited to 'files')
-rwxr-xr-xfiles/airsonic-download19
-rw-r--r--files/airsonic.conf31
-rw-r--r--files/airsonic.service23
3 files changed, 73 insertions, 0 deletions
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