diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 0ab9b197..095c4976 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -94,5 +94,6 @@ target_link_libraries(snapserver ${SERVER_LIBRARIES}) install(TARGETS snapserver COMPONENT server DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES snapserver.1 COMPONENT server DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) install(FILES etc/snapserver.conf COMPONENT server DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) +install(FILES etc/index.html COMPONENT server DESTINATION ${CMAKE_INSTALL_DATADIR}/snapserver) install(DIRECTORY etc/snapweb/ DESTINATION ${CMAKE_INSTALL_DATADIR}/snapserver/snapweb) #install(FILES ../debian/snapserver.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR}) diff --git a/server/Makefile b/server/Makefile index 114f72d7..0eb16873 100644 --- a/server/Makefile +++ b/server/Makefile @@ -125,6 +125,7 @@ install: install -g wheel -o root -m 555 $(BIN).1 $(TARGET_DIR)/local/man/man1/$(BIN).1 install -g wheel -o root -m 555 etc/$(BIN).bsd $(TARGET_DIR)/local/etc/rc.d/$(BIN) install -g wheel -o root etc/$(BIN).conf /etc/$(BIN).conf + install -g wheel -o root -m 644 etc/index.html -Dt /usr/share/snapserver/ for file in etc/snapweb/*\.*; do install -g wheel -o root -m 644 $${file} -Dt "/usr/share/snapserver/snapweb/"; done for file in etc/snapweb/3rd-party/*\.*; do install -g wheel -o root -m 644 $${file} -Dt "/usr/share/snapserver/snapweb/3rd-party/"; done @@ -136,6 +137,7 @@ install: install -g wheel -o root $(BIN).1 $(TARGET_DIR)/local/share/man/man1/$(BIN).1 install -g wheel -o root etc/$(BIN).plist /Library/LaunchAgents/de.badaix.snapcast.$(BIN).plist install -g wheel -o root etc/$(BIN).conf /etc/$(BIN).conf + install -g wheel -o root -m 644 etc/index.html -Dt /usr/share/snapserver/ for file in etc/snapweb/*\.*; do install -g wheel -o root -m 644 $${file} -Dt "/usr/share/snapserver/snapweb/"; done for file in etc/snapweb/3rd-party/*\.*; do install -g wheel -o root -m 644 $${file} -Dt "/usr/share/snapserver/snapweb/3rd-party/"; done launchctl load /Library/LaunchAgents/de.badaix.snapcast.$(BIN).plist @@ -163,6 +165,7 @@ installfiles: install -s -D -g root -o root $(BIN) $(TARGET_DIR)/bin/$(BIN) install -D -g root -o root $(BIN).1 $(TARGET_DIR)/share/man/man1/$(BIN).1 install -g root -o root etc/$(BIN).conf /etc/$(BIN).conf; + install -g root -o root -m 644 etc/index.html -Dt /usr/share/snapserver/ for file in etc/snapweb/*\.*; do install -g root -o root -m 644 $${file} -Dt "/usr/share/snapserver/snapweb/"; done for file in etc/snapweb/3rd-party/*\.*; do install -g root -o root -m 644 $${file} -Dt "/usr/share/snapserver/snapweb/3rd-party/"; done diff --git a/server/control_session_http.cpp b/server/control_session_http.cpp index 852c78d4..2b4da4da 100644 --- a/server/control_session_http.cpp +++ b/server/control_session_http.cpp @@ -155,6 +155,17 @@ void ControlSessionHttp::handle_request(http::request
res{http::status::ok, req.version()}; + res.set(http::field::server, HTTP_SERVER_NAME); + res.set(http::field::content_type, "text/html"); + res.keep_alive(req.keep_alive()); + res.body() = "