Skip to content

Commit

Permalink
Merge pull request #28 from jcorporation/devel
Browse files Browse the repository at this point in the history
Merge devel into master
  • Loading branch information
jcorporation authored Aug 9, 2018
2 parents dfe7e31 + e46c0b2 commit 51e54e7
Show file tree
Hide file tree
Showing 19 changed files with 765 additions and 391 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.6)
project (mympd C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
set(CPACK_PACKAGE_VERSION_MAJOR "3")
set(CPACK_PACKAGE_VERSION_MINOR "4")
set(CPACK_PACKAGE_VERSION_MINOR "5")
set(CPACK_PACKAGE_VERSION_PATCH "0")

if(CMAKE_BUILD_TYPE MATCHES RELEASE)
Expand Down Expand Up @@ -34,6 +34,7 @@ set(SOURCES
src/mpd_client.c
dist/src/mongoose/mongoose.c
dist/src/frozen/frozen.c
dist/src/inih/ini.c
)

add_executable(mympd ${SOURCES})
Expand All @@ -52,4 +53,4 @@ install(FILES dist/htdocs/css/bootstrap.min.css DESTINATION share/${PROJECT_NAME
install(FILES dist/htdocs/css/mpd.min.css DESTINATION share/${PROJECT_NAME}/htdocs/css/)
install(DIRECTORY htdocs/assets DESTINATION share/${PROJECT_NAME}/htdocs)
install(DIRECTORY DESTINATION /var/lib/${PROJECT_NAME}/)
install(FILES contrib/options DESTINATION /etc/${PROJECT_NAME}/)
install(FILES contrib/mympd.conf DESTINATION /etc/${PROJECT_NAME}/)
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Backend
-------
- Mongoose: https://github.com/cesanta/mongoose
- Frozen: https://github.com/cesanta/frozen
- inih: https://github.com/benhoyt/inih

Dependencies
------------
Expand All @@ -68,29 +69,14 @@ Unix Build Instructions
Run Flags
---------
```
Usage: ./mympd [OPTION]...
-h, --mpdhost <host> connect to mpd at host [localhost]
-p, --mpdport <port> connect to mpd at port [6600]
-m, --mpdpass <password> specifies the password to use when connecting to mpd
-w, --webport <port> listen port for webserver [80]
-S, --ssl enable ssl
-W, --sslport <port> listen port for ssl webserver [443]
-C, --sslcert <filename> filename for ssl certificate [/etc/mympd/ssl/server.pem]
-K, --sslkey <filename> filename for ssl key [/etc/mympd/ssl/server.key]
-s, --streamport <port> connect to mpd http stream at port [8000]
-u, --user <username> drop priviliges to user after socket bind
-i, --coverimage <filename> filename for coverimage [folder.jpg]
-t, --statefile <filename> filename for mympd state [/var/lib/mympd/mympd.state]
-v, --version get version
--help this help
Usage: ./mympd /etc/mypd/mympd.conf
```

SSL
---

1. Create ca and certificate ```/path/to/src/contrib/crcert.sh``` (mkrelease.sh do this for you).
2. Start myMPD with ```-S``` (use default certificate under ```/etc/mympd/ssl/```).
1. Create ca and certificate ```/path/to/src/contrib/crcert.sh``` (mkrelease.sh does this for you).
2. Set ```ssl=true``` in /etc/mympd/mympd.conf (use default certificate under ```/etc/mympd/ssl/```).
3. Import ```/etc/mympd/ssl/ca/ca.pem``` in your browser to trust the certificate.
4. myMPD redirects http requests to https, ensure that myMPD hostname is resolvable.

Expand Down
49 changes: 3 additions & 46 deletions contrib/mympd.1
Original file line number Diff line number Diff line change
@@ -1,61 +1,18 @@
.\" Manpage for myMPD.
.\" Contact [email protected] to correct errors or typos.
.TH man 1 "24 May 2018" "1.0.0" "myMPD man page"
.TH man 1 "06 Aug 2018" "3.5.0" "myMPD man page"
.SH NAME
myMPD \- Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
.SH SYNOPSIS
mympd [OPTION]...
mympd /path/to/mympd.conf
.SH DESCRIPTION
myMPD is a lightweight MPD web client that runs without a dedicated webserver or interpreter.
It's tuned for minimal resource usage and requires only very litte dependencies.
myMPD is a fork of ympd.

.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-mpdhost HOST\fR
connect to mpd at host, defaults to localhost
.TP
\fB\-p\fR, \fB\-\-mpdport PORT\fR
connect to mpd at port, defaults to 6600
.TP
\fB\-m\fR, \fB\-\-mpdpass PASSWORD\fR
specifies the password to use when connecting to mpd
.TP
\fB\-w\fR, \fB\-\-webport PORT\fR
listen interface/port for webserver [80]
.TP
\fB\-S\fR, \fB\-\-ssl\fR
enable ssl
.TP
\fB\-W\fR, \fB\-\-sslport PORT\fR
listen interface/port for ssl webserver [443]
.TP
\fB\-C\fR, \fB\-\-sslcert FILENAME\fR
filename for ssl certificate [/etc/mympd/ssl/server.pem]
.TP
\fB\-K\fR, \fB\-\-sslkey FILENAME\fR
filename for ssl key [/etc/mympd/ssl/server.key]
.TP
\fB-s\fR, \fB\-\-streamport PORT
connect to mpd http stream at port [8000]
.TP
\fB\-u\fR, \fB\-\-user USERNAME\fR
drop privileges to the provided username after socket binding
.TP
\fB-i\fR, \fB\-\-coverimage FILENAME\fR
filename for coverimage [folder.jpg]
.TP
\fB-t\fR, \fB\-\-statefile FILENAME\fR
filename for mympd state [/var/lib/mympd/mympd.state]
.TP
\fB\-v\fR, \fB\-\-version\fR
print version and exit
.TP
\fB\-\-help\fR
print all valid options and exits
.SH BUGS
No known bugs.
.SH AUTHOR
Juergen Mang ([email protected])

https://github.com/jcorporation/ympd
https://github.com/jcorporation/mympd
27 changes: 27 additions & 0 deletions contrib/mympd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#myMPD config file

#Connection to mpd
mpdhost = 127.0.0.1
mpdport = 6600
#mpdpass =

#Webserver options
webport = 80

#Enable ssl
ssl = true
sslport = 443
sslcert = /etc/mympd/ssl/server.pem
sslkey = /etc/mympd/ssl/server.key

#myMPD user
user = nobody

#Port for mpd http stream
streamport = 8000

#Name for coverimages
coverimage = folder.jpg

#myMPD statefile
statefile = /var/lib/mympd/mympd.state
3 changes: 1 addition & 2 deletions contrib/mympd.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ Description=myMPD server daemon
Requires=network.target local-fs.target mpd.service

[Service]
EnvironmentFile=/etc/mympd/options
ExecStart=/usr/bin/mympd --user $MYMPD_USER --webport $WEB_PORT --mpdhost $MPD_HOST --mpdport $MPD_PORT $MPD_PASSWORD --coverimage $COVERIMAGE --statefile $STATEFILE $SSL
ExecStart=/usr/bin/mympd /etc/mympd/mympd.conf
Type=simple

[Install]
Expand Down
9 changes: 0 additions & 9 deletions contrib/options

This file was deleted.

2 changes: 1 addition & 1 deletion dist/htdocs/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 51e54e7

Please sign in to comment.