diff --git a/.travis.yml b/.travis.yml index aab29ee..4b2afb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: c sudo: required -dist: precise +dist: trusty compiler: - gcc diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d0e1a0..4e1d183 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) -project (ympd) +project (ympd C) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/") set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MINOR "2") @@ -24,8 +24,8 @@ include_directories(${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR} ${LIBMPDCLIENT_I include(CheckCSourceCompiles) -set(CMAKE_C_FLAGS "-std=gnu99 -Wall") -set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -pedantic") if(WITH_IPV6) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6) endif() diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c89b804 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM alpine:3.5 +WORKDIR /app/build +COPY . /app +RUN apk add --no-cache g++ make cmake libmpdclient-dev openssl-dev +RUN cmake .. +RUN make + +FROM alpine:3.5 +RUN apk add --no-cache libmpdclient openssl +EXPOSE 8080 +COPY --from=0 /app/build/ympd /usr/bin/ympd +COPY --from=0 /app/build/mkdata /usr/bin/mkdata +CMD ympd \ No newline at end of file diff --git a/README.md b/README.md index af3a310..4bf91f2 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,12 @@ Dependencies ------------ - libmpdclient 2: http://www.musicpd.org/libs/libmpdclient/ - cmake 2.6: http://cmake.org/ + - OpenSSL: https://www.openssl.org/ Unix Build Instructions ----------------------- -1. install dependencies, cmake and libmpdclient are available from all major distributions. +1. install dependencies. cmake, libmpdclient (dev), and OpenSSL (dev) are available from all major distributions. 2. create build directory ```cd /path/to/src; mkdir build; cd build``` 3. create makefile ```cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr``` 4. build ```make``` @@ -28,14 +29,15 @@ Run flags ``` Usage: ./ympd [OPTION]... - -d, --digest path to htdigest file for authorization - (realm ympd) [no authorization] - -h, --host connect to mpd at host [localhost] - -p, --port connect to mpd at port [6600] - -w, --webport [ip:] listen interface/port for webserver [8080] - -u, --user drop priviliges to user after socket bind - -V, --version get version - --help this help + -D, --digest path to htdigest file for authorization + (realm ympd) [no authorization] + -h, --host connect to mpd at host [localhost] + -p, --port connect to mpd at port [6600] + -w, --webport [ip:] listen interface/port for webserver [8080] + -d, --dirbletoken Dirble API token + -u, --user drop priviliges to user after socket bind + -V, --version get version + --help this help ``` SSL Support diff --git a/contrib/init.debian b/contrib/init.debian index e1c6fab..6b328f0 100755 --- a/contrib/init.debian +++ b/contrib/init.debian @@ -24,7 +24,9 @@ YMPD_USER=nobody MPD_HOST=localhost MPD_PORT=6600 WEB_PORT=8080 +DIRBLE_API_TOKEN=2e223c9909593b94fc6577361a #DIGEST=--digest /path/to/htdigest +#LOCALPORT=8080 # Exit if the package is not installed @@ -36,7 +38,7 @@ WEB_PORT=8080 # Load the VERBOSE setting and other rcS variables [ -f /etc/default/rcS ] && . /etc/default/rcS -DAEMON_OPT="--user $YMPD_USER --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT $DIGEST" +DAEMON_OPT="--user $YMPD_USER --mpdpass '$MPD_PASSWORD' --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT --dirbletoken $DIRBLE_API_TOKEN $DIGEST $LOCALPORT" do_start() { diff --git a/contrib/ympd.default b/contrib/ympd.default index 184b2ed..f0cd0f5 100644 --- a/contrib/ympd.default +++ b/contrib/ympd.default @@ -1,5 +1,8 @@ MPD_HOST=localhost MPD_PORT=6600 +MPD_PASSWORD= WEB_PORT=8080 YMPD_USER=nobody +DIRBLE_API_TOKEN=2e223c9909593b94fc6577361a #DIGEST=--digest /path/to/htdigest +#LOCALPORT=--localport 8080 diff --git a/contrib/ympd.freebsd b/contrib/ympd.freebsd new file mode 100755 index 0000000..532a90c --- /dev/null +++ b/contrib/ympd.freebsd @@ -0,0 +1,28 @@ +#!/bin/sh + +# PROVIDE: ympd +# REQUIRE: DAEMON musicpd +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable ympd: +# +# ympd_enable="YES" + +. /etc/rc.subr + +name="ympd" +rcvar="${name}_enable" +command="/usr/local/bin/${name}" +pidfile="/var/run/${name}.pid" +start_cmd="ympd_start" + +load_rc_config "${name}" +: ${ympd_enable:="NO"} + +ympd_start() +{ + check_startmsgs && echo "Starting ${name}." + /usr/sbin/daemon -f -p "${pidfile}" "${command}" "${rc_flags}" +} + +run_rc_command "$1" diff --git a/contrib/ympd.service b/contrib/ympd.service index 4969337..43a9e1a 100644 --- a/contrib/ympd.service +++ b/contrib/ympd.service @@ -5,11 +5,14 @@ Requires=network.target local-fs.target [Service] Environment=MPD_HOST=localhost Environment=MPD_PORT=6600 +Environment=MPD_PASSWORD= Environment=WEB_PORT=8080 Environment=YMPD_USER=nobody +Environment=DIRBLE_API_TOKEN=2e223c9909593b94fc6577361a Environment=DIGEST= +Environment=LOCALPORT= EnvironmentFile=/etc/default/ympd -ExecStart=/usr/bin/ympd --user $YMPD_USER --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT $DIGEST +ExecStart=/usr/bin/ympd --user $YMPD_USER --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT --dirbletoken $DIRBLE_API_TOKEN $DIGEST $LOCALPORT Type=simple [Install] diff --git a/htdocs/css/mpd.css b/htdocs/css/mpd.css index 85401cb..a5c6acc 100644 --- a/htdocs/css/mpd.css +++ b/htdocs/css/mpd.css @@ -27,11 +27,22 @@ button { margin-top: 2px; } +#breadcrump { + display: block; + + overflow: auto; + white-space: nowrap; +} + +#breadcrump > li > a{ + cursor: pointer; +} + #counter { - font-size: 24px; - margin-top: -6px; - margin-left: 10px; - min-width: 50px; + font-size: 24px; + margin-top: -6px; + margin-left: 10px; + min-width: 50px; } #search { @@ -39,7 +50,7 @@ button { } .btn-group-hover { - opacity: 20%; + opacity: 20%; } .btn:active, @@ -61,8 +72,50 @@ button { } } -#salamisandwich td:nth-child(3), th:nth-child(3) { +h1 { + display: block; + + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +td:nth-child(4), th:nth-child(4) { + /* This *has* to be placed before + any t[dh]:nth-last-child(2) for + the override to work. */ + min-width: 50%; +} + +td:nth-last-child(2), th:nth-last-child(2) { text-align: right; + width: 4em; +} + +#salamisandwich td:nth-child(4) span { + font-size: 90%; + + display: block; +} + +td:nth-child(2), td:nth-child(3) { + min-width: 25%; + max-width: 10em; + + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +@media only screen and (max-width: 600px) { + td:nth-child(2), td:nth-child(3) { + min-width: 0; + max-width: 0; + } + td:nth-child(4), th:nth-child(4) { + min-width: 10%; + white-space: normal; + } } tbody { @@ -78,7 +131,7 @@ td:last-child, td:first-child { z-index: 9999; } -/* Positioning */ +/* Positioning */ .notifications.top-right { right: 10px; top: 60px; @@ -94,3 +147,17 @@ td:last-child, td:first-child { button { overflow: hidden; } + +#trashmode span:last-child { + display:inline-block; + text-align:left; + width:2.8em; +} + +#filter > a.active { + font-weight: bold; + pointer-events: none; + cursor: default; + text-decoration: none; + color: black; +} diff --git a/htdocs/index.html b/htdocs/index.html index 45a1165..c9437b5 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -95,18 +95,19 @@
- +
-
Queue
+
Queue +

- - + +

  

@@ -118,7 +119,7 @@ -
+
@@ -128,10 +129,10 @@ # - Title - Album Artist - Duration + Album + Title + Length @@ -168,7 +169,7 @@
-
+
- Save queue + Save Queue
-
- -
@@ -242,6 +238,19 @@
Mongoose GPLv2
libMPDClient BSD License

+
+
+ +
+
+ +
+
+
@@ -260,7 +269,7 @@
-
@@ -305,7 +314,7 @@ - +