From 1035264d66d6e266a7b19dcbf18f95b8aa927aca Mon Sep 17 00:00:00 2001 From: Jason Pleau Date: Fri, 1 May 2015 17:05:34 -0400 Subject: [PATCH 1/3] manpage: set section to 1 and update version --- ympd.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ympd.1 b/ympd.1 index a240afb..d94ed30 100644 --- a/ympd.1 +++ b/ympd.1 @@ -1,6 +1,6 @@ .\" Manpage for ympd. .\" Contact andy@ympd.org to correct errors or typos. -.TH man 8 "18 Mar 2014" "1.2" "ympd man page" +.TH man 1 "19 Oct 2014" "1.2.3" "ympd man page" .SH NAME ympd \- Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS .SH SYNOPSIS From 3ef53f3cc20c031c39dc015c937ab07a567e1f0b Mon Sep 17 00:00:00 2001 From: Jason Pleau Date: Fri, 1 May 2015 17:06:54 -0400 Subject: [PATCH 2/3] webpage: remove respond.js Calling outside resources is a breach of privacy, and prevents the page from loading correctly if offline. --- htdocs/index.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/index.html b/htdocs/index.html index 33f0bc9..3ba6a7e 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -16,12 +16,6 @@ - - - From 5abfdfda7b2c9fac25dd2db7115a3796a15c8eb9 Mon Sep 17 00:00:00 2001 From: Jason Pleau Date: Fri, 1 May 2015 17:11:15 -0400 Subject: [PATCH 3/3] update init script and systemd service file init script: depend on $remote_fs instead of $local_fs. Reason: /usr can be mounted a remote filesystem. Also depend on mpd (instead of $mpd, which doesn't seem to exist.. at least on my system) Also provide a default config (which should be installed as /etc/default/ympd) This commit makes the systemd unit file as well as the init script load values from this configuration file so the user can change ympd settings easily when running it as a service. --- contrib/init.debian | 13 +++++++++---- contrib/ympd.default | 4 ++++ contrib/ympd.service | 5 +++-- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 contrib/ympd.default diff --git a/contrib/init.debian b/contrib/init.debian index 517c25f..5fac553 100755 --- a/contrib/init.debian +++ b/contrib/init.debian @@ -1,8 +1,8 @@ #!/bin/sh ### BEGIN INIT INFO # Provides: ympd -# Required-Start: $local_fs $mpd -# Required-Stop: $local_fs $mpd +# Required-Start: $remote_fs mpd +# Required-Stop: $remote_fs mpd # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Daemonized version of ympd. @@ -20,8 +20,11 @@ PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME LOG_OUT=/var/log/$NAME.out LOG_ERR=/var/log/$NAME.err -YMPD_USER=mpd -DAEMON_OPT="--user $YMPD_USER --webport 8080" +YMPD_USER=nobody +MPD_HOST=localhost +MPD_PORT=6600 +WEB_PORT=8080 + # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -32,6 +35,8 @@ DAEMON_OPT="--user $YMPD_USER --webport 8080" # Load the VERBOSE setting and other rcS variables [ -f /etc/default/rcS ] && . /etc/default/rcS +DAEMON_OPT="--user $YMPD_USER --webport $MPD_WEBHOST --host $MPD_HOST --port $MPD_PORT" + do_start() { start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \ diff --git a/contrib/ympd.default b/contrib/ympd.default new file mode 100644 index 0000000..c7bbcda --- /dev/null +++ b/contrib/ympd.default @@ -0,0 +1,4 @@ +MPD_HOST=localhost +MPD_PORT=6600 +WEB_PORT=8080 +YMPD_USER=nobody diff --git a/contrib/ympd.service b/contrib/ympd.service index 5d44c17..b39f0c9 100644 --- a/contrib/ympd.service +++ b/contrib/ympd.service @@ -6,8 +6,9 @@ Requires=network.target local-fs.target Environment=MPD_HOST=localhost Environment=MPD_PORT=6600 Environment=WEB_PORT=8080 -EnvironmentFile=-/etc/conf.d/ympd -ExecStart=/usr/bin/ympd -h $MPD_HOST -p $MPD_PORT -w $WEB_PORT +Environment=YMPD_USER=nobody +EnvironmentFile=/etc/default/ympd +ExecStart=/usr/bin/ympd --user $YMPD_USER --webport $MPD_WEBHOST --host $MPD_HOST --port $MPD_PORT Type=simple [Install]