1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-11-23 05:17:18 +00:00

Merge pull request #97 from SuperBFG7/ssl

Compile mongoose with SSL support
This commit is contained in:
Andy 2016-02-13 21:24:44 +01:00
commit 868f0f622a
2 changed files with 21 additions and 1 deletions

View File

@ -14,6 +14,7 @@ endif()
option(WITH_MPD_HOST_CHANGE "Let users of the web frontend change the MPD Host" ON) option(WITH_MPD_HOST_CHANGE "Let users of the web frontend change the MPD Host" ON)
option(WITH_DYNAMIC_ASSETS "Serve assets dynamically (e.g for development/packaging)" OFF) option(WITH_DYNAMIC_ASSETS "Serve assets dynamically (e.g for development/packaging)" OFF)
option(WITH_IPV6 "enable IPv6 support" ON) option(WITH_IPV6 "enable IPv6 support" ON)
option(WITH_SSL "enable SSL support" ON)
find_package(LibMPDClient REQUIRED) find_package(LibMPDClient REQUIRED)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
@ -28,6 +29,12 @@ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
if(WITH_IPV6) if(WITH_IPV6)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
endif() endif()
if(WITH_SSL)
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
# list(APPEND LIB_LIST ${OPENSSL_LIBRARIES})
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_SSL)
endif()
file(GLOB RESOURCES file(GLOB RESOURCES
RELATIVE ${PROJECT_SOURCE_DIR} RELATIVE ${PROJECT_SOURCE_DIR}
@ -63,7 +70,7 @@ if(NOT WITH_DYNAMIC_ASSETS)
endif() endif()
add_executable(ympd ${SOURCES}) add_executable(ympd ${SOURCES})
target_link_libraries(ympd ${LIBMPDCLIENT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(ympd ${LIBMPDCLIENT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
install(TARGETS ympd DESTINATION bin) install(TARGETS ympd DESTINATION bin)
install(FILES ympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1) install(FILES ympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)

View File

@ -36,6 +36,19 @@ Usage: ./ympd [OPTION]...
--help this help --help this help
``` ```
SSL Support
-----------
To run ympd with SSL support:
- create a certificate (key and cert in the same file), example:
```
# openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 1000 -nodes
# cat key.pem cert.pem > ssl.pem
```
- tell ympd to use a webport using SSL and where to find the certificate:
```
# ./ympd -w "ssl://8081:/path/to/ssl.pem"
```
Copyright Copyright
--------- ---------