Refactor assets and config directory

This commit is contained in:
ReenigneArcher 2022-05-11 21:31:31 -04:00
parent ca00949851
commit 68ba1db24a
69 changed files with 89 additions and 74 deletions

View File

@ -130,7 +130,7 @@ jobs:
mkdir -p build mkdir -p build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR=. -DSUNSHINE_DEFAULT_DIR=/etc/sunshine -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON "../" cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/.assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON ..
make -j ${nproc} make -j ${nproc}
- name: Set AppImage Version - name: Set AppImage Version
@ -228,7 +228,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_DEFAULT_DIR=/etc/sunshine .. cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/.assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config ..
make -j ${nproc} make -j ${nproc}
- name: Package MacOS - name: Package MacOS
@ -297,7 +297,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -DSUNSHINE_CONFIG_DIR=config -G "MinGW Makefiles" ..
mingw32-make -j2 mingw32-make -j2
- name: Package Windows - name: Package Windows

16
.gitignore vendored
View File

@ -10,14 +10,14 @@ cmake-build*
.idea .idea
# Extra FontAwesome files # Extra FontAwesome files
/assets/web/fonts/fontawesome-free-web/css/*.css /src_assets/common/assets/web/fonts/fontawesome-free-web/css/*.css
!/assets/web/fonts/fontawesome-free-web/css/*min.css !/src_assets/common/assets/web/fonts/fontawesome-free-web/css/*min.css
/assets/web/fonts/fontawesome-free-web/js/ /src_assets/common/assets/web/fonts/fontawesome-free-web/js/
/assets/web/fonts/fontawesome-free-web/less/ /src_assets/common/assets/web/fonts/fontawesome-free-web/less/
/assets/web/fonts/fontawesome-free-web/metadata/ /src_assets/common/assets/web/fonts/fontawesome-free-web/metadata/
/assets/web/fonts/fontawesome-free-web/scss/ /src_assets/common/assets/web/fonts/fontawesome-free-web/scss/
/assets/web/fonts/fontawesome-free-web/sprites/ /src_assets/common/assets/web/fonts/fontawesome-free-web/sprites/
/assets/web/fonts/fontawesome-free-web/svgs/ /src_assets/common/assets/web/fonts/fontawesome-free-web/svgs/
# Translations # Translations
*.mo *.mo

View File

@ -6,6 +6,7 @@ project(Sunshine VERSION 0.13.0
) )
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(SUNSHINE_SOURCE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src_assets")
if(WIN32) if(WIN32)
# Ugly hack to compile with #include <qos2.h> # Ugly hack to compile with #include <qos2.h>
@ -147,6 +148,8 @@ elseif(APPLE)
set(PLATFORM_INCLUDE_DIRS set(PLATFORM_INCLUDE_DIRS
${Boost_INCLUDE_DIR}) ${Boost_INCLUDE_DIR})
set(APPLE_PLIST_FILE ${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/Info.plist)
set(PLATFORM_TARGET_FILES set(PLATFORM_TARGET_FILES
sunshine/platform/macos/av_audio.h sunshine/platform/macos/av_audio.h
sunshine/platform/macos/av_audio.m sunshine/platform/macos/av_audio.m
@ -163,7 +166,7 @@ elseif(APPLE)
sunshine/platform/macos/publish.cpp sunshine/platform/macos/publish.cpp
sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.c sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.c
sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.h sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.h
${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mac/Info.plist) ${APPLE_PLIST_FILE})
else() else()
add_compile_definitions(SUNSHINE_PLATFORM="linux") add_compile_definitions(SUNSHINE_PLATFORM="linux")
@ -390,15 +393,11 @@ else()
endif() endif()
if(NOT SUNSHINE_ASSETS_DIR) if(NOT SUNSHINE_ASSETS_DIR)
set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assets") set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_BINARY_DIR}/.assets")
endif() endif()
if(NOT SUNSHINE_CONFIG_DIR) if(NOT SUNSHINE_CONFIG_DIR)
set(SUNSHINE_CONFIG_DIR "${SUNSHINE_ASSETS_DIR}") set(SUNSHINE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/config")
endif()
if(NOT SUNSHINE_DEFAULT_DIR)
set(SUNSHINE_DEFAULT_DIR "${SUNSHINE_ASSETS_DIR}")
endif() endif()
list(APPEND CBS_EXTERNAL_LIBRARIES list(APPEND CBS_EXTERNAL_LIBRARIES
@ -421,8 +420,6 @@ endif()
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR}") list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR}")
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_CONFIG_DIR="${SUNSHINE_CONFIG_DIR}") list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_CONFIG_DIR="${SUNSHINE_CONFIG_DIR}")
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_DEFAULT_DIR="${SUNSHINE_DEFAULT_DIR}")
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps.json")
add_executable(sunshine ${SUNSHINE_TARGET_FILES}) add_executable(sunshine ${SUNSHINE_TARGET_FILES})
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS}) target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS}) target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
@ -437,7 +434,7 @@ if(NOT DEFINED CMAKE_CUDA_STANDARD)
endif() endif()
if(APPLE) if(APPLE)
target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mac/Info.plist) target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${APPLE_PLIST_FILE})
endif() endif()
foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS) foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS)
@ -472,8 +469,11 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h
install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio) install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio)
install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc) install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc)
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_windows/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT config)
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT config)
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp # set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
@ -509,10 +509,16 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h
# assets # assets
set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Assets") set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Assets")
set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Assets include the apps and configurations, shaders, default box art, and web ui.") set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web ui.")
set(CPACK_COMPONENT_ASSETS_GROUP "${CMAKE_PROJECT_NAME}") set(CPACK_COMPONENT_ASSETS_GROUP "${CMAKE_PROJECT_NAME}")
set(CPACK_COMPONENT_ASSETS_REQUIRED true) set(CPACK_COMPONENT_ASSETS_REQUIRED true)
# config
set(CPACK_COMPONENT_CONFIG_DISPLAY_NAME "Config")
set(CPACK_COMPONENT_CONFIG_DESCRIPTION "Default config and apps.json files.")
set(CPACK_COMPONENT_CONFIG_GROUP "${CMAKE_PROJECT_NAME}")
set(CPACK_COMPONENT_CONFIG_REQUIRED true)
# audio tool # audio tool
set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info.exe") set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info.exe")
set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool that allows you to get information about sound devices.") set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool that allows you to get information about sound devices.")
@ -528,13 +534,23 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h
set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool that allows you to enable/disable the Sunshine service.") set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool that allows you to enable/disable the Sunshine service.")
set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools") set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools")
endif() endif()
if(UNIX)
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
# Installation destination dir
set(CPACK_SET_DESTDIR true)
set(CMAKE_INSTALL_PREFIX "/usr/local/sunshine/")
endif()
if(APPLE) # TODO: test if(APPLE) # TODO: test
set(prefix "${CMAKE_PROJECT_NAME}.app/Contents") set(prefix "${CMAKE_PROJECT_NAME}.app/Contents")
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS") set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${INSTALL_RUNTIME_DIR}") install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_mac/" DESTINATION "${INSTALL_RUNTIME_DIR}")
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
install(TARGETS sunshine install(TARGETS sunshine
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
@ -542,26 +558,27 @@ if(APPLE) # TODO: test
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop # TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets_mac/Info.plist") set(CPACK_BUNDLE_PLIST "${APPLE_PLIST_FILE}")
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
# Portfile # Portfile
configure_file(Portfile.in Portfile @ONLY) configure_file(Portfile.in Portfile @ONLY)
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}") install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_linux/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
install(FILES "${SUNSHINE_ASSETS_DIR}/linux-misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d")
install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user")
# Pre and post install # Pre and post install
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${SUNSHINE_ASSETS_DIR}/linux-deb/preinst;${SUNSHINE_ASSETS_DIR}/linux-deb/postinst;${SUNSHINE_ASSETS_DIR}/linux-deb/conffiles") "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/preinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/postinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/conffiles")
set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst") set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/preinst")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/postinst") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/postinst")
# Dependencies # Dependencies
set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_DEB_COMPONENT_INSTALL ON)
@ -569,10 +586,6 @@ if(UNIX AND NOT APPLE)
set(CPACK_RPM_PACKAGE_REQUIRES "libssl==1.1, libavdevice>=58, libboost-thread>=1.67.0, libboost-filesystem>=1.67.0, libboost-log>=1.67.0, libpulse>=0, libopus>=0, libxcb-shm>=0, libxcb-xfixes>=0, libxtst>=0, libevdev>=2.0, libdrm>=2.0, libcap>=2.0") set(CPACK_RPM_PACKAGE_REQUIRES "libssl==1.1, libavdevice>=58, libboost-thread>=1.67.0, libboost-filesystem>=1.67.0, libboost-log>=1.67.0, libpulse>=0, libopus>=0, libxcb-shm>=0, libxcb-xfixes>=0, libxtst>=0, libevdev>=2.0, libdrm>=2.0, libcap>=2.0")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config
# Installation destination dir
set(CPACK_SET_DESTDIR true)
set(CMAKE_INSTALL_PREFIX "/etc/sunshine")
# AppImage desktop file # AppImage desktop file
configure_file(sunshine.desktop.in sunshine.desktop @ONLY) configure_file(sunshine.desktop.in sunshine.desktop @ONLY)
endif() endif()

View File

@ -31,21 +31,19 @@ depends_lib port:avahi \
boost.version 1.76 boost.version 1.76
configure.args -DBOOST_ROOT=[boost::install_area] \ configure.args -DBOOST_ROOT=[boost::install_area] \
-DSUNSHINE_ASSETS_DIR=${worksrcpath}/assets -DSUNSHINE_ASSETS_DIR=${prefix}/usr/local/sunshine/.assets
-DSUNSHINE_DEFAULT_DIR=${prefix}/etc/sunshine -DSUNSHINE_CONFIG_DIR=${prefix}/usr/local/sunshine/config
cmake.out_of_source yes cmake.out_of_source yes
destroot { destroot {
xinstall -d -m 755 ${destroot}${prefix}/etc/${name} xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/.assets
xinstall ${worksrcpath}/assets/assets_mac/apps.json ${destroot}${prefix}/etc/${name} xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets
xinstall ${worksrcpath}/assets/assets_common/box.png ${destroot}${prefix}/etc/${name} xinstall {*}[glob ${worksrcpath}/src_assets/macos/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets
xinstall ${worksrcpath}/assets/assets_common/sunshine.conf ${destroot}${prefix}/etc/${name}
xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/web xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/config
xinstall {*}[glob ${worksrcpath}/assets/assets_common/web/*.html] ${destroot}${prefix}/etc/${name}/web xinstall {*}[glob ${worksrcpath}/src_assets/common/config/*] ${destroot}${prefix}/usr/local/${name}/config
xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/web/third_party xinstall {*}[glob ${worksrcpath}/src_assets/macos/config/*] ${destroot}${prefix}/usr/local/${name}/config
xinstall {*}[glob ${worksrcpath}/assets/assets_common/web/third_party/*] ${destroot}${prefix}/etc/${name}/web/third_party
xinstall ${workpath}/build/${name} ${destroot}${prefix}/bin xinstall ${workpath}/build/${name} ${destroot}${prefix}/bin
} }

View File

@ -1,2 +0,0 @@
/etc/sunshine/sunshine.conf
/etc/sunshine/apps.json

View File

@ -1,9 +0,0 @@
#!/bin/sh
#Store backup for old config files to prevent it from being overwritten
if [ -f /etc/sunshine/sunshine.conf ]; then
cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old
fi
if [ -f /etc/sunshine/apps.json ]; then
cp /etc/sunshine/apps.json /etc/sunshine/apps.json.old
fi

View File

@ -6,9 +6,12 @@ Sunshine will work with the default settings for most users. In some cases you m
Configuration Configuration
------------- -------------
The default location for the configuration file is ``./assets/sunshine.conf``. You can use another location if you The default location for the configuration file is listed below. You can use another location if you
choose, by passing in the full configuration file path as the first argument when you start Sunshine. choose, by passing in the full configuration file path as the first argument when you start Sunshine.
The default location of the ``apps.json`` is the same as the configuration file. You can use a custom
location by modifying the configuration file.
**Default File Location** **Default File Location**
.. table:: .. table::
@ -17,9 +20,10 @@ choose, by passing in the full configuration file path as the first argument whe
======= =========== ======= ===========
Value Description Value Description
======= =========== ======= ===========
Linux ./assets/sunshine.conf Docker /config/
MacOS /opt/local/etc/sunshine.conf Linux /usr/local/sunshine/config/
Windows ./assets/sunshine.conf MacOS /usr/local/sunshine/config/
Windows ./config/
======= =========== ======= ===========
Example Example

View File

@ -27,7 +27,7 @@ AppImage
.. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/pkg:appimage?logo=github&style=for-the-badge .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/pkg:appimage?logo=github&style=for-the-badge
:alt: GitHub issues by-label :alt: GitHub issues by-label
The current compatibility of the AppImage is shown below. The current known compatibility of the AppImage is shown below.
- [✖] Debian oldstable (buster) - [✖] Debian oldstable (buster)
- [✔] Debian stable (bullseye) - [✔] Debian stable (bullseye)

View File

Before

Width:  |  Height:  |  Size: 998 B

After

Width:  |  Height:  |  Size: 998 B

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,2 @@
/usr/local/sunshine/config/sunshine.conf
/usr/local/sunshine/config/apps.json

View File

@ -12,25 +12,25 @@ else
echo "Warning: /etc/group not found" echo "Warning: /etc/group not found"
fi fi
if [ -f /etc/sunshine/sunshine.conf.old ]; then if [ -f /usr/local/sunshine/config/sunshine.conf.old ]; then
echo "Restoring old sunshine.conf" echo "Restoring old sunshine.conf"
mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf mv /usr/local/sunshine/config/sunshine.conf.old /usr/local/sunshine/config/sunshine.conf
fi fi
if [ -f /etc/sunshine/apps.json.old ]; then if [ -f /usr/local/sunshine/config/apps.json.old ]; then
echo "Restoring old apps.json" echo "Restoring old apps.json"
mv /etc/sunshine/apps.json.old /etc/sunshine/apps.json mv /usr/local/sunshine/config/apps.json.old /usr/local/sunshine/config/apps.json
fi fi
# Update permissions on config files for Web Manager # Update permissions on config files for Web Manager
if [ -f /etc/sunshine/apps.json ]; then if [ -f /usr/local/sunshine/config/apps.json ]; then
echo "chmod 666 /etc/sunshine/apps.json" echo "chmod 666 /etc/sunshine/apps.json"
chmod 666 /etc/sunshine/apps.json chmod 666 /usr/local/sunshine/config/apps.json
fi fi
if [ -f /etc/sunshine/sunshine.conf ]; then if [ -f /usr/local/sunshine/config/sunshine.conf ]; then
echo "chmod 666 /etc/sunshine/sunshine.conf" echo "chmod 666 /etc/sunshine/sunshine.conf"
chmod 666 /etc/sunshine/sunshine.conf chmod 666 /usr/local/sunshine/config/sunshine.conf
fi fi
# Ensure Sunshine can grab images from KMS # Ensure Sunshine can grab images from KMS

View File

@ -0,0 +1,9 @@
#!/bin/sh
#Store backup for old config files to prevent it from being overwritten
if [ -f /usr/local/sunshine/config/sunshine.conf ]; then
cp /usr/local/sunshine/config/sunshine.conf /usr/local/sunshine/config/sunshine.conf.old
fi
if [ -f /usr/local/sunshine/config/apps.json ]; then
cp /usr/local/sunshine/config/apps.json /usr/local/sunshine/config/apps.json.old
fi

View File

@ -20,7 +20,7 @@ using namespace std::literals;
#define PRIVATE_KEY_FILE CA_DIR "/cakey.pem" #define PRIVATE_KEY_FILE CA_DIR "/cakey.pem"
#define CERTIFICATE_FILE CA_DIR "/cacert.pem" #define CERTIFICATE_FILE CA_DIR "/cacert.pem"
#define APPS_JSON_PATH SUNSHINE_CONFIG_DIR "/" APPS_JSON #define APPS_JSON_PATH SUNSHINE_CONFIG_DIR "/apps.json"
namespace config { namespace config {
namespace nv { namespace nv {
@ -695,7 +695,7 @@ int apply_flags(const char *line) {
void apply_config(std::unordered_map<std::string, std::string> &&vars) { void apply_config(std::unordered_map<std::string, std::string> &&vars) {
if(!fs::exists(stream.file_apps.c_str())) { if(!fs::exists(stream.file_apps.c_str())) {
fs::copy_file(SUNSHINE_DEFAULT_DIR "/" APPS_JSON, stream.file_apps); fs::copy_file(SUNSHINE_CONFIG_DIR "/apps.json", stream.file_apps);
} }
for(auto &[name, val] : vars) { for(auto &[name, val] : vars) {
@ -906,7 +906,7 @@ int parse(int argc, char *argv[]) {
} }
if(!fs::exists(sunshine.config_file)) { if(!fs::exists(sunshine.config_file)) {
fs::copy_file(SUNSHINE_DEFAULT_DIR "/sunshine.conf", sunshine.config_file); fs::copy_file(SUNSHINE_CONFIG_DIR "/sunshine.conf", sunshine.config_file);
} }
auto vars = parse_config(read_file(sunshine.config_file.c_str())); auto vars = parse_config(read_file(sunshine.config_file.c_str()));