Compare commits

...

1219 Commits

Author SHA1 Message Date
ReenigneArcher
446825b73d Merge pull request #877 from LizardByte/nightly
v0.18.2
2023-02-13 14:19:40 -05:00
ReenigneArcher
0d100a57a6 changelog: v0.18.2 (#925) 2023-02-13 09:58:10 -05:00
Conn O'Griofa
55a225d21c AMF: add missing encoder tunables (#902) 2023-02-13 09:23:29 -05:00
dependabot[bot]
ae12424279 Bump vedantmgoyal2009/winget-releaser from 1 to 2 (#921)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-13 08:58:06 -05:00
Conn O'Griofa
3c223eb289 CMake: CPack: use correct Boost dependency versions (#920) 2023-02-12 21:03:35 -05:00
ReenigneArcher
9ac1e3dcd6 web: ui: add macos audio sink (#912) 2023-02-09 19:41:52 -05:00
ReenigneArcher
a21e231cae web: api: add mimes type map (#890) 2023-02-08 21:35:02 -05:00
LizardByte-bot
2c4e293e21 Bump ffmpeg (#898)
Co-authored-by: LizardByte-bot <108553330+RetroArcher-bot@users.noreply.github.com>
2023-02-07 16:26:12 -05:00
Conn O'Griofa
1b45b57d07 Linux/VAAPI: implement vaSyncBuffer stub for libva <2.9.0 (#886) 2023-02-07 16:02:42 -05:00
LizardByte-bot
905904960d ci: update global docker (#897) 2023-02-07 14:21:42 -05:00
LizardByte-bot
48559a5876 ci: update global workflows (#896) 2023-02-07 13:52:39 -05:00
Grider
d2461e1908 Fix wayland capture on nvidia for kms (#884) 2023-02-05 18:41:35 -05:00
dependabot[bot]
f8819d32e3 Bump m2r2 from 0.3.3 to 0.3.3.post2 (#861)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-31 21:04:06 -05:00
ReenigneArcher
09dff34105 Merge pull request #866 from LizardByte/nightly
v0.18.1
2023-01-31 20:44:20 -05:00
ReenigneArcher
16e2789197 cmake: v0.18.1 (#874) 2023-01-31 16:43:38 -05:00
ReenigneArcher
08ac580bc6 changelog: v0.18.1 (#873) 2023-01-31 16:02:16 -05:00
Conn O'Griofa
cdfcdf2dc7 CMake: CPack: set Intel MediaSDK as arch-specfic depend (#868) 2023-01-31 08:39:20 -05:00
Conn O'Griofa
fb7c9e22ff CMake: Linux: update dependencies & use dynamic Boost (#864) 2023-01-30 21:29:44 -05:00
ReenigneArcher
b2c5da2cfc Merge pull request #738 from LizardByte/nightly
v0.18.0
2023-01-29 22:26:36 -05:00
ReenigneArcher
98d61b16f6 changelog: fix parsing issue with single quotes (#858) 2023-01-29 18:38:47 -05:00
ReenigneArcher
df6e15f1f7 changelog: fix v0.18.0 formatting (#857) 2023-01-29 17:42:53 -05:00
ReenigneArcher
6cc13b8ef6 docs: update changelog for v0.18.0 (#836) 2023-01-29 17:00:14 -05:00
Cameron Gutman
592f3a70a3 Display initialization and frame ownership fixes (#850) 2023-01-28 23:15:37 -06:00
istori1
9155e39e91 Flatpak build improvements (#784) 2023-01-28 15:21:16 -05:00
Cameron Gutman
142f06714f Windows installer fixes (#843) 2023-01-27 19:16:32 -06:00
Cameron Gutman
a3e2c4fa31 Free AVFrame before calling eglTerminate() (#842) 2023-01-27 09:21:05 -06:00
Conn O'Griofa
8b507d2b30 Fix image leak of hardware parallel encoder on display reinit (#823) 2023-01-26 12:12:49 -05:00
manteuffel723
0698210ce1 Fix Error: Couldn't import RGB Image: 00003002 and 00003004 (#761) 2023-01-26 11:23:44 -05:00
Костадин Дамянов
d33e3a2882 Restart the systemd service in case of a crash (#830) 2023-01-26 09:10:13 -05:00
Cameron Gutman
bcd5188ac5 Implement HDR support for Windows (#825) 2023-01-25 19:48:55 -06:00
Jari
1f2ad8da00 Scrub basic auth header from logs (#834) 2023-01-25 19:14:59 -05:00
Aaron Rumpler
5a60090ddc Rename 'Steam BigPicture' to 'Steam Big Picture' in apps.json (#827) 2023-01-25 18:16:03 -05:00
ReenigneArcher
3bb784b379 update docker tag information (#785) 2023-01-25 17:00:21 -05:00
Jari
35b660851c Fix SimpleWeb arbitrary file read vulnurability (#829) 2023-01-25 16:26:41 -05:00
Jari
d625dda4ea Steam Deck Gamingmode fix (#711) 2023-01-24 20:47:52 -06:00
Cameron Gutman
9181028bcf HDR prep work (#808) 2023-01-23 20:54:08 -06:00
LizardByte-bot
fa6c279efc ci: update global workflows (#816) 2023-01-22 17:13:33 -05:00
ReenigneArcher
9d6d59aa55 cd: fix aur publish conditions (#815) 2023-01-22 13:23:24 -05:00
ReenigneArcher
9df6283da4 cd: fix aur publish conditions (#814) 2023-01-22 12:24:25 -05:00
ReenigneArcher
c8c80807da fix aur nightly publishing (#813) 2023-01-22 11:44:36 -05:00
ReenigneArcher
3f202be09a docker build dependent on event type (#812) 2023-01-22 09:53:42 -05:00
Cameron Gutman
4b642f6e01 Implement horizontal scrolling and Sunshine detection for Moonlight (#793) 2023-01-21 17:42:08 -06:00
Cameron Gutman
da390c37db Improve reliability of hybrid graphics detection (#801) 2023-01-20 22:12:16 -06:00
Cameron Gutman
7242202291 CMake: Default to Release build and stop hardcoding optimization flags (#777) 2023-01-20 00:18:30 -06:00
LizardByte-bot
f213aae7b8 ci: update global docker (#803) 2023-01-19 17:08:47 -05:00
LizardByte-bot
bfd1e81a25 ci: update global workflows (#802) 2023-01-19 12:35:16 -05:00
Lukas Senionis
c81aa99c38 Fix child process spawning on linux (#773) 2023-01-19 00:40:12 -06:00
Cameron Gutman
c4c0413f9e Fix streaming to multiple clients from hardware encoder on Windows (#798) 2023-01-18 07:47:00 -06:00
Cameron Gutman
49fc618682 Add support for hybrid graphics systems (NVIDIA Optimus) (#782) 2023-01-17 23:55:44 -06:00
Cameron Gutman
1fbbab9df7 QSV performance optimization and HEVC hang fix (#786) 2023-01-17 18:12:14 -06:00
Cameron Gutman
7f6383833c Replace frame capture busy loop with waitable timer (#778) 2023-01-17 09:09:15 -05:00
KuleRucket
4ef97c755a Fix multi-character character constant compiler warning (#765)
Co-authored-by: KuleRucket <luke.d.tucker@gmail.com>
2023-01-16 22:19:26 -05:00
Cameron Gutman
fa14b6ead7 Network performance optimizations (#771) 2023-01-16 18:17:04 -05:00
LizardByte-bot
42f6634e85 Bump ffmpeg (#769) 2023-01-16 12:52:09 -05:00
Brad Richardson
e88dec22ee Link mfx on Linux (#781) 2023-01-16 07:31:03 -05:00
Conn O'Griofa
f44ae4cc8d nvenc: add nvidia preset migration guide to docs (#685) 2023-01-15 22:20:10 -05:00
ReenigneArcher
3510b8636a build with docker and improve CUDA compute capability support (#714) 2023-01-15 09:31:37 -05:00
Cameron Gutman
9fe539f87d Avoid redundant padding fills in display_vram_t::convert() (#763) 2023-01-14 20:14:55 -05:00
Cameron Gutman
4fc444b5b3 Intel QuickSync support for Windows (#758) 2023-01-14 16:23:49 -05:00
Cameron Gutman
5480d3d59d Switch to faster nanors Reed-Solomon implementation (#753) 2023-01-14 09:45:12 -05:00
Cameron Gutman
696a11942c Enforce 10 FPS encoding frame rate floor to improve static image quality (#754) 2023-01-11 11:02:53 -05:00
dependabot[bot]
43d47c6f3c Bump third-party/miniupnp from 207cf44 to 014c9df (#734)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 16:54:01 -05:00
Conn O'Griofa
b405888088 CMake: Windows: harden install by including zlib1.dll (#743) 2023-01-10 16:25:09 -05:00
dependabot[bot]
3771062499 Bump sphinx from 6.1.1 to 6.1.3 (#749)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 15:46:53 -05:00
Cameron Gutman
44ad28ebf4 Fix a reference leak of hw_frames_ctx and prepare for QSV (#736) 2023-01-10 14:52:15 -05:00
Tony Langhammer
5477f58f18 Move the check for UPnP enabled up to avoid error messages (#748) 2023-01-10 13:25:16 -05:00
ReenigneArcher
7dbd5b41b2 Fix typo in Shortcuts section (#744) 2023-01-10 09:26:42 -05:00
dependabot[bot]
f210b89dd7 Bump third-party/nv-codec-headers from b550d40 to 2055784 (#704)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 10:53:39 -05:00
LizardByte-bot
6ff236727f Bump ffmpeg (#693)
Co-authored-by: LizardByte-bot <108553330+RetroArcher-bot@users.noreply.github.com>
2023-01-09 10:07:27 -05:00
Brad Richardson
3af1744c9b FFmpeg updates with QSV-enabled builds (#730) 2023-01-09 08:24:21 -05:00
ReenigneArcher
b2fe0423d2 Merge pull request #567 from LizardByte/nightly
v0.17.0
2023-01-08 21:03:16 -05:00
ReenigneArcher
009975dc7b prepare v0.17.0 (#708) 2023-01-08 20:10:13 -05:00
ReenigneArcher
23ef23159a revert windows build libpsl version lock (#729) 2023-01-08 19:41:33 -05:00
Conn O'Griofa
d51afbe19d CMake: win32: fix API version, disable boost-cmake detection (#732) 2023-01-08 19:06:56 -05:00
ReenigneArcher
a26877a917 fix submodule names (#725) 2023-01-08 10:05:29 -05:00
Cameron Gutman
6607062648 Fix divisor for YUV range (#728) 2023-01-08 09:04:07 -05:00
Cameron Gutman
77d3a7e2ab Color conversion fixes and BT.2020 support (#723) 2023-01-07 22:28:47 -05:00
Cameron Gutman
7770b5f708 Enable Mouse Keys while streaming for systems with no mouse plugged in (#721) 2023-01-07 15:11:14 -05:00
Cameron Gutman
e2fce257b5 Fix Windows masked cursor blending with GPU encoders (#720) 2023-01-07 14:25:02 -05:00
Cameron Gutman
c95f54f874 Migrate Windows config files into specific config directory (#716) 2023-01-07 13:34:06 -05:00
Brad Richardson
9b6d0b7a06 Generated app id with hashed input data (#715) 2023-01-07 09:42:40 -05:00
dependabot[bot]
effa98f76a Bump sphinx from 6.0.0 to 6.1.1 (#713)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-05 19:59:41 -05:00
Cameron Gutman
65574a02d4 Add an Apply button to the Web UI when running as a Win32 Service (#700) 2023-01-05 14:26:54 -05:00
Cameron Gutman
5980e520b9 Improve robustness of encoder selection (#710) 2023-01-05 12:28:40 -05:00
Cameron Gutman
00aa23b342 Fix hang on stream termination if no frames can be captured (#709) 2023-01-05 11:21:38 -05:00
Cameron Gutman
f1c225fccc Terminate Sunshine if a session doesn't terminate for more than 10 seconds (#707) 2023-01-05 09:05:25 -05:00
Cameron Gutman
08cb5fc2f2 Minor UI fixes (#696) 2023-01-04 18:44:23 -05:00
Dmitry Khlestkov
1a929cc37b Fix origin_web_ui_allowed binding (#697) 2023-01-04 12:24:20 -05:00
Cameron Gutman
c72aeef67b Only increase rc_buffer_size when software encoding with more than one slice (#692) 2023-01-04 11:50:36 -05:00
Cameron Gutman
76896eba88 Fix NVENC profile values not applying (#695) 2023-01-04 11:18:28 -05:00
Cameron Gutman
1c1a7fa8c0 Fix 7.1 surround channel mapping (#694) 2023-01-04 10:08:33 -05:00
Jackson Garner
ff883058e6 Fix wayland capture on nvidia (#649) 2023-01-04 09:13:09 -05:00
dependabot[bot]
a3922d9eef Bump third-party/moonlight-common-c from 9da6329 to ef9ad52 (#690)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-03 22:41:25 -05:00
Cameron Gutman
cc688c7845 Implement process and thread priority adjustments (#691) 2023-01-03 22:05:00 -05:00
dependabot[bot]
997e8c6e5a Bump @fortawesome/fontawesome-free from 6.2.0 to 6.2.1 (#639)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-03 19:50:59 -05:00
dependabot[bot]
e410426257 Bump bootstrap from 5.0.0 to 5.2.3 (#638)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-03 19:07:03 -05:00
Tony Langhammer
30a790ba40 Fix UPnP IGD detection (#689) 2023-01-03 16:09:07 -05:00
Brad Richardson
052297a1a5 Update app id on edit (#670)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2023-01-02 21:02:10 -05:00
ReenigneArcher
12efe96297 fix docs badges for epub (#679) 2023-01-02 18:18:29 -05:00
ReenigneArcher
952e142ffa fix aur publish trigger event (#680) 2023-01-02 17:24:39 -05:00
Cameron Gutman
0439d7a83a Use separate encoding and capture devices to enable parallel encoding and capture (#668) 2023-01-02 15:56:58 -05:00
Cameron Gutman
76ffa2a0b5 Fix unexpected format switching in display_vram (#667) 2023-01-02 12:11:45 -05:00
ReenigneArcher
f9963ed39b update clang-format (#666) 2023-01-02 11:17:02 -05:00
LizardByte-bot
a7a9df3b9d ci: update global workflows (#673) 2023-01-02 10:12:06 -05:00
ReenigneArcher
cfe7129100 windows: pin libpsl version (#669) 2023-01-01 23:59:53 -05:00
LizardByte-bot
97b1790d0c ci: update release notifier (#665) 2023-01-01 09:36:24 -05:00
LizardByte-bot
9ae46e1325 ci: update global docker (#663) 2023-01-01 00:35:39 -05:00
LizardByte-bot
e5dedbbe46 ci: update global python (#662) 2023-01-01 00:09:29 -05:00
LizardByte-bot
17cd230c55 ci: update global workflows (#661) 2022-12-31 22:38:46 -05:00
Elia Zammuto
a5213c6225 Logs inside the WebUI (#634) 2022-12-31 20:12:36 -05:00
Cameron Gutman
248b1bfa19 Fix launching apps when Sunshine is running as admin (#659) 2022-12-31 19:05:22 -05:00
Cameron Gutman
0c6d0edacf Dynamic capture format selection (IDXGIOutput5) (#654)
Co-authored-by: Conn O'Griofa <connogriofa@gmail.com>
2022-12-31 17:38:29 -05:00
Cameron Gutman
03b62730ae Convert keyboard input to scancodes using the US English layout (#651) 2022-12-30 13:30:11 -05:00
ReenigneArcher
91f4f15c49 set concurrency limit for CI workflow (#657) 2022-12-30 12:24:35 -05:00
dependabot[bot]
3b53734eab Bump sphinx from 5.3.0 to 6.0.0 (#653)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-30 11:46:31 -05:00
dependabot[bot]
2dc150761c Bump third-party/ViGEmClient from f719a1d to 9e842ba (#558)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-30 11:02:46 -05:00
ReenigneArcher
8aaf9fd141 remove automatic desktop entry (#652) 2022-12-30 09:31:50 -05:00
ReenigneArcher
8b3b00059e Merge pull request #650 from cgutman/term_logging_feedback
Remove Enter prompt on exit and make log levels for execution messages consistent
2022-12-29 15:27:32 -05:00
Cameron Gutman
e00aa4f0f3 Make log priority consistent for execution messages 2022-12-29 12:47:44 -06:00
Cameron Gutman
a95a553970 Remove prompt to press enter after Sunshine exits 2022-12-29 12:47:20 -06:00
Cameron Gutman
d6db10afb4 Remove/fix calls to std::abort() (#648) 2022-12-29 11:09:11 -05:00
Cameron Gutman
8ad7af86c0 Graceful termination on shutdown, logoff, and service stop (#647) 2022-12-29 09:32:23 -05:00
ReenigneArcher
dc5571ba98 add cmake-lint action (#646) 2022-12-29 08:24:13 -05:00
ReenigneArcher
88a450bf1f update docs (#574) 2022-12-28 16:30:32 -05:00
Conn O'Griofa
27919697a7 CMake: NSIS: improve user upgrade experience (#587) 2022-12-28 15:39:05 -05:00
Cameron Gutman
a996902a33 Generate certificates with unique serial numbers (#645) 2022-12-28 14:03:41 -05:00
LizardByte-bot
ad20572dde ci: update global workflows (#643) 2022-12-28 10:48:29 -05:00
Cameron Gutman
f4a48f44e4 Rework audio bitrate and quality handling (#642) 2022-12-28 09:30:51 -05:00
Cameron Gutman
c7fe8f65bd windows: Fix audio when host is not using 48 KHz sample rate (#640) 2022-12-28 08:53:58 -05:00
Conn O'Griofa
215c86455f nvenc, amdvce: rework all user presets/options (#623) 2022-12-27 21:27:47 -05:00
Cameron Gutman
05f5370efe Launch games under the correct user account on Windows (#600) 2022-12-27 15:52:41 -05:00
ReenigneArcher
c1f0daa024 fix npm path (#635) 2022-12-27 14:03:00 -05:00
Conn O'Griofa
c0b042fa8a windows/vram: fix fringing in NV12 colour conversion (#622) 2022-12-27 11:05:57 -05:00
LizardByte-bot
d69d540031 Bump ffmpeg (#631) 2022-12-27 10:24:19 -05:00
Brad Richardson
95437d15f3 FFmpeg 5 and pre-built CBS (#509) 2022-12-27 09:13:54 -05:00
Brad Richardson
cbb5ec3f29 Remove duplicate boost port (#630) 2022-12-27 08:11:01 -05:00
Conn O'Griofa
c3ec53c0ae CMake: win32: further fix for boost linker incompatibility (#632) 2022-12-26 23:20:46 -05:00
LizardByte-bot
5adbd2988c ci: update global workflows (#613) 2022-12-22 22:47:24 -05:00
Cameron Gutman
1e037db7bd Fix pixel pitch handling for DXGI_FORMAT_R16G16B16A16_FLOAT (#605) 2022-12-22 21:58:39 -05:00
Cameron Gutman
bb092c0723 Fix streaming with non-B8G8R8A8 desktop mode (#609) 2022-12-22 20:48:31 -05:00
Cameron Gutman
1041f87a5d Spawn Sunshine.exe in a job object, so it is terminated if SunshineSvc.exe dies (#602) 2022-12-22 13:09:45 -05:00
LizardByte-bot
2b1514b547 Bump ffmpeg (#603) 2022-12-21 23:04:58 -05:00
Cameron Gutman
8a99187562 Fix SunshineSvc hanging if an error occurs during startup (#598) 2022-12-21 16:41:48 -05:00
ReenigneArcher
b1ac4bc57c Merge pull request #599 from cgutman/path_env
Fix PATH variable handling on Windows
2022-12-21 11:44:47 -05:00
Cameron Gutman
6c5a323b4a Use the proper environment variable for the Program Files (x86) folder 2022-12-21 09:48:30 -06:00
Cameron Gutman
dfb8d9d87f Fix PATH environment variable handling on Windows
PATH needs to be matched case-insensitively on Windows or we will just clobber the pre-existing PATH
2022-12-21 09:48:30 -06:00
Brad Richardson
7a23d6aa81 macOS arm64 (#591) 2022-12-20 14:38:50 -05:00
Conn O'Griofa
302bf58631 CMakeLists: win32: fix build against boost 1.81.0-1+ (#576) 2022-12-17 15:16:35 -05:00
dependabot[bot]
66f1ac664a Bump third-party/miniupnp from 6f848ae to 207cf44 (#557)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-12-16 18:48:09 -05:00
ReenigneArcher
223e87f30b set submodule branches (#570) 2022-12-16 17:27:28 -05:00
Cameron Gutman
633f0035c2 Send a valid PTS in the RTP video header (#529) 2022-12-16 15:56:44 -05:00
Cameron Gutman
66f46ab341 Send valid frame type value in frame header (#516) 2022-12-16 14:53:34 -05:00
Cameron Gutman
f4edce318c Avoid using functions deprecated in OpenSSL 3.0 (#515) 2022-12-15 21:21:57 -05:00
Conn O'Griofa
a54830cf39 video: vaapi: reduce async_depth to 1 (#545) 2022-12-15 20:37:55 -05:00
dependabot[bot]
63c105bfb1 Bump third-party/moonlight-common-c from 8169a31 to 9da6329 (#559)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 16:43:57 -05:00
dependabot[bot]
a1d07ff0e0 Bump third-party/TPCircularBuffer from bce9170 to 8833b3a (#555)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 16:07:24 -05:00
Cameron Gutman
5e6a42abb2 Migrate to upstream Simple-Web-Server submodule (#517) 2022-12-15 15:32:31 -05:00
Conn O'Griofa
3fd38b3a2e video: reduce nvenc delay/async_depth to 0 (#507) 2022-12-15 14:18:11 -05:00
Conn O'Griofa
cb406bce06 Video: revert software bitrate change & use more conservative bufsize (#482) 2022-12-15 13:12:25 -05:00
Conn O'Griofa
a4a5d30603 AMD encoder improvements (#480) 2022-12-15 11:23:59 -05:00
ReenigneArcher
5e40248fdf update ffmpeg submodules (#565) 2022-12-15 09:31:45 -05:00
ReenigneArcher
08d623ce44 Merge pull request #467 from LizardByte/nightly
v0.16.0
2022-12-14 10:35:31 -05:00
ReenigneArcher
12f1ec6b25 update issue template (#554) 2022-12-14 09:52:06 -05:00
ReenigneArcher
8c8a7bb886 update ffmpeg submodules (#552) 2022-12-14 06:51:42 -05:00
Conn O'Griofa
37c0f794b0 CMake: Linux: use standard FreeDesktop udev/systemd paths (#550) 2022-12-13 22:19:44 -05:00
ReenigneArcher
fe1321f33c Merge pull request #548 from LizardByte/prepare/v0.16.0
prepare v0.16.0
2022-12-12 21:49:32 -05:00
ReenigneArcher
5b239c17d0 prepare v0.16.0 2022-12-12 21:16:19 -05:00
LizardByte-bot
c60ebb76b9 ci: update global workflows (#547) 2022-12-12 20:04:06 -05:00
dependabot[bot]
6f369398b3 Bump furo from 2022.9.29 to 2022.12.7 (#531)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-11 21:16:33 -05:00
ReenigneArcher
84fdc7ee08 change linux build matrix (#468) 2022-12-11 20:26:25 -05:00
Brad Richardson
e8aa7499af Sunshine prebuilts (#510) 2022-12-11 17:46:19 -05:00
LizardByte-bot
a7b19f48fe ci: update release notifier (#534) 2022-12-10 10:45:09 -05:00
LizardByte-bot
a6e47ff033 ci: update global workflows (#532) 2022-12-10 10:27:26 -05:00
LizardByte-bot
dbe56ee583 ci: update global cpp (#533) 2022-12-10 10:02:33 -05:00
ReenigneArcher
ed5ee24efb Merge pull request #530 from psyke83/restrict_boost_ver
CMake: win32: fix linker errors with mingw boost 1.80.0-2
2022-12-10 08:11:23 -05:00
ReenigneArcher
97716fa0c8 fix aur build 2022-12-10 04:17:51 +00:00
Conn O'Griofa
7648496b89 CMake: win32: fix linker errors with mingw boost 1.80.0-2 2022-12-08 14:57:21 +00:00
ReenigneArcher
5ed17fb89d Merge pull request #511 from cgutman/utf8_events
Add support for UTF-8 input messages on Windows
2022-12-08 09:11:23 -05:00
Cameron Gutman
e39d9bc662 Add support for Unicode input messages on Windows 2022-11-23 21:45:26 -06:00
Cameron Gutman
d912cce5ba Update moonlight-common-c to pick up new input structures 2022-11-23 21:45:26 -06:00
ReenigneArcher
fbd6807eb8 Merge pull request #504 from LizardByte/update/use-npm-dependencies 2022-11-20 12:41:20 -05:00
ReenigneArcher
f0cfc4aa8a update build instructions 2022-11-19 18:58:37 -05:00
ReenigneArcher
67a569c0b8 Merge branch 'nightly' into update/use-npm-dependencies 2022-11-19 12:58:58 -05:00
ReenigneArcher
981d878082 use npm dependencies 2022-11-19 12:58:29 -05:00
istori1
4c1371aaeb Add install scripts (Flatpak) (#471)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-11-18 18:52:58 -05:00
LizardByte-bot
9af770e217 ci: update global workflows (#505) 2022-11-18 17:14:22 -05:00
LizardByte-bot
4cbf8c01d2 ci: update global docker (#502) 2022-11-18 12:30:39 -05:00
LizardByte-bot
8132c82b07 ci: update global workflows (#501) 2022-11-18 12:09:31 -05:00
ReenigneArcher
4a924acbc3 Merge pull request #498 from LizardByte/dependabot/github_actions/nightly/KSXGitHub/github-actions-deploy-aur-2.6.0
Bump KSXGitHub/github-actions-deploy-aur from 2.5.0 to 2.6.0
2022-11-18 11:33:29 -05:00
dependabot[bot]
390c664e84 Bump KSXGitHub/github-actions-deploy-aur from 2.5.0 to 2.6.0
Bumps [KSXGitHub/github-actions-deploy-aur](https://github.com/KSXGitHub/github-actions-deploy-aur) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/KSXGitHub/github-actions-deploy-aur/releases)
- [Commits](https://github.com/KSXGitHub/github-actions-deploy-aur/compare/v2.5.0...v2.6.0)

---
updated-dependencies:
- dependency-name: KSXGitHub/github-actions-deploy-aur
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-18 16:13:29 +00:00
Mariotaku
01b8ba353a Cover Finder (#216)
Adds functionality to search and add game cover images automatically.

Co-authored-by: Conn O'Griofa <connogriofa@gmail.com>
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-11-18 11:07:22 -05:00
ReenigneArcher
66615a0be0 Merge pull request #500 from LizardByte/dependabot/pip/nightly/sphinx-copybutton-0.5.1
Bump sphinx-copybutton from 0.5.0 to 0.5.1
2022-11-16 09:08:01 -05:00
dependabot[bot]
e924e2eedb Bump sphinx-copybutton from 0.5.0 to 0.5.1
Bumps [sphinx-copybutton](https://github.com/executablebooks/sphinx-copybutton) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/executablebooks/sphinx-copybutton/releases)
- [Changelog](https://github.com/executablebooks/sphinx-copybutton/blob/master/CHANGELOG.md)
- [Commits](https://github.com/executablebooks/sphinx-copybutton/compare/v0.5.0...v0.5.1)

---
updated-dependencies:
- dependency-name: sphinx-copybutton
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 00:31:17 +00:00
ReenigneArcher
4190667d94 Merge pull request #473 from LizardByte/add/docker-platform-arm64
add linux/arm64/v8 docker platform
2022-11-02 18:46:36 -04:00
ReenigneArcher
0bdb887e2c add linux/arm64/v8 docker platform 2022-11-02 18:11:37 -04:00
ReenigneArcher
92f5c49685 Merge pull request #472 from LizardByte/fix/CI-winget-releaser
fix winget release
2022-11-02 10:29:03 -04:00
ReenigneArcher
89a0109fa7 fix winget release
Fixes #464
2022-11-02 10:09:01 -04:00
ReenigneArcher
cf2de6e81e Merge pull request #470 from LizardByte/dependabot/pip/nightly/babel-2.11.0
Bump babel from 2.10.3 to 2.11.0
2022-11-02 09:21:43 -04:00
dependabot[bot]
6a2a485435 Bump babel from 2.10.3 to 2.11.0
Bumps [babel](https://github.com/python-babel/babel) from 2.10.3 to 2.11.0.
- [Release notes](https://github.com/python-babel/babel/releases)
- [Changelog](https://github.com/python-babel/babel/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-babel/babel/compare/v2.10.3...v2.11.0)

---
updated-dependencies:
- dependency-name: babel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-02 12:40:43 +00:00
ReenigneArcher
b310436bdb Merge pull request #469 from CrazyStevenz/patch-1
Fix credentials command typo in docs
2022-11-01 22:25:26 -04:00
Stefanos Papanatsios
bea78dd3eb Fix credentials command typo in docs 2022-11-01 19:32:04 +02:00
ReenigneArcher
447a00936b Merge pull request #466 from bananaman2020/patch-1
fix typo
2022-11-01 12:11:20 -04:00
Kuba
ca3bab3242 fix typo 2022-10-31 20:35:03 +00:00
ReenigneArcher
e1b112cafd Merge pull request #460 from LizardByte/nightly
v0.15.0 resubmit
2022-10-31 07:23:34 -04:00
ReenigneArcher
949506208e Merge pull request #459 from LizardByte/fix/CI-workflow
fix env variables for setup_release job
2022-10-30 20:56:03 -04:00
ReenigneArcher
84ae033a37 fix env variables for setup_release job 2022-10-30 20:38:32 -04:00
ReenigneArcher
8509ee72c3 Merge pull request #458 from LizardByte/nightly
v0.15.0 resubmit
2022-10-30 19:48:29 -04:00
ReenigneArcher
8a853fc79d Merge pull request #457 from LizardByte/fix/CI-env-variables
fix CI env variables
2022-10-30 19:09:20 -04:00
ReenigneArcher
c665e211cd fix CI env variables 2022-10-30 18:51:37 -04:00
ReenigneArcher
1e6d9da2d6 Merge pull request #456 from LizardByte/nightly
v0.15.0 resubmit
2022-10-30 17:33:58 -04:00
ReenigneArcher
71d249b32e Merge pull request #455 from LizardByte/fix/CI-setup-release
fix CI setup-release
2022-10-30 15:45:56 -04:00
ReenigneArcher
bfdcfbb357 fix CI setup-release 2022-10-30 15:25:38 -04:00
ReenigneArcher
660d8e191c Merge pull request #332 from LizardByte/nightly
v0.15.0
2022-10-30 15:05:55 -04:00
ReenigneArcher
5af39cbbb0 Merge pull request #454 from LizardByte/update/v0.15.0-changelog
prep v0.15.0
2022-10-30 13:50:45 -04:00
ReenigneArcher
f34e3b03fb v0.15.0 2022-10-30 13:21:18 -04:00
ReenigneArcher
4428054d03 Merge pull request #400 from w0utert/nightly
Fix CUDA RGBA to NV12 conversion
2022-10-30 12:52:08 -04:00
ReenigneArcher
b210356dfd Merge branch 'nightly' into nightly 2022-10-30 12:05:40 -04:00
ReenigneArcher
1905163b26 Merge pull request #452 from LizardByte/update/docs-theme-furo
change docs theme to `furo`
2022-10-30 11:16:12 -04:00
ReenigneArcher
3cab7e1067 change docs theme to furo 2022-10-30 10:13:59 -04:00
ReenigneArcher
42a990a12b Merge pull request #450 from LizardByte/update/nightly-release-builds
update nightly release builds
2022-10-29 17:39:08 -04:00
ReenigneArcher
5f3a466631 update nightly release builds 2022-10-29 16:53:58 -04:00
ReenigneArcher
e1efdadce1 Merge pull request #447 from LizardByte/update/nightly-release-commit
fix `setup_release` outputs
2022-10-28 22:55:02 -04:00
ReenigneArcher
2183f8eb0f fix setup_release outputs 2022-10-28 22:39:45 -04:00
ReenigneArcher
3df9f3de17 Merge pull request #445 from LizardByte/update/nightly-releases
update nightly releases
2022-10-28 21:30:27 -04:00
ReenigneArcher
cf5460bd80 update nightly releases
- use github sha for nightly tag
- specifically provide commit to release action
- build aarch64 flatpak on nightly release
2022-10-28 20:46:46 -04:00
ReenigneArcher
3113de6bfe Merge pull request #443 from LizardByte/add/nightly-release
add nightly release
2022-10-28 19:54:21 -04:00
ReenigneArcher
6e9aac3b83 add nightly release 2022-10-28 19:34:51 -04:00
ReenigneArcher
f932d6c18c Merge pull request #442 from LizardByte/fix/winget-releaser
fix winget releaser
2022-10-28 16:23:45 -04:00
ReenigneArcher
d0ce0a67f2 fix winget releaser 2022-10-28 15:44:27 -04:00
ReenigneArcher
a82a9f8ada Merge pull request #441 from LizardByte/update/docs
update docs
2022-10-28 15:22:23 -04:00
ReenigneArcher
548eeb8889 update docs 2022-10-28 15:04:31 -04:00
ReenigneArcher
dcdd716a57 update docker (#325)
* update docker
* remove legacy docker builds
* update docker documentation
* update docker build

Co-authored-by: ABeltramo <beltramo.ale@gmail.com>
2022-10-27 21:51:24 -04:00
ReenigneArcher
dc491fa5d4 Merge pull request #432 from LizardByte/update/flatpak-apps-config-file
update apps.json
2022-10-27 11:33:14 -04:00
ReenigneArcher
322da7ea30 Merge branch 'nightly' into update/flatpak-apps-config-file 2022-10-27 11:11:44 -04:00
ReenigneArcher
a043dfcf6c Update apps.json
- reformat `apps.json` files
- use `sed` to add required prefixes for flatpak build
2022-10-26 21:43:24 -04:00
ReenigneArcher
3ee511cabb Merge branch 'nightly' into nightly 2022-10-26 16:19:05 -04:00
ReenigneArcher
c9c93a265a Merge pull request #345 from brownj85/master
Add missing EGL extension for linux
2022-10-26 16:16:46 -04:00
ReenigneArcher
b484060831 Merge branch 'nightly' into master 2022-10-26 15:35:47 -04:00
ReenigneArcher
894cb6507e Merge pull request #431 from LizardByte/add/discord-notifier
Create release-notifier-moonlight.yml
2022-10-25 11:34:54 -04:00
ReenigneArcher
4769a9348b Create release-notifier-moonlight.yml 2022-10-25 10:38:03 -04:00
ReenigneArcher
7ad91e2dab Merge pull request #430 from istori1/patch-1
Remove libcheck and libevent
2022-10-25 09:31:36 -04:00
istori1
c1b4dccd7e Merge branch 'nightly' into patch-1 2022-10-24 17:48:34 -04:00
istori1
166f9f73e0 Enabled x264 and removed libevent 2022-10-24 17:47:19 -04:00
ReenigneArcher
1295096568 Merge pull request #428 from LizardByte/update/localize-workflow
update localize workflow
2022-10-24 14:54:08 -04:00
istori1
db55ff8ea1 Remove libcheck and disable x265 2022-10-24 07:05:13 -04:00
ReenigneArcher
88d67277f6 update localize workflow
- fix git diff comparison
- add current date to created PR
2022-10-23 13:21:00 -04:00
ReenigneArcher
83c8a460e1 Merge pull request #425 from istori1/patch-2
[Flatpak] Do not cache cuda module
2022-10-22 10:12:03 -04:00
istori1
cc0ac47f29 Update CI.yml 2022-10-21 19:40:54 -04:00
istori1
272368b59c Do not cache cuda module 2022-10-21 19:28:36 -04:00
ReenigneArcher
87856862dd Merge pull request #424 from LizardByte/add/flatpak-builder-cache
add flatpak-builder cache
2022-10-21 08:24:59 -04:00
ReenigneArcher
b5ec178cd6 add flatpak-builder cache 2022-10-20 20:56:04 -04:00
istori1
49afefc43f Export Debug Bundle [Flatpak] (#422) 2022-10-20 13:37:34 -04:00
istori1
e2bb1a720a Adding back CPU encoding (#419) 2022-10-20 10:34:29 -04:00
LizardByte-bot
cd89808a21 ci: update global cpp (#421) 2022-10-19 20:18:25 -04:00
LizardByte-bot
9f0af0f8ae ci: update global workflows (#417) 2022-10-19 19:34:36 -04:00
ReenigneArcher
afd52ba5e0 Merge pull request #416 from istori1/patch-1
Update dev.lizardbyte.sunshine.yml
2022-10-19 19:03:46 -04:00
istori1
87f01fc0b8 Update dev.lizardbyte.sunshine.yml 2022-10-19 17:29:27 -04:00
ReenigneArcher
952d961871 Merge pull request #415 from LizardByte/add/flatpak-matrix
use matrix build for flatpak
2022-10-19 11:17:15 -04:00
ReenigneArcher
ef2ca538a3 use matrix build for flatpak
Co-Authored-By: istori1 <107304850+istori1@users.noreply.github.com>
2022-10-19 10:14:28 -04:00
ReenigneArcher
f9b2686547 Merge pull request #413 from istori1/patch-6
Reduce build time and cleanup for Flatpak
2022-10-18 16:00:21 -04:00
istori1
35cdc2c89b Update dev.lizardbyte.sunshine.yml 2022-10-17 20:28:45 -04:00
istori1
3baace6711 Reduce build time and cleanup 2022-10-17 17:31:12 -04:00
ReenigneArcher
afe661db56 Merge pull request #411 from LizardByte/dependabot/pip/nightly/sphinx-5.3.0
Bump sphinx from 5.2.3 to 5.3.0
2022-10-17 08:48:28 -04:00
dependabot[bot]
b6ae848bb5 Bump sphinx from 5.2.3 to 5.3.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.2.3 to 5.3.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.2.3...v5.3.0)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 01:22:31 +00:00
ReenigneArcher
64b52205ab Merge pull request #410 from LizardByte/update/workflows
Update workflows
2022-10-16 20:34:22 -04:00
ReenigneArcher
93315f280e Update CI.yml
- use `GITHUB_OUTPUT` instead of `set-output`
2022-10-16 17:53:22 -04:00
ReenigneArcher
9b66a5a16b Bump actions/checkout from 2 to 3 2022-10-16 14:12:48 -04:00
ReenigneArcher
09c9a1a16b Merge pull request #346 from LizardByte/fix/image-paths
fix image paths
2022-10-16 09:33:27 -04:00
ReenigneArcher
b4703efbef Merge branch 'nightly' into fix/image-paths 2022-10-16 08:44:15 -04:00
ReenigneArcher
264c9272df fix string concatenation of image in assets dir 2022-10-15 20:04:40 -04:00
w0utert
79ce11fe72 Merge branch 'nightly' into nightly 2022-10-13 22:08:20 +02:00
ReenigneArcher
9213037ad4 Merge pull request #401 from istori1/patch-5
Update Flatpak sources to Kinetic
2022-10-13 14:27:49 -04:00
istori1
25a64bff44 Update Flatpak sources to Kinetic 2022-10-12 19:01:23 -04:00
ReenigneArcher
f51a84c9ec Merge pull request #372 from Logical-sh/no-sink-path-rebased
[Linux Pulse/Pipewire] No sink path *rebased*
2022-10-11 08:35:16 -04:00
ReenigneArcher
907798f9da Merge branch 'nightly' into no-sink-path-rebased 2022-10-11 06:58:19 -04:00
Wouter Bijlsma
7f53388304 Fix CUDA RGBA to NV12 conversion
On linux hosts with Nvidia GPU and CUDA support enabled, a CUDA kernel
is used to convert captured RGBA frames to NV12 before encoding. This
kernel contained a bug affecting image quality, in particular when
rendering high-contrast colored text and sharp lines. See [1] for more
information.

This commit fixes the format conversion kernel by taking 2x2 RGBA blocks
to generate 4 luma (Y) values and 1 chroma (UV) pair, ie: 12 bits per
pixel YUV420 (NV12). Previous code incorrectly generated 1 UV pair for
every 2 pixels.

[1] https://github.com/LizardByte/Sunshine/issues/154
2022-10-10 21:39:58 +02:00
ReenigneArcher
43525415fd Merge pull request #322 from LizardByte/dependabot/github_actions/nightly/KSXGitHub/github-actions-deploy-aur-2.5.0
Bump KSXGitHub/github-actions-deploy-aur from 2.4.1 to 2.5.0
2022-10-10 15:29:36 -04:00
dependabot[bot]
96b3bf30f6 Bump KSXGitHub/github-actions-deploy-aur from 2.4.1 to 2.5.0
Bumps [KSXGitHub/github-actions-deploy-aur](https://github.com/KSXGitHub/github-actions-deploy-aur) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/KSXGitHub/github-actions-deploy-aur/releases)
- [Commits](https://github.com/KSXGitHub/github-actions-deploy-aur/compare/v2.4.1...v2.5.0)

---
updated-dependencies:
- dependency-name: KSXGitHub/github-actions-deploy-aur
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 18:42:42 +00:00
ReenigneArcher
8e63b2523a Merge branch 'nightly' into fix/image-paths 2022-10-10 14:41:44 -04:00
ReenigneArcher
e1f0e3a719 Merge pull request #385 from LizardByte/dependabot/pip/nightly/sphinx-5.2.3
Bump sphinx from 5.1.1 to 5.2.3
2022-10-10 14:28:44 -04:00
dependabot[bot]
6800fc00f4 Bump sphinx from 5.1.1 to 5.2.3
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.1.1 to 5.2.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/5.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.1.1...v5.2.3)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 17:40:24 +00:00
LizardByte-bot
e0f2d3affc ci: update issue templates (#398) 2022-10-10 13:37:52 -04:00
LizardByte-bot
ac1feb386c ci: update global python (#397) 2022-10-10 12:49:59 -04:00
LizardByte-bot
de091570b9 ci: update global workflows (#396) 2022-10-10 12:07:07 -04:00
ReenigneArcher
99f9174353 Merge pull request #394 from istori1/patch-3
Change Flatpak sources to jammy
2022-10-10 11:16:00 -04:00
istori1
b40d414346 Update CI.yml 2022-10-10 07:14:12 -04:00
istori1
eedcd49713 Update dev.lizardbyte.sunshine.yml 2022-10-10 06:56:22 -04:00
istori1
418d3cc76c Change Flatpak sources to jammy 2022-10-09 09:40:19 -04:00
Michael Rogers
cf6107971d Merge branch 'nightly' into no-sink-path-rebased 2022-09-16 11:54:02 -05:00
Michael Rogers
62af7d255c Clang Format Applied 2022-09-16 11:47:10 -05:00
Michael Rogers
d4a4096bba Added some sanity checks for no sink being detected. 2022-09-16 11:46:41 -05:00
ReenigneArcher
5e5ae0b4b8 Merge branch 'nightly' into fix/image-paths 2022-09-11 20:35:24 -04:00
ReenigneArcher
636a928fc0 Merge pull request #330 from LizardByte/fix/paths
fix path issues
2022-09-11 20:28:28 -04:00
ReenigneArcher
5f9101f72d Merge branch 'nightly' into fix/paths 2022-09-11 19:41:30 -04:00
ReenigneArcher
f9040a55d5 Merge pull request #341 from istori1/patch-3
Update boost to 1.80.0 (flatpak/macport)
2022-09-11 19:28:41 -04:00
istori1
674a9da166 Update boost version in portfile 2022-09-11 08:34:52 -04:00
ReenigneArcher
2298cbbe20 remove debugging commands from add-firewall-rule.bat 2022-08-30 12:39:12 -04:00
ReenigneArcher
58ed5ba3ce fix typos and comment formatting 2022-08-28 16:42:00 -04:00
ReenigneArcher
f7d4f49809 fix windows add-firewall-rule script 2022-08-28 15:51:17 -04:00
ReenigneArcher
43fa4100d2 update docs
- add information about various ports
- correct typos in macos installation instructions
2022-08-26 20:25:03 -04:00
ReenigneArcher
b3a1615170 fix image paths 2022-08-26 19:40:53 -04:00
Jack Brown
b421c8e2e9 Merge branch 'nightly' into master 2022-08-26 19:00:12 -04:00
Jack Brown
977a4d3d4a Add dma import modifiers EGL ext 2022-08-26 18:20:49 -04:00
ReenigneArcher
642c4a9ed7 add home directory access for flatpak 2022-08-25 08:38:56 -04:00
ReenigneArcher
83ea433857 update docs 2022-08-24 21:40:53 -04:00
ReenigneArcher
0ac67f13d7 fix assets directory for flatpak and AUR 2022-08-24 15:46:02 -04:00
istori1
f32387f67e Update boost to 1.80.0 2022-08-24 12:20:49 -04:00
ReenigneArcher
6980ee36b3 fix windows install extra commands and...
- prompt to remove install directory on uninstall
- delete start menu icons on uninstall
- create appdata folder if it doesn't exist
2022-08-20 22:18:25 -04:00
ReenigneArcher
e04ed497a6 Enable firewall rules for Windows 2022-08-17 14:41:04 -04:00
ReenigneArcher
7b8abc49e2 Merge branch 'nightly' into fix/paths 2022-08-17 13:51:43 -04:00
ReenigneArcher
53bd9ea82b Merge pull request #321 from sitiom/firewall-rules
Add batch files to add and remove firewall rules
2022-08-17 13:50:13 -04:00
ReenigneArcher
adeb99f8c2 Merge branch 'nightly' into firewall-rules 2022-08-17 10:26:54 -04:00
Ryan Caezar Itang
65b557d003 Add batch files to add and remove firewall rules 2022-08-16 11:57:14 +08:00
ReenigneArcher
ccd568af3e Merge pull request #329 from LizardByte/update/templates
use org level PR template
2022-08-15 18:47:12 -04:00
ReenigneArcher
749bfa89ef cleanup commented out AppImage CI code 2022-08-15 18:45:05 -04:00
ReenigneArcher
663a92ce33 install bat scripts on windows 2022-08-14 22:16:20 -04:00
ReenigneArcher
8b0e6a28c2 single AppImage file
- simplify cmake install prefix and assets directory
2022-08-14 18:29:05 -04:00
ReenigneArcher
9a95ce5132 simplify portable config for AppImage 2022-08-12 18:33:40 -04:00
ReenigneArcher
7dc8546c25 remove config backup and restore 2022-08-12 16:13:04 -04:00
ReenigneArcher
30c178baa1 move default configs to assets directory 2022-08-12 16:00:19 -04:00
ReenigneArcher
911035c711 use org level PR template 2022-08-12 15:25:56 -04:00
ReenigneArcher
6000b85b1a Merge pull request #283 from LizardByte/nightly
v0.14.1
2022-08-09 19:42:10 -04:00
ReenigneArcher
d661568536 Merge pull request #317 from LizardByte/prepare-v0.14.1
prepare v0.14.1
2022-08-09 18:44:36 -04:00
ReenigneArcher
c4e3687c01 Merge branch 'nightly' into prepare-v0.14.1 2022-08-09 17:22:14 -04:00
ReenigneArcher
a6b8371178 v0.14.1 2022-08-09 17:20:46 -04:00
ReenigneArcher
f546ee8551 Merge pull request #316 from LizardByte/prepare-v0.14.1
Prepare v0.14.1
2022-08-09 08:23:20 -04:00
ReenigneArcher
db28239939 v0.14.1 2022-08-08 22:40:13 -04:00
ReenigneArcher
9f87401173 fix source directory 2022-08-08 22:40:01 -04:00
ReenigneArcher
4100f790ee Merge pull request #304 from LizardByte/bot/manual-update-global-workflow-nightly-cnnsp
ci: update global workflows
2022-08-08 20:35:16 -04:00
ReenigneArcher
a4acaf15b0 move sunshine to src
- this will allow for common cpp workflow files within org
2022-08-07 23:37:57 -04:00
ReenigneArcher
0de52efdb1 move TPCircularBuffer submodule 2022-08-07 23:13:19 -04:00
ReenigneArcher
1d242aed7c fix yaml-lint errors 2022-08-07 21:19:05 -04:00
LizardByte-bot
4d3c9b0be8 ci: update global workflows 2022-08-07 23:33:19 +00:00
ReenigneArcher
8164c09ea0 Merge pull request #215 from sitiom/winget-releaser
Add winget releaser action
2022-08-07 19:32:13 -04:00
ReenigneArcher
b464902f25 Merge branch 'nightly' into winget-releaser 2022-08-07 18:35:09 -04:00
ReenigneArcher
844f041a58 Merge pull request #302 from LizardByte/update/html
Update/html
2022-08-07 18:16:39 -04:00
ReenigneArcher
de628e843e Merge branch 'nightly' into update/html 2022-08-07 17:29:03 -04:00
ReenigneArcher
de6779ed83 Merge pull request #303 from LizardByte/fix/archlinux-package-action
fixed archlinux-package-action
2022-08-07 17:28:45 -04:00
ReenigneArcher
2afa3a4390 Change docs nav header background color 2022-08-07 17:01:25 -04:00
ReenigneArcher
094ab4eb1a fixed archlinux-package-action 2022-08-07 16:46:02 -04:00
ReenigneArcher
c184f16e28 fix support link and...
- remove AUR `sunshine-git` badge
2022-08-07 16:39:59 -04:00
ReenigneArcher
15aca474eb fix button formatting 2022-08-07 16:34:39 -04:00
ReenigneArcher
d963bd1daa add discord widgetbot crate 2022-08-07 16:34:15 -04:00
istori1
d38392aea0 sunshine.conf and apps.json on user's home config dir (#269) 2022-08-05 20:47:21 -04:00
sitiom
b7ef109d95 Update Winget badge link (#284)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-08-03 15:56:35 -04:00
dependabot[bot]
dc8bda0e1b Bump KSXGitHub/github-actions-deploy-aur from 2.3.0 to 2.4.1 (#292)
Bumps [KSXGitHub/github-actions-deploy-aur](https://github.com/KSXGitHub/github-actions-deploy-aur) from 2.3.0 to 2.4.1.
- [Release notes](https://github.com/KSXGitHub/github-actions-deploy-aur/releases)
- [Commits](https://github.com/KSXGitHub/github-actions-deploy-aur/compare/v2.3.0...v2.4.1)

---
updated-dependencies:
- dependency-name: KSXGitHub/github-actions-deploy-aur
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-08-03 15:13:31 -04:00
Ryan Caezar Itang
7cc5e1345c Add Winget Releaser workflow 2022-08-03 23:31:29 +08:00
Robert
49147694de Fix minor typo (#287)
Correct 'verfied' to 'verified'

Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-08-02 09:20:34 -04:00
istori1
58a71bf3e7 Add permission for Flatpak. (#291)
* Add permission for Flatpak.

Adding --talk-name=org.freedesktop.Flatpak as this is needed to launch applications on the host. Example flatpak-spawn --host sleep 1m.

* Alphabetical order
2022-07-31 20:52:39 -04:00
LizardByte-bot
5ac84fd03f ci: update global workflows (#286) 2022-07-30 21:48:13 -04:00
LizardByte-bot
1439c8d951 ci: update release notifier (#282) 2022-07-30 15:14:28 -04:00
LizardByte-bot
ce9934ca52 ci: update issue templates (#281) 2022-07-30 13:44:57 -04:00
LizardByte-bot
7451c1bd17 ci: update global cpp (#280) 2022-07-29 23:18:06 -04:00
LizardByte-bot
7340f7660b ci: update dependabot (#278) 2022-07-29 22:29:35 -04:00
LizardByte-bot
a9af8472df ci: update global workflows (#279) 2022-07-29 21:45:02 -04:00
LizardByte-bot
b5fa9bb1be ci: update global python (#277)
Co-authored-by: LizardByte-bot <108553330+RetroArcher-bot@users.noreply.github.com>
2022-07-29 19:28:15 -04:00
dependabot[bot]
f850b037bc Bump sphinx from 5.0.2 to 5.1.1 in /scripts (#268)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.0.2 to 5.1.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/5.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.0.2...v5.1.1)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-29 10:47:41 -04:00
ReenigneArcher
da3c39e9e3 change org to LizardByte (#263)
- updates issue template
- updates docker readme
2022-07-29 09:45:26 -04:00
ReenigneArcher
7d4df19cdc fix aur build (#273)
* fix aur build

* Update both aur repos
2022-07-29 08:56:07 -04:00
istori1
d19c883067 Add CUDA to Flatpak (#218) 2022-07-05 19:27:14 -04:00
ReenigneArcher
42eda48ce4 Merge pull request #232 from SunshineStream/fix-CI-for-outside-pull-requests
Fix flatpak CI for outside pull requests
2022-06-29 20:32:25 -04:00
ReenigneArcher
fd0dc9ab8e Fix flatpak CI for outside pull requests 2022-06-29 20:02:15 -04:00
ReenigneArcher
1415c8b200 Merge pull request #204 from SunshineStream/macports-improvements
Macports improvements
2022-06-29 19:44:46 -04:00
ReenigneArcher
8ba3c073e7 Remove macOS requirements table 2022-06-29 19:08:14 -04:00
ReenigneArcher
92f1313993 Merge branch 'nightly' into macports-improvements 2022-06-29 19:06:33 -04:00
ReenigneArcher
2b3c514aad Merge pull request #214 from SunshineStream/add-aur-publish
Integrate AUR package `sunshine-git`
2022-06-29 18:57:16 -04:00
ReenigneArcher
819501c4e7 Use v2.3.0 of KSXGitHub/github-actions-deploy-aur action 2022-06-28 20:39:58 -04:00
ReenigneArcher
3b2226c4ea Add paths for aur package 2022-06-28 20:39:33 -04:00
ReenigneArcher
00405892cb Don't rename default config files 2022-06-28 19:26:34 -04:00
ReenigneArcher
3cd3d261e9 Update macOS documentation 2022-06-28 19:16:24 -04:00
ReenigneArcher
4f07672cfa CI cleanup 2022-06-28 19:00:13 -04:00
ReenigneArcher
25e21ee807 Fix removing directories for macos uninstall_pkg 2022-06-25 19:10:47 -04:00
ReenigneArcher
270d4ddffe Fix paths for AUR and...
- Rename udev rules file
- Refactor CI to properly collect clone url for PRs (AUR only)
2022-06-23 23:55:48 -04:00
ReenigneArcher
46dede3381 Disable matrix for Macports
- Currently cannot build Sunshine on macOS < 10.8 due to missing video toolbox framework
2022-06-23 22:58:27 -04:00
ReenigneArcher
7019756fa1 Fix macos uninstall pkg script 2022-06-23 20:42:18 -04:00
ReenigneArcher
a1d8cc2296 Update installation.rst 2022-06-22 21:43:18 -04:00
ReenigneArcher
c61b31e8a6 Create uninstall_pkg.sh 2022-06-22 21:42:10 -04:00
ReenigneArcher
802e5c79fa Add config option SUNSHINE_MACOS_PACKAGE
- Refactor UNIX/APPLE packaging
2022-06-22 19:52:48 -04:00
ReenigneArcher
6b64149591 Update Portfile
- Add `compiler.cxx_standard`
- Don't overwrite config files
- Fix `maintainers`
- Correct cmake configure arguments
- Remove `destroot`
- Use `git` instead of `github.setup`
- Set revision to 0
- Add long description
2022-06-21 22:35:03 -04:00
ReenigneArcher
8fc8884dbc Update PKGBUILD
- Add `avahi` as dependency
- Order dependencies in alphabetical order
- Use fast compilation for `make` command
2022-06-20 20:35:19 -04:00
ReenigneArcher
2b76111e51 Remove AUR from issue template config 2022-06-20 19:44:20 -04:00
ReenigneArcher
54221ae938 Use cached responses for AUR badges 2022-06-20 19:19:47 -04:00
ReenigneArcher
f07171315f Configure PKGBUILD according to github event
- Release to AUR on push into `master`
- Update AUR installation instructions
- Use common linux directories for `PKGBUILD`
2022-06-19 23:35:02 -04:00
ReenigneArcher
f4074341a5 Add AUR PKGBUILD 2022-06-19 14:42:19 -04:00
ReenigneArcher
9c4763af75 Configure Portfile in Macports job 2022-06-18 14:19:34 -04:00
ReenigneArcher
6dc10a4d60 Merge branch 'nightly' into macports-improvements 2022-06-18 12:48:35 -04:00
ReenigneArcher
4b332d6fa0 Merge branch 'macports-improvements' of https://github.com/SunshineStream/Sunshine into macports-improvements 2022-06-18 12:13:05 -04:00
ReenigneArcher
12a361a3d9 Merge pull request #195 from SunshineStream/add-flatpak
Initial flatpak packaging
2022-06-18 11:59:00 -04:00
ReenigneArcher
840013ec78 Update documentation for Flatpak 2022-06-18 11:10:07 -04:00
sitiom
e45452b9bc Add Winget in Third Party Packages (#207)
* Add Winget in Third Party Packages
* Add etiquette tip in Contributing section

Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-06-18 09:42:05 -04:00
ReenigneArcher
8509260194 Fix branch for PUSH events
- This partially fixes #194
2022-06-17 19:18:56 -04:00
ReenigneArcher
2a13697fef Replace hardcoded paths for unix and...
- Add cache for flatpak job

Co-Authored-By: istori1 <107304850+istori1@users.noreply.github.com>
2022-06-17 17:58:07 -04:00
ReenigneArcher
bd51a7d5fa Refactor assets and config directories 2022-06-17 15:30:56 -04:00
ReenigneArcher
1cf0360520 Initial flatpak packaging
- adds `com.github.sunshinestream.sunshine.yml`
- moves and renames `sunshine.desktop`
- moves and renames `Portfile`
- adds cmake options for configuration only

Co-Authored-By: istori1 <107304850+istori1@users.noreply.github.com>
2022-06-17 14:29:34 -04:00
ReenigneArcher
4a0d632c6e Lint and built Portfile 2022-06-17 11:14:34 -04:00
ReenigneArcher
d336de68a2 Merge pull request #202 from SunshineStream/dependabot/pip/scripts/nightly/babel-2.10.3
Bump babel from 2.9.1 to 2.10.3 in /scripts
2022-06-17 10:19:15 -04:00
dependabot[bot]
1175a3184e Bump babel from 2.9.1 to 2.10.3 in /scripts
Bumps [babel](https://github.com/python-babel/babel) from 2.9.1 to 2.10.3.
- [Release notes](https://github.com/python-babel/babel/releases)
- [Changelog](https://github.com/python-babel/babel/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-babel/babel/compare/v2.9.1...v2.10.3)

---
updated-dependencies:
- dependency-name: babel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-17 14:03:34 +00:00
ReenigneArcher
dde56c2bb7 Merge pull request #209 from SunshineStream/dependabot/pip/scripts/nightly/sphinx-5.0.2
Bump sphinx from 4.5.0 to 5.0.2 in /scripts
2022-06-17 10:02:54 -04:00
dependabot[bot]
7da652e299 Bump sphinx from 4.5.0 to 5.0.2 in /scripts
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 4.5.0 to 5.0.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/5.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v4.5.0...v5.0.2)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-17 13:25:50 +00:00
ReenigneArcher
3663e35ecf Lint and built Portfile 2022-06-16 17:40:26 -04:00
ReenigneArcher
e78ec5c2ce Add notes 2022-06-16 16:18:59 -04:00
ReenigneArcher
70ae7a2fa9 Merge pull request #190 from SunshineStream/nightly
v0.14.0
2022-06-15 18:29:04 -04:00
ReenigneArcher
651d75fce7 Update version 2022-06-15 18:17:12 -04:00
ReenigneArcher
c3dfcc1f11 Merge pull request #189 from SunshineStream/update-changelog-v0.14.0
Update CHANGELOG.md for v0.14.0
2022-06-15 18:07:50 -04:00
ReenigneArcher
a02d314dde Update CHANGELOG.md for v0.14.0 2022-06-15 17:50:11 -04:00
ReenigneArcher
b5fd69a9ed Merge pull request #164 from psyke83/DwmFlush
platform/windows: add DwmFlush() call to improve Windows capture
2022-06-15 17:49:45 -04:00
Conn O'Griofa
2d969c2ccc platform/windows: change dwmflush default, add autodetection
On each re/init, query the active monitor refresh rate via
DwmGetCompositionTimingInfo. If the client requested framerate exceeds
the host monitor refresh, automatically disable DwmFlush.

This avoids the problem by which DwmFlush would constrain the client
FPS if the host monitor runs at a lower refresh rate, thus allowing
the feature to be enabled by default.

If there are other issues caused by DwmFlush for certain systems,
it can still be disabled via configuration.
2022-06-15 22:23:09 +01:00
Conn O'Griofa
211b25848f platform/windows: add optional DwmFlush() call to improve Windows capture
Invoke DwmFlush() before acquiring the next frame to alleviate visual stutter
during mouse movement at the cost of constraining the capture rate to the host's
monitor refresh.

Disabled by default; enable via "dwmflush" boolean configuration parameter.
2022-06-15 22:23:09 +01:00
Conn O'Griofa
d051b58190 webui: correct AMD AMF Coder name & pre-fill default setting 2022-06-15 22:23:09 +01:00
Conn O'Griofa
ab0a6b5fa6 webui: remove erroneous v-bind properties
These were causing unusual behaviour (select dialogs displaying a blank label
when a value should be selected, and values randomly setting themselves to
undefined when switching tabs).
2022-06-15 22:23:09 +01:00
Conn O'Griofa
0c827690ec config: move VideoToolbox variables into correct video_t struct location 2022-06-15 22:23:09 +01:00
ReenigneArcher
f5d7cf7692 Merge pull request #144 from SunshineStream/add-cpack
Add cpack
2022-06-15 17:12:19 -04:00
ReenigneArcher
dd73f45175 Deactivate mac port job 2022-06-15 16:05:23 -04:00
ReenigneArcher
e86207606a Use openssl for deb package instead of libssl1.1/3 2022-06-15 15:53:04 -04:00
ReenigneArcher
ca21e6a8ac Update documentation 2022-06-15 15:52:38 -04:00
ReenigneArcher
9990b9b04b Separate job for Macports build 2022-06-15 15:02:57 -04:00
ReenigneArcher
341bc98730 Merge branch 'add-cpack' of https://github.com/SunshineStream/Sunshine into add-cpack 2022-06-13 20:26:16 -04:00
ReenigneArcher
1a1cf20152 Update MacOS build 2022-06-13 15:56:46 -04:00
ReenigneArcher
7a5890469c Update MacOS build 2022-06-12 22:31:59 -04:00
ReenigneArcher
65c4f01998 Update documentation
- Add copy button to code blocks
- Fix some badges
- Improve Linux installation instructions
2022-06-09 19:50:20 -04:00
ReenigneArcher
676b5559ec Merge pull request #179 from SunshineStream/dependabot/github_actions/nightly/actions/setup-python-4
Bump actions/setup-python from 3 to 4
2022-06-09 11:30:46 -04:00
dependabot[bot]
e9b46201fd Bump actions/setup-python from 3 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-09 12:42:27 +00:00
ReenigneArcher
9b4fc8a270 Fix udev rules
- Adds to permission to create "Sunshine Mouse"
2022-06-08 23:00:18 -04:00
ReenigneArcher
7cb0286414 Fix paths for linux cpack build 2022-06-08 21:27:41 -04:00
ReenigneArcher
3b41888c66 Update CI.yml 2022-06-08 21:03:14 -04:00
ReenigneArcher
4a65d2cafc Fix libssl3 dependency for Ubuntu 22.04 2022-06-08 21:02:28 -04:00
ReenigneArcher
34f1e89366 Update linux installation instructions 2022-06-08 21:01:34 -04:00
ReenigneArcher
91cf3bcdcc Use portable config directory for AppImage 2022-06-08 21:01:08 -04:00
ReenigneArcher
e7ec6050d9 Use portable config directory for AppImage 2022-06-07 23:32:08 -04:00
ReenigneArcher
0f3eaf0f84 Add pip for dependabot 2022-06-07 18:32:09 -04:00
ReenigneArcher
c75efd3999 Merge pull request #170 from SunshineStream/dependabot/github_actions/nightly/DoozyX/clang-format-lint-action-0.14
Bump DoozyX/clang-format-lint-action from 0.13 to 0.14
2022-06-03 12:02:58 -04:00
dependabot[bot]
f2934c620b Bump DoozyX/clang-format-lint-action from 0.13 to 0.14
Bumps [DoozyX/clang-format-lint-action](https://github.com/DoozyX/clang-format-lint-action) from 0.13 to 0.14.
- [Release notes](https://github.com/DoozyX/clang-format-lint-action/releases)
- [Commits](https://github.com/DoozyX/clang-format-lint-action/compare/v0.13...v0.14)

---
updated-dependencies:
- dependency-name: DoozyX/clang-format-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-03 12:35:18 +00:00
ReenigneArcher
4f6b001483 Update paths and dependencies
- Updates paths for Linux and MacOS builds
- Strategy matrix build for Linux (CPACK/AppImage)
- Fix dependencies for rpm package
2022-05-15 16:26:00 -04:00
ReenigneArcher
de3c37969f Merge pull request #157 from KarlVogel/f35-libcap
f35: add libcap-devel to enable KMS code
2022-05-14 08:21:28 -04:00
Karl Vogel
c719ddfc31 fedora: add libcap/libdrm-devel to enable KMS code 2022-05-14 12:16:14 +02:00
ReenigneArcher
a5e56cf47d Merge branch 'nightly' into add-cpack 2022-05-12 21:05:23 -04:00
ReenigneArcher
84fd2c5766 Merge pull request #158 from cazzoo/nightly
Add missing dependencies to AppImage
2022-05-12 15:21:57 -04:00
ReenigneArcher
68ba1db24a Refactor assets and config directory 2022-05-11 23:10:46 -04:00
ReenigneArcher
ca00949851 Refactor build_linux job 2022-05-11 19:23:05 -04:00
ReenigneArcher
88925c705f Add gtk plugin for linuxdeploy / AppImage 2022-05-10 20:39:14 -04:00
ReenigneArcher
c2752262e5 Add missing AppImage libraries 2022-05-10 18:54:50 -04:00
Caz zoo
496e51d93a Fixes #8 and relates #146 Adding required missing dependencies for Arch base distro 2022-05-10 23:46:03 +02:00
ReenigneArcher
6c04065ba7 Set DEFAULT_SUNSHINE_DIR for CI builds
- Add libssl3.0 as CPACK_DEBIAN_PACKAGE_DEPENDS
2022-05-08 21:39:10 -04:00
ReenigneArcher
fff419a7ff Fix AppImage source filename 2022-05-06 15:19:11 -04:00
ReenigneArcher
a3e3da3136 Fix cmake project parameters 2022-05-06 14:39:26 -04:00
ReenigneArcher
49bfd2ba1f Rename apps.json files throughout project
- Remove `appveyor.yml`
- Add project description to CMakeLists.txt
- Add project homepage url to CMakeLists.txt
2022-05-06 14:24:39 -04:00
ReenigneArcher
93aebf461a Set assets dir for Windows 2022-05-06 13:21:47 -04:00
ReenigneArcher
c409022df5 Combine AppImage and Linux build 2022-05-06 12:55:43 -04:00
ReenigneArcher
c4441db606 Remove CPACK_COMPONENT_APPLICATION_DEPENDS 2022-05-06 10:16:59 -04:00
ReenigneArcher
0d0496adf3 Remove CPACK_NSIS_MUI_HEADERIMAGE 2022-05-06 10:04:29 -04:00
ReenigneArcher
ca6f02c953 Modify windows installer 2022-05-05 23:58:08 -04:00
ReenigneArcher
8b86abfceb Reorganize assets 2022-05-05 23:09:35 -04:00
ReenigneArcher
5135c16bda Update Portfile and...
- Upload Portfile as artifact during builds and releases
- Update assets for cpack packages
2022-05-05 21:19:19 -04:00
ReenigneArcher
e6d6d47be1 Create MacOS archive 2022-05-05 20:05:07 -04:00
ReenigneArcher
639af4f08a Add MacOS build 2022-05-03 20:40:01 -04:00
ReenigneArcher
12bf5cffc5 Use CMAKE_PROJECT_NAME 2022-04-30 19:06:19 -04:00
ReenigneArcher
6741997e59 Update documentation for cpack 2022-04-30 18:22:17 -04:00
ReenigneArcher
369a941c48 Fix artifacts folder for AppImage 2022-04-30 17:51:14 -04:00
ReenigneArcher
2a69385aed Revert workflow logic 2022-04-30 15:13:36 -04:00
ABeltramo
31f7faa6a5 win: installation directory fix 2022-04-30 10:25:40 +01:00
ABeltramo
dc4393a583 CI: windows build packaging to ZIP, split artifacts upload for different packages 2022-04-30 10:25:40 +01:00
ABeltramo
5eb3e7c75f CI: use cpack for windows 7Z, split back deb/rpm and appimage, moved release action at the end 2022-04-30 10:25:38 +01:00
ABeltramo
6858f9c8d4 fix: testing CI 2022-04-30 10:25:00 +01:00
ABeltramo
af342c8cc9 fix: CI, better jobs dependencies 2022-04-30 10:25:00 +01:00
ABeltramo
4e4a5c8df8 feat: testing out a better CI workflow 2022-04-30 10:25:00 +01:00
ABeltramo
cc2d982ceb feat: testing out CI building for new packages 2022-04-30 10:25:00 +01:00
ABeltramo
e2bef750b4 feat: created NSIS windows installer, fixed Linux packaging paths 2022-04-30 10:25:00 +01:00
ABeltramo
ffdcf0fea8 feat: basic OSX .app generation
added default brew link libraries path
2022-04-30 10:24:59 +01:00
ABeltramo
2ea414d1d4 testing RPM package dependencies 2022-04-30 10:24:59 +01:00
ABeltramo
c4977b5393 WIP: Moving to cpack in order to unify installers across all platforms 2022-04-30 10:24:57 +01:00
ReenigneArcher
13c2dce3f1 Merge pull request #143 from SunshineStream/update-localization-workflow
Do not fail workflow if `sunshine.po` doesn't exist
2022-04-29 21:20:16 -04:00
ReenigneArcher
b0a02a5985 Do not fail workflow if sunshine.po doesn't exist
- Add proper keywords for boost::locale
- Minor documentation updates about localization
2022-04-29 19:48:07 -04:00
ReenigneArcher
b0df4eabd1 Merge pull request #130 from Logical-sh/pipewire-compatibility
Improved Pulse/Pipewire Compatibility for Linux.
2022-04-29 15:59:04 -04:00
ReenigneArcher
ceb7f5f41a Merge pull request #142 from SunshineStream/update-help-argument
Update help argument
2022-04-29 13:06:28 -04:00
ReenigneArcher
aa46b8e293 Revert removing name argument from print_help function
- The existing method is better because it uses the binary name instead of the project name `Sunshine`.
2022-04-29 12:52:09 -04:00
Michael Rogers
63a83cdf7a Fix formatting 2022-04-29 11:22:35 -05:00
Michael Rogers
bd033f9e15 Fixed formatting. 2022-04-29 11:20:45 -05:00
Michael Rogers
62ca9c31a0 Updated the linux for better pulse behavior. 2022-04-29 11:20:38 -05:00
Michael Rogers
e8ef708034 Fix virtual sink overriding config sink. 2022-04-29 11:19:00 -05:00
ReenigneArcher
ec450be8b5 Merge pull request #125 from Logical-sh/AVPacket-Fix
AVPacket Fix
2022-04-29 10:45:42 -04:00
ReenigneArcher
d4df041210 Merge pull request #141 from thatsysadmin/nightly
Add dependencies for Fedora RPM package
2022-04-29 08:51:00 -04:00
ReenigneArcher
ced0029abc Remove unused argument 2022-04-29 00:01:32 -04:00
ReenigneArcher
a9cf0ebf18 Remove unused name variable
- Add documentation blocks
2022-04-28 23:24:17 -04:00
ReenigneArcher
3d6611fd50 Update help argument 2022-04-28 22:51:02 -04:00
h
74736c6b76 Merge branch 'nightly' of https://github.com/thatsysadmin/Sunshine into nightly 2022-04-28 17:38:23 -07:00
h
0e0b2ce366 Add RPMFusion/FFMPEG dependancy. 2022-04-28 17:38:20 -07:00
ReenigneArcher
3b49deac25 Merge pull request #140 from SunshineStream/general-cleanup
Workflow updates
2022-04-28 18:41:21 -04:00
ReenigneArcher
734400dc77 Remove white background from png logo 2022-04-28 18:20:53 -04:00
ReenigneArcher
ef9abf2f15 Get version number from CMakeLists 2022-04-28 18:15:56 -04:00
ReenigneArcher
b286c06144 Fix localize git diff and git reset steps 2022-04-23 20:50:42 -04:00
ReenigneArcher
521335c387 Add ffmpeg dependency 2022-04-23 16:20:06 -04:00
ReenigneArcher
780339d91b Add boost dependencies 2022-04-23 13:18:29 -04:00
ReenigneArcher
b332633b07 Add submodules 2022-04-23 13:09:18 -04:00
ReenigneArcher
4cd1014bac Use apt_packages to install cmake 2022-04-23 13:01:57 -04:00
ReenigneArcher
7a1e5f43d9 Workflow updates
- Do not re-run PR tests on edited PRs
- Close added/fixed issues on published release
- Issues stale after 60 days instead of 30, close after 10 days instead of 5
- Use Vankka/pr-target-branch-action for checking that PR is made to proper branch
- Add version number to sphinx config, must use cmake to configure the file
- Add jobs to readthedocs.yaml configuration
2022-04-23 12:35:39 -04:00
ReenigneArcher
c4054c75a7 Merge pull request #134 from SunshineStream/add-sphinx-docs
Add sphinx docs
2022-04-21 08:30:48 -04:00
ReenigneArcher
f36d81954b Update rpm install commands 2022-04-19 20:38:06 -04:00
ReenigneArcher
eacae3954e Fix typos 2022-04-18 16:21:05 -04:00
ReenigneArcher
56cf3e4ede Update admonitions 2022-04-18 16:05:17 -04:00
ReenigneArcher
293ee266af Add docker file build instructions and...
- Remove readme.md files
2022-04-18 15:26:53 -04:00
ReenigneArcher
536df759ae Initial version of sphinx documentation and...
- remove ubuntu 21.04 from CI (end of life)
- adjust matrix strategy for clang.yml
- Use lessons learned from RetroArcher on localize.yml, crowdin.yml, and locale.py
- Add end of life comments to Dockerfiles
- Adjust dependency order in Dockerfiles
2022-04-18 14:53:28 -04:00
ReenigneArcher
4bdf8375cc Merge pull request #129 from SunshineStream/dependabot/github_actions/nightly/actions/upload-artifact-3
Bump actions/upload-artifact from 2 to 3
2022-04-12 23:32:51 -04:00
h
a6921fffad Add initial support for RPM packaging (#121)
- Add gen-rpm
- Package rpm in CI testing and releases
- Remove fedora 33 from testing (end of life)
- Update arguments for `build_private.sh` and `build_sunshine.sh`

Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2022-04-12 23:29:08 -04:00
Michael Rogers
1ad0c93ad8 Changed the video packet to contain AVPacket instead of extending it. 2022-04-12 16:13:05 -05:00
ReenigneArcher
97f333c970 Merge pull request #118 from HomerSp/fix-network-drop-crash
Properly catch exceptions in stream broadcast handlers
2022-04-11 18:29:56 -04:00
dependabot[bot]
b854807d40 Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 14:37:04 +00:00
Mathias Tillman
a9b9d1bd09 Properly catch exceptions in stream broadcast handlers to prevent unhandled exception crash/termination. 2022-04-07 08:20:47 +02:00
ReenigneArcher
0044ec1d52 Merge pull request #104 from SunshineStream/general-cleanup
General cleanup
2022-03-16 18:58:10 -04:00
ReenigneArcher
9c976a23de Rename artifacts 2022-03-16 18:34:43 -04:00
ReenigneArcher
9930880ee6 Update README.md 2022-03-15 22:30:23 -04:00
ReenigneArcher
82e1b61a31 Delete gamepad.png 2022-03-15 22:30:10 -04:00
ReenigneArcher
5bb197ccfc Update sunshine.ico 2022-03-15 22:30:01 -04:00
ReenigneArcher
20c0426ace Update pull_request_template.md 2022-03-15 22:11:44 -04:00
ReenigneArcher
0a9cc511ed Update config.yml 2022-03-15 22:06:24 -04:00
ReenigneArcher
2a7af03f9a Rename packages 2022-03-15 22:02:16 -04:00
ReenigneArcher
7910ac78a5 Merge pull request #103 from SunshineStream/add-ubuntu-18.04
Add ubuntu 18.04 packaging
2022-03-15 19:54:11 -04:00
ReenigneArcher
67762aa445 Fix matrix.extension 2022-03-15 19:39:21 -04:00
ReenigneArcher
7f22774e08 Fix syntax error 2022-03-15 19:29:12 -04:00
ReenigneArcher
cbafe09396 Add ubuntu 18.04 build and
- Prepare for rpm packaging
2022-03-15 19:23:08 -04:00
ReenigneArcher
615f7e5875 Use correct version of boost and cmake 2022-03-15 19:18:23 -04:00
ReenigneArcher
3f309832f7 Add comments 2022-03-15 19:17:22 -04:00
ReenigneArcher
719f4cef59 Add pipefail and comments 2022-03-15 19:17:06 -04:00
ReenigneArcher
da582198db Merge pull request #97 from SunshineStream/dependabot/github_actions/nightly/actions-js/push-1.3
Bump actions-js/push from 1.2 to 1.3
2022-03-14 10:27:46 -04:00
dependabot[bot]
04a2ecaff4 Bump actions-js/push from 1.2 to 1.3
Bumps [actions-js/push](https://github.com/actions-js/push) from 1.2 to 1.3.
- [Release notes](https://github.com/actions-js/push/releases)
- [Commits](https://github.com/actions-js/push/compare/v1.2...v1.3)

---
updated-dependencies:
- dependency-name: actions-js/push
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 12:38:51 +00:00
ReenigneArcher
3b8b4653e9 Merge pull request #94 from SunshineStream/i10n
Initial support for localization
2022-03-13 16:54:25 -04:00
ReenigneArcher
ea27955b16 Merge pull request #88 from HomerSp/fix-hwdevice-destroyed-before-ctx
Fix hwdevice being destroyed before context causing sigsegv on AMD
2022-03-13 16:50:30 -04:00
ReenigneArcher
e223ba53f9 Merge pull request #87 from HomerSp/fix-rumble-hang
Fix rumble events causing game to freeze
2022-03-13 16:48:43 -04:00
ReenigneArcher
907d0bfcd5 Fix .po file extension 2022-03-13 16:39:33 -04:00
ReenigneArcher
a014391ae7 Update for Crowdin Integration
- Rename extracted template file to `sunshine.po`
- Add `crowdin.yml`
- Remove `--init` and `--update` from `localize.yml`
  - Crowdin will initialize new languages and update existing ones
2022-03-13 16:29:51 -04:00
ReenigneArcher
84584c950b Update comment 2022-03-11 14:07:10 -05:00
ReenigneArcher
f1d82a7d09 Update trigger conditions
- Only run when changes are made on files inside 'sunshine' directory
  - Prevents workflow from running again when this workflow pushes changes back into 'locale' directory
  - Should be cleaner than using 'paths-ignore'
2022-03-11 14:00:23 -05:00
ReenigneArcher
01155ef4a3 Update trigger events
- Don't run if commits are all in 'locale' directory
  - Allows pushing changes back into nightly from this workflow without triggering and endless loop
- Don't run job unless event is 'pull_request.merged'
2022-03-11 13:48:24 -05:00
ReenigneArcher
88cf616a48 Move _locale.py and requirements 2022-03-11 13:46:18 -05:00
ReenigneArcher
b3cdadca86 Create localize.yml 2022-03-11 00:26:53 -05:00
ReenigneArcher
3bd9f6b710 Ignore translation templates and compilations 2022-03-11 00:22:29 -05:00
ReenigneArcher
e28cc5e645 Create _locale.py 2022-03-11 00:21:12 -05:00
ReenigneArcher
045970bcc5 Create requirements.txt 2022-03-11 00:20:25 -05:00
Mathias Tillman
6fca2c593c Use session_t destructor to ensure the context and hwdevice are always destroyed in the correct order. 2022-03-10 09:09:24 +01:00
Mathias Tillman
e61bbe87b4 Read revents from the temporary pollfds instead of copying them over to the old vector.
Decrement index for polls when erasing to make sure none of the events are skipped.
2022-03-09 22:23:38 +01:00
Mathias Tillman
80ebc9982e Fix another lint warning. 2022-03-09 17:27:42 +01:00
Mathias Tillman
9a2689692a Fix lint warning about code style. 2022-03-09 16:40:39 +01:00
Mathias Tillman
a31c6c4cd0 Fix hwdevice being destroyed before context, causing a sigsegv because the context relies on the hwdevice still being active. 2022-03-09 16:20:51 +01:00
Mathias Tillman
1f79f4ed12 Fix rumble events causing hang because the received input events were not read properly. 2022-03-09 00:30:10 +01:00
ReenigneArcher
6da0483951 Merge pull request #82 from sitiom/nightly
Add TPCircularBuffer submodule
2022-03-03 11:10:25 -05:00
ReenigneArcher
3abb199697 Merge pull request #83 from SunshineStream/dependabot/github_actions/nightly/actions/stale-5
Bump actions/stale from 4.1.0 to 5
2022-03-03 09:05:00 -05:00
dependabot[bot]
4c7afc05c7 Bump actions/stale from 4.1.0 to 5
Bumps [actions/stale](https://github.com/actions/stale) from 4.1.0 to 5.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v4.1.0...v5)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 21:55:46 +00:00
ReenigneArcher
222e53781d Merge pull request #84 from SunshineStream/dependabot/github_actions/nightly/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-03-02 16:41:50 -05:00
dependabot[bot]
8d4bd87ad2 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 12:36:17 +00:00
Ryan Caezar Itang
861331be1c Add TPCircularBuffer submodule 2022-03-02 11:19:05 +08:00
ReenigneArcher
2fa2afed56 Merge pull request #74 from SunshineStream/dependabot/github_actions/nightly/actions/stale-4.1.0
Bump actions/stale from 3 to 4.1.0
2022-02-27 23:26:29 -05:00
ReenigneArcher
5e910b5fab Update issues-stale.yml
- Remove skip-stale-issue-message
- Remove skip-stale-pr-message
2022-02-27 13:18:36 -05:00
dependabot[bot]
1520cb7bf9 Bump actions/stale from 3 to 4.1.0
Bumps [actions/stale](https://github.com/actions/stale) from 3 to 4.1.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v3...v4.1.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-27 18:11:56 +00:00
ReenigneArcher
4b658cd86b Merge pull request #73 from SunshineStream/nightly
v0.13.0
2022-02-27 13:11:37 -05:00
ReenigneArcher
f6311ceb3f Merge pull request #72 from SunshineStream/prepare-v0.13.0
Prepare v0.13.0
2022-02-27 12:54:55 -05:00
ReenigneArcher
9b2321a722 Merge pull request #71 from SunshineStream/improve-version-automation
Get version from CMakeLists
2022-02-27 12:54:20 -05:00
ReenigneArcher
1e91356155 Fix desktop file directory 2022-02-27 12:40:31 -05:00
ReenigneArcher
fb7a3a0758 Bump version to v0.13.0 2022-02-27 12:21:48 -05:00
ReenigneArcher
c2d4ffdaed Use master branch for create_release action
- Will always use latest version
2022-02-27 12:21:23 -05:00
ReenigneArcher
c5e6b84e3d Get version from CMakeLists 2022-02-27 12:17:30 -05:00
ReenigneArcher
68f35f6ab1 Merge pull request #66 from abusse/staging
Initial support for MacOS
2022-02-27 11:44:09 -05:00
Anselm Busse
2b450839a1 Initial support for MacOS
This commit introduces initial support for MacOS as third major host platform.
It relies on the VideoToolbox framework for audio and video processing, which
enables hardware accelerated processing of the stream on most platforms.
Audio capturing requires third party tools as MacOS does not offer the
recording of the audio output like the other platforms do. The commit enables
most features offered by Sunshine for MacOS with the big exception of gamepad
support. The patch sets was tested by a few volunteers, which allowed to remove
some of the early bugs. However, several bugs especially regarding corner
cases have probably not surfaced yet.

Besides instructions how to build from source, the commit also adds a Portfile
that allows a more easy installation. After available on the release branch,
a pull request for the Portfile in the MacPorts project is planned.

Signed-off-by: Anselm Busse <anselm.busse@outlook.com>
2022-02-26 10:18:00 +01:00
Anselm Busse
df3e7c5ca1 Prepare for ObjectiveC/ObjectiveC++ code
This commit modifies the clang-format configuration and workflow to support ObjectiveC and ObjectiveC++ code.

Signed-off-by: Anselm Busse <anselm.busse@outlook.com>
2022-02-24 21:10:25 +01:00
ReenigneArcher
a4fa42fa96 Merge pull request #55 from SunshineStream/add-clang-linter
Add clang linter
2022-02-17 18:13:59 -05:00
ReenigneArcher
d6183430ef clang lint 2022-02-16 18:23:56 -05:00
ReenigneArcher
f54a32feac Update clang.yml 2022-02-16 18:13:16 -05:00
ReenigneArcher
37edcb1b55 Update clang.yml
- Fix syntax error
2022-02-16 18:10:54 -05:00
ReenigneArcher
320b691086 Update clang.yml
- Use job strategy matrix
  - inplace True allows artifacts to be uploaded; however workflow succeeds even if there are errors
  - inplace False fails workflow if there are errors
2022-02-16 18:09:23 -05:00
ReenigneArcher
5163ec93b4 Update clang.yml 2022-02-16 18:02:05 -05:00
ReenigneArcher
2be7790415 Update clang.yml
- Add upload artifacts
2022-02-16 17:58:06 -05:00
ReenigneArcher
27d2735454 Create clang.yml 2022-02-16 17:51:05 -05:00
ReenigneArcher
361e5f7ea7 Create dependabot.yml 2022-02-16 17:50:52 -05:00
ReenigneArcher
4a483078ad Merge pull request #30 from SunshineStream/nightly
v0.12.0
2022-02-14 14:09:15 -05:00
ReenigneArcher
4dff0c8384 Merge branch 'nightly' of https://github.com/SunshineStream/Sunshine into nightly 2022-02-13 13:04:41 -05:00
ReenigneArcher
543254691b v0.12.0 2022-02-13 13:04:17 -05:00
ReenigneArcher
96205dc48d Merge pull request #51 from SunshineStream/improve-version-verification
Improve version verification
2022-02-13 13:02:39 -05:00
ReenigneArcher
ec5ea7cffb Update CI.yml
- Version from .desktop file needs to be 1.0 (this is not the sunshine version)
- Setting VERSION environment variable will set AppImage version, otherwise short commit hash will be used
2022-02-13 12:45:13 -05:00
ReenigneArcher
8bb7a63479 Fix job needs
- Build jobs didn't run if `check_versions` doesn't run (need to ENSURE PR check into master is successful before merging!)
2022-02-13 12:17:04 -05:00
ReenigneArcher
95302485a0 Improve version verification 2022-02-13 12:07:10 -05:00
ReenigneArcher
7a1347c1f5 Merge branch 'v0.12.0-changelog' into nightly 2022-02-13 09:31:46 -05:00
ReenigneArcher
a78ad20142 Merge branch 'nightly' into v0.12.0-changelog 2022-02-13 09:30:33 -05:00
ReenigneArcher
9dd6576b26 Update CHANGELOG.md
- Update v0.12.0 release date
2022-02-13 09:25:41 -05:00
ReenigneArcher
cf8a843b03 Merge pull request #43 from SunshineStream/update-web-ui
Update web ui
2022-02-13 09:21:45 -05:00
ReenigneArcher
8b423315d0 Use local fontawesome assets 2022-02-10 18:34:35 -05:00
ReenigneArcher
7417430659 Update .gitignore 2022-02-10 18:32:50 -05:00
ReenigneArcher
a494bfa1e9 Merge pull request #49 from SunshineStream/fix-sample-config
Fix sample config
2022-02-10 07:08:10 -05:00
ReenigneArcher
e239751f50 Update sunshine.conf
- Rename `amd_preset` to `amd_quality`
- Document `key_rightalt_to_key_win`
2022-02-09 19:44:45 -05:00
ReenigneArcher
91465ed257 Update config.html
- Fix some typos
- Reformat some tags
2022-02-09 19:44:05 -05:00
ReenigneArcher
830fa6567b Fix ico file
- All sizes available on separate layers
2022-02-08 23:09:10 -05:00
ReenigneArcher
f347089312 Fix font-awesome stylesheet 2022-02-08 23:08:36 -05:00
ReenigneArcher
a577f76d71 Fix favicon and logo 2022-02-08 21:35:48 -05:00
ReenigneArcher
89f05711e0 Use cdn for fontawesome 2022-02-08 21:35:00 -05:00
ReenigneArcher
b19803564c Update issues.yml
- Label discussions
2022-02-06 17:42:38 -05:00
ReenigneArcher
a9988cb346 Update issues-stale.yml
- Change time of scheduled trigger
2022-02-06 17:42:20 -05:00
ReenigneArcher
b288993b86 Rename workflow 2022-02-06 17:32:55 -05:00
ReenigneArcher
37e608a889 Update CHANGELOG.md 2022-02-06 17:23:57 -05:00
ReenigneArcher
067214a9f9 Merge pull request #36 from cfajardo/add-application-image
Add application image
2022-02-06 16:44:43 -05:00
Christophe Fajardo
b5896c8f26 remove NOTICE from CMakeLists.txt 2022-02-06 21:28:03 +01:00
ReenigneArcher
9f4ad530ca Update web ui
- Add fontawesome
- Add favicon
- Add logo
- Add support and legal links to index.html
- Improve layout of index.html
- Improve layout of navbar
2022-02-05 18:18:00 -05:00
ReenigneArcher
c6d489da11 Merge pull request #42 from okkiv/master
fix git url in build scripts
2022-02-04 09:28:52 -05:00
okkiv
c3d498e30c fetch correct sources 2022-02-04 11:54:20 +01:00
okkiv
bd8ba66023 fetch correct sources 2022-02-04 11:53:49 +01:00
Christophe Fajardo
cf859b7c13 NOTICE file added with Steam trademarks notice 2022-02-03 22:15:13 +01:00
Christophe Fajardo
3b2c70422a remove double quotes from path 2022-02-03 22:02:36 +01:00
Christophe Fajardo
a9ebdf6785 fixed apps_linux typo 2022-02-03 09:58:57 +01:00
Christophe Fajardo
8164b514e1 apps page image path documentation update 2022-02-02 23:04:25 +01:00
Christophe Fajardo
398bf9819e steam.png added 2022-02-02 23:02:49 +01:00
Christophe Fajardo
59959d6397 extension bugfix and default app_windows.json image-path fixed 2022-02-01 23:14:05 +01:00
ReenigneArcher
cbbd813c5a Merge pull request #38 from ReenigneArcher/add-version-argument
Add version argument
2022-01-25 16:51:06 -05:00
Christophe Fajardo
f4344ade53 tolower on extension 2022-01-25 21:13:54 +01:00
Christophe Fajardo
8e1b718d7f reviews changes 2022-01-24 21:33:26 +01:00
ReenigneArcher
ed62a1f93d Add "v" to --version argument output 2022-01-23 18:38:15 -05:00
ReenigneArcher
592cb002bd Add version test
- Add version test on push or PR targets to master branch (AppImage only)
2022-01-23 18:20:37 -05:00
ReenigneArcher
ebc581e165 Merge pull request #34 from TheElixZammuto/web-ui-fixes
UI Web Fixes
2022-01-23 13:35:02 -05:00
ReenigneArcher
c7a3f7f46e Add version argument 2022-01-23 13:05:35 -05:00
Elia Zammuto
41df9c658b Update welcome.html 2022-01-23 17:31:59 +01:00
Elia Zammuto
4bada2d9f6 Update pin.html 2022-01-23 17:31:32 +01:00
Christophe Fajardo
83da80f631 Fix HTTP content type for appassets 2022-01-23 16:27:31 +01:00
Christophe Fajardo
2bcb713b82 formating 2022-01-23 11:33:02 +01:00
ReenigneArcher
e5239583b5 Merge pull request #28 from alvaromunoz/patch-1
Update index.html
2022-01-20 23:02:32 -05:00
ReenigneArcher
4126a1a98e Update CHANGELOG.md
- Update based on #33
- Fix year for 2021 releases
2022-01-20 22:56:53 -05:00
Christophe Fajardo
abf2a5ea4e minor refactoring and Content-Type header 2022-01-20 18:10:30 +01:00
Christophe Fajardo
a9bbadf8ad WebUI image path configuration added 2022-01-20 16:15:44 +01:00
Christophe Fajardo
38dcdcba2f fully working backend image posters 2022-01-20 15:55:06 +01:00
Christophe Fajardo
4a50fcafd8 send image as a binary stream 2022-01-20 14:31:16 +01:00
Christophe Fajardo
67f35dfc5f Merge branch 'nightly' into add-application-image 2022-01-20 09:17:39 +01:00
ReenigneArcher
de9136c61e Merge pull request #33 from cfajardo/psyke83-bufsize-fix
video: use a better vbv-bufsize & correct software bitrate calculation
2022-01-19 20:23:33 -05:00
Elia Zammuto
dd7736e806 UI Web Fixes 2022-01-19 21:27:17 +01:00
ReenigneArcher
720f44c03b Merge pull request #32 from SunshineStream/update-issue-template
Update bug-report.yml
2022-01-18 21:58:10 -05:00
Christophe Fajardo
3981ca0840 applist image attribute 2022-01-18 22:06:20 +01:00
Alvaro
9f707f9015 Update index.html 2022-01-18 11:08:23 -03:00
Conn O'Griofa
1b6bf8fa34 video: use a better vbv-bufsize & correct software bitrate calculation
* Increase vbv-bufsize to 1/10 of requested bitrate. The previous value
  was too low, which was resulting in poor encoding quality and failure to
  stabilize at the requested bitrate. Setting to 1/10 of bitrate is a
  good compromise, as it avoids quality loss but also prevents bandwidth
  spikes far above the bitrate/vbv-maxrate.
* With vbv-bufsize set to a more appropriate value, testing shows that
  the average bitrate vs client-requested bandwidth overshoots by ~20%.
  Adjust for this scenario in the software encoding case only.
2022-01-18 09:42:25 +01:00
ReenigneArcher
41e6344995 Update bug-report.yml
- Use form instead of template
2022-01-16 14:05:18 -05:00
ReenigneArcher
5993deadb2 Merge pull request #31 from SunshineStream/fix-changelog-parser-issue
Update create_package.yml
2022-01-15 19:32:35 -05:00
ReenigneArcher
7306a3468d Update create_package.yml
-Use master branch for verify_changelog action
2022-01-15 19:19:15 -05:00
ReenigneArcher
1513880f63 Merge pull request #29 from SunshineStream/fix-changelog-parser-issue
Fix changelog_parser action
2022-01-15 19:10:25 -05:00
ReenigneArcher
41044ab97f Update CHANGELOG.md
- changelog parser action fails if "v" is in prefix
2022-01-15 00:48:30 -05:00
Alvaro
1b392e3921 Update index.html
Update repo address
2022-01-13 23:38:32 -03:00
ReenigneArcher
870b6e2675 Merge pull request #27 from SunshineStream/nightly
v0.11.1
2022-01-13 16:17:32 -05:00
ReenigneArcher
ac7fcfe056 Merge pull request #26 from ReenigneArcher/update-changelog
Update changelog
2022-01-12 19:08:40 -05:00
ReenigneArcher
55ac123d03 Update history 2022-01-12 19:01:00 -05:00
ReenigneArcher
c748980f58 Merge branch 'SunshineStream:nightly' into nightly 2022-01-12 18:29:50 -05:00
ReenigneArcher
d1a41ad8fe Merge pull request #6 from ReenigneArcher/add-build-checks
Automated PR tests and releases
2022-01-12 17:19:12 -05:00
ReenigneArcher
db6e2a57ad Merge pull request #9 from ReenigneArcher/add-build-checks
Update create_package.yml
2022-01-11 19:10:36 -05:00
ReenigneArcher
f2c53a52c2 Update create_package.yml
-Verify changelog requires checkout
2022-01-11 18:55:58 -05:00
ReenigneArcher
adfb3619c3 Merge pull request #8 from ReenigneArcher/add-build-checks
Test
2022-01-11 18:52:43 -05:00
ReenigneArcher
8781fbcc20 Update create_package.yml
- github.base_ref is needed for pull request check
2022-01-11 18:35:05 -05:00
ReenigneArcher
2c0873332c Merge pull request #6 from ReenigneArcher/add-build-checks
Update create_package.yml
2022-01-11 18:20:41 -05:00
ReenigneArcher
a2c45f8de0 Update create_package.yml
-Fix typo in Windows build
2022-01-11 18:03:30 -05:00
ReenigneArcher
cefcaed358 Update create_package.yml 2022-01-11 17:40:58 -05:00
ReenigneArcher
6ba4b56f32 Merge pull request #4 from ReenigneArcher/test_release
Update CHANGELOG.md
2022-01-11 10:53:26 -05:00
ReenigneArcher
bfda8558ea Update CHANGELOG.md 2022-01-11 10:39:20 -05:00
ReenigneArcher
cc5c1a9b90 Merge pull request #3 from ReenigneArcher/add-build-checks
Add build checks
2022-01-11 10:32:21 -05:00
ReenigneArcher
c5d782dac5 Remove Ubuntu 18.04 from strategy 2022-01-11 10:18:52 -05:00
ReenigneArcher
60d63fcd21 Update create_package.yml
-Remove push event for add-build-checks
2022-01-11 10:01:43 -05:00
ReenigneArcher
8f99d6cf01 Delete create_release.yml 2022-01-11 10:01:20 -05:00
ReenigneArcher
4c6a0cdc37 Package based on strategy matrix 2022-01-11 09:46:18 -05:00
ReenigneArcher
0cad1bf6a5 Revert changes 2022-01-11 09:45:45 -05:00
ReenigneArcher
95a478e55e Revert changes 2022-01-11 09:45:23 -05:00
ReenigneArcher
41a30b5826 Skip packaging/release for Fedora build 2022-01-11 01:13:57 -05:00
ReenigneArcher
b1030b6601 Move gen-deb to Dockerfiles 2022-01-11 01:13:29 -05:00
ReenigneArcher
5dfd5d8027 set -e
Github not respecting -e in shebang
2022-01-11 00:46:47 -05:00
ReenigneArcher
51b7dc5b5c Update create_package.yml 2022-01-11 00:14:49 -05:00
ReenigneArcher
7bfbdd5bc0 Update create_package.yml 2022-01-11 00:12:54 -05:00
ReenigneArcher
aa3137c0a9 Update create_package.yml
-Replace create_release.yml with common create_release action
2022-01-11 00:04:13 -05:00
ReenigneArcher
c2027a5481 Remove token
The documentation states "The called workflow is automatically granted access to `github.token` and `secrets.GITHUB_TOKEN`."
2022-01-10 21:46:12 -05:00
ReenigneArcher
909e36b80d Update create_package.yml
-Use with instead of secrets on caller workflow
2022-01-10 21:20:36 -05:00
ReenigneArcher
4fa2624495 Update create_package.yml
-Initialize workflow
2022-01-10 21:17:20 -05:00
ReenigneArcher
a97c88c45b Update create_package.yml
-Fix typo in uses path
2022-01-10 21:15:34 -05:00
ReenigneArcher
c579f638fc Create CHANGELOG.md 2022-01-10 21:12:04 -05:00
ReenigneArcher
65fdf8f6d1 Create create_release.yml 2022-01-10 21:11:58 -05:00
ReenigneArcher
f6fd1f7e84 Update and rename create_package.yml
-Create release on push to master (fails if changelog version matches latest release)
-Move windows package to artifacts folder
-Use re-usable workflow create_release.yml
2022-01-10 21:11:44 -05:00
ReenigneArcher
732f5bf21d Merge pull request #2 from TheElixZammuto/build-patch-windows
Build Checks - Fixed Windows Build
2021-12-27 10:19:47 -05:00
Elia Zammuto
6d2d3eca18 Manually Imported Upstream PR #296
https://github.com/loki-47-6F-64/sunshine/pull/296 by psyke83 should fix the header issue by compiling
2021-12-26 23:32:34 +01:00
Elia Zammuto
997738816d Update pull-requests_build-check.yml 2021-12-24 12:19:28 +01:00
Elia Zammuto
41906b6fab Use msys2 for Windows Build 2021-12-24 11:27:40 +01:00
ReenigneArcher
c910de12ff Update Dockerfile-ubuntu_18_04 2021-12-21 19:34:42 -05:00
ReenigneArcher
2baed357f2 Update Dockerfile-ubuntu_18_04 2021-12-21 19:10:27 -05:00
ReenigneArcher
ee513939aa Update Dockerfile-ubuntu_18_04 2021-12-21 18:51:55 -05:00
ReenigneArcher
b843ab7b97 Update Dockerfile-ubuntu_18_04 2021-12-21 18:33:59 -05:00
ReenigneArcher
8c37fa8d8b Update Dockerfile-ubuntu_18_04 2021-12-21 18:19:38 -05:00
ReenigneArcher
a46a14c6ac Update Dockerfile-ubuntu_18_04
-Test building glibc 2.31
2021-12-21 18:08:52 -05:00
ReenigneArcher
2fec2bfc51 Update pull-requests_build-check.yml
-Change version for MarkusJx/install-boost
2021-12-21 17:37:40 -05:00
ReenigneArcher
ea1e6f20a8 Update Dockerfile-ubuntu_20_04 2021-12-21 00:07:51 -05:00
ReenigneArcher
aeb72cba02 Update Dockerfile-ubuntu_18_04 2021-12-21 00:07:24 -05:00
ReenigneArcher
279fb8803e Update Dockerfile-ubuntu_18_04 2021-12-20 23:54:46 -05:00
ReenigneArcher
59394e23f4 Update Dockerfile-ubuntu_18_04 2021-12-20 23:43:23 -05:00
ReenigneArcher
8f78b599ae Use update-alternatives for gcc-10 and g++-10 2021-12-20 23:23:26 -05:00
ReenigneArcher
cc4ec1b526 Update Dockerfile-ubuntu_18_04 2021-12-20 23:00:25 -05:00
ReenigneArcher
18a977fdf1 Update pull-requests_build-check.yml 2021-12-20 21:38:32 -05:00
ReenigneArcher
bc945df0a7 Update pull-requests_build-check.yml 2021-12-20 21:31:22 -05:00
ReenigneArcher
32867d1bbf Update pull-requests_build-check.yml
-Try Windows build with Unix Makefiles
2021-12-20 21:15:24 -05:00
ReenigneArcher
c844290c81 Update pull-requests_build-check.yml 2021-12-20 18:26:38 -05:00
ReenigneArcher
4a1f5194cc Update pull-requests_build-check.yml
-Remove libc++
-Try setting compiler to c++17
2021-12-20 18:15:16 -05:00
ReenigneArcher
0db8e634a8 Update pull-requests_build-check.yml
-Fix name of libc++ for windows build
2021-12-20 17:54:13 -05:00
ReenigneArcher
8309ee965a Update pull-requests_build-check.yml
-Add mingw-w64-libc++
2021-12-20 17:38:42 -05:00
ReenigneArcher
0fa4a89223 Merge pull request #2 from SunshineStream/nightly
Add TEMPLATES and WORKFLOWS
2021-12-20 17:22:50 -05:00
ReenigneArcher
9350afbe6a Test boost compiled with mingw 2021-12-20 15:52:01 -05:00
ReenigneArcher
7ce9d27a67 Update Dockerfile-ubuntu_18_04
-Add ffmpeg
2021-12-19 19:20:20 -05:00
ReenigneArcher
83a4440cad Update Dockerfile-ubuntu_18_04
-Add libboost-regex-dev
2021-12-19 18:53:16 -05:00
ReenigneArcher
85cd54fdfe Update Dockerfile-ubuntu_18_04
-Move wget
2021-12-19 18:37:52 -05:00
ReenigneArcher
c3eabebd91 Update Dockerfile-ubuntu_18_04
-Try different cmake repo
2021-12-19 18:35:02 -05:00
ReenigneArcher
26aff26eb0 Update Dockerfile-fedora_35
-Add gcc-c++ package
2021-12-19 18:03:50 -05:00
ReenigneArcher
07b974d638 Update Dockerfile-fedora_33 2021-12-19 17:47:35 -05:00
ReenigneArcher
75cdac5dbf Update Dockerfile-ubuntu_18_04
-Remove cmake build
-Test pipefail
2021-12-19 17:19:01 -05:00
ReenigneArcher
7c6fecf13d Fix cmake 2021-12-19 16:46:47 -05:00
ReenigneArcher
7c96ee1e00 Fix cmake
-Add repo for updated cmake
2021-12-19 16:22:17 -05:00
ReenigneArcher
975c4e6b26 Install rpmfusion as separate command 2021-12-19 16:03:08 -05:00
ReenigneArcher
c4838424db Remove --no-install-recommends option 2021-12-19 16:02:13 -05:00
ReenigneArcher
e07279707a Update dockerfiles
-Fix spacing
2021-12-19 15:40:12 -05:00
ReenigneArcher
1e0db7df4e Rename deb to Linux 2021-12-19 15:39:39 -05:00
ReenigneArcher
b41cbc8ab4 Fix fedora version 2021-12-19 15:24:02 -05:00
ReenigneArcher
906870d36f Back to single line install command
-Testing, dockerfiles fail when packages split into multiple lines
2021-12-19 15:23:11 -05:00
ReenigneArcher
95baeed75e Re-order RUN command 2021-12-19 15:05:23 -05:00
ReenigneArcher
a622c1591e Rename job deb to Linux 2021-12-19 15:04:54 -05:00
ReenigneArcher
030269b596 Cleanup dockerfiles 2021-12-19 14:55:53 -05:00
ReenigneArcher
5ff5d46ba5 Cleanup dockerfiles 2021-12-19 14:41:04 -05:00
ReenigneArcher
d1ab44912b Fix dockerfile 2021-12-19 13:23:06 -05:00
ReenigneArcher
23c6e455fe Update Dockerfile-ubuntu_18_04
-Fix gcc-10
2021-12-19 11:10:40 -05:00
ReenigneArcher
7b5ac1c869 Update Dockerfile-fedora_35 2021-12-19 11:06:09 -05:00
ReenigneArcher
143ca274f5 Update Dockerfile-fedora_33 2021-12-19 11:06:06 -05:00
ReenigneArcher
7d51a4bfbf change linux names to lowercase 2021-12-19 10:45:29 -05:00
ReenigneArcher
23e64f23a8 Add additional distros 2021-12-19 10:40:11 -05:00
ReenigneArcher
a5e2df11eb Update pull-requests_build-check.yml 2021-12-19 00:42:34 -05:00
ReenigneArcher
4406f7428b Update pull-requests_build-check.yml 2021-12-19 00:11:15 -05:00
ReenigneArcher
17770fe130 Update pull-requests_build-check.yml 2021-12-19 00:04:20 -05:00
ReenigneArcher
ff47a13bc3 Update pull-requests_build-check.yml 2021-12-18 23:44:02 -05:00
ReenigneArcher
ed38b7e86c Update pull-requests_build-check.yml
-Testing
2021-12-18 23:35:41 -05:00
ReenigneArcher
3f2ee64293 Update pull-requests_build-check.yml
-Testing
2021-12-18 22:39:07 -05:00
ReenigneArcher
2512e7f445 Update pull-requests_build-check.yml
-Testing
2021-12-18 22:22:27 -05:00
ReenigneArcher
9fbfca5699 Update pull-requests_build-check.yml
-Try boost 1.72.0
2021-12-18 21:19:23 -05:00
ReenigneArcher
1039160d3a Update pull-requests_build-check.yml
-Try boost v1.73.0 built on windows server 2019
2021-12-18 20:57:11 -05:00
ReenigneArcher
214478760b Update pull-requests_build-check.yml
-Try older version of boost, new version failing with cmake 3.22
2021-12-18 19:37:32 -05:00
ReenigneArcher
c49cbd3c3c Update pull-requests_build-check.yml 2021-12-18 19:15:05 -05:00
ReenigneArcher
de8cff072d Update pull-requests_build-check.yml
-Add environment variable BOOST_ROOT
2021-12-18 18:41:58 -05:00
ReenigneArcher
2b0e1fb9dc Update pull-requests_build-check.yml
-Fix boost install directory
2021-12-18 18:21:12 -05:00
ReenigneArcher
f6d9061441 Update pull-requests_build-check.yml
-Install boost
-Remove boost debug during cmake
2021-12-18 18:16:27 -05:00
ReenigneArcher
71b5495569 Update pull-requests_build-check.yml
-Boost debug on
2021-12-18 17:59:30 -05:00
ReenigneArcher
0fa68397b7 Update pull-requests_build-check.yml
-Fix path issue for pacman command
2021-12-18 17:39:49 -05:00
ReenigneArcher
2561886189 Update pull-requests_build-check.yml
-Add Windows build
2021-12-18 17:36:39 -05:00
ReenigneArcher
b73ddc232b Update pull-requests_build-check.yml
-Fix permission denied error when moving deb package
2021-12-18 17:01:54 -05:00
ReenigneArcher
65b9b653d0 Update pull-requests_build-check.yml
-Fix command that moves deb package
-Separate setup, build, and package steps
2021-12-18 16:51:49 -05:00
ReenigneArcher
ca8917dd1b Update pull-requests_build-check.yml
-build with -u for non interactive
2021-12-18 16:31:45 -05:00
ReenigneArcher
bbdf9618ea Update pull-requests_build-check.yml 2021-12-18 11:41:06 -05:00
ReenigneArcher
23f9474e9e Update pull-requests_build-check.yml 2021-12-18 11:34:49 -05:00
ReenigneArcher
69642d2db3 Update pull-requests_build-check.yml 2021-12-18 11:03:56 -05:00
ReenigneArcher
47a7c5e27b Fix typo in docker build readme 2021-12-17 22:25:22 -05:00
ReenigneArcher
502bf8ebf8 Update pull-requests_build-check.yml
-Add deb job with matrix strategy
2021-12-17 22:00:37 -05:00
ReenigneArcher
ecba80372d Merge pull request #1 from ReenigneArcher/add-build-checks
Add build checks (just AppImage for now)
2021-12-17 22:00:02 -05:00
ReenigneArcher
f272b865cd Update pull-requests_build-check.yml
-recursive submodules
-only run on PR for master or nightly branch
2021-12-17 17:36:11 -05:00
ReenigneArcher
89cfbc6bd3 Update pull-requests_build-check.yml
-Checkout recursively with submodules
2021-12-17 14:15:23 -05:00
ReenigneArcher
e2d3fef9db Update pull-requests_build-check.yml
-Attempt to fix build step at line 56
-Various tweaks to quoting and directory names
2021-12-17 13:30:19 -05:00
ReenigneArcher
c5b8deff41 Update pull-requests_build-check.yml
-Fix syntax error
2021-12-17 10:59:55 -05:00
ReenigneArcher
8478ccca5d Create pull-requests_build-check.yml 2021-12-17 10:55:23 -05:00
ReenigneArcher
a268cb552d Create sunshine.desktop 2021-12-17 10:55:20 -05:00
ReenigneArcher
1b0978f252 Create sunshine.png 2021-12-17 10:55:18 -05:00
ReenigneArcher
8730980ab8 Update config.yml
-Fix path for discussions url
2021-12-16 12:14:26 -05:00
ReenigneArcher
caf70d703e Update bug-report.md
-Add lines for gpu information and capture method
2021-12-16 11:13:19 -05:00
ReenigneArcher
95ced89d5e Add .github 2021-12-16 10:39:14 -05:00
loki-47-6F-64
e4c9c292e5 Fix package generation when building with the scripts 2021-10-05 13:53:58 +02:00
loki-47-6F-64
fe7a7f4d77 Fix build scripts when used on Ubuntu 21.04 2021-10-04 20:53:40 +02:00
loki
cb0b32f90a Add icon to windows executable 2021-10-03 21:12:06 +02:00
loki-47-6F-64
9e93bb2dd8 Merge branch 'master' into crct 2021-10-03 19:21:02 +02:00
loki-47-6F-64
0e6c41f823 Merge pull request #240 from luk1337/master
Explicitely link to Boost::log on non-win32 platforms
2021-10-03 19:19:32 +02:00
loki-47-6F-64
725212b8a4 Create scripts that handle building from source automatically 2021-10-03 18:46:34 +02:00
LuK1337
a275ee6b65 Explicitely link to Boost::log on non-win32 platforms
This fixes linker errors related to boost log library.
2021-10-03 00:18:05 +02:00
loki-47-6F-64
997095ce39 Resolve merge conflicts 2021-10-01 11:30:12 +02:00
loki-47-6F-64
8b9cd51134 Merge branch 'master' of github.com:loki-47-6F-64/sunshine 2021-09-27 19:12:51 +02:00
loki-47-6F-64
e7cbfb3ee9 Fix dependencies for debian bullseye 2021-09-27 19:54:32 +02:00
loki-47-6F-64
1f7bdb1b2a Fix segfault when multiple controllers connected 2021-09-27 19:35:06 +02:00
loki-47-6F-64
9f14b2278d Fix rate control for hevc with amdvce 2021-09-27 19:12:42 +02:00
loki-47-6F-64
4177b02064 Allow cuda kernel to run in parallell 2021-09-27 17:58:35 +02:00
loki-47-6F-64
847d7b6980 Fix minor error in README 2021-09-26 23:45:44 +02:00
diadatp
ef1114512f test 3 2021-09-27 01:29:52 +05:30
diadatp
38c36c00c9 test 2 2021-09-27 00:54:53 +05:30
diadatp
846820f4ec test 1 2021-09-27 00:24:24 +05:30
diadatp
c39e90b9b0 Trying again with full cuda install. 2021-09-26 22:36:22 +05:30
diadatp
096d7587c3 Forgot sudo in appveyor config file. 2021-09-26 19:06:29 +05:30
diadatp
27f5bb60e5 Testing AppVeyor CUDA install. 2021-09-26 18:55:28 +05:30
diadatp
70ed5ce829 Merge branch 'master' into cmake_cuda 2021-09-26 17:48:51 +05:30
diadatp
e58dc8e446 Fix CUDA build via CMakeLists flags. 2021-09-26 16:01:59 +05:30
loki-47-6F-64
60e3538adc Attempt to fix ubuntu 20.04 build, again 2021-09-26 11:39:36 +02:00
loki-47-6F-64
e2fb02323c Attempt to fix ubuntu 20.04 build 2021-09-26 10:57:43 +02:00
loki-47-6F-64
57c7945847 Fix typo in README 2021-09-26 00:18:49 +02:00
loki-47-6F-64
68c723e135 Resolve merge conflicts 2021-09-26 00:16:14 +02:00
loki-47-6F-64
0241414dfb Merge branch 'cuda' of github.com:loki-47-6F-64/sunshine into cuda 2021-09-25 22:31:48 +02:00
loki-47-6F-64
c5a356f3e7 Fix compilation on ubuntu 20.04 2021-09-25 22:31:39 +02:00
loki-47-6F-64
deecd19af2 Update appveyor.yml 2021-09-25 21:50:47 +02:00
loki-47-6F-64
f4cb13aa0e Merge pull request #229 from hadicharara/master
Added warning for low version of ffmpeg
2021-09-25 21:16:26 +02:00
Hadi Charara
4385014049 Added warning for low version of ffmpeg 2021-09-25 15:09:03 -04:00
loki-47-6F-64
fcb84132f4 Sharper images when not scaling the image 2021-09-25 19:18:43 +02:00
loki-47-6F-64
50bd3094b4 More accurate capture rate for NvFBC 2021-09-25 17:46:26 +02:00
loki-47-6F-64
d7cb71f877 Update README 2021-09-25 15:35:44 +02:00
loki-47-6F-64
e287404992 Handle acquiring display names based on encoder 2021-09-25 14:44:38 +02:00
loki-47-6F-64
d332f11101 Update instructions in the config file 2021-09-25 13:12:13 +02:00
loki-47-6F-64
f78a9e2ccf Fix downscaling image when using cuda 2021-09-25 12:44:45 +02:00
loki-47-6F-64
bd7294e672 Fix cuda kernel launch when encoding in 4K 2021-09-22 19:12:20 +02:00
loki-47-6F-64
b3304a059d Target older cuda architecture for compatibility 2021-09-22 14:49:49 +02:00
loki-47-6F-64
d0529fb234 Make dependency on cuda development files optional 2021-09-22 14:17:08 +02:00
loki-47-6F-64
bb912786bd Added NvFBC on Linux 2021-09-22 11:36:59 +02:00
loki-47-6F-64
8f47190ffc Test for availability of crct info before using it 2021-09-20 18:37:51 +02:00
loki-47-6F-64
196f1f7471 Make changes in brightness of the color more visible 2021-09-20 00:21:54 +02:00
loki-47-6F-64
e3cc25f23f Use linear interpolation with the cuda kernel 2021-09-20 00:03:33 +02:00
loki-47-6F-64
a963b31c1d Ensure the background color is black 2021-09-19 23:00:42 +02:00
loki-47-6F-64
4d1689d6e9 Each cuda::sws_t has it's own color matrix 2021-09-19 21:27:31 +02:00
loki-47-6F-64
fed329568c Use an actual cuda kernel to convert RGB to NV12 2021-09-19 20:40:34 +02:00
loki-47-6F-64
e3f642ac25 Reduce cpu usage with x11grab 2021-09-15 12:10:12 +02:00
loki-47-6F-64
c94d922282 Fix windows build 2021-09-14 19:16:29 +02:00
loki-47-6F-64
7563a0fa1f Merge branch 'master' into cuda 2021-09-14 15:09:21 +02:00
loki-47-6F-64
f5db0e438b The background is black instead of green 2021-09-14 15:07:34 +02:00
loki-47-6F-64
9982ae4675 Convert images on the GPU on Linux for NVidia cards 2021-09-14 11:58:21 +02:00
loki
69eba9c493 Merge branch 'master' of github.com:loki-47-6F-64/sunshine 2021-09-13 20:55:16 +02:00
loki-47-6F-64
2c67d73f08 Merge pull request #214 from exetico/patch-1
Adding note about `sink` in pipewire
2021-09-13 20:54:35 +02:00
loki
7f4b9cf36c Change where keycode is mapped 2021-09-13 20:34:45 +02:00
loki
9c0ea17ada Update Linux specific code for fix in previous commit 2021-09-13 20:33:17 +02:00
loki
91a6e55f74 Fix segfault when connecting multiple controllers at the same ttime 2021-09-13 20:24:04 +02:00
Tobias Nordahl Kristensen
fea650fbe4 Typo ipewire 2021-09-13 17:17:32 +02:00
Tobias Nordahl Kristensen
35e0497f86 Adding note about sink in pipewire
Also, splitting it up to two points, so it's a bit easier to read.
2021-09-11 16:07:52 +02:00
loki-47-6F-64
fbc3735f44 Merge pull request #210 from WisdomCode/master
Apply key rewrite also when keeping key pressed
2021-09-09 21:23:22 +02:00
WisdomCode
9be80c103e Shortcut Flags need to be adjusted as well 2021-09-09 21:15:35 +02:00
WisdomCode
640f2b1c55 Syntax 2021-09-09 15:05:04 +02:00
WisdomCode
d8df57130a Apply key rewrite also when keeping key pressed 2021-09-09 14:57:04 +02:00
loki-47-6F-64
3ba0533773 Merge pull request #207 from WisdomCode/master
Add non US Backslash for international keyboards on Linux
2021-09-08 21:59:44 +02:00
Christian Rupp
b1224032a1 Add non US Backslash for international keyboards on Linux 2021-09-08 17:18:27 +02:00
loki-47-6F-64
1a7ed53559 Merge pull request #205 from sethicis/patch-1
Update README.md
2021-09-07 09:10:37 +02:00
Kyle Blagg
9e9487617a Update README.md
Added a troubleshooting note for an issue encountered on Manjaro Linux due to Avahi.
2021-09-06 20:49:20 -04:00
Loki
d68b8138a5 Detect x11/wayland at runtime 2021-09-06 20:40:41 +02:00
Loki
10ca72f934 Refactor egl::surface_descriptor_t, removed obj_count and plane_indices 2021-09-06 19:46:42 +02:00
loki-47-6F-64
9dbf0df67d Merge pull request #202 from angelnu/patch-1
libcap-dev is associated to libcap2
2021-09-05 11:18:31 +02:00
Loki
b072af3082 Fix bad file descriptor when using wlgrab 2021-09-05 11:16:59 +02:00
Angel Nunez Mencias
35c8b74bb4 libcap-dev is associated to libcap2
at least since Ubuntu 18.04
2021-09-05 01:30:55 +02:00
Loki
7fbe9ba34f Added warning if only one of libcap or libdrm has been found 2021-09-04 20:15:08 +02:00
Loki
81c6ca5915 Merge branch 'master' into setcap-p 2021-09-04 18:30:29 +02:00
loki
d73a4a38e5 Fix multi-monitor setup with KMSgrab 2021-09-04 18:16:36 +02:00
David Rosca
6309f478a2 kmsgrab: Only gain effective CAP_SYS_ADMIN when needed 2021-09-04 16:28:59 +02:00
loki-47-6F-64
4ca2c0e740 Merge branch 'cpu-usage' 2021-09-04 12:09:27 +02:00
loki-47-6F-64
ea9ada8d20 Trade slightly higher rumble latency for lower cpu usage 2021-09-04 12:09:12 +02:00
loki-47-6F-64
302b61090b Merge pull request #200 from nowrep/pabuf
pulse: Set pa_buffer_attr.maxlength when creating stream
2021-09-03 15:45:56 +02:00
David Rosca
75d224cd67 pulse: Set pa_buffer_attr.maxlength when creating stream 2021-09-03 14:53:53 +02:00
David Rosca
2ff9a129c0 Reduce CPU usage 2021-09-03 14:03:59 +02:00
loki-47-6F-64
a1a4ce1af8 Merge pull request #196 from nowrep/wlsoftware
wlgrab: Fix ram (software encoding) snapshot
2021-09-03 11:23:52 +02:00
David Rosca
44ac873100 wlgrab: Fix ram (software encoding) snapshot 2021-09-03 11:02:38 +02:00
loki-47-6F-64
3d179a869a Push the right change this time xD 2021-09-03 10:20:29 +02:00
loki-47-6F-64
530f2de79e Revert "Test for capability of modifiers when importing framebuffer to openGL"
This reverts commit 276aa23a61.
2021-09-03 10:16:46 +02:00
loki-47-6F-64
512e581d56 Revert "Revert "Linux: DRM modifier 0 is valid""
This reverts commit e5c2ad2069.
2021-09-03 10:16:10 +02:00
loki-47-6F-64
e5c2ad2069 Revert "Linux: DRM modifier 0 is valid"
This reverts commit e33a7ff53b.
2021-09-03 10:12:16 +02:00
loki-47-6F-64
6af961199e Remove redundent code 2021-09-03 10:01:51 +02:00
loki-47-6F-64
276aa23a61 Test for capability of modifiers when importing framebuffer to openGL 2021-09-02 20:38:45 +02:00
David Rosca
e33a7ff53b Linux: DRM modifier 0 is valid
DRM_FORMAT_MOD_LINEAR = 0
2021-09-02 12:34:27 +02:00
David Rosca
d9d50d8943 kmsgrab: Fix multi-plane import 2021-09-02 12:34:19 +02:00
loki-47-6F-64
7c753e2289 Merge branch 'master' into wlroots-drm 2021-09-01 21:50:24 +02:00
loki-47-6F-64
ff81a286bb Merge pull request #185 from TheElixZammuto/web-ui-troubleshooting
Web UI - Troubleshooting Page
2021-09-01 21:48:34 +02:00
Loki
c7c3ac7c9c Merged with master 2021-09-01 14:22:41 +02:00
Loki
74f673e23c Fix build for SUNSHINE_ENABLE_WAYLAND=OFF 2021-08-31 21:19:02 +02:00
Loki
7c51fbfd18 Correlate KMS output to wayland xdg-output 2021-08-31 20:46:50 +02:00
Elia Zammuto
7839ff8057 Minor tweaks to troubleshooting page 2021-08-30 20:46:14 +02:00
loki-47-6F-64
8b91e168e5 Merge pull request #179 from nowrep/kmsgrab-multiplane
kmsgrab: Support multi-plane formats
2021-08-29 21:07:04 +02:00
David Rosca
08f056bb3f kmsgrab: Support multi-plane formats 2021-08-29 20:26:11 +02:00
Elia Zammuto
808af7fce1 Fix Alignment 2021-08-29 18:48:43 +02:00
Elia Zammuto
090d353f3d Added Visual Feedback on action 2021-08-29 18:42:09 +02:00
Elia Zammuto
c4b371ccc9 Merge branch 'master' into web-ui-troubleshooting 2021-08-29 18:25:03 +02:00
Loki
06a1119512 Fix segfault for wlroots based capturing 2021-08-29 09:34:00 +02:00
Loki
b80c4253f0 Make KMSgrab smooth on Wayland 2021-08-28 22:22:02 +02:00
Loki
3f306de5e1 Prevent OpenGL error when switching cursor image 2021-08-28 20:30:07 +02:00
Loki
39f9506446 Fix blank video for vaapi 2021-08-28 17:48:28 +02:00
Loki
00de30d336 Omit single copy of frame with VAAPI if possible 2021-08-26 23:59:32 +02:00
Loki
b59df48dde Keep image on vram if at all possible with wlroots based compositors 2021-08-26 22:06:59 +02:00
loki-47-6F-64
3840b3c561 Merge pull request #169 from gamozolabs/master
Make Sunshine usable fully offline
2021-08-26 08:35:53 +02:00
loki-47-6F-64
b5424ec671 Merge pull request #171 from felipejfc/starting_dir
feat: add support to specifying start_dir to processes
2021-08-26 08:35:23 +02:00
Loki
ec184fb2ab Screencast wlroots based compositors 2021-08-25 16:09:42 +02:00
Felipe Cavalcanti
4a750c7b16 fix: rename starting dir with working dir 2021-08-24 21:13:33 -03:00
Felipe Cavalcanti
f38bbf90bb feat: add support to specifying start_dir to processes 2021-08-24 15:32:18 -03:00
Loki
05dcff4f87 Ask Wayland what monitor outputs are available 2021-08-23 18:22:59 +02:00
Brandon Falk
b458118e34 Pulled in remote assets locally such that Sunshine can be used fully offline 2021-08-22 05:26:39 -07:00
loki
7a920da06d Removed unnecessary references to drmModeFB2 2021-08-21 20:35:36 +02:00
loki
ec84f43b80 Bump up version number of debian package 2021-08-21 20:28:14 +02:00
loki
03d572fe10 Fix generated debian package 2021-08-20 22:21:13 +02:00
loki
c41df22c88 Fix build errors when disabling KMS 2021-08-20 22:00:26 +02:00
loki
3b3b9e2bd9 Fix reinitializing KMS framebuffer 2021-08-20 21:01:33 +02:00
loki
ebf9dbe931 Merge branch 'kmsgrab' 2021-08-19 22:19:46 +02:00
loki
0b3b78891b Update debian package 2021-08-19 22:16:02 +02:00
loki
12af30b75b Update README 2021-08-19 22:09:09 +02:00
loki-47-6F-64
a9775a0686 Merge pull request #164 from Jorys-Paulin/feature/welcome
Tweaks to the welcome page
2021-08-19 21:42:20 +02:00
loki
ca9809ca7e Fix stream based on KMS freezing when switching resolutions 2021-08-19 21:40:14 +02:00
Jorys Paulin
97e14de63e Update welcome page layout 2021-08-19 12:54:40 +02:00
loki
0f4cdc2d21 Fix hanging when switching monitors 2021-08-18 21:13:55 +02:00
loki
869b6ed89d Fix VAAPI with intel iGPU's 2021-08-18 20:19:15 +02:00
loki
1876de0a68 Fix cursor disappearing on Windows 2021-08-18 11:05:14 +02:00
Jorys Paulin
019d064d8e Disable submit button when loading 2021-08-18 10:46:57 +02:00
Jorys Paulin
d6b45eb825 Added autocompletion on welcome page 2021-08-18 10:39:24 +02:00
Jorys Paulin
556a6aaf33 Fixed labels on welcome page 2021-08-18 10:33:24 +02:00
loki
fc7ec9e538 Better validation of vaapi capability 2021-08-17 21:15:38 +02:00
Elia Zammuto
1f239214a1 Troubleshooting page 2021-08-17 20:22:47 +02:00
loki-47-6F-64
9e224987f7 Merge pull request #162 from TheElixZammuto/web-ui-prettier
Fixed Formatting of HTML pages, added Prettier Support
2021-08-17 19:15:54 +02:00
Elia Zammuto
81317ce672 Fixed Formatting of HTML pages, added Prettier Support 2021-08-17 19:12:15 +02:00
loki
fce23c482c Fix incorrect cursor location 2021-08-15 22:25:34 +02:00
loki
1d2e042240 Use standard function for create egl images 2021-08-15 22:19:08 +02:00
loki
d852bb82a3 Only use graphics card connected to monitor if it's capable of h264 encoding 2021-08-15 22:15:24 +02:00
loki
fdb7754043 Attempt to render cursor when X11 is available 2021-08-15 20:38:30 +02:00
loki-47-6F-64
62c3faaacb Merge branch 'master' of https://github.com/loki-47-6F-64/sunshine 2021-08-15 00:36:40 +02:00
loki-47-6F-64
b58279beea Omit one copy for display_vrm on Windows 2021-08-15 00:36:31 +02:00
loki
898d62bad9 Filter out cursors from drm planes 2021-08-13 16:09:05 +02:00
loki
446c8ace82 Merge branch 'master' into kmsgrab 2021-08-12 22:08:06 +02:00
loki
e007ee9976 Handle monitors in different GPU's 2021-08-12 22:07:00 +02:00
loki
6721155155 Omit copy to RAM when possible with VAAPI 2021-08-12 21:11:40 +02:00
loki-47-6F-64
b80619fb0f Merge pull request #154 from guanzhangrtk/master
Update README about MSYS2 requirement on Windows
2021-08-10 15:38:53 +02:00
GuanZhang
e75e26467f Merge branch 'loki-47-6F-64:master' into master 2021-08-09 15:54:26 +09:00
GuanZhang
2187f0b198 Merge pull request #1 from guanzhangrtk/guanzhangrtk-msys2-readme
MSYS2 is needed to build under Windows
2021-08-09 15:53:47 +09:00
GuanZhang
3382a5d03c MSYS2 is needed to build under Windows 2021-08-09 15:52:49 +09:00
loki-47-6F-64
fff9145680 Merge pull request #152 from guanzhangrtk/master
Add missing requirements for clean MSYS2 environment
2021-08-09 08:32:23 +02:00
GuanZhang
13e57bb183 Merge branch 'loki-47-6F-64:master' into master 2021-08-09 11:42:02 +09:00
GuanZhang
948500ae41 Added missing sv as requested by loki-47-6F-64 2021-08-09 11:38:12 +09:00
loki-47-6F-64
17bcdd7902 Merge pull request #153 from TheElixZammuto/password-validation
Welcome: Password Validation
2021-08-08 17:43:39 +02:00
Elia Zammuto
03837a9308 Password Validation 2021-08-08 16:47:38 +02:00
Loki
b8bfc13cf9 Prevent segfault on empty string_view 2021-08-08 13:59:43 +02:00
loki
24403cdd25 Fix segfault when switching monitors with kmsgrab 2021-08-08 13:42:25 +02:00
loki
13d0106feb Don't shutdown stream if audio capture fails 2021-08-08 13:41:09 +02:00
GuanZhang
dce64fc487 Add more detailed log message when config::nvhttp.file_state doesn't exist upon first run 2021-08-08 18:20:43 +09:00
GuanZhang
0629fe7846 Add missing requirements for clean MSYS2 environment 2021-08-08 18:04:48 +09:00
loki
315ec47523 Display single monitor only with kmsgrab 2021-08-07 21:31:25 +02:00
loki
9ed2141fc8 Fix X11 screengrabbing with vaapi 2021-08-07 14:39:18 +02:00
loki
5b40c5008f Merge branch 'master' of github.com:loki-47-6F-64/sunshine 2021-08-07 12:12:27 +02:00
loki
62db9ae01a fix reading config option for log level 2021-08-07 12:12:18 +02:00
loki-47-6F-64
8c2cd2f60d Load mDNS at runtime on Windows 2021-08-07 00:05:38 +02:00
loki
0812f6f3c3 Merge branch 'master' into kmsgrab 2021-08-06 15:56:10 +02:00
loki
065e9e718a Choose between x11grab and kmsgrab at runtime 2021-08-06 15:55:38 +02:00
loki-47-6F-64
27f1dc318b Merge pull request #137 from cgutman/win32_service
Add Win32 service to run Sunshine as LocalSystem
2021-08-06 09:26:39 +02:00
Loki
ac5f439839 Skeleton of grabbing image with kms 2021-08-05 21:24:52 +02:00
Cameron Gutman
b4255e22aa Write Sunshine log output to disk and hide the window 2021-08-03 19:27:23 -05:00
Cameron Gutman
d15c1af152 Add uninstall-service.bat 2021-08-03 18:41:23 -05:00
Cameron Gutman
0140989f3a Add Win32 service to run Sunshine as LocalSystem on login 2021-08-03 18:41:23 -05:00
Loki
793e329fa5 Merge with master 2021-08-03 20:35:57 +02:00
Loki
6702802829 Load X11 libraries at runtime 2021-08-03 20:31:27 +02:00
loki
dae9a67fe2 update README 2021-08-03 15:28:32 +02:00
loki
b8e11b1272 Merge branch 'master' of github.com:loki-47-6F-64/sunshine 2021-08-03 15:24:15 +02:00
loki
f08b6abc96 Make keybindings configurable 2021-08-03 15:24:04 +02:00
loki-47-6F-64
965812bc19 Merge pull request #146 from TheElixZammuto/web-ui-welcome
Show a Welcome Page if credentials are created the first time
2021-08-03 13:07:08 +02:00
Elia Zammuto
7f643345ce welcome now puts credentials instead of generating 2021-07-30 16:06:59 +02:00
Elia Zammuto
28fecbc50c Show a Welcome Page if credentials are created the first time Sunshine is started 2021-07-29 18:55:34 +02:00
loki
6c11e9f27d Switch monitors on Windows 2021-07-29 17:27:22 +02:00
loki
2af179630a Switch monitors based on keyboard shortcuts 2021-07-29 16:48:03 +02:00
loki
c243e82047 Add shortcut for hiding and showing the cursor 2021-07-28 22:03:17 +02:00
loki
3de77b1849 Fix error 104 in Moonlight when starting Steam Bigpicture 2021-07-27 23:05:49 +02:00
loki
37d09b0bdb Merge branch 'capture_callback' 2021-07-27 18:57:11 +02:00
loki
9a5d23ebde Fix setting default SUNSHINE_DEFAULT_DIR 2021-07-27 18:55:41 +02:00
loki-47-6F-64
da3ed5ff79 Merge pull request #142 from JacekJagosz/master
Make Sunshine on Linux stateless
2021-07-27 16:01:15 +02:00
Jacek Jagosz
2e8b462fe5 Not create unnecessary variables and make fs use strings directly instead of converting them 2021-07-27 15:58:01 +02:00
loki
87b2b708f8 Update Linux build for callback code 2021-07-26 20:56:32 +02:00
loki
7ddf8bbe94 Capturing images by callback, rather than pulling 2021-07-26 18:09:07 +02:00
loki
a87782b025 Fix stuttering on Windows 2021-07-26 14:37:57 +02:00
Jacek Jagosz
c39f2b0c1f If config files don't exist in user specified directory copy files from default, not override user choice 2021-07-25 20:39:45 +02:00
Jacek Jagosz
a07ad3e479 If CONFIG and DEFAULT directories haven't been configured, make them point to ASSETS 2021-07-25 14:09:47 +02:00
Jacek Jagosz
c58f95b79e Try making sunshine on Linux stateless 2021-07-25 14:02:58 +02:00
loki
d9f7952710 Fix weird bug where Sunshine couldn't accept user input from terminal on Linux 2021-07-25 13:16:17 +02:00
Loki
ab70a056fc Add CQP for older intel iGPU's 2021-07-24 19:33:23 +01:00
loki
844ba53f54 Remove dependency on X11 for keyboard input 2021-07-24 14:51:33 +02:00
loki
63b920cd7b Merge branch 'master' into rumble 2021-07-23 20:07:03 +02:00
loki
2a5fd78789 Fix crackling audio on Linux 2021-07-23 18:43:35 +02:00
loki
bc52fe9b82 Improve fps for software encoding on Windows 2021-07-23 17:36:32 +02:00
loki
667c113d5b Merge branch 'master' into rumble 2021-07-22 21:14:53 +02:00
loki
38915859ba Don't overwrite config files with debian package 2021-07-22 21:14:36 +02:00
loki
70d0be4b9a Add rumble effect on Linux 2021-07-22 18:19:25 +02:00
loki
dad446ea41 Print request for rumble on the terminal for Linux 2021-07-21 20:24:23 +02:00
loki
d283900e43 add config options for select gamepad to emulate 2021-07-18 15:46:46 +02:00
loki
4b043e31fe Support ds4 controller on Windows 2021-07-18 15:32:26 +02:00
loki
f65882e42a Merge branch 'master' into rumble 2021-07-18 11:06:08 +02:00
loki
1fda8f6219 Support Rumble on Windows 2021-07-18 11:05:34 +02:00
loki-47-6F-64
620c629bb4 Merge pull request #135 from cgutman/partial_chain
Fix X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE error with some embedded clients
2021-07-18 10:46:33 +02:00
Cameron Gutman
a1f63da057 Fix client auth error with some embedded clients 2021-07-17 19:34:08 -05:00
loki
5ff5942258 Fix video packet corruption after error correction 2021-07-11 16:18:49 +02:00
loki
8c803e6a34 Fix lack of audio for second client when multiple clients are connected simultaniously 2021-07-11 15:27:12 +02:00
loki
a93a640d42 Merge branch 'master' into multi-block-fec 2021-07-10 23:49:56 +02:00
loki
62abd1ee19 Merge branch 'master' of github.com:loki-47-6F-64/sunshine 2021-07-10 23:49:38 +02:00
loki
d55c6ee84c Fix incorrect scaling of absolute mouse coordinates (again) 2021-07-10 23:49:04 +02:00
loki-47-6F-64
d3419697a5 Merge pull request #125 from cgutman/yuv420_linux_nvenc
Reduce CPU usage with Linux NVENC
2021-07-10 19:10:58 +02:00
Cameron Gutman
a7171d77db Reduce CPU usage with Linux NVENC
The internal assembly routines inside libswscale perform the
RGB->YUV conversion using a fully planar output format, then
have to perform an additional YUV420->NV12 conversion step.

NVENC can directly consume YUV420 input frames, so we can
completely avoid this NV12 conversion and save quite a bit of
CPU time in the process.
2021-07-10 11:24:13 -05:00
loki
fccb8d080d Merge branch 'master' into multi-block-fec 2021-07-10 17:37:47 +02:00
loki
24acfabe07 Prevent fec encoding from exceeding DATA_SHARDS_MAX 2021-07-10 17:33:25 +02:00
loki-47-6F-64
61be0eb051 Merge pull request #120 from cgutman/nvenc_linux
Add basic NVENC support on Linux
2021-07-10 17:30:51 +02:00
loki-47-6F-64
c4b4393177 Merge pull request #123 from cgutman/longer_ping_timeout
Increase default ping timeout to 10 seconds
2021-07-10 17:30:20 +02:00
Cameron Gutman
388e4696ff Increase default ping timeout to 10 seconds
During periods of poor connectivity, the ping timeout of 2 seconds
can easily be exceeded, especially with ENet's RTO backoff active.

This causes an unnecessary disconnection when the connection would
have recovered on its own in a few seconds. Increasing the timeout
to 10 seconds should prevent spurious disconnections in most cases.
2021-07-09 23:45:59 -05:00
Cameron Gutman
43dc7cf7c0 Fix video bitstream corruption when matching replacement isn't found
NVENC doesn't always include the HEVC bitstream prefix that Sunshine
is looking to patch. When this happens replace() appends a spurious
00 00 00 01 28 NALU prefix to the end of the bitstream rather than
simply doing nothing.

This causes varying degrees of malfunctioning depending on the client,
with the worst being complete video corruption on iOS.
2021-07-09 20:04:07 -05:00
Cameron Gutman
e8feb00b33 Use a valid RTP version to fix Wireshark parsing 2021-07-09 20:01:39 -05:00
Cameron Gutman
42472bec85 Enable NVENC configuration page on Linux 2021-07-09 20:01:39 -05:00
loki-47-6F-64
769c4c8f99 Merge pull request #121 from cgutman/update_gfe_version
Update GfeVersion to be consistent with AppVersion
2021-07-09 19:05:06 +02:00
Cameron Gutman
049044f768 Update GfeVersion to be consistent with AppVersion 2021-07-09 08:47:44 -05:00
Cameron Gutman
971c784f14 Add basic NVENC support on Linux
We're not offloading scaling and YUV conversion from the CPU yet,
so the gains aren't as high as one of the fully accelerated
backends like Windows NVENC or Linux VAAPI.

Still, offloading the H.264/HEVC encoding itself is an improvement
over doing everything on the CPU.
2021-07-09 08:13:05 -05:00
loki
747ba7f23a fix incorrect pix_fmt 2021-07-09 14:21:57 +02:00
loki
4a3f3622b8 Merge branch 'master' into encrypt_control_and_audio 2021-07-09 14:19:21 +02:00
loki
7d2705424a Use extended termination error code 2021-07-09 13:26:39 +02:00
loki
b228fd371c Send back encrypted termination code 2021-07-09 12:27:38 +02:00
loki
cbd2a8269c Encrypt audio when requested by Moonlight 2021-07-08 22:44:35 +02:00
loki
7f9467d759 Add support for IDR frame request for encrypted control 2021-07-07 17:10:06 +02:00
loki
9cf7c14a26 Improve speed quitting apps 2021-07-07 17:00:12 +02:00
loki
f09aea81fe Update moonlight-common-c and Simple-Web-Server 2021-07-07 16:55:52 +02:00
loki
8249d41848 Let Moonlight know it's unauthorized, rather than just resetting the connection 2021-07-07 16:39:16 +02:00
loki-47-6F-64
d33f742241 Merge pull request #119 from cgutman/remove_superkey_workaround
Remove super key workaround
2021-07-07 07:36:54 +02:00
Cameron Gutman
6d0499b0e3 Remove super key workaround
Moonlight can now pass the super key natively
2021-07-06 23:34:11 -05:00
loki
fd7a6d070b Merge branch 'master' into encrypt_control_and_audio 2021-07-06 20:54:52 +02:00
loki
3d81b0fe7a Remove redundant code 2021-07-06 20:54:29 +02:00
loki
1d37a19468 Merge branch 'master' into encrypt_control_and_audio 2021-07-06 19:31:18 +02:00
loki-47-6F-64
cc3cf60015 Merge pull request #116 from cgutman/fix_expired_certs
Allow expired or not-yet-valid client certificates
2021-07-06 19:30:08 +02:00
loki-47-6F-64
8d4e55fcbb Merge pull request #118 from cgutman/idr_frame_delay
Fix IDR frame delays after packet loss or client request
2021-07-06 19:29:47 +02:00
loki
25aa8b41a5 Don't keep reinitializing the cipher context for gcm 2021-07-06 19:11:16 +02:00
Cameron Gutman
667878d2eb Fix IDR frame delays after packet loss or client request
This can lead to spurious poor connection warnings in Moonlight.
2021-07-05 17:55:32 -05:00
Cameron Gutman
53a9f365ce Allow expired or not-yet-valid client certificates 2021-07-05 16:42:59 -05:00
loki
a587338701 Fully encrypt control data 2021-07-05 20:58:53 +02:00
loki
a52f547726 Correctly identify size of rtsp packet 2021-07-04 21:25:10 +02:00
loki
136e9c43a5 Handle RTSP packets that are broken up in more than two pieces 2021-07-04 18:57:55 +02:00
loki
616f62fb9f Add support for periodic ping 2021-07-04 17:12:41 +02:00
loki
9d10eaeef4 Merge branch 'master' into min_fec_packets 2021-07-04 16:30:40 +02:00
loki
f23fcee382 Merge branch 'audio_fec' into min_fec_packets 2021-07-04 16:29:34 +02:00
loki
21b1a4a336 If all content has been read in RTSP request, no need for waiting for next message 2021-07-04 16:06:03 +02:00
loki
b346ac2eb0 Use tcp instead of udp for RTSP setup 2021-07-04 15:50:28 +02:00
Cameron Gutman
db5a9363ba Add support for minimum required FEC packets attribute 2021-07-04 00:14:22 -05:00
Cameron Gutman
0a637b2272 Parse additional SDP options 2021-07-03 23:38:45 -05:00
Cameron Gutman
169a53b568 Increase default FEC percentage to match GFE
Also increase the range to the maximum of 255
2021-07-03 23:37:43 -05:00
Cameron Gutman
109b48a108 Implement audio FEC support 2021-07-03 18:32:33 -05:00
Cameron Gutman
118707f37a Improve audio RTP header data to better match GFE 2021-07-03 16:05:18 -05:00
loki
e169259f6f install systemd service for debian packages 2021-07-03 18:13:05 +02:00
loki
355df9a615 Listening on arbitrary ports now compatible with Moonlight 2021-07-03 13:14:23 +02:00
loki
96cfb1f368 add missing file 2021-07-01 12:17:10 +02:00
loki
545cca792b Fix inabillity to display secure desktop even when runnig as system account 2021-06-30 22:03:21 +02:00
loki
ae04c4afbb Gracefully exit when stopped by systemd or pkill 2021-06-30 17:28:58 +02:00
loki
e8fadd2848 Update version for debian package 2021-06-30 15:51:26 +02:00
loki
beb6bdfadb Allow end user to configure what ports to listen on 2021-06-30 15:25:08 +02:00
loki
8bf4ade9d8 Disable UPnP by default 2021-06-30 12:22:37 +02:00
loki
ea928c53b4 Add support for upnp 2021-06-29 22:42:06 +02:00
loki
c1697c8562 add comma's -_- 2021-06-28 21:56:21 +02:00
loki
57c4986f0e Add necessary dependencies for Debian package 2021-06-28 21:52:24 +02:00
loki
0cc7e35ed9 Automatic service discovery for Windows 2021-06-28 21:05:52 +02:00
loki
d6eceaf0dc Fix incorrect instruction in the README 2021-06-26 16:25:46 +02:00
loki
cf7eb14573 Remove redundent thread creation 2021-06-26 15:48:07 +02:00
loki
ed5de34800 Dynamically load avahi libraries if they are available 2021-06-26 15:36:56 +02:00
loki
27d4f6063f refactored publish.cpp from C code to C++ code 2021-06-26 13:32:14 +02:00
loki
62662edc8d Merge with master 2021-06-26 12:40:06 +02:00
loki
b67600962a Fix incorrect scaling for absolute mouse coordinates 2021-06-24 20:53:19 +02:00
loki
1eda45a81a Allow installation of debian package 2021-06-24 20:23:43 +02:00
loki
926e95f527 Fix absolute mouse coordinates with multiple monitors on Windows 2021-06-23 21:51:15 +02:00
loki
029194cb60 Fix incorrect abs mouse coordinates on Linux when scaling to different aspect ratio 2021-06-23 14:05:09 +02:00
loki
7e3abefc2c pass session event objects through safe::mail_t 2021-06-22 22:26:11 +02:00
loki
cf9eb961fc Pass global event objects through mail_t 2021-06-21 21:21:52 +02:00
loki
0a05c28df8 fixed incorrect colors when scaling with software 2021-06-20 16:13:34 +02:00
loki
0034438c9e fixed incorrect colors when scaling with software 2021-06-20 15:58:13 +02:00
loki
2691489dab Merge branch 'vaapi' 2021-06-20 15:30:16 +02:00
loki
9e7ecf8db2 Allow replacement of hevc headers 2021-06-20 15:29:51 +02:00
loki-47-6F-64
32e6054435 Fix incorrect instruction in the README 2021-06-20 15:16:30 +02:00
loki-47-6F-64
bd2d846557 Merge pull request #100 from TheElixZammuto/master
Fix Config Page AMD RC settings
2021-06-18 22:52:07 +02:00
Elia Zammuto
0932d8bab9 Merge pull request #5 from TheElixZammuto/fix-config-page
Fix amd rc selection on config page
2021-06-18 22:44:25 +02:00
Elia Zammuto
82ac3becd8 Fix amd rc selection on config page 2021-06-18 22:43:55 +02:00
loki
7b86ea9e87 temporary workaround for hanging when interrupting application before http server started 2021-06-18 20:02:57 +02:00
loki
63d15333f2 Allow injecting more than one type of header data into video 2021-06-18 17:27:56 +02:00
loki
ac862f9157 bump up version of debian package 2021-06-18 12:59:39 +02:00
loki
23b09e3d41 fix an issue causing free called on unallocated data 2021-06-17 23:26:25 +02:00
loki-47-6F-64
4024378772 Merge pull request #98 from luk1337/master
include FFMPEG_INCLUDE_DIRS for third-party/cbs module
2021-06-16 19:12:57 +02:00
LuK1337
64e1132579 include FFMPEG_INCLUDE_DIRS for third-party/cbs module 2021-06-16 18:32:11 +02:00
loki-47-6F-64
6749b64ed5 Merge pull request #93 from TheElixZammuto/master
Update README to accomodate Web UI Changes
2021-06-16 16:11:03 +02:00
loki
0c43b83598 make config files writable for Web Manager on Linux when installed web debian package 2021-06-16 16:06:36 +02:00
loki
c47e3cb020 add missing file 2021-06-16 15:04:12 +02:00
loki
f3b07efaf3 add advanced option for credentials file 2021-06-16 14:49:51 +02:00
loki
02360f7aef fix build windows 2021-06-16 14:34:05 +02:00
loki
c21301a423 fix storing log level through web manager 2021-06-16 11:38:26 +02:00
loki
64a6c1419b store state in .config/sunshine on Linux 2021-06-16 11:26:54 +02:00
loki
6f95d360b5 fix web manager when installed through deb package 2021-06-15 21:56:32 +02:00
loki
71cef4b700 remove arch specific code 2021-06-15 18:31:40 +02:00
loki
56bb4ca865 removed redundent build dependency on Windows 2021-06-14 21:09:11 +02:00
loki
fa0ff91d23 some minor refactoring 2021-06-14 20:47:30 +02:00
loki
13caabaec8 fix h264 vui params 2021-06-14 17:43:21 +02:00
Loki
8f2e00f31b minor refactoring 2021-06-14 14:54:09 +02:00
Loki
78244a48d2 remove two redundent tests for encoder validation 2021-06-14 14:44:17 +02:00
Loki
8be7c563a9 Fix windows build 2021-06-14 14:34:38 +02:00
loki
3fe134d8a6 attempt to fix ubuntu build 2021-06-13 21:59:10 +02:00
loki
f4c145136c Attempt to compile on ubuntu 20.04 2021-06-13 21:51:49 +02:00
loki
ee10a795bd Attempt to compile on ubuntu 20.04 2021-06-13 21:48:04 +02:00
loki
8e32c8e6f4 Inject VUI data in SPS header if missing 2021-06-13 21:29:32 +02:00
loki
30f7742f51 Test for presence of sps->vui parameters 2021-06-12 23:08:20 +02:00
loki
55ce46e6ed fix windows build 2021-06-12 19:51:58 +02:00
loki
9e03cdda42 constant bitrate for audio 2021-06-12 18:30:24 +02:00
loki
76f34be395 move third-party source files to folder third-party 2021-06-11 11:59:19 +02:00
loki
ee89b211de include sstream in linux/audio.cpp to prevent compilation errors 2021-06-11 10:31:32 +02:00
loki
0c5daa44a1 Fix not responding to key modifiers on moonlight-embedded 2021-06-10 22:44:56 +02:00
loki
5495c8367a Search for active sink, rather than hardware sink 2021-06-10 18:39:16 +02:00
loki
988bf33b40 Fix bug not accepting paired device after reboot 2021-06-10 17:44:40 +02:00
loki
e53f65c305 Remove use shutdown signal inside init function 2021-06-09 22:01:18 +02:00
loki
1afd1b7c94 generate user credentials based on command line iuput 2021-06-09 21:55:13 +02:00
loki
33fbd5f431 Show/Hide config options based on platform and added vaapi config options to UI 2021-06-09 20:40:17 +02:00
loki
17d3fcf0d0 fix adding and editing apps json 2021-06-09 19:12:00 +02:00
loki
cf77b301bc centralize reading/writing file 2021-06-09 12:04:51 +02:00
loki
9d52174d6b fix selecting incorrect monitor on linux 2021-06-09 11:49:31 +02:00
loki
e2874b40c1 unfinished vaapi encoder should not be default yet 2021-06-08 22:38:48 +02:00
loki
914f329eea removed unnessesary header includes 2021-06-08 22:23:39 +02:00
loki
877c739f1b Merge branch 'master' into vaapi 2021-06-08 22:18:27 +02:00
loki
61b195e9f4 some refactoring 2021-06-08 22:10:42 +02:00
loki
c53564dd31 fixed calling terminate instead of gracefully ending 2021-06-08 21:58:32 +02:00
loki
9eb4eadda6 Fix linux build 2021-06-08 10:11:58 +02:00
Loki
44ebc4846b removed useless if statement 2021-06-07 14:27:42 +02:00
Loki
3a3d4928f9 Fix compilation on Windows 2021-06-07 14:22:23 +02:00
loki
84c55d6efc Fix file descriptor leak 2021-06-06 20:57:42 +02:00
loki
7f636a25a8 Look for VAAPI availabillity during runtime 2021-06-06 18:45:45 +02:00
loki
825a706139 Remove build dependency for gbm 2021-06-06 17:19:30 +02:00
loki
4df57a722e Grab whatever function we can 2021-06-06 17:19:11 +02:00
loki
45f9ce3a20 Allow va to have it's own file descriptor for the VAAPI device 2021-06-05 23:19:58 +02:00
loki
f2863cceb7 Properly scale image on VAAPI 2021-06-05 12:25:19 +02:00
loki
6b9ed7fcb3 Add option to select render device for VAAPI 2021-06-05 10:20:36 +02:00
loki
f33a587218 Fix software encoder 2021-06-04 21:35:00 +02:00
loki
bdb9ed9001 Perform image format conversion for VAAPI on the gpu 2021-06-04 21:12:06 +02:00
Elia Zammuto
41911a26fb Update README to accomodate Web UI Changes 2021-06-03 21:27:11 +02:00
loki-47-6F-64
0942f2ee7f Merge pull request #92 from exalented/exalented-pipewire-docs
Add pipewire documentation
2021-06-02 22:41:40 +02:00
exalented
a05a3b355c Update README.md
Add a bit of pipewire documentation in the README.
2021-06-02 11:55:25 -07:00
loki-47-6F-64
ff1722bbd1 Merge pull request #89 from TheElixZammuto/web-ui
Web UI
2021-05-30 17:36:39 +02:00
Elia Zammuto
dc281119af Fix Header Link 2021-05-30 16:46:05 +02:00
Elia Zammuto
b848db8f2b Config Update and PIN POST Method 2021-05-30 16:42:40 +02:00
Elia Zammuto
bc261fddf2 Updated Config Page 2021-05-30 15:56:13 +02:00
Elia Zammuto
bb251d5046 Code Cleanup 2021-05-30 14:58:38 +02:00
Elia Zammuto
ec9481392a Password Change UI 2021-05-29 23:35:44 +02:00
Elia Zammuto
8961b0462e Fix Incldue Order 2021-05-29 23:05:37 +02:00
Elia Zammuto
ffb80c5fc3 Fix Format 2021-05-29 22:29:10 +02:00
Elia Zammuto
4835366a0c Fixed Build 2021-05-29 22:26:17 +02:00
Elia Zammuto
c09855f703 Merge branch 'loki-47-6F-64-master' into web-ui 2021-05-29 22:07:53 +02:00
Elia Zammuto
5761b05f3b Merge branch 'master' of https://github.com/loki-47-6F-64/sunshine into loki-47-6F-64-master 2021-05-29 22:06:28 +02:00
loki
ff1ea1a63e Use VAAPI for hardware encoding on Linux 2021-05-29 16:25:37 +02:00
Elia Zammuto
0ea6363172 Username/Password Authentication for UI 2021-05-28 22:49:27 +02:00
loki
fe5375f17b update debian package version 2021-05-26 21:40:23 +02:00
loki
fd43ebc2bf add build status 2021-05-26 21:33:28 +02:00
loki
113e7a52d4 advertise display modes 2021-05-26 17:34:25 +02:00
loki
9f6b4ed93b Work around weird mapping for audio channels 2021-05-25 18:55:29 +02:00
loki
7aff15f743 Mainain aspect ratio when using nvenc and amdvce 2021-05-24 20:58:05 +02:00
loki
1c4435312e maintain aspect ratio when using software encoder 2021-05-24 18:08:32 +02:00
loki
dcb32eaaf7 Skip error correction when a video frame is to large, the alternative is skipping the frame itself 2021-05-22 23:09:53 +02:00
loki
ba07fd510e Upmix/Downmix audio 2021-05-22 19:51:01 +02:00
loki
2fb5f8a7d0 Add config option for virtual_sink on windows 2021-05-21 14:28:24 +02:00
loki
b119121e10 Change default audio device on Windows 2021-05-21 13:53:12 +02:00
loki
cb101eca16 Merge branch 'master' into surround 2021-05-20 11:02:26 +02:00
loki-47-6F-64
29674b8ed0 Merge pull request #87 from psyke83/hevc_forced_idr
Force IDR frames for libx265 encoder
2021-05-20 09:27:14 +02:00
Conn O'Griofa
c6a0eeef3f Force IDR frames for libx265 encoder
Parameter is needed to avoid infinite black screen with
"Waiting for IDR frame" in moonlight-qt (3.1.3) on Windows.
2021-05-20 00:22:28 +01:00
loki
825efb512a Based on client request, mute the host on Linux 2021-05-19 21:44:42 +02:00
loki
cd870bdcdd Guard against missing parameters 2021-05-19 20:02:03 +02:00
loki
0868d898f6 Create virtual audio sinks on Linux 2021-05-19 18:11:06 +02:00
loki
66a78f0d40 Fix windows build 2021-05-19 09:42:38 +02:00
loki
2b04e1428c Select audio output on Linux 2021-05-18 13:36:12 +02:00
Elia Zammuto
57f444357d Web UI IP Based Authentication 2021-05-17 21:56:55 +02:00
Elia Zammuto
fe08c241ec Fixes 2021-05-17 21:30:03 +02:00
loki
3d8a99f541 clang-format 2021-05-17 21:21:57 +02:00
Elia Zammuto
03236a50e5 UI for Application Config 2021-05-16 20:06:06 +02:00
loki
a6c1649493 Remove redundent code 2021-05-15 17:01:03 +02:00
loki
33a330fd6c Downmix surround 5.1 to stereo 2021-05-14 21:44:20 +02:00
loki
3901e404a9 Add forgotten requirement for compilation on ubuntu 2021-05-14 21:32:46 +02:00
loki
381e8bcfaa Prepare for release 2021-05-13 15:26:08 +02:00
loki
1050978246 Add warning to ignore errors during encoder validation 2021-05-12 23:22:13 +02:00
loki
9e48e58221 Allow applications started by sunshine to be detached 2021-05-12 23:01:30 +02:00
loki
5d313b509e fix resetting mouse buttons on end stream 2021-05-12 15:48:39 +02:00
loki
022b2202f6 Absolute mouse coordinates on Windows 2021-05-12 14:42:10 +02:00
loki
2e9a1cfbba absolute mouse coordinates regardless of the number of monitors attached on Linux 2021-05-11 23:51:45 +02:00
Elia Zammuto
27a1144217 Moved Common HTTPS Initialization Logic in a common file 2021-05-11 23:38:45 +02:00
loki
1d84c8f9ce Correct dimensions for touchscreen when single monitor attached 2021-05-11 23:30:56 +02:00
Elia Zammuto
04421d84a3 Fix Indentations and Shutdown Handling 2021-05-11 22:19:29 +02:00
loki
92cd8648fa Some refactoring for linux/display.cpp 2021-05-11 20:10:33 +02:00
loki
41cc9a3e80 absolute mouse coordinate support for single monitor on Linux 2021-05-11 18:01:56 +02:00
Loki
b97c902d10 print absolute mouse movement packets 2021-05-10 15:04:41 +02:00
loki
25309f21ee Fix appveyor build 2021-05-10 01:31:08 +02:00
loki
1ba8da9780 Fix error in README file 2021-05-10 01:07:24 +02:00
loki
66bc335d3f Merge branch 'master' of github.com:loki-47-6F-64/sunshine 2021-05-10 01:04:44 +02:00
loki
e834f375fb resolve merge conflict 2021-05-10 01:03:41 +02:00
loki
9c41972b65 minor modification for sunshine.service 2021-05-10 01:02:24 +02:00
loki-47-6F-64
41c30e9cfd Merge pull request #51 from Doomsdayrs/patch-1
Update README.md
2021-05-09 22:32:16 +02:00
Elia Zammuto
fd8cbf0c7d Merge branch 'loki-47-6F-64:master' into web-ui 2021-05-09 18:59:36 +02:00
Elia Zammuto
4fe90dcbd6 Started Work on Web UI 2021-05-09 18:55:34 +02:00
loki
377b086882 Fix amd_rc config options 2021-05-09 16:37:40 +02:00
loki
ade2ef3a15 Fix profile values for amfvce 2021-05-09 16:19:05 +02:00
loki
6f428eb316 Ensure no input remains in the task_pool before resetting 2021-05-09 11:56:53 +02:00
loki
2970ad662c No more dumb pointers for initialization 2021-05-09 11:40:12 +02:00
loki
1dfe49e765 Merge branch 'draw' 2021-05-08 14:16:29 +02:00
loki-47-6F-64
7a93a72710 Merge pull request #83 from TheElixZammuto/fix-stuck-keys
Fix Modifiers stuck on Host On Disconnection
2021-05-08 13:53:35 +02:00
Elia Zammuto
661c8260e5 Fix Position for input::reset 2021-05-08 13:46:20 +02:00
loki
13c2da07e8 Move shaders to seperate folder in assets 2021-05-08 13:22:04 +02:00
Elia Zammuto
71b214ca43 Fix Stuck Modifiers on Disconnection 2021-05-08 13:08:07 +02:00
loki
513942c888 Improve colors for nv12 2021-05-08 12:03:58 +02:00
loki
67df04e0a2 Fix cursor position on lower resolution screens 2021-05-06 16:51:59 +02:00
loki
7b45f0d899 Fix cursor height and width 2021-05-06 13:51:29 +02:00
loki
0f661e467e Blend cursor onto the image 2021-05-06 12:36:26 +02:00
loki
0232d8027c Render cursor on duplicated image 2021-05-06 12:00:39 +02:00
loki
3a0377851d Update gitignore 2021-05-05 16:00:27 +02:00
loki
a93bad4cf3 Fix crash when sending SIGINT before starting the http server 2021-05-05 15:53:22 +02:00
loki
88c3828ad3 Fixed not testing for 10bit pixels support 2021-05-05 12:17:25 +02:00
loki
c19853f03f Add color for BT701 colorspace 2021-05-05 11:28:57 +02:00
loki
1b7e103ef6 Allow resizing the image during conversion 2021-05-04 10:21:56 +02:00
loki
900d59b3ac Dynamically set colors during runtime 2021-05-03 22:06:55 +02:00
loki
37a9256587 Render NV12 color format 2021-05-02 22:35:19 +02:00
loki
127b5501d9 Render luma onto nv12 surface 2021-04-30 20:01:15 +02:00
Elia Zammuto
a081a9f5c4 Merge pull request #3 from loki-47-6F-64/master
Updates
2021-04-28 21:06:52 +02:00
loki
fe8c2ceab9 Warn when VideoProcessorSetStreamAlpha isn't supported 2021-04-28 13:44:42 +02:00
loki
1be5b4787f Moved pairInputDesktop() from desktop.h to input.cpp 2021-04-26 19:27:55 +02:00
loki
bb88d6f828 Third attempt to fix linux build for appveyor 2021-04-26 21:08:20 +02:00
loki
a7030641f3 Second attempt to fix linux build 2021-04-26 20:50:37 +02:00
loki
208de3dae9 Fix Linux build 2021-04-26 20:36:54 +02:00
Loki
e81db118d5 Fix windows build 2021-04-26 14:46:57 +02:00
loki
488d8e5fc2 force merge 2021-04-24 23:46:04 +02:00
loki
0049b36471 Use existing config option for selecting monitor 2021-04-24 23:41:56 +02:00
loki
66b4b70023 merge with notentered 2021-04-24 17:12:10 +02:00
loki
438ae6a761 Don't stop streaming when UAC is running 2021-04-24 15:53:48 +02:00
loki
0cfb440cf6 Added config examples to the config file 2021-04-24 14:23:12 +02:00
loki
a613280bbd Merge branch 'master' into TheElixZammuto 2021-04-24 13:09:14 +02:00
loki
6112c81db7 Fix –undefined reference to __memcpy_chk when building on msys64 2021-04-24 12:07:26 +02:00
arne
3ec4bf52e1 avahi service publishing cleanup & appveyor 2021-04-13 18:36:48 +02:00
arne
ec44a4391a avahi service publishing 2021-04-13 18:15:53 +02:00
Elia Zammuto
3f26a4fd21 Merge pull request #2 from psyke83/realtime_gpu
Use realtime GPU priority to avoid stalls during high GPU usage
2021-04-05 15:35:04 +02:00
Elia Zammuto
bb5b003dd5 Disabled key frames when not needed 2021-04-01 20:27:59 +02:00
Elia Zammuto
99777c8e82 Added more params 2021-04-01 14:25:38 +02:00
Elia Zammuto
4daaa1f089 Added some keyframes 2021-03-31 14:11:21 +02:00
Elia Zammuto
0828cc3f83 Started work on AMD Hardware Decoding 2021-03-29 13:16:56 +02:00
Elia Zammuto
790835f6c6 Merge pull request #1 from theofficialgman/amd_encoder
Add amd decoder support
2021-03-21 18:59:09 +01:00
kiralycraft
fe3784454a Fixed unspecified monitor streaming the whole X 2021-02-28 17:56:38 +02:00
kiralycraft
b336bf2fcb Attempt to update GCC to version 8 for appveyor 2021-02-28 16:10:29 +02:00
kiralycraft
87be37293e Accidentally modified stock config file 2021-02-28 15:56:23 +02:00
kiralycraft
7abcfc0390 Added ability to stream specific monitor on Linux 2021-02-28 15:52:47 +02:00
Garrett
020e2069cb Add amd decoder support 2021-01-28 18:38:11 -05:00
Zlatko Zahariev
83dd07469e Initial elevated windows work 2021-01-15 02:07:49 -05:00
Conn O'Griofa
0a883ab651 Use realtime GPU priority to avoid stalls during high GPU usage
Change derived from OBS project commit: ec769ef008
See related discussion: https://obsproject.com/forum/threads/obs-studio-24-0-3-gpu-priority-fix-testing.111669/
2021-01-11 04:22:18 +00:00
Doomsdayrs
7b39b93bb2 Update README.md
- Cleaned things up a bit more
- Simplified instructions
- make instruction has `-j ${nproc}` to ease up the word count
- Use $USER instead of {username}
2020-11-18 15:31:13 -05:00
Jacek Szafarkiewicz
30496c79ab Make systemd script cleaner 2020-09-04 15:51:20 +02:00
268 changed files with 51057 additions and 10430 deletions

73
.clang-format Normal file
View File

@@ -0,0 +1,73 @@
---
# This file is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: Consecutive
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterUnion: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 2
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 2
Cpp11BracedListStyle: false
UseTab: Never

18
.dockerignore Normal file
View File

@@ -0,0 +1,18 @@
# ignore git files
.git*
# ignore hidden files
.*
# ignore repo directories and files
docs/
scripts/
tools/
crowdin.yml
# ignore dev directories
build/
venv/
# ignore artifacts
artifacts/

7
.flake8 Normal file
View File

@@ -0,0 +1,7 @@
[flake8]
filename =
*.py,
*.pys
max-line-length = 120
extend-exclude =
venv/

150
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,150 @@
---
name: Bug Report
description: Create a bug report to help us improve.
body:
- type: markdown
attributes:
value: >
**THIS IS NOT THE PLACE TO ASK FOR SUPPORT!**
Please use our [Support Center](https://app.lizardbyte.dev/support) for support issues.
Non actionable bug reports will be locked and closed!
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: checkboxes
attributes:
label: Is your issue described in the documentation?
description: Please read our [documentation](https://docs.lizardbyte.dev/projects/sunshine)
options:
- label: I have read the documentation
required: true
- type: checkboxes
attributes:
label: Is your issue present in the nightly release?
description: Please test the [nightly](https://github.com/LizardByte/Sunshine/releases/tag/nightly-dev) release
options:
- label: This issue is present in the nightly release
required: true
- type: textarea
id: description
attributes:
label: Describe the Bug
description: A clear and concise description of the bug.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
- type: textarea
id: additional
attributes:
label: Additional Context
description: Add any other context about the bug here.
- type: dropdown
id: os
attributes:
label: Host Operating System
description: What version operating system are you running the software on?
options:
- Docker
- Linux
- macOS
- Windows
- other, n/a
- type: input
id: os-version
attributes:
label: Operating System Version
description: Provide the version of the operating system. Additionally a build number would be helpful.
validations:
required: true
- type: dropdown
id: os-architecture
attributes:
label: Architecture
options:
- 32 bit
- 64 bit
- arm
- other, n/a
- type: input
id: version
attributes:
label: Sunshine commit or version
placeholder: eg. 0.16.0
validations:
required: true
- type: dropdown
id: package_type
attributes:
label: Package
description: The package you installed
options:
- Linux - AppImage
- Linux - AUR
- Linux - 20.04-deb
- Linux - 22.04-deb
- Linux - Docker
- Linux - flatpak
- Linux - rpm
- macOS - dmg
- macOS - Portfile
- macOS - pkg
- Windows - installer
- Windows - portable
- other (not listed)
- other (self built)
- other (fork of this repo)
- type: dropdown
id: graphics_type
attributes:
label: GPU Type
description: The type of the installed graphics card.
options:
- AMD
- Intel
- Nvidia
- none (software encoding)
- type: input
id: graphics_model
attributes:
label: GPU Model
description: The model of the installed graphics card.
placeholder: e.g. GeForce RTX 2080 SUPER
validations:
required: true
- type: input
id: graphics_driver
attributes:
label: GPU Driver/Mesa Version
description: The driver/mesa version of the installed graphics card.
placeholder: e.g. 497.29
validations:
required: true
- type: input
id: capture_method
attributes:
label: Capture Method (Linux Only)
description: If on Linux, the capture method being used.
placeholder: e.g. PipeWire/KVM/X11/KMS
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output
description: |
Please copy and paste any relevant log output. This will be automatically formatted into code,
so no need for backticks.
render: Shell
- type: markdown
attributes:
value: |
Make sure to close your issue when it's solved! If you found the solution yourself please comment
so that others benefit from it.

13
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
blank_issues_enabled: false
contact_links:
- name: Support Center
url: https://app.lizardbyte.dev/support
about: Official LizardByte support
- name: Feature request
url: https://app.lizardbyte.dev/feedback
about: Share your suggestions or ideas to help us improve

54
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:30"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
time: "09:00"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "daily"
time: "09:30"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "10:00"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
time: "10:30"
target-branch: "nightly"
open-pull-requests-limit: 10

49
.github/label-actions.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Configuration for Label Actions - https://github.com/dessant/label-actions
added:
comment: >
This feature has been added and will be available in the next release.
fixed:
comment: >
This issue has been fixed and will be available in the next release.
invalid:duplicate:
comment: >
:wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue.
close: true
lock: true
unlabel: 'status:awaiting-triage'
-invalid:duplicate:
reopen: true
unlock: true
invalid:support:
comment: >
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports.
However, this issue appears to be a support request. Please use our
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks.
close: true
lock: true
lock-reason: 'off-topic'
unlabel: 'status:awaiting-triage'
-invalid:support:
reopen: true
unlock: true
invalid:template-incomplete:
issues:
comment: >
:wave: @{issue-author}, please edit your issue to complete the template with
all the required info. Your issue will be automatically closed in 5 days if
the template is not completed. Thanks.
prs:
comment: >
:wave: @{issue-author}, please edit your PR to complete the template with
all the required info. Your PR will be automatically closed in 5 days if
the template is not completed. Thanks.

28
.github/pr_release_template.md vendored Normal file
View File

@@ -0,0 +1,28 @@
## Description
<!--- Please include a summary of the changes. --->
This PR was created automatically.
### Screenshot
<!--- Include screenshots if the changes are UI-related. --->
### Issues Fixed or Closed
<!--- Close issue example: `- Closes #1` --->
<!--- Fix bug issue example: `- Fixes #2` --->
<!--- Resolve issue example: `- Resolves #3` --->
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Dependency update (updates to dependencies)
- [ ] Documentation update (changes to documentation)
- [ ] Repository update (changes to repository files, e.g. `.github/...`)
## Branch Updates
- [x] I want maintainers to keep my branch updated
## Changelog Summary
<!--- Summarize all the changes in a bulleted list. --->

954
.github/workflows/CI.yml vendored Normal file
View File

@@ -0,0 +1,954 @@
---
name: CI
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
push:
branches: [master, nightly]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
github_env:
name: GitHub Env Debug
runs-on: ubuntu-latest
steps:
- name: Dump github context
run: echo "$GITHUB_CONTEXT"
shell: bash
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
check_changelog:
name: Check Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
uses: actions/checkout@v3
- name: Verify Changelog
id: verify_changelog
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
uses: LizardByte/.github/actions/verify_changelog@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
outputs:
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }}
last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
check_versions:
name: Check Versions
runs-on: ubuntu-latest
needs: check_changelog
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check CMakeLists.txt Version
run: |
version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | \
grep -o -E '[0-9]+\.[0-9]+\.[0-9]+')
echo "cmakelists_version=${version}" >> $GITHUB_ENV
- name: Compare CMakeList.txt Version
if: ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }}
run: |
echo CMakeLists version: "$cmakelists_version"
echo Changelog version: "${{ needs.check_changelog.outputs.next_version_bare }}"
echo Within 'CMakeLists.txt' change "project(Sunshine [VERSION $cmakelists_version]" to \
"project(Sunshine [VERSION ${{ needs.check_changelog.outputs.next_version_bare }}]"
exit 1
setup_release:
name: Setup Release
needs: check_changelog
runs-on: ubuntu-latest
steps:
- name: Set release details
id: release_details
env:
RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }}
run: |
# determine to create a release or not
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
RELEASE=true
else
RELEASE=false
fi
# set the release tag
COMMIT=${{ github.sha }}
if [[ $GITHUB_REF == refs/heads/master ]]; then
TAG="${{ needs.check_changelog.outputs.next_version }}"
RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}"
RELEASE_BODY="$RELEASE_BODY"
PRE_RELEASE="false"
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then
TAG="nightly-dev"
RELEASE_NAME="nightly"
RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}"
PRE_RELEASE="true"
fi
echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT
echo "release_tag=${TAG}" >> $GITHUB_OUTPUT
echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT
echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT
echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT
# this is stupid but works for multiline strings
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
echo "$RELEASE_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
outputs:
create_release: ${{ steps.release_details.outputs.create_release }}
release_tag: ${{ steps.release_details.outputs.release_tag }}
release_commit: ${{ steps.release_details.outputs.release_commit }}
release_name: ${{ steps.release_details.outputs.release_name }}
release_body: ${{ env.RELEASE_BODY }}
pre_release: ${{ steps.release_details.outputs.pre_release }}
setup_flatpak_matrix:
name: Setup Flatpak Matrix
runs-on: ubuntu-latest
steps:
- name: Set release details
id: flatpak_matrix
# https://www.cynkra.com/blog/2020-12-23-dynamic-gha
run: |
# determine which architectures to build
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
matrix=$((
echo '{ "arch" : ["x86_64", "aarch64"] }'
) | jq -c .)
else
matrix=$((
echo '{ "arch" : ["x86_64"] }'
) | jq -c .)
fi
echo $matrix
echo $matrix | jq .
echo "matrix=$matrix" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.flatpak_matrix.outputs.matrix }}
build_linux_aur:
name: Linux AUR
runs-on: ubuntu-latest
needs: setup_release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Dependencies Linux AUR
run: |
sudo apt-get update -y
sudo apt-get install -y \
cmake
- name: Configure PKGBUILD files
id: prepare
run: |
# variables for manifest
aur_publish=false
aur_pkg=sunshine-dev
sub_version=""
conflicts="'sunshine'"
provides="'sunshine'"
branch=${GITHUB_HEAD_REF}
# check the branch variable
if [ -z "$branch" ]; then
echo "This is a PUSH event"
commit=${{ github.sha }}
clone_url=${{ github.event.repository.clone_url }}
if [[ ${{ github.ref == 'refs/heads/master' }} == true ]]; then
echo "This is a main release event"
aur_publish=true
aur_pkg=sunshine
conflicts=""
provides=""
elif [[ ${{ github.ref == 'refs/heads/nightly' }} == true ]]; then
echo "This is a nightly release event"
sub_version=".r${commit}"
fi
else
echo "This is a PR event"
commit=${{ github.event.pull_request.head.sha }}
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
sub_version=".r${commit}"
fi
echo "Commit: ${commit}"
echo "Clone URL: ${clone_url}"
echo "aur_publish=${aur_publish}" >> $GITHUB_OUTPUT
echo "aur_pkg=${aur_pkg}" >> $GITHUB_OUTPUT
mkdir -p artifacts
mkdir -p build
cd build
cmake -DSUNSHINE_CONFIGURE_AUR=ON \
-DSUNSHINE_AUR_PKG=${aur_pkg} \
-DSUNSHINE_SUB_VERSION=${sub_version} \
-DSUNSHINE_AUR_CONFLICTS=${conflicts} \
-DSUNSHINE_AUR_PROVIDES=${provides} \
-DGITHUB_CLONE_URL=${clone_url} \
-DGITHUB_COMMIT=${commit} \
-DSUNSHINE_CONFIGURE_ONLY=ON \
..
cd ..
mv ./build/PKGBUILD ./artifacts/
- name: Validate package
uses: LizardByte/archlinux-package-action@master
with:
path: artifacts
flags: '--syncdeps --noconfirm'
namcap: true
srcinfo: true
aur: true # workaround mirror problem
- name: Upload Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: sunshine-linux-aur
path: artifacts/
- name: Publish AUR package
if: ${{ steps.prepare.outputs.aur_publish == 'true' }}
uses: KSXGitHub/github-actions-deploy-aur@v2.6.0
with:
pkgname: ${{ steps.prepare.outputs.aur_pkg }}
pkgbuild: ./artifacts/PKGBUILD
assets: |
./artifacts/*
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Automatic update from GitHub ${{ github.repository }} per ${{ github.ref }}
allow_empty_commits: false
build_linux_flatpak:
name: Linux Flatpak
runs-on: ubuntu-22.04
needs: [setup_release, setup_flatpak_matrix]
strategy:
fail-fast: false # false to test all, true to fail entire job if any fail
matrix: ${{fromJson(needs.setup_flatpak_matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Dependencies Linux Flatpak
run: |
PLATFORM_VERSION=21.08
sudo apt-get update -y
sudo apt-get install -y \
cmake \
flatpak \
qemu-user-static
sudo su $(whoami) -c "flatpak --user remote-add --if-not-exists flathub \
https://flathub.org/repo/flathub.flatpakrepo"
sudo su $(whoami) -c "flatpak --user install -y flathub \
org.flatpak.Builder \
org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \
org.freedesktop.Sdk/${{ matrix.arch }}/${PLATFORM_VERSION} \
org.freedesktop.Sdk.Extension.node18/${{ matrix.arch }}/${PLATFORM_VERSION} \
"
- name: Cache Flatpak build
uses: actions/cache@v3
with:
path: ./build/.flatpak-builder
key: flatpak-${{ matrix.arch }}-${{ github.sha }}
restore-keys: |
flatpak-${{ matrix.arch }}-
- name: Configure Flatpak Manifest
run: |
# variables for manifest
branch=${GITHUB_HEAD_REF}
# check the branch variable
if [ -z "$branch" ]
then
echo "This is a PUSH event"
branch=${{ github.ref_name }}
commit=${{ github.sha }}
clone_url=${{ github.event.repository.clone_url }}
else
echo "This is a PR event"
commit=${{ github.event.pull_request.head.sha }}
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
fi
echo "Branch: ${branch}"
echo "Commit: ${commit}"
echo "Clone URL: ${clone_url}"
mkdir -p build
mkdir -p artifacts
cd build
cmake -DGITHUB_CLONE_URL=${clone_url} \
-DGITHUB_BRANCH=${branch} \
-DGITHUB_COMMIT=${commit} \
-DSUNSHINE_CONFIGURE_FLATPAK_MAN=ON \
-DSUNSHINE_CONFIGURE_ONLY=ON \
..
- name: Build Linux Flatpak
working-directory: build
run: |
sudo su $(whoami) -c 'flatpak run org.flatpak.Builder --arch=${{ matrix.arch }} --repo=repo --force-clean \
--stop-at=cuda build-sunshine dev.lizardbyte.sunshine.yml'
cp -r .flatpak-builder copy-of-flatpak-builder
sudo su $(whoami) -c 'flatpak run org.flatpak.Builder --arch=${{ matrix.arch }} --repo=repo --force-clean \
build-sunshine dev.lizardbyte.sunshine.yml'
rm -rf .flatpak-builder
mv copy-of-flatpak-builder .flatpak-builder
sudo su $(whoami) -c 'flatpak build-bundle --arch=${{ matrix.arch }} ./repo \
../artifacts/sunshine_${{ matrix.arch }}.flatpak dev.lizardbyte.sunshine'
sudo su $(whoami) -c 'flatpak build-bundle --runtime --arch=${{ matrix.arch }} ./repo \
../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak dev.lizardbyte.sunshine.Debug'
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: sunshine-linux-flatpak-${{ matrix.arch }}
path: artifacts/
- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
uses: ncipollo/release-action@v1
with:
name: ${{ needs.setup_release.outputs.release_name }}
tag: ${{ needs.setup_release.outputs.release_tag }}
commit: ${{ needs.setup_release.outputs.release_commit }}
artifacts: "*artifacts/*"
token: ${{ secrets.GH_BOT_TOKEN }}
allowUpdates: true
body: ${{ needs.setup_release.outputs.release_body }}
discussionCategory: announcements
prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_linux:
name: Linux
runs-on: ubuntu-${{ matrix.dist }}
needs: [check_changelog, setup_release]
strategy:
fail-fast: false # false to test all, true to fail entire job if any fail
matrix:
include: # package these differently
- type: appimage
EXTRA_ARGS: '-DSUNSHINE_CONFIGURE_APPIMAGE=ON'
dist: 20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Dependencies Linux
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
if [[ ${{ matrix.dist }} == "18.04" ]]; then
# Ubuntu 18.04 packages
sudo add-apt-repository ppa:savoury1/boost-defaults-1.71 -y
sudo apt-get update -y
sudo apt-get install -y \
libboost-filesystem1.71-dev \
libboost-log1.71-dev \
libboost-regex1.71-dev \
libboost-thread1.71-dev \
libboost-program-options1.71-dev
# Install cmake
wget https://cmake.org/files/v3.22/cmake-3.22.2-linux-x86_64.sh
chmod +x cmake-3.22.2-linux-x86_64.sh
mkdir /opt/cmake
./cmake-3.22.2-linux-x86_64.sh --prefix=/opt/cmake --skip-license
ln --force --symbolic /opt/cmake/bin/cmake /usr/local/bin/cmake
cmake --version
# install newer tar from focal... appimagelint fails on 18.04 without this
echo "original tar version"
tar --version
wget -O tar.deb http://security.ubuntu.com/ubuntu/pool/main/t/tar/tar_1.30+dfsg-7ubuntu0.20.04.2_amd64.deb
sudo apt-get -y install -f ./tar.deb
echo "new tar version"
tar --version
else
# Ubuntu 20.04+ packages
sudo apt-get update -y
sudo apt-get install -y \
cmake \
libboost-filesystem-dev \
libboost-log-dev \
libboost-thread-dev \
libboost-program-options-dev
fi
sudo apt-get install -y \
build-essential \
gcc-10 \
g++-10 \
libavdevice-dev \
libcap-dev \
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libmfx-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \
libx11-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
wget
# clean apt cache
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
# Update gcc alias
# https://stackoverflow.com/a/70653945/11214013
sudo update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-10 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-10 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10
# Install CUDA
sudo wget \
https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \
--progress=bar:force:noscroll -q --show-progress -O /root/cuda.run
sudo chmod a+x /root/cuda.run
sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm
sudo rm /root/cuda.run
- name: Build Linux
run: |
mkdir -p build
mkdir -p artifacts
npm install
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=share/sunshine \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_CUDA=ON \
${{ matrix.EXTRA_ARGS }} \
..
make -j ${nproc}
- name: Package Linux - CPACK
if: ${{ matrix.type == 'cpack' }}
working-directory: build
run: |
cpack -G DEB
mv ./cpack_artifacts/Sunshine.deb ../artifacts/sunshine-${{ matrix.dist }}.deb
if [[ ${{ matrix.dist }} == "20.04" ]]; then
cpack -G RPM
mv ./cpack_artifacts/Sunshine.rpm ../artifacts/sunshine.rpm
fi
- name: Set AppImage Version
if: ${{ matrix.type == 'appimage' && ( needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.last_version ) }} # yamllint disable-line rule:line-length
run: |
version=${{ needs.check_changelog.outputs.next_version_bare }}
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Package Linux - AppImage
if: ${{ matrix.type == 'appimage' }}
working-directory: build
run: |
# install sunshine to the DESTDIR
make install DESTDIR=AppDir
# custom AppRun file
cp -f ../packaging/linux/AppImage/AppRun ./AppDir/
chmod +x ./AppDir/AppRun
# variables
DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}"
ICON_FILE="${ICON_FILE:-sunshine.png}"
# AppImage
# https://docs.appimage.org/packaging-guide/index.html
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage \
--appdir ./AppDir \
--executable ./sunshine \
--icon-file "../$ICON_FILE" \
--desktop-file "./$DESKTOP_FILE" \
--library /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 \
--library /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \
--library /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \
--output appimage
# move
mv Sunshine*.AppImage ../artifacts/sunshine.AppImage
# permissions
chmod +x ../artifacts/sunshine.AppImage
- name: Verify AppImage
if: ${{ matrix.type == 'appimage' }}
run: |
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
chmod +x appimagelint-x86_64.AppImage
# rm -rf ~/.cache/appimagelint/
./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: sunshine-linux-${{ matrix.type }}-${{ matrix.dist }}
path: artifacts/
- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
uses: ncipollo/release-action@v1
with:
name: ${{ needs.setup_release.outputs.release_name }}
tag: ${{ needs.setup_release.outputs.release_tag }}
commit: ${{ needs.setup_release.outputs.release_commit }}
artifacts: "*artifacts/*"
token: ${{ secrets.GH_BOT_TOKEN }}
allowUpdates: true
body: ${{ needs.setup_release.outputs.release_body }}
discussionCategory: announcements
prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_mac:
name: MacOS
runs-on: macos-11
needs: setup_release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Dependencies MacOS
run: |
# install dependencies using homebrew
brew install boost cmake curl node opus
# fix openssl header not found
ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl
- name: Build MacOS
run: |
npm install
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=local/sunshine/assets \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
..
make -j ${nproc}
- name: Package MacOS
run: |
mkdir -p artifacts
cd build
# package
cpack -G DragNDrop
mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos-experimental-dragndrop.dmg
cpack -G Bundle
mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos-experimental-bundle.dmg
cpack -G ZIP
mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-macos-experimental-archive.zip
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: sunshine-macos
path: artifacts/
# this step can be removed after packages are fixed
- name: Delete experimental packages
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
working-directory: artifacts
run: |
rm -f ./sunshine-macos-experimental-dragndrop.dmg
rm -f ./sunshine-macos-experimental-bundle.dmg
rm -f ./sunshine-macos-experimental-archive.zip
# # no artifacts to release currently
# - name: Create/Update GitHub Release
# if: ${{ needs.setup_release.outputs.create_release == 'true' }}
# uses: ncipollo/release-action@v1
# with:
# name: ${{ needs.setup_release.outputs.release_name }}
# tag: ${{ needs.setup_release.outputs.release_tag }}
# commit: ${{ needs.setup_release.outputs.release_commit }}
# artifacts: "*artifacts/*"
# token: ${{ secrets.GH_BOT_TOKEN }}
# allowUpdates: true
# body: ${{ needs.setup_release.outputs.release_body }}
# discussionCategory: announcements
# prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_mac_port:
name: Macports
needs: setup_release
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout ports
uses: actions/checkout@v3
with:
repository: macports/macports-ports
fetch-depth: 64
path: ports
- name: Checkout mpbb
uses: actions/checkout@v3
with:
repository: macports/mpbb
path: mpbb
- name: Setup Dependencies Macports
run: |
# install dependencies using homebrew
brew install cmake
- name: Configure Portfile
run: |
# variables for Portfile
branch=${GITHUB_HEAD_REF}
# check the branch variable
if [ -z "$branch" ]
then
echo "This is a PUSH event"
commit=${{ github.sha }}
clone_url=${{ github.event.repository.clone_url }}
else
echo "This is a PR event"
commit=${{ github.event.pull_request.head.sha }}
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
fi
echo "Commit: ${commit}"
echo "Clone URL: ${clone_url}"
mkdir build
cd build
cmake -DGITHUB_COMMIT=${commit} \
-DGITHUB_CLONE_URL=${clone_url} \
-DSUNSHINE_CONFIGURE_PORTFILE=ON \
-DSUNSHINE_CONFIGURE_ONLY=ON \
..
cd ..
# copy Portfile to artifacts
mkdir -p artifacts
cp -f ./build/Portfile ./artifacts/
# copy Portfile to ports
mkdir -p ./ports/multimedia/Sunshine
cp -f ./build/Portfile ./ports/multimedia/Sunshine/Portfile
# testing
cat ./artifacts/Portfile
- name: Bootstrap MacPorts
run: |
. ports/.github/workflows/bootstrap.sh
# Add getopt, mpbb and the MacPorts paths to $PATH for the subsequent steps.
echo "/opt/mports/bin" >> $GITHUB_PATH
echo "${PWD}/mpbb" >> $GITHUB_PATH
echo "/opt/local/bin" >> $GITHUB_PATH
echo "/opt/local/sbin" >> $GITHUB_PATH
- name: Determine list of subports
id: subportlist
run: |
set -eu
port=Sunshine
subportlist=""
echo "Listing subports for Sunshine"
new_subports=$(mpbb \
--work-dir /tmp/mpbb \
list-subports \
--archive-site= \
--archive-site-private= \
--include-deps=no \
"$port" \
| tr '\n' ' ')
for subport in $new_subports; do
echo "$subport"
subportlist="$subportlist $subport"
done
echo "subportlist=${subportlist}" >> $GITHUB_OUTPUT
- name: Run port lint for all subports
run: |
set -eu
fail=0
for subport in $subportlist; do
echo "::group::${subport}"
path=$(port file "$subport")
messagetype="warning"
if ! messages=$(port -q lint "$subport" 2>&1); then
messagetype="error"
fail=1
fi
if [ -n "$messages" ]; then
echo "$messages"
# See https://github.com/actions/toolkit/issues/193#issuecomment-605394935
encoded_messages="port lint ${subport}:%0A"
encoded_messages+="$(echo "${messages}" | sed -E 's/$/%0A/g' | tr -d '\n')"
echo "::${messagetype} file=${path#${PWD}/ports/},line=1,col=1::${encoded_messages}"
fi
echo "::endgroup::"
done
exit "$fail"
env:
subportlist: ${{ steps.subportlist.outputs.subportlist }}
- name: Build subports
run: |
set -eu
fail=0
for subport in $subportlist; do
workdir="/tmp/mpbb/$subport"
mkdir -p "$workdir/logs"
touch "$workdir/logs/dependencies-progress.txt"
echo "::group::Cleaning up between ports"
sudo mpbb --work-dir "$workdir" cleanup
echo "::endgroup::"
echo "::group::Installing dependencies for ${subport}"
sudo mpbb \
--work-dir "$workdir" \
install-dependencies \
"$subport" >"$workdir/logs/install-dependencies.log" 2>&1 &
deps_pid=$!
tail -f "$workdir/logs/dependencies-progress.txt" 2>/dev/null &
tail_pid=$!
set +e
wait "$deps_pid"
deps_exit=$?
set -e
kill "$tail_pid" || true
if [ "$deps_exit" -ne 0 ]; then
echo "::endgroup::"
echo "::error::Failed to install dependencies for ${subport}"
fail=1
continue
fi
echo "::endgroup::"
echo "::group::Installing ${subport}"
set +e
sudo mpbb \
--work-dir "$workdir" \
install-port \
--source \
"$subport"
install_exit=$?
set -e
if [ "$install_exit" -ne 0 ]; then
echo "::endgroup::"
echo "::error::Failed to install ${subport}"
fail=1
continue
fi
echo "::endgroup::"
done
exit "$fail"
env:
subportlist: ${{ steps.subportlist.outputs.subportlist }}
- name: Package
run: |
# create packages
sudo port pkg sunshine
sudo port dmg sunshine
work=$(port work sunshine)
echo "Sunshine port work directory: ${work}"
# move components out of port work directory
sudo mv ${work}/Sunshine*component.pkg /tmp/
# copy artifacts
sudo mv ${work}/Sunshine*.pkg ./artifacts/sunshine.pkg
sudo mv ${work}/Sunshine*.dmg ./artifacts/sunshine.dmg
# move components back
# sudo mv /tmp/Sunshine*component.pkg ${work}/
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: sunshine-macports
path: artifacts/
- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
uses: ncipollo/release-action@v1
with:
name: ${{ needs.setup_release.outputs.release_name }}
tag: ${{ needs.setup_release.outputs.release_tag }}
commit: ${{ needs.setup_release.outputs.release_commit }}
artifacts: "*artifacts/*"
token: ${{ secrets.GH_BOT_TOKEN }}
allowUpdates: true
body: ${{ needs.setup_release.outputs.release_body }}
discussionCategory: announcements
prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_win:
name: Windows
runs-on: windows-2019
needs: setup_release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Dependencies Windows
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
base-devel
diffutils
git
make
mingw-w64-x86_64-binutils
mingw-w64-x86_64-boost
mingw-w64-x86_64-cmake
mingw-w64-x86_64-curl
mingw-w64-x86_64-libmfx
mingw-w64-x86_64-nsis
mingw-w64-x86_64-openssl
mingw-w64-x86_64-opus
mingw-w64-x86_64-toolchain
nasm
wget
yasm
- name: Install npm packages
run: |
npm install
- name: Build Windows
shell: msys2 {0}
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DSUNSHINE_ASSETS_DIR=assets \
-G "MinGW Makefiles" \
..
mingw32-make -j$(nproc)
- name: Package Windows
shell: msys2 {0}
run: |
mkdir -p artifacts
cd build
# package
cpack -G NSIS
cpack -G ZIP
# move
mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows.exe
mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows.zip
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: sunshine-windows
path: artifacts/
- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
uses: ncipollo/release-action@v1
with:
name: ${{ needs.setup_release.outputs.release_name }}
tag: ${{ needs.setup_release.outputs.release_tag }}
commit: ${{ needs.setup_release.outputs.release_commit }}
artifacts: "*artifacts/*"
token: ${{ secrets.GH_BOT_TOKEN }}
allowUpdates: true
body: ${{ needs.setup_release.outputs.release_body }}
discussionCategory: announcements
prerelease: ${{ needs.setup_release.outputs.pre_release }}
release-winget:
name: Release to WinGet
needs: [setup_release, build_win]
if: ${{ needs.setup_release.outputs.create_release == 'true' && github.ref == 'refs/heads/master' }}
runs-on: windows-latest # the required action can only be run on Windows
steps:
- name: Release to WinGet
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: LizardByte.Sunshine
release-tag: ${{ needs.setup_release.outputs.release_tag }}
installers-regex: '\.exe$' # only .exe files
token: ${{ secrets.GH_BOT_TOKEN }}

35
.github/workflows/auto-create-pr.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# This workflow creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created
# against the `master` (default) branch.
name: Auto create PR
on:
push:
branches:
- 'nightly'
jobs:
create_pr:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: "" # should be "nightly" as it's the triggering branch
destination_branch: "master"
pr_title: "Pulling ${{ github.ref_name }} into master"
pr_template: ".github/pr_release_template.md"
pr_assignee: "${{ secrets.GH_BOT_NAME }}"
pr_draft: true
pr_allow_empty: false
github_token: ${{ secrets.GH_BOT_TOKEN }}

64
.github/workflows/automerge.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs.
name: Automerge PR
on:
pull_request:
types:
- opened
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
autoapprove:
if: >-
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
contains(fromJson('["LizardByte-bot"]'), github.actor) &&
startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Autoapproving
uses: hmarr/auto-approve-action@v3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Label autoapproved
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['autoapproved', 'autoupdate']
})
automerge:
if: startsWith(github.repository, 'LizardByte/')
needs: [autoapprove]
runs-on: ubuntu-latest
steps:
- name: Automerging
uses: pascalgn/automerge-action@v0.15.5
env:
BASE_BRANCHES: nightly
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
MERGE_LABELS: "!dependencies"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
MERGE_DELETE_BRANCH: true
MERGE_ERROR_FAIL: true
MERGE_FILTER_AUTHOR: ${{ secrets.GH_BOT_NAME }}
MERGE_RETRIES: "240" # 1 hour
MERGE_RETRY_SLEEP: "15000" # 15 seconds

View File

@@ -0,0 +1,72 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Label PRs with `autoupdate` if various conditions are met, otherwise, remove the label.
name: Label PR autoupdate
on:
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize
jobs:
label_pr:
if: >-
startsWith(github.repository, 'LizardByte/') &&
contains(github.event.pull_request.body, fromJSON('"] I want maintainers to keep my branch updated"'))
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Check if member
id: org_member
run: |
status="true"
gh api \
-H "Accept: application/vnd.github+json" \
/orgs/${{ github.repository_owner }}/members/${{ github.actor }} || status="false"
echo "result=${status}" >> $GITHUB_OUTPUT
- name: Label autoupdate
if: >-
steps.org_member.outputs.result == 'true' &&
contains(github.event.pull_request.labels.*.name, 'autoupdate') == false &&
contains(github.event.pull_request.body,
fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == true
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['autoupdate']
})
- name: Unlabel autoupdate
if: >-
contains(github.event.pull_request.labels.*.name, 'autoupdate') &&
(
(github.event.action == 'synchronize' && steps.org_member.outputs.result == 'false') ||
(contains(github.event.pull_request.body,
fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == false
)
)
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ['autoupdate']
})

51
.github/workflows/autoupdate.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# This workflow is designed to work with the following workflows:
# - automerge
# - autoupdate-labeler
# It uses an action that auto-updates pull requests branches, when changes are pushed to their destination branch.
# Auto-updating to the latest destination branch works only in the context of upstream repo and not forks.
# Dependabot PRs are updated by an action that comments `@depdenabot rebase` on dependabot PRs. (disabled)
name: autoupdate
on:
push:
branches:
- 'nightly'
jobs:
autoupdate:
name: Autoupdate autoapproved PR created in the upstream
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Update
uses: docker://chinthakagodawita/autoupdate-action:v1
env:
EXCLUDED_LABELS: "central_dependency,dependencies"
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
PR_FILTER: "labelled"
PR_LABELS: "autoupdate"
PR_READY_STATE: "all"
MERGE_CONFLICT_ACTION: "fail"
# Disabled due to:
# - no major version tag, resulting in constant nagging to update this action
# - additionally, the code is sketchy, 16k+ lines of code?
# https://github.com/bbeesley/gha-auto-dependabot-rebase/blob/main/dist/main.cjs
#
# dependabot-rebase:
# name: Dependabot Rebase
# if: >-
# startsWith(github.repository, 'LizardByte/')
# runs-on: ubuntu-latest
# steps:
# - name: rebase
# uses: "bbeesley/gha-auto-dependabot-rebase@v1.3.18"
# env:
# GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}

390
.github/workflows/ci-docker.yml vendored Normal file
View File

@@ -0,0 +1,390 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# This workflow is intended to work with all our organization Docker projects. A readme named `DOCKER_README.md`
# will be used to update the description on Docker hub.
# custom comments in dockerfiles:
# `# platforms: `
# Comma separated list of platforms, i.e. `# platforms: linux/386,linux/amd64`. Docker platforms can alternatively
# be listed in a file named `.docker_platforms`.
# `# platforms_pr: `
# Comma separated list of platforms to run for PR events, i.e. `# platforms_pr: linux/amd64`. This will take
# precedence over the `# platforms: ` directive.
# `# artifacts: `
# `true` to build in two steps, stopping at `artifacts` build stage and extracting the image from there to the
# GitHub runner.
name: CI Docker
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
push:
branches: [master, nightly]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check_dockerfiles:
name: Check Dockerfiles
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Find dockerfiles
id: find
run: |
dockerfiles=$(find . -type f -iname "Dockerfile" -o -iname "*.dockerfile")
echo "found dockerfiles: ${dockerfiles}"
# do not quote to keep this as a single line
echo dockerfiles=${dockerfiles} >> $GITHUB_OUTPUT
MATRIX_COMBINATIONS=""
for FILE in ${dockerfiles}; do
# extract tag from file name
tag=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(Dockerfile)/None/gm')
if [[ $tag == "None" ]]; then
MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"dockerfile\": \"$FILE\"},"
else
tag=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(.+)(\.dockerfile)/-\2/gm')
MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"dockerfile\": \"$FILE\", \"tag\": \"$tag\"},"
fi
done
# removes the last character (i.e. comma)
MATRIX_COMBINATIONS=${MATRIX_COMBINATIONS::-1}
# setup matrix for later jobs
matrix=$((
echo "{ \"include\": [$MATRIX_COMBINATIONS] }"
) | jq -c .)
echo $matrix
echo $matrix | jq .
echo "matrix=$matrix" >> $GITHUB_OUTPUT
outputs:
dockerfiles: ${{ steps.find.outputs.dockerfiles }}
matrix: ${{ steps.find.outputs.matrix }}
check_changelog:
name: Check Changelog
needs: [check_dockerfiles]
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
runs-on: ubuntu-latest
steps:
- name: Checkout
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
uses: actions/checkout@v3
- name: Verify Changelog
id: verify_changelog
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
uses: LizardByte/.github/actions/verify_changelog@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
outputs:
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }}
last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
setup_release:
name: Setup Release
needs: check_changelog
runs-on: ubuntu-latest
steps:
- name: Set release details
id: release_details
env:
RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }}
run: |
# determine to create a release or not
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
RELEASE=true
else
RELEASE=false
fi
# set the release tag
COMMIT=${{ github.sha }}
if [[ $GITHUB_REF == refs/heads/master ]]; then
TAG="${{ needs.check_changelog.outputs.next_version }}"
RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}"
RELEASE_BODY="$RELEASE_BODY"
PRE_RELEASE="false"
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then
TAG="nightly-dev"
RELEASE_NAME="nightly"
RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}"
PRE_RELEASE="true"
fi
echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT
echo "release_tag=${TAG}" >> $GITHUB_OUTPUT
echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT
echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT
echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT
# this is stupid but works for multiline strings
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
echo "$RELEASE_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
outputs:
create_release: ${{ steps.release_details.outputs.create_release }}
release_tag: ${{ steps.release_details.outputs.release_tag }}
release_commit: ${{ steps.release_details.outputs.release_commit }}
release_name: ${{ steps.release_details.outputs.release_name }}
release_body: ${{ env.RELEASE_BODY }}
pre_release: ${{ steps.release_details.outputs.pre_release }}
lint_dockerfile:
needs: [check_dockerfiles]
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }}
name: Lint Dockerfile${{ matrix.tag }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Hadolint
id: hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.dockerfile }}
ignore: DL3008,DL3013,DL3016,DL3018,DL3028,DL3059
output-file: ./hadolint.log
verbose: true
- name: Log
if: failure()
run: |
echo "Hadolint outcome: ${{ steps.hadolint.outcome }}" >> $GITHUB_STEP_SUMMARY
cat "./hadolint.log" >> $GITHUB_STEP_SUMMARY
docker:
needs: [check_dockerfiles, check_changelog, setup_release]
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }}
name: Docker${{ matrix.tag }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare
id: prepare
env:
NV: ${{ needs.check_changelog.outputs.next_version }}
run: |
# get branch name
BRANCH=${GITHUB_HEAD_REF}
if [ -z "$BRANCH" ]; then
echo "This is a PUSH event"
BRANCH=${{ github.ref_name }}
fi
# determine to push image to dockerhub and ghcr or not
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
PUSH=true
else
PUSH=false
fi
# setup the tags
REPOSITORY=${{ github.repository }}
BASE_TAG=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]')
COMMIT=${{ github.sha }}
TAGS="${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }}"
if [[ $GITHUB_REF == refs/heads/master ]]; then
TAGS="${TAGS},${BASE_TAG}:latest${{ matrix.tag }},ghcr.io/${BASE_TAG}:latest${{ matrix.tag }}"
TAGS="${TAGS},${BASE_TAG}:master${{ matrix.tag }},ghcr.io/${BASE_TAG}:master${{ matrix.tag }}"
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then
TAGS="${TAGS},${BASE_TAG}:nightly${{ matrix.tag }},ghcr.io/${BASE_TAG}:nightly${{ matrix.tag }}"
else
TAGS="${TAGS},${BASE_TAG}:test${{ matrix.tag }},ghcr.io/${BASE_TAG}:test${{ matrix.tag }}"
fi
if [[ ${NV} != "" ]]; then
TAGS="${TAGS},${BASE_TAG}:${NV}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${NV}${{ matrix.tag }}"
fi
# parse custom directives out of dockerfile
# try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy`
# directives for PR event, i.e. not push event
if [[ ${PUSH} == "false" ]]; then
while read -r line; do
if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then
# echo the line and use `sed` to remove the custom directive
PLATFORMS=$(echo -e "$line" | sed 's/# platforms_pr: //')
elif [[ $PLATFORMS != "" ]]; then
# break while loop once all custom "PR" event directives are found
break
fi
done <"${{ matrix.dockerfile }}"
fi
# directives for all events... above directives will not be parsed if they were already found
while read -r line; do
if [[ $line == "# platforms: "* && $PLATFORMS == "" ]]; then
# echo the line and use `sed` to remove the custom directive
PLATFORMS=$(echo -e "$line" | sed 's/# platforms: //')
elif [[ $line == "# artifacts: "* && $ARTIFACTS == "" ]]; then
# echo the line and use `sed` to remove the custom directive
ARTIFACTS=$(echo -e "$line" | sed 's/# artifacts: //')
elif [[ $PLATFORMS != "" && $ARTIFACTS != "" ]]; then
# break while loop once all custom directives are found
break
fi
done <"${{ matrix.dockerfile }}"
# if PLATFORMS is blank, fall back to the legacy method of reading from the `.docker_platforms` file
if [[ $PLATFORMS == "" ]]; then
# read the platforms from `.docker_platforms`
PLATFORMS=$(<.docker_platforms)
fi
# if PLATFORMS is still blank, fall back to `linux/amd64`
if [[ $PLATFORMS == "" ]]; then
PLATFORMS="linux/amd64"
fi
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT
echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
echo "push=${PUSH}" >> $GITHUB_OUTPUT
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Set Up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
- name: Cache Docker Layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: Docker-buildx${{ matrix.tag }}-${{ github.sha }}
restore-keys: |
Docker-buildx${{ matrix.tag }}-
- name: Log in to Docker Hub
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to the Container registry
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GH_BOT_NAME }}
password: ${{ secrets.GH_BOT_TOKEN }}
- name: Build artifacts
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
id: build_artifacts
uses: docker/build-push-action@v4
with:
context: ./
file: ${{ matrix.dockerfile }}
target: artifacts
outputs: type=local,dest=artifacts
push: false
platforms: ${{ steps.prepare.outputs.platforms }}
build-args: |
BRANCH=${{ steps.prepare.outputs.branch }}
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }}
COMMIT=${{ steps.prepare.outputs.commit }}
tags: ${{ steps.prepare.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push
id: build
uses: docker/build-push-action@v4
with:
context: ./
file: ${{ matrix.dockerfile }}
push: ${{ steps.prepare.outputs.push }}
platforms: ${{ steps.prepare.outputs.platforms }}
build-args: |
BRANCH=${{ steps.prepare.outputs.branch }}
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }}
COMMIT=${{ steps.prepare.outputs.commit }}
tags: ${{ steps.prepare.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Arrange Artifacts
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
working-directory: artifacts
run: |
# artifacts will be in sub directories named after the docker target platform, e.g. `linux_amd64`
# so move files to the artifacts directory
# https://unix.stackexchange.com/a/52816
find ./ -type f -exec mv -t ./ -n '{}' +
- name: Upload Artifacts
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
uses: actions/upload-artifact@v3
with:
name: Docker${{ matrix.tag }}
path: artifacts/
- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' && steps.prepare.outputs.artifacts == 'true' }}
uses: ncipollo/release-action@v1
with:
name: ${{ needs.setup_release.outputs.release_name }}
tag: ${{ needs.setup_release.outputs.release_tag }}
commit: ${{ needs.setup_release.outputs.release_commit }}
artifacts: "*artifacts/*"
token: ${{ secrets.GH_BOT_TOKEN }}
allowUpdates: true
body: ${{ needs.setup_release.outputs.release_body }}
discussionCategory: announcements
prerelease: ${{ needs.setup_release.outputs.pre_release }}
- name: Update Docker Hub Description
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported
repository: ${{ env.BASE_TAG }}
short-description: ${{ github.event.repository.description }}
readme-filepath: ./DOCKER_README.md

84
.github/workflows/cpp-lint.yml vendored Normal file
View File

@@ -0,0 +1,84 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Lint c++ source files and cmake files.
name: C++ Lint
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
clang-format:
name: Clang Format Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Find cpp files
id: cpp_files
run: |
cpp_files=$(find . -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.m" -o -iname "*.mm")
echo "found cpp files: ${cpp_files}"
# do not quote to keep this as a single line
echo cpp_files=${cpp_files} >> $GITHUB_OUTPUT
- name: Clang format lint
if: ${{ steps.cpp_files.outputs.cpp_files }}
uses: DoozyX/clang-format-lint-action@v0.15
with:
source: ${{ steps.cpp_files.outputs.cpp_files }}
extensions: 'cpp,h,m,mm'
clangFormatVersion: 15
style: file
inplace: false
- name: Upload Artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: clang-format-fixes
path: ${{ steps.cpp_files.outputs.cpp_files }}
cmake-lint:
name: CMake Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools cmakelang
- name: Find cmake files
id: cmake_files
run: |
cmake_files=$(find . -type f -iname "CMakeLists.txt" -o -iname "*.cmake")
echo "found cmake files: ${cmake_files}"
# do not quote to keep this as a single line
echo cmake_files=${cmake_files} >> $GITHUB_OUTPUT
- name: Test with cmake-lint
run: |
cmake-lint --line-width 120 --tab-size 4 ${{ steps.cmake_files.outputs.cmake_files }}

59
.github/workflows/issues-stale.yml vendored Normal file
View File

@@ -0,0 +1,59 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Manage stale issues and PRs.
name: Stale Issues / PRs
on:
schedule:
- cron: '00 10 * * *'
jobs:
stale:
name: Check Stale Issues / PRs
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Stale
uses: actions/stale@v7
with:
close-issue-message: >
This issue was closed because it has been stalled for 10 days with no activity.
close-pr-message: >
This PR was closed because it has been stalled for 10 days with no activity.
days-before-stale: 90
days-before-close: 10
exempt-all-assignees: true
exempt-issue-labels: 'added,fixed'
exempt-pr-labels: 'dependencies,l10n'
stale-issue-label: 'stale'
stale-issue-message: >
This issue is stale because it has been open for 90 days with no activity.
Comment or remove the stale label, otherwise this will be closed in 10 days.
stale-pr-label: 'stale'
stale-pr-message: >
This PR is stale because it has been open for 90 days with no activity.
Comment or remove the stale label, otherwise this will be closed in 10 days.
repo-token: ${{ secrets.GH_BOT_TOKEN }}
- name: Invalid Template
uses: actions/stale@v7
with:
close-issue-message: >
This issue was closed because the the template was not completed after 5 days.
close-pr-message: >
This PR was closed because the the template was not completed after 5 days.
days-before-stale: 0
days-before-close: 5
exempt-pr-labels: 'dependencies,l10n'
only-labels: 'invalid:template-incomplete'
stale-issue-label: 'invalid:template-incomplete'
stale-issue-message: >
Invalid issues template.
stale-pr-label: 'invalid:template-incomplete'
stale-pr-message: >
Invalid PR template.
repo-token: ${{ secrets.GH_BOT_TOKEN }}

25
.github/workflows/issues.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Label and un-label actions using `../label-actions.yml`.
name: Issues
on:
issues:
types: [labeled, unlabeled]
discussion:
types: [labeled, unlabeled]
jobs:
label:
name: Label Actions
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Label Actions
uses: dessant/label-actions@v3
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}

98
.github/workflows/localize.yml vendored Normal file
View File

@@ -0,0 +1,98 @@
---
name: localize
on:
push:
branches: [nightly]
paths: # prevents workflow from running unless these files change
- '.github/workflows/localize.yml'
- 'src/**'
- 'locale/sunshine.po'
workflow_dispatch:
env:
file: ./locale/sunshine.po
jobs:
localize:
name: Update Localization
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python 3.9
uses: actions/setup-python@v4 # https://github.com/actions/setup-python
with:
python-version: '3.9'
- name: Set up Python 3.9 Dependencies
run: |
cd ./scripts
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Set up xgettext
run: |
sudo apt-get update -y && \
sudo apt-get --reinstall install -y \
gettext
- name: Update Strings
run: |
# first, try to remove existing file as xgettext does not remove unused translations
if [ -f "${{ env.file }}" ];
then
rm ${{ env.file }}
echo "new_file=false" >> $GITHUB_ENV
else
echo "new_file=true" >> $GITHUB_ENV
fi
# extract the new strings
python ./scripts/_locale.py --extract
- name: git diff
if: ${{ env.new_file == 'false' }}
run: |
# disable the pager
git config --global pager.diff false
# print the git diff
git diff locale/sunshine.po
# set the variable with minimal output, replacing `\t` with ` `
OUTPUT=$(git diff --numstat locale/sunshine.po | sed -e "s#\t# #g")
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
- name: git reset
# only run if a single line changed (date/time) and file already existed
if: ${{ env.git_diff == '1 1 locale/sunshine.po' && env.new_file == 'false' }}
run: |
git reset --hard
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create/Update Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
locale/*.po
token: ${{ secrets.GH_BOT_TOKEN }} # must trigger PR tests
commit-message: New localization template
branch: localize/update
delete-branch: true
base: nightly
title: New Babel Updates
body: |
Update report
- Updated ${{ steps.date.outputs.date }}
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
babel
l10n

32
.github/workflows/pull-requests.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Ensure PRs are made against `nightly` branch.
name: Pull Requests
on:
pull_request_target:
types: [opened, synchronize, edited, reopened]
# no concurrency for pull_request_target events
jobs:
check-pull-request:
name: Check Pull Request
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- uses: Vankka/pr-target-branch-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: master
exclude: nightly # Don't prevent going from nightly -> master
change-to: nightly
comment: |
Your PR was set to `master`, PRs should be sent to `nightly`.
The base branch of this PR has been automatically changed to `nightly`.
Please check that there are no merge conflicts

38
.github/workflows/python-flake8.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Lint python files with flake8.
name: flake8
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4 # https://github.com/actions/setup-python
with:
python-version: '3.10'
- name: Install dependencies
run: |
# pin flake8 before v6.0.0 due to removal of support for type comments (required for Python 2.7 type hints)
python -m pip install --upgrade pip setuptools "flake8<6"
- name: Test with flake8
run: |
python -m flake8 --verbose

View File

@@ -0,0 +1,22 @@
---
name: Release Notifications (Moonlight)
on:
release:
types: [published]
jobs:
discord:
runs-on: ubuntu-latest
steps:
- name: discord
uses: sarisia/actions-status-discord@v1 # https://github.com/sarisia/actions-status-discord
with:
webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK_MOONLIGHT }}
nodetail: true
nofail: false
username: ${{ secrets.DISCORD_USERNAME }}
avatar_url: ${{ secrets.ORG_LOGO_URL }}
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
description: ${{ github.event.release.body }}
color: 0xFF4500

88
.github/workflows/release-notifier.yml vendored Normal file
View File

@@ -0,0 +1,88 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Send release notification to various platforms.
name: Release Notifications
on:
release:
types: [published]
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onevent_nametypes
jobs:
discord:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: discord
uses: sarisia/actions-status-discord@v1 # https://github.com/sarisia/actions-status-discord
with:
webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
nodetail: true
nofail: false
username: ${{ secrets.DISCORD_USERNAME }}
avatar_url: ${{ secrets.ORG_LOGO_URL }}
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
description: ${{ github.event.release.body }}
color: 0xFF4500
facebook_group:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: facebook-post-action
uses: ReenigneArcher/facebook-post-action@v1 # https://github.com/ReenigneArcher/facebook-post-action
with:
page_id: ${{ secrets.FACEBOOK_GROUP_ID }}
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
message: |
${{ github.event.repository.name }} ${{ github.ref_name }} Released
${{ github.event.release.body }}
url: ${{ github.event.release.html_url }}
facebook_page:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: facebook-post-action
uses: ReenigneArcher/facebook-post-action@v1 # https://github.com/ReenigneArcher/facebook-post-action
with:
page_id: ${{ secrets.FACEBOOK_PAGE_ID }}
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
message: |
${{ github.event.repository.name }} ${{ github.ref_name }} Released
${{ github.event.release.body }}
url: ${{ github.event.release.html_url }}
reddit:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: reddit
uses: bluwy/release-for-reddit-action@v2 # https://github.com/bluwy/release-for-reddit-action
with:
username: ${{ secrets.REDDIT_USERNAME }}
password: ${{ secrets.REDDIT_PASSWORD }}
app-id: ${{ secrets.REDDIT_CLIENT_ID }}
app-secret: ${{ secrets.REDDIT_CLIENT_SECRET }}
subreddit: ${{ secrets.REDDIT_SUBREDDIT }}
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
url: ${{ github.event.release.html_url }}
flair-id: ${{ secrets.REDDIT_FLAIR_ID }} # https://www.reddit.com/r/<subreddit>>/api/link_flair.json
comment: ${{ github.event.release.body }}
twitter:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: twitter
uses: ethomson/send-tweet-action@v1 # https://github.com/ethomson/send-tweet-action
with:
consumer-key: ${{ secrets.TWITTER_API_KEY }}
consumer-secret: ${{ secrets.TWITTER_API_SECRET }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
status: ${{ github.event.release.html_url }}

66
.github/workflows/yaml-lint.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
# Lint yaml files.
name: yaml lint
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Find additional files
id: find-files
run: |
# space separated list of files
FILES=.clang-format
# empty placeholder
FOUND=""
for FILE in ${FILES}; do
if [ -f "$FILE" ]
then
FOUND="$FOUND $FILE"
fi
done
echo "found=${FOUND}" >> $GITHUB_OUTPUT
- name: yaml lint
id: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
config_data: |
extends: default
rules:
comments:
level: error
line-length:
max: 120
truthy:
# GitHub uses "on" for workflow event triggers
# .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning"
allowed-values: ['true', 'false', 'on']
check-keys: true
level: warning
file_or_dir: . ${{ steps.find-files.outputs.found }}
- name: Log
run: |
cat "${{ steps.yaml-lint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY

14
.gitignore vendored
View File

@@ -1,8 +1,18 @@
build
cmake-build-*
cmake-build*
.DS_Store
.vscode
.vs
*.swp
*.kdev4
.cache
.idea
# npm
node_modules/
package-lock.json
# Translations
*.mo
*.pot

56
.gitmodules vendored
View File

@@ -1,12 +1,48 @@
[submodule "moonlight-common-c"]
path = moonlight-common-c
[submodule "third-party/moonlight-common-c"]
path = third-party/moonlight-common-c
url = https://github.com/moonlight-stream/moonlight-common-c.git
[submodule "Simple-Web-Server"]
path = Simple-Web-Server
url = https://github.com/loki-47-6F-64/Simple-Web-Server.git
[submodule "ViGEmClient"]
path = ViGEmClient
branch = master
[submodule "third-party/Simple-Web-Server"]
path = third-party/Simple-Web-Server
url = https://gitlab.com/eidheim/Simple-Web-Server.git
branch = master
[submodule "third-party/ViGEmClient"]
path = third-party/ViGEmClient
url = https://github.com/ViGEm/ViGEmClient
[submodule "pre-compiled"]
path = pre-compiled
url = https://bitbucket.org/Loki-47-6F-64/pre-compiled.git
branch = master
[submodule "third-party/miniupnp"]
path = third-party/miniupnp
url = https://github.com/miniupnp/miniupnp
branch = master
[submodule "third-party/nv-codec-headers"]
path = third-party/nv-codec-headers
url = https://github.com/FFmpeg/nv-codec-headers
branch = sdk/11.1
[submodule "third-party/TPCircularBuffer"]
path = third-party/TPCircularBuffer
url = https://github.com/michaeltyson/TPCircularBuffer
branch = master
[submodule "third-party/ffmpeg-windows-x86_64"]
path = third-party/ffmpeg-windows-x86_64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-windows-x86_64
[submodule "third-party/ffmpeg-macos-x86_64"]
path = third-party/ffmpeg-macos-x86_64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-macos-x86_64
[submodule "third-party/ffmpeg-linux-x86_64"]
path = third-party/ffmpeg-linux-x86_64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-linux-x86_64
[submodule "third-party/ffmpeg-linux-aarch64"]
path = third-party/ffmpeg-linux-aarch64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-linux-aarch64
[submodule "third-party/ffmpeg-macos-aarch64"]
path = third-party/ffmpeg-macos-aarch64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-macos-aarch64
[submodule "third-party/nanors"]
path = third-party/nanors
url = https://github.com/sleepybishop/nanors.git
branch = master

1
.prettierrc.json Normal file
View File

@@ -0,0 +1 @@
{}

44
.readthedocs.yaml Normal file
View File

@@ -0,0 +1,44 @@
---
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python
build:
os: ubuntu-20.04
tools:
python: "3.10"
## apt packages required packages to run cmake on sunshine, note that additional packages are required
# apt_packages:
# - cmake
# - libboost-filesystem-dev
# - libboost-log-dev
# - libboost-thread-dev
## run cmake
# jobs:
# pre_build:
# - cmake .
## Include the submodules, required for cmake
# submodules:
# include: all
# recursive: true
# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true
# Using Sphinx, build docs in additional formats
formats: all
python:
install:
- requirements: ./docs/requirements.txt
system_packages: true

319
CHANGELOG.md Normal file
View File

@@ -0,0 +1,319 @@
# Changelog
## [0.18.2] - 2023-02-13
### Fixed
- (Video/KMV/Linux) Fixed wayland capture on Nvidia for KMS
- (Video/Linux) Implement vaSyncBuffer stuf for libva <2.9.0
- (UI) Fix issue where mime type was not being set for node_modules when using a reverse proxy
- (UI/macOS) Added missing audio sink config options
- (Linux) Specify correct Boost dependency versions
- (Video/AMF) Add missing encoder tunables
## [0.18.1] - 2023-01-31
### Fixed
- (Linux) Fixed missing dependencies for deb and rpm packages
- (Linux) Use dynamic boost
## [0.18.0] - 2023-01-29
Attention, this release contains critical security fixes. Please update as soon as possible. Additionally, we are
encouraging users to change your Sunshine password, especially if you expose the web UI (i.e. port 47790 by default)
to the internet, or have ever uploaded your logs with verbose output to a public resource.
### Added
- (Windows) Add support for Intel QuickSync
- (Linux) Added aarch64 deb and rpm packages
- (Windows) Add support for hybrid graphics systems, such as laptops with both integrated and discrete GPUs
- (Linux) Add support for streaming from Steam Deck Gaming Mode
- (Windows) Add HDR support, see https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/usage.html#hdr-support
### Fixed
- (Network) Refactor code for UPnP port forwarding
- (Video) Enforce 10 FPS encoding frame rate minimum to improve static image quality
- (Linux) deb and rpm packages are now specific to destination distro and version
- (Docs) Add nvidia/nvenc preset migration guide
- (Network) Performance optimizations
- (Video/Windows) Fix streaming to multiple clients from hardware encoder
- (Linux) Fix child process spawning
- (Security) Fix security vulnerability in implementation of SimpleWebServer
- (Misc) Rename "Steam BigPicture" to "Steam Big Picture" in default apps.json
- (Security) Scrub basic authorization header from logs
- (Linux) The systemd service will now restart in the event of a crash
- (Video/KMS/Linux) Fixed error: `couldn't import RGB Image: 00003002 and 00003004`
- (Video/Windows) Fix stream freezing triggered by the resolution changed
- (Installer/Windows) Fixes silent installation and other miscellaneous improvements
- (CPU) Significantly improved CPU usage
## [0.17.0] - 2023-01-08
If you are running Sunshine as a service on Windows, we are strongly urging you to update to v0.17.0 as soon as
possible. Older Windows versions of Sunshine had a security flaw in which the binary was located in a user-writable
location which is problematic when running as a service or on a multi-user system. Additionally, when running Sunshine
as a service, games and applications were launched as SYSTEM. This could lead to issues with save files and other game
settings. In v0.17.0, games now run under your user account without elevated privileges.
### Breaking
- (Apps) Removed automatic desktop entry (Re-add by adding an empty application named "Desktop" with no commands, "desktop.png" can be added as the image.)
- (Windows) Improved user upgrade experience (Suggest to manually uninstall existing Sunshine version before this upgrade. Do NOT select to remove everything, if prompted. Make a backup of config files before uninstall.)
- (Windows) Move config files to specific directory (files will be migrated automatically if using Windows installer)
- (Dependencies) Fix npm path (breaking change for package maintainers)
### Added
- (macOS) Added initial support for arm64 on macOS through Macports portfile
- (Input) Added support for foreign keyboard input
- (Misc) Logs inside the WebUI and log to file
- (UI/Windows) Added an Apply button to configuration page when running as a service
- (Input/Windows) Enable Mouse Keys while streaming for systems with no physical mouse
### Fixed
- (Video) Improved capture performance
- (Audio) Improved audio bitrate and quality handling
- (Apps/Windows) Fixed PATH environment variable handling
- (Apps/Windows) Use the proper environment variable for the Program Files (x86) folder
- (Service/Windows) Fix SunshineSvc hanging if an error occurs during startup
- (Service/Windows) Spawn Sunshine.exe in a job object, so it is terminated if SunshineSvc.exe dies
- (Video) windows/vram: fix fringing in NV12 colour conversion
- (Apps/Windows) Launch games under the correct user account
- (Video) nvenc, amdvce: rework all user presets/options
- (Network) Generate certificates with unique serial numbers
- (Service/Windows) Graceful termination on shutdown, logoff, and service stop
- (Apps/Windows) Fix launching apps when Sunshine is running as admin
- (Misc) Remove/fix calls to std::abort()
- (Misc) Remove prompt to press enter after Sunshine exits
- (Misc) Make log priority consistent for execution messages
- (Apps) Applications in Moonlight clients are now updated automatically after editing
- (Video/Linux) Fix wayland capture on nvidia
- (Audio) Fix 7.1 surround channel mapping
- (Video) Fix NVENC profile values not applying
- (Network) Fix origin_web_ui_allowed binding
- (Service/Windows) Self terminate/restart service if process hangs for 10 seconds
- (Input/Windows) Fix Windows masked cursor blending with GPU encoders
- (Video) Color conversion fixes and BT.2020 support
### Dependencies
- Bump ffmpeg from 4.4 to 5.1
- ffmpeg_patches: add amfenc delay/buffering fix
- CBS moved to ffmpeg submodules
- Migrate to upstream Simple-Web-Server submodule
- Bump third-party/TPCircularBuffer from `bce9170` to `8833b3a`
- Bump third-party/moonlight-common-c from `8169a31` to `ef9ad52`
- Bump third-party/miniupnp from `6f848ae` to `207cf44`
- Bump third-party/ViGEmClient from `f719a1d` to `9e842ba`
- Bump bootstrap from 5.0.0 to 5.2.3
- Bump @fortawesome/fontawesome-free from 6.2.0 to 6.2.1
## [0.16.0] - 2022-12-13
### Added
- Add cover finder
- (Docker) Add arm64 docker image
- (Flatpak) Add installation helper scripts
- (Windows) Add support for Unicode input messages
### Fixed
- (Linux) Reintroduce Ubuntu 20.04 and 22.04 specific deb packages
- (Linux) Fixed udev and systemd file locations
### Dependencies
- Bump babel from 2.10.3 to 2.11.0
- Bump sphinx-copybutton from 0.5.0 to 0.5.1
- Bump KSXGitHub/github-actions-deploy-aur from 2.5.0 to 2.6.0
- Use npm for web dependencies (breaking change for third-party package maintainers)
- Update moonlight-common-c
- Use pre-built ffmpeg from LizardByte/build-deps for all sunshine builds (breaking change for third-party package maintainers)
- Bump furo from 2022.9.29 to 2022.12.7
### Misc
- Misc org level workflow updates
- Fix misc typos in docs
- Fix winget release
## [0.15.0] - 2022-10-30
### Added
- (Windows) Add firewall rules scripts
- (Windows) Automatically add and remove firewall rules at install/uninstall
- (Windows) Automatically add and remove service at install/uninstall
- (Docker) Official image added
- (Linux) Add aarch64 flatpak package
### Changed
- (Windows/Linux/MacOS) - Move default config and apps file to assets directory
- (MacOS) Bump boost to 1.80 for macport builds
- (Linux) Remove backup and restore of config files
### Fixed
- (Linux) - Create sunshine config directory if it doesn't exist
- (Linux) Remove portable home and config directories for AppImage
- (Windows) Include service install and uninstall scripts again
- (Windows) Automatically delete start menu entry upon uninstall
- (Windows) Automatically delete program install directory upon uninstall, with user prompt
- (Linux) Handle the case of no default audio sink
- (Windows/Linux/MacOS) Fix default image paths
- (Linux) Fix CUDA RGBA to NV12 conversion
## [0.14.1] - 2022-08-09
### Added
- (Linux) Flatpak package added
- (Linux) AUR package automated updates
- (Windows) Winget package automated updates
### Changed
- (General) Moved repo to @LizardByte GitHub org
- (WebUI) Fixed button spacing on home page
- (WebUI) Added Discord WidgetBot Crate
### Fixed
- (Linux/Mac) Default config and app files now copied to user home directory
- (Windows) Default config and app files now copied to working directory
## [0.14.0] - 2022-06-15
### Added
- (Documentation) Added Sphinx documentation available at https://sunshinestream.readthedocs.io/en/latest/
- (Development) Initial support for Localization
- (Linux) Add rpm package as release asset
- (macOS) Add Portfile as release asset
- (Windows) Add DwmFlush() call to improve capture
- (Windows) Add Windows installer
### Fixed
- (AMD) Fixed hwdevice being destroyed before context
- (Linux) Added missing dependencies to AppImage
- (Linux) Fixed rumble events causing game to freeze
- (Linux) Improved Pulse/Pipewire compatibility
- (Linux) Moved to single deb package
- (macOS) Fixed missing TPCircularBuffer submodule
- (Stream) Properly catch exceptions in stream broadcast handlers
- (Stream/Video) AVPacket fix
## [0.13.0] - 2022-02-27
### Added
- (macOS) Initial support for macOS (#40)
## [0.12.0] - 2022-02-13
### Added
- New command line argument `--version`
- Custom png poster support
### Changed
- Correct software bitrate calculation
- Increase vbv-bufsize to 1/10 of requested bitrate
- Improvements to Web UI
## [0.11.1] - 2021-10-04
### Changed
- (Linux) Fix search path for config file and assets
## [0.11.0] - 2021-10-04
### Added
- (Linux) Added support for wlroots based compositors on Wayland.
- (Windows) Added an icon for the executable
### Changed
- Fixed a bug causing segfault when connecting multiple controllers.
- (Linux) Improved NVENC, it now offloads converting images from RGB to NV12
- (Linux) Fixed a bug causes stuttering
## [0.10.1] - 2021-08-21
### Changed
- (Linux) Re-enabled KMS
## [0.10.0] - 2021-08-20
### Added
- Added support for Rumble with gamepads.
- Added support for keyboard shortcuts <--- See the README for details.
- (Windows) A very basic script has been added in Sunshine-Windows\tools <-- This will start Sunshine at boot with the highest privileges which is needed to display the login prompt.
### Changed
- Some cosmetic changes to the WebUI.
- The first time the WebUI is opened, it will request the creation of a username/password pair from the user.
- Fixed audio crackling introduced in version 0.8.0
- (Linux) VAAPI hardware encoding now works on Intel i7-6700 at least. <-- For the best experience, using ffmpeg version 4.3 or higher is recommended.
- (Windows) Installing from debian package shouldn't overwrite your configuration files anymore. <-- It's recommended that you back up `/etc/sunshine/` before testing this.
## [0.9.0] - 2021-07-11
### Added
- Added audio encryption
- (Linux) Added basic NVENC support on Linux
- (Windows) The Windows version can now capture the lock screen and the UAC prompt as long as it's run through `PsExec.exe` https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
### Changed
- Sunshine will now accept expired or not-yet-valid certificates, as long as they are signed properly.
- Fixed compatibility with iOS version of Moonlight
- Drastically reduced chance of being forced to skip error correction due to video frame size
- (Linux) sunshine.service will be installed automatically.
## [0.8.0] - 2021-06-30
### Added
- Added mDNS support: Moonlight will automatically find Sunshine.
- Added UPnP support. It's off by default.
## [0.7.7] - 2021-06-24
### Added
- (Linux) Added installation package for Debian
### Changed
- Fixed incorrect scaling for absolute mouse coordinates when using multiple monitors.
- Fixed incorrect colors when scaling for software encoder
## [0.7.1] - 2021-06-18
### Changed
- (Linux) Fixed an issue where it was impossible to start sunshine on ubuntu 20.04
## [0.7.0] - 2021-06-16
### Added
- Added a Web Manager. Accessible through: https://localhost:47990 or https://<ip of your pc>:47990
- (Linux) Added hardware encoding support for AMD on Linux
### Changed
- (Linux) Moved certificates and saved pairings generated during runtime to .config/sunshine on Linux
## [0.6.0] - 2021-05-26
### Added
- Added support for surround audio
### Changed
- Maintain aspect ratio when scaling video
- Fix issue where Sunshine is forced to drop frames when they are too large
## [0.5.0] - 2021-05-13
### Added
- Added support for absolute mouse coordinates
- (Linux) Added support for streaming specific monitor on Linux
- (Windows) Added support for AMF on Windows
## [0.4.0] - 2020-05-03
### Changed
- prep-cmd is now optional in apps.json
- Fixed bug causing video artifacts
- Fixed bug preventing Moonlight from closing app on exit
- Fixed bug causing preventing keyboard keys from repeating on latest version of Moonlight
- Fixed bug causing segfault when another session of sunshine was already running
- Fixed bug causing crash when monitor has resolution 1366x768
## [0.3.1] - 2020-04-24
### Changed
- Fix a memory leak.
## [0.3.0] - 2020-04-23
### Changed
- Hardware acceleration on NVidia GPU's for Video encoding on Windows
## [0.2.0] - 2020-03-21
### Changed
- Multicasting is now supported: You can set the maximum simultaneous connections with the configurable option: channels
- Configuration variables can be overwritten on the command line: "name=value" --> it can be useful to set min_log_level=debug without modifying the configuration file
- Switches to make testing the pairing mechanism more convenient has been added, see "sunshine --help" for details
## [0.1.1] - 2020-01-30
### Added
- (Linux) Added deb package and service for Linux
## [0.1.0] - 2020-01-27
### Added
- The first official release for Sunshine!
[0.1.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.1.0
[0.1.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.1.1
[0.2.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.2.0
[0.3.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.3.0
[0.3.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.3.1
[0.4.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.4.0
[0.5.0]: https://github.com/LizardByte/Sunshine/releases/tag/0.5.0
[0.6.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.6.0
[0.7.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.7.0
[0.7.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.7.1
[0.7.7]: https://github.com/LizardByte/Sunshine/releases/tag/v0.7.7
[0.8.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.8.0
[0.9.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.9.0
[0.10.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.10.0
[0.10.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.10.1
[0.11.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.11.0
[0.11.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.11.1
[0.12.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.12.0
[0.13.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.13.0
[0.14.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.14.0
[0.14.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.14.1
[0.15.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.15.0
[0.16.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.16.0
[0.17.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.17.0
[0.18.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.0
[0.18.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.1
[0.18.2]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.2

File diff suppressed because it is too large Load Diff

134
DOCKER_README.md Normal file
View File

@@ -0,0 +1,134 @@
# Docker
## Important note
Starting with v0.18.0, tag names have changed. You may no longer use `latest`, `master`, `vX.X.X`.
## Build your own containers
This image provides a method for you to easily use the latest Sunshine release in your own docker projects. It is not
intended to use as a standalone container at this point, and should be considered experimental.
```dockerfile
ARG SUNSHINE_VERSION=latest
ARG SUNSHINE_OS=ubuntu-22.04
FROM lizardbyte/sunshine:${SUNSHINE_VERSION}-${SUNSHINE_OS}
# install Steam, Wayland, etc.
ENTRYPOINT steam && sunshine
```
### SUNSHINE_VERSION
- `latest`, `master`, `vX.X.X`
- `nightly`
- commit hash
### SUNSHINE_OS
Sunshine images are available, based on the following base images.
- `debian-bullseye`
- `fedora-36`
- `fedora-37`
- `ubuntu-20.04`
- `ubuntu-22.04`
### Tags
You must combine the `SUNSHINE_VERSION` and `SUNSHINE_OS` to determine the tag to pull. The format should be
`<SUNSHINE_VERSION>-<SUNSHINE_OS>`. For example, `latest-ubuntu-22.04`.
See all our available tags on [docker hub](https://hub.docker.com/r/lizardbyte/sunshine/tags) or
[ghcr](https://github.com/LizardByte/Sunshine/pkgs/container/sunshine/versions) for more info.
## Where used
This is a list of docker projects using Sunshine. Something missing? Let us know about it!
- [Games on Whales](https://games-on-whales.github.io)
## Port and Volume mappings
Examples are below of the required mappings. The configuration file will be saved to `/config` in the container.
### Using docker run
Create and run the container (substitute your `<values>`):
```bash
docker run -d \
--name=<image_name> \
--restart=unless-stopped
-e PUID=<uid> \
-e PGID=<gid> \
-e TZ=<timezone> \
-v <path to data>:/config \
-p 47984-47990:47984-47990/tcp \
-p 48010:48010 \
-p 47998-48000:47998-48000/udp \
<image>
```
### Using docker-compose
Create a `docker-compose.yml` file with the following contents (substitute your `<values>`):
```yaml
version: '3'
services:
<image_name>:
image: <image>
container_name: sunshine
restart: unless-stopped
volumes:
- <path to data>:/config
environment:
- PUID=<uid>
- PGID=<gid>
- TZ=<timezone>
ports:
- "47984-47990:47984-47990/tcp"
- "48010:48010"
- "47998-48000:47998-48000/udp"
```
### Parameters
You must substitute the `<values>` with your own settings.
Parameters are split into two halves separated by a colon. The left side represents the host and the right side the
container.
**Example:** `-p external:internal` - This shows the port mapping from internal to external of the container.
Therefore `-p 47990:47990` would expose port `47990` from inside the container to be accessible from the host's IP on
port `47990` (e.g. `http://<host_ip>:47990`). The internal port must be `47990`, but the external port may be changed
(e.g. `-p 8080:47990`). All the ports listed in the `docker run` and `docker-compose` examples are required.
| Parameter | Function | Example Value | Required |
|-----------------------------|----------------------|--------------------|----------|
| `-p <port>:47990` | Web UI Port | `47990` | True |
| `-v <path to data>:/config` | Volume mapping | `/home/sunshine` | True |
| `-e PUID=<uid>` | User ID | `1001` | False |
| `-e PGID=<gid>` | Group ID | `1001` | False |
| `-e TZ=<timezone>` | Lookup [TZ value][1] | `America/New_York` | False |
[1]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
#### User / Group Identifiers:
When using data volumes (-v flags) permissions issues can arise between the host OS and the container. To avoid this
issue you can specify the user PUID and group PGID. Ensure the data volume directory on the host is owned by the same
user you specify.
In this instance `PUID=1001` and `PGID=1001`. To find yours use id user as below:
```bash
$ id dockeruser
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
```
If you want to change the PUID or PGID after the image has been built, it will require rebuilding the image.
## Supported Architectures
Specifying `lizardbyte/sunshine:latest-<SUNSHINE_OS>` or `ghcr.io/lizardbyte/sunshine:latest-<SUNSHINE_OS>` should
retrieve the correct image for your architecture.
The architectures supported by these images are:
| Architecture | Available |
|:---------------:|:---------:|
| amd64 / x86_64 | ✅ |
| arm64 / aarch64 | ✅ |

View File

@@ -1,144 +0,0 @@
# - Try to find FFMPEG
# Once done this will define
# FFMPEG_FOUND - System has FFMPEG
# FFMPEG_INCLUDE_DIRS - The FFMPEG include directories
# FFMPEG_LIBRARIES - The libraries needed to use FFMPEG
# FFMPEG_LIBRARY_DIRS - The directory to find FFMPEG libraries
#
# written by Roy Shilkrot 2013 http://www.morethantechnical.com/
#
find_package(PkgConfig)
MACRO(FFMPEG_FIND varname shortname headername)
IF(NOT WIN32)
PKG_CHECK_MODULES(PC_${varname} ${shortname})
FIND_PATH(${varname}_INCLUDE_DIR "${shortname}/${headername}"
HINTS ${PC_${varname}_INCLUDEDIR} ${PC_${varname}_INCLUDE_DIRS}
NO_DEFAULT_PATH
)
ELSE()
FIND_PATH(${varname}_INCLUDE_DIR "${shortname}/${headername}")
ENDIF()
IF(${varname}_INCLUDE_DIR STREQUAL "${varname}_INCLUDE_DIR-NOTFOUND")
message(STATUS "look for newer strcture")
IF(NOT WIN32)
PKG_CHECK_MODULES(PC_${varname} "lib${shortname}")
FIND_PATH(${varname}_INCLUDE_DIR "lib${shortname}/${headername}"
HINTS ${PC_${varname}_INCLUDEDIR} ${PC_${varname}_INCLUDE_DIRS}
NO_DEFAULT_PATH
)
ELSE()
FIND_PATH(${varname}_INCLUDE_DIR "lib${shortname}/${headername}")
IF(${${varname}_INCLUDE_DIR} STREQUAL "${varname}_INCLUDE_DIR-NOTFOUND")
#Desperate times call for desperate measures
MESSAGE(STATUS "globbing...")
FILE(GLOB_RECURSE ${varname}_INCLUDE_DIR "/ffmpeg*/${headername}")
MESSAGE(STATUS "found: ${${varname}_INCLUDE_DIR}")
IF(${varname}_INCLUDE_DIR)
GET_FILENAME_COMPONENT(${varname}_INCLUDE_DIR "${${varname}_INCLUDE_DIR}" PATH)
GET_FILENAME_COMPONENT(${varname}_INCLUDE_DIR "${${varname}_INCLUDE_DIR}" PATH)
ELSE()
SET(${varname}_INCLUDE_DIR "${varname}_INCLUDE_DIR-NOTFOUND")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
IF(${${varname}_INCLUDE_DIR} STREQUAL "${varname}_INCLUDE_DIR-NOTFOUND")
MESSAGE(STATUS "Can't find includes for ${shortname}...")
ELSE()
MESSAGE(STATUS "Found ${shortname} include dirs: ${${varname}_INCLUDE_DIR}")
#GET_DIRECTORY_PROPERTY(FFMPEG_PARENT DIRECTORY ${${varname}_INCLUDE_DIR} PARENT_DIRECTORY)
GET_FILENAME_COMPONENT(FFMPEG_PARENT ${${varname}_INCLUDE_DIR} PATH)
MESSAGE(STATUS "Using FFMpeg dir parent as hint: ${FFMPEG_PARENT}")
IF(NOT WIN32)
FIND_LIBRARY(${varname}_LIBRARIES NAMES ${shortname}
HINTS ${PC_${varname}_LIBDIR} ${PC_${varname}_LIBRARY_DIR} ${FFMPEG_PARENT})
ELSE()
FIND_PATH(${varname}_LIBRARIES "${shortname}.dll.a" HINTS ${FFMPEG_PARENT})
# FILE(GLOB_RECURSE ${varname}_LIBRARIES "${FFMPEG_PARENT}/*${shortname}.lib")
# GLOBing is very bad... but windows sux, this is the only thing that works
ENDIF()
IF(${varname}_LIBRARIES STREQUAL "${varname}_LIBRARIES-NOTFOUND")
MESSAGE(STATUS "look for newer structure for library")
FIND_LIBRARY(${varname}_LIBRARIES NAMES lib${shortname}
HINTS ${PC_${varname}_LIBDIR} ${PC_${varname}_LIBRARY_DIR} ${FFMPEG_PARENT})
ENDIF()
IF(${varname}_LIBRARIES STREQUAL "${varname}_LIBRARIES-NOTFOUND")
MESSAGE(STATUS "Can't find lib for ${shortname}...")
ELSE()
MESSAGE(STATUS "Found ${shortname} libs: ${${varname}_LIBRARIES}")
ENDIF()
IF(NOT ${varname}_INCLUDE_DIR STREQUAL "${varname}_INCLUDE_DIR-NOTFOUND"
AND NOT ${varname}_LIBRARIES STREQUAL ${varname}_LIBRARIES-NOTFOUND)
MESSAGE(STATUS "found ${shortname}: include ${${varname}_INCLUDE_DIR} lib ${${varname}_LIBRARIES}")
SET(FFMPEG_${varname}_FOUND 1)
SET(FFMPEG_${varname}_INCLUDE_DIRS ${${varname}_INCLUDE_DIR})
SET(FFMPEG_${varname}_LIBS ${${varname}_LIBRARIES})
ELSE()
MESSAGE(STATUS "Can't find ${shortname}")
ENDIF()
ENDIF()
ENDMACRO(FFMPEG_FIND)
FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
FFMPEG_FIND(LIBSWSCALE swscale swscale.h)
SET(FFMPEG_FOUND "NO")
IF (FFMPEG_LIBAVFORMAT_FOUND AND
FFMPEG_LIBAVDEVICE_FOUND AND
FFMPEG_LIBAVCODEC_FOUND AND
FFMPEG_LIBAVUTIL_FOUND AND
FFMPEG_LIBSWSCALE_FOUND
)
SET(FFMPEG_FOUND "YES")
SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS})
SET(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBAVFORMAT_LIBRARY_DIRS})
SET(FFMPEG_LIBRARIES
${FFMPEG_LIBAVFORMAT_LIBS}
${FFMPEG_LIBAVDEVICE_LIBS}
${FFMPEG_LIBAVCODEC_LIBS}
${FFMPEG_LIBAVUTIL_LIBS}
${FFMPEG_LIBSWSCALE_LIBS}
)
ELSE ()
MESSAGE(STATUS "Could not find FFMPEG")
ENDIF()
message(STATUS ${FFMPEG_LIBRARIES} ${FFMPEG_LIBAVFORMAT_LIBRARIES})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(FFMPEG DEFAULT_MSG
FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARY_DIRS FFMPEG_LIBRARIES)

3
NOTICE Normal file
View File

@@ -0,0 +1,3 @@
©2018 Valve Corporation. Steam and the Steam logo are trademarks and/or
registered trademarks of Valve Corporation in the U.S. and/or other countries. All
rights reserved.

185
README.md
View File

@@ -1,185 +0,0 @@
# Introduction
Sunshine is a Gamestream host for Moonlight
- [Building](README.md#building)
- [Credits](README.md#credits)
# Building
- [Linux](README.md#linux)
- [Windows](README.md#windows-10)
## Linux
### Requirements:
Ubuntu 20.04:
sudo apt install cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
### Compilation:
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
- `cd sunshine && mkdir build && cd build`
- `cmake ..`
- `make`: It is suggested to use the `-j C#` flags with this command, `C#` being the number of cores your PC has
### Setup:
sunshine needs access to uinput to create mouse and gamepad events:
- Add user to group 'input': "usermod -a -G input username
- Create a file: "/etc/udev/rules.d/85-sunshine-input.rules"
- The contents of the file is as follows:
KERNEL=="uinput", GROUP="input", mode="0660"
- assets/sunshine.conf is an example configuration file. Modify it as you see fit and use it by running: "sunshine path/to/sunshine.conf"
- path/to/build/dir/sunshine.service is used to start sunshine in the background:
- `cp sunshine.service $HOME/.config/systemd/user/`
- Modify $HOME/.config/systemd/user/sunshine.conf to point to the sunshine executable
- `systemctl --user start sunshine`
- assets/apps.json is an [example](README.md#application-list) of a list of applications that are started just before running a stream
### Trouleshooting:
* If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input":
* groups
* If Sunshine sends audio from the microphone instead of the speaker, try the following steps:
* pacmd list-sources | grep "name:"
* Copy the name to the configuration option "audio_sink"
* restart sunshine
## Windows 10
### Requirements:
MSYS2 : mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-boost
### Compilation:
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
- `cd sunshine && mkdir build && cd build`
- `cmake -G"Unix Makefiles" ..`
- `make`
### Setup:
- **OPTIONAL** Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases]
### Static build
#### Requirements:
MSYS2 : mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-boost git-lfs
#### Compilation:
- `git lfs install`
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
- `cd sunshine && mkdir build && cd build`
- `cmake -DSUNSHINE_STANDALONE=ON -G"Unix Makefiles" ..`
- `make`
# Common
## Usage:
- run "sunshine path/to/sunshine.conf"
- In Moonlight: Add PC manually
- When Moonlight request you insert the correct pin on sunshine, either:
- Type in the URL bar of your browser: `xxx.xxx.xxx.xxx:47989/pin/####`
- `wget xxx.xxx.xxx.xxx:47989/pin/####`
- The x's are the IP of your instance, `####` is the pin
- Click on one of the Applications listed
- Have fun :)
## Note:
- The Windows key is not passed through by Moonlight, therefore Sunshine maps Right-Alt key to the Windows key
- If you set Video Bitrate to 0.5Mb/s:
- Sunshine will use CRF or QP to controll the quality of the stream. (See example configuration file for more details)
- This is less CPU intensive and it has lower average bandwith requirements compared to manually setting bitrate to acceptable quality
- However, it has higher peak bitrates, forcing Sunshine to drop entire frames when streaming 1080P due to their size.
- When this happens, the video portion of the stream appears to be frozen.
- This is rare enough that using this for the desktop environment is tolerable (in my opinion), however for gaming not so much.
## Credits:
- [Simple-Web-Server](https://gitlab.com/eidheim/Simple-Web-Server)
- [Moonlight](https://github.com/moonlight-stream)
- [Looking-Glass](https://github.com/gnif/LookingGlass) (For showing me how to properly capture frames on Windows, saving me a lot of time :)
## Application List:
- You can use Environment variables in place of values
- $(HOME) will be replaced by the value of $HOME
- $$ will be replaced by $ --> $$(HOME) will be replaced by $(HOME)
- env: Adds or overwrites Environment variables for the commands/applications run by Sunshine.
- "Variable name":"Variable value"
- apps: The list of applications
- Example:
```json
{
"name":"An App",
"cmd":"command to open app",
"prep-cmd":[
{
"do":"somecommand",
"undo":"undothatcommand"
}
]
}
```
- name: Self explanatory
- output <optional>: The file where the output of the command is stored
- If it is not specified, the output is ignored
- prep-cmd: A list of commands to be run before/after the application
- If any of the prep-commands fail, starting the application is aborted
- do: Run before the application
- If it fails, all 'undo' commands of the previously succeeded 'do' commands are run
- undo <optional>: Run after the application has terminated
- This should not fail considering it is supposed to undo the 'do' commands.
- If it fails, Sunshine is terminated
- cmd <optional>: The main application
- If not specified, a processs is started that sleeps indefinitely
1. When an application is started, if there is an application already running, it will be terminated.
2. When the application has been shutdown, the stream shuts down as well.
3. In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application, instead it simply starts a stream.
Linux
```json
{
"env":{
"DISPLAY":":0",
"DRI_PRIME":"1",
"XAUTHORITY":"$(HOME)/.Xauthority",
"PATH":"$(PATH):$(HOME)/.local/bin"
},
"apps":[
{
"name":"Low Res Desktop",
"prep-cmd":[
{ "do":"xrandr --output HDMI-1 --mode 1920x1080", "undo":"xrandr --output HDMI-1 --mode 1920x1200" }
]
},
{
"name":"Steam BigPicture",
"output":"steam.txt",
"cmd":"steam -bigpicture",
"prep-cmd":[]
}
]
}
```
Windows
```json
{
"env":{
"PATH":"$(PATH);C:\\Program Files (x86)\\Steam"
},
"apps":[
{
"name":"Steam BigPicture",
"output":"steam.txt",
"prep-cmd":[
{"do":"steam \"steam://open/bigpicture\""}
]
}
]
}
```

132
README.rst Normal file
View File

@@ -0,0 +1,132 @@
Overview
========
LizardByte has the full documentation hosted on `Read the Docs <https://sunshinestream.readthedocs.io/>`_.
About
-----
Sunshine is a self-hosted game stream host for Moonlight.
Offering low latency, cloud gaming server capabilities with support for AMD, Intel, and Nvidia GPUs for hardware
encoding. Software encoding is also available. You can connect to Sunshine from any Moonlight client on a variety of
devices. A web UI is provided to allow configuration, and client pairing, from your favorite web browser. Pair from
the local server or any mobile device.
System Requirements
-------------------
.. warning:: This table is a work in progress. Do not purchase hardware based on this.
**Minimum Requirements**
+------------+------------------------------------------------------------+
| GPU | AMD: VCE 1.0 or higher, see `obs-amd hardware support`_ |
| +------------------------------------------------------------+
| | Intel: VAAPI-compatible, see: `VAAPI hardware support`_ |
| +------------------------------------------------------------+
| | Nvidia: NVENC enabled cards, see `nvenc support matrix`_ |
+------------+------------------------------------------------------------+
| CPU | AMD: Ryzen 3 or higher |
| +------------------------------------------------------------+
| | Intel: Core i3 or higher |
+------------+------------------------------------------------------------+
| RAM | 4GB or more |
+------------+------------------------------------------------------------+
| OS | Windows: 10+ (Windows Server not supported) |
| +------------------------------------------------------------+
| | macOS: 11.7+ |
| +------------------------------------------------------------+
| | Linux/Debian: 11 (bullseye) |
| +------------------------------------------------------------+
| | Linux/Fedora: 36+ |
| +------------------------------------------------------------+
| | Linux/Ubuntu: 20.04+ (focal) |
+------------+------------------------------------------------------------+
| Network | Host: 5GHz, 802.11ac |
| +------------------------------------------------------------+
| | Client: 5GHz, 802.11ac |
+------------+------------------------------------------------------------+
**4k Suggestions**
+------------+------------------------------------------------------------+
| GPU | AMD: Video Coding Engine 3.1 or higher |
| +------------------------------------------------------------+
| | Intel: HD Graphics 510 or higher |
| +------------------------------------------------------------+
| | Nvidia: GeForce GTX 1080 or higher |
+------------+------------------------------------------------------------+
| CPU | AMD: Ryzen 5 or higher |
| +------------------------------------------------------------+
| | Intel: Core i5 or higher |
+------------+------------------------------------------------------------+
| Network | Host: CAT5e ethernet or better |
| +------------------------------------------------------------+
| | Client: CAT5e ethernet or better |
+------------+------------------------------------------------------------+
**HDR Suggestions**
+------------+------------------------------------------------------------+
| GPU | AMD: Video Coding Engine 3.4 or higher |
| +------------------------------------------------------------+
| | Intel: UHD Graphics 730 or higher |
| +------------------------------------------------------------+
| | Nvidia: Pascal-based GPU (GTX 10-series) or higher |
+------------+------------------------------------------------------------+
| CPU | AMD: todo |
| +------------------------------------------------------------+
| | Intel: todo |
+------------+------------------------------------------------------------+
| Network | Host: CAT5e ethernet or better |
| +------------------------------------------------------------+
| | Client: CAT5e ethernet or better |
+------------+------------------------------------------------------------+
Integrations
------------
.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/CI.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge
:alt: GitHub Workflow Status (CI)
:target: https://github.com/LizardByte/Sunshine/actions/workflows/CI.yml?query=branch%3Amaster
.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/localize.yml.svg?branch=nightly&label=localize%20build&logo=github&style=for-the-badge
:alt: GitHub Workflow Status (localize)
:target: https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Anightly
.. image:: https://img.shields.io/readthedocs/sunshinestream?label=Docs&style=for-the-badge&logo=readthedocs
:alt: Read the Docs
:target: http://sunshinestream.readthedocs.io/
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=localized&style=for-the-badge&query=%24.progress..data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json&logo=crowdin
:alt: CrowdIn
:target: https://crowdin.com/project/sunshinestream
Support
-------
Our support methods are listed in our
`LizardByte Docs <https://lizardbyte.readthedocs.io/en/latest/about/support.html>`_.
Downloads
---------
.. image:: https://img.shields.io/github/downloads/lizardbyte/sunshine/total?style=for-the-badge&logo=github
:alt: GitHub Releases
:target: https://github.com/LizardByte/Sunshine/releases/latest
.. image:: https://img.shields.io/docker/pulls/lizardbyte/sunshine?style=for-the-badge&logo=docker
:alt: Docker
:target: https://hub.docker.com/r/lizardbyte/sunshine
Stats
------
.. image:: https://img.shields.io/github/stars/lizardbyte/sunshine?logo=github&style=for-the-badge
:alt: GitHub stars
:target: https://github.com/LizardByte/Sunshine
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=AUR&style=for-the-badge&query=$.results.0.NumVotes&url=https%3A%2F%2Fapp.lizardbyte.dev%2Funo%2Faur%2Fsunshine.json&logo=archlinux
:alt: AUR votes
:target: https://aur.archlinux.org/packages/sunshine
.. _nvenc support matrix: https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new
.. _obs-amd hardware support: https://github.com/obsproject/obs-amd-encoder/wiki/Hardware-Support
.. _VAAPI hardware support: https://www.intel.com/content/www/us/en/developer/articles/technical/linuxmedia-vaapi.html

Submodule ViGEmClient deleted from 52682b59c4

View File

@@ -1,38 +0,0 @@
image:
- Ubuntu
- Visual Studio 2019
environment:
matrix:
- BUILD_TYPE: Debug
- BUILD_TYPE: Release
install:
- sh: sudo apt update
- sh: sudo apt install -y build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
- cmd: C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git yasm nasm diffutils make"
before_build:
- git submodule update --init --recursive
- mkdir build
- cd build
build_script:
- cmd: set OLDPATH=%PATH%
- cmd: set PATH=C:\msys64\mingw64\bin
- sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_EXECUTABLE_PATH=sunshine -DSUNSHINE_ASSETS_DIR=/etc/sunshine ..
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
- sh: make -j$(nproc)
- cmd: mingw32-make -j2
- cmd: set PATH=%OLDPATH%
after_build:
- sh: ./gen-deb
- cmd: Del ..\assets\apps_linux.json
- cmd: 7z a Sunshine-Windows.zip ..\assets
- cmd: 7z a Sunshine-Windows.zip sunshine.exe
- cmd: 7z a Sunshine-Windows.zip tools\dxgi-info.exe
- cmd: 7z a Sunshine-Windows.zip tools\audio-info.exe
- cmd: appveyor PushArtifact Sunshine-Windows.zip
- sh: appveyor PushArtifact package-deb/sunshine.deb
- sh: appveyor PushArtifact sunshine.service

View File

@@ -1,19 +0,0 @@
{
"env":{
"PATH":"$(PATH):$(HOME)/.local/bin"
},
"apps":[
{
"name":"Low Res Desktop",
"prep-cmd":[
{ "do":"xrandr --output HDMI-1 --mode 1920x1080", "undo":"xrandr --output HDMI-1 --mode 1920x1200" }
]
},
{
"name":"Steam BigPicture",
"output":"steam.txt",
"cmd":"steam -bigpicture"
}
]
}

View File

@@ -1,15 +0,0 @@
{
"env":{
"PATH":"$(PATH);C:\\Program Files (x86)\\Steam"
},
"apps":[
{
"name":"Steam BigPicture",
"output":"steam.txt",
"prep-cmd":[
{"do":"steam \"steam://open/bigpicture\""}
]
}
]
}

View File

@@ -1,182 +0,0 @@
# If no external IP address is given, the local IP address is used
# external_ip = 123.456.789.12
# The private key must be 2048 bits
# pkey = /dir/pkey.pem
# The certificate must be signed with a 2048 bit key
# cert = /dir/cert.pem
# The name displayed by Moonlight
# If not specified, the PC's hostname is used
# sunshine_name = Sunshine
# The minimum log level printed to standard out
#
# none -> no logs are printed to standard out
#
# verbose = [0]
# debug = [1]
# info = [2]
# warning = [3]
# error = [4]
# fatal = [5]
# none = [6]
#
# min_log_level = info
# The origin of the remote endpoint address that is not denied for HTTP method /pin
# Could be any of the following values:
# pc|lan|wan
# pc: Only localhost may access /pin
# lan: Only those in LAN may access /pin
# wan: Anyone may access /pin
#
# origin_pin_allowed = lan
# The file where current state of Sunshine is stored
# file_state = sunshine_state.json
# How long to wait in milliseconds for data from moonlight before shutting down the stream
# ping_timeout = 2000
# The file where configuration for the different applications that Sunshine can run during a stream
# file_apps = apps.json
# How much error correcting packets must be send for every video
# This is just some random number, don't know the optimal value
# The higher fec_percentage, the lower space for the actual data to send per frame there is
#
# The value must be greater than 0 and lower than or equal to 100
# fec_percentage = 10
# When multicasting, it could be usefull to have different configurations for each connected Client.
# For example:
# Clients connected through WAN and LAN have different bitrate contstraints.
# Decoders may require different settings for color
#
# Unlike simply broadcasting to multiple Client, this will generate distinct video streams.
# Note, CPU usage increases for each distinct video stream generated
# channels = 1
# The back/select button on the controller
# On the Shield, the home and powerbutton are not passed to Moonlight
# If, after the timeout, the back button is still pressed down, Home/Guide button press is emulated.
# If back_button_timeout < 0, then the Home/Guide button will not be emulated
# back_button_timeout = 2000
# !! Windows only !!
# Control how fast keys will repeat themselves
# The initial delay in milliseconds before repeating keys
# key_repeat_delay = 500
#
# How often keys repeat every second
# This configurable option supports decimals
# key_repeat_frequency = 24.9
# The name of the audio sink used for Audio Loopback
# If you do not specify this variable, pulseaudio will select the default monitor device.
#
# You can find the name of the audio sink using the following command:
# !! Linux only !!
# pacmd list-sources | grep "name:"
# audio_sink = alsa_output.pci-0000_09_00.3.analog-stereo.monitor
#
# !! Windows only !!
# tools\audio-info.exe
# audio_sink = {0.0.0.00000000}.{FD47D9CC-4218-4135-9CE2-0C195C87405B}
# !! Windows only !!
# You can select the video card you want to stream:
# The appropriate values can be found using the following command:
# tools\dxgi-info.exe
# adapter_name = Radeon RX 580 Series
# output_name = \\.\DISPLAY1
###############################################
# FFmpeg software encoding parameters
# Honestly, I have no idea what the optimal values would be.
# Play around with this :)
# Constant Rate Factor. Between 1 and 52. It allows QP to go up during motion and down with still image, resulting in constant perceived quality
# Higher value means more compression, but less quality
# If crf == 0, then use QP directly instead
# crf = 0
# Quantitization Parameter
# Higher value means more compression, but less quality
# If crf != 0, then this parameter is ignored
# qp = 28
# Minimum number of threads used by ffmpeg to encode the video.
# Increasing the value slightly reduces encoding efficiency, but the tradeoff is usually
# worth it to gain the use of more CPU cores for encoding. The ideal value is the lowest
# value that can reliably encode at your desired streaming settings on your hardware.
# min_threads = 1
# Allows the client to request HEVC Main or HEVC Main10 video streams.
# HEVC is more CPU-intensive to encode, so enabling this may reduce performance when using software encoding.
# If set to 0 (default), Sunshine will specify support for HEVC based on encoder
# If set to 1, Sunshine will not advertise support for HEVC
# If set to 2, Sunshine will advertise support for HEVC Main profile
# If set to 3, Sunshine will advertise support for HEVC Main and Main10 (HDR) profiles
# hevc_mode = 0
# Force a specific encoder, otherwise Sunshine will use the first encoder that is available
# supported encoders:
# nvenc
# software
#
# encoder = nvenc
##################################### Software #####################################
# See x264 --fullhelp for the different presets
# sw_preset = superfast
# sw_tune = zerolatency
#
##################################### NVENC #####################################
###### presets ###########
# default
# hp -- high performance
# hq -- high quality
# slow -- hq 2 passes
# medium -- hq 1 pass
# fast -- hp 1 pass
# bd
# ll -- low latency
# llhq
# llhp
# lossless
# losslesshp
##########################
# nv_preset = llhq
#
####### rate control #####
# auto -- let ffmpeg decide rate control
# constqp -- constant QP mode
# vbr -- variable bitrate
# cbr -- constant bitrate
# cbr_hq -- cbr high quality
# cbr_ld_hq -- cbr low delay high quality
# vbr_hq -- vbr high quality
##########################
# nv_rc = auto
###### h264 entropy ######
# auto -- let ffmpeg nvenc decide the entropy encoding
# cabac
# cavlc
##########################
# nv_coder = auto
##############################################
# Some configurable parameters, are merely toggles for specific features
# The first occurrence turns it on, the second occurence turns it off, the third occurence turns it on again, etc, etc
# Here, you change the default state of any flag
#
# To set the initial state of flags -0 and -1 to on, set the following flags:
# flags = 01
#
# See: sunshine --help for all options under the header: flags

21
cmake/FindLIBCAP.cmake Normal file
View File

@@ -0,0 +1,21 @@
# - Try to find Libcap
# Once done this will define
#
# LIBCAP_FOUND - system has Libcap
# LIBCAP_INCLUDE_DIRS - the Libcap include directory
# LIBCAP_LIBRARIES - the libraries needed to use Libcap
# LIBCAP_DEFINITIONS - Compiler switches required for using Libcap
# Use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig)
pkg_check_modules(PC_LIBCAP libcap)
set(LIBCAP_DEFINITIONS ${PC_LIBCAP_CFLAGS})
find_path(LIBCAP_INCLUDE_DIRS sys/capability.h PATHS ${PC_LIBCAP_INCLUDEDIR} ${PC_LIBCAP_INCLUDE_DIRS})
find_library(LIBCAP_LIBRARIES NAMES libcap.so PATHS ${PC_LIBCAP_LIBDIR} ${PC_LIBCAP_LIBRARY_DIRS})
mark_as_advanced(LIBCAP_INCLUDE_DIRS LIBCAP_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBCAP REQUIRED_VARS LIBCAP_LIBRARIES LIBCAP_INCLUDE_DIRS)

21
cmake/FindLIBDRM.cmake Normal file
View File

@@ -0,0 +1,21 @@
# - Try to find Libdrm
# Once done this will define
#
# LIBDRM_FOUND - system has Libdrm
# LIBDRM_INCLUDE_DIRS - the Libdrm include directory
# LIBDRM_LIBRARIES - the libraries needed to use Libdrm
# LIBDRM_DEFINITIONS - Compiler switches required for using Libdrm
# Use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig)
pkg_check_modules(PC_LIBDRM libdrm)
set(LIBDRM_DEFINITIONS ${PC_LIBDRM_CFLAGS})
find_path(LIBDRM_INCLUDE_DIRS drm.h PATHS ${PC_LIBDRM_INCLUDEDIR} ${PC_LIBDRM_INCLUDE_DIRS} PATH_SUFFIXES libdrm)
find_library(LIBDRM_LIBRARIES NAMES libdrm.so PATHS ${PC_LIBDRM_LIBDIR} ${PC_LIBDRM_LIBRARY_DIRS})
mark_as_advanced(LIBDRM_INCLUDE_DIRS LIBDRM_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBDRM REQUIRED_VARS LIBDRM_LIBRARIES LIBDRM_INCLUDE_DIRS)

80
cmake/FindWayland.cmake Normal file
View File

@@ -0,0 +1,80 @@
# Try to find Wayland on a Unix system
#
# This will define:
#
# WAYLAND_FOUND - True if Wayland is found
# WAYLAND_LIBRARIES - Link these to use Wayland
# WAYLAND_INCLUDE_DIRS - Include directory for Wayland
# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
#
# In addition the following more fine grained variables will be defined:
#
# Wayland_Client_FOUND WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES
# Wayland_Server_FOUND WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES
# Wayland_EGL_FOUND WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES
# Wayland_Cursor_FOUND WAYLAND_CURSOR_INCLUDE_DIRS WAYLAND_CURSOR_LIBRARIES
#
# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
# 2020 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (NOT WIN32)
# Use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig)
PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor)
set(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS})
find_path(WAYLAND_CLIENT_INCLUDE_DIRS NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
find_library(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
if(WAYLAND_CLIENT_INCLUDE_DIRS AND WAYLAND_CLIENT_LIBRARIES)
set(Wayland_Client_FOUND TRUE) # cmake-lint: disable=C0103
else()
set(Wayland_Client_FOUND FALSE) # cmake-lint: disable=C0103
endif()
mark_as_advanced(WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES)
find_path(WAYLAND_CURSOR_INCLUDE_DIRS NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
find_library(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
if(WAYLAND_CURSOR_INCLUDE_DIRS AND WAYLAND_CURSOR_LIBRARIES)
set(Wayland_Cursor_FOUND TRUE) # cmake-lint: disable=C0103
else()
set(Wayland_Cursor_FOUND FALSE) # cmake-lint: disable=C0103
endif()
mark_as_advanced(WAYLAND_CURSOR_INCLUDE_DIRS WAYLAND_CURSOR_LIBRARIES)
find_path(WAYLAND_EGL_INCLUDE_DIRS NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
find_library(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
if(WAYLAND_EGL_INCLUDE_DIRS AND WAYLAND_EGL_LIBRARIES)
set(Wayland_EGL_FOUND TRUE) # cmake-lint: disable=C0103
else()
set(Wayland_EGL_FOUND FALSE) # cmake-lint: disable=C0103
endif()
mark_as_advanced(WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES)
find_path(WAYLAND_SERVER_INCLUDE_DIRS NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
find_library(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
if(WAYLAND_SERVER_INCLUDE_DIRS AND WAYLAND_SERVER_LIBRARIES)
set(Wayland_Server_FOUND TRUE) # cmake-lint: disable=C0103
else()
set(Wayland_Server_FOUND FALSE) # cmake-lint: disable=C0103
endif()
mark_as_advanced(WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES)
set(WAYLAND_INCLUDE_DIRS ${WAYLAND_CLIENT_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS}
${WAYLAND_EGL_INCLUDE_DIRS} ${WAYLAND_CURSOR_INCLUDE_DIRS})
set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES}
${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES})
mark_as_advanced(WAYLAND_INCLUDE_DIRS WAYLAND_LIBRARIES)
list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIRS)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Wayland REQUIRED_VARS WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIRS HANDLE_COMPONENTS)
ENDIF ()

22
crowdin.yml Normal file
View File

@@ -0,0 +1,22 @@
---
"base_path": "."
"base_url": "https://api.crowdin.com" # optional (for Crowdin Enterprise only)
"preserve_hierarchy": false # flatten tree on crowdin
"pull_request_labels": [
"crowdin",
"l10n"
]
"files": [
{
"source": "/locale/*.po",
"translation": "/locale/%two_letters_code%/LC_MESSAGES/%original_file_name%",
"languages_mapping": {
"two_letters_code": {
# map non-two letter codes here, left side is crowdin designation, right side is babel designation
"en-GB": "en_GB",
"en-US": "en_US"
}
}
}
]

View File

@@ -0,0 +1,156 @@
# syntax=docker/dockerfile:1.4
# artifacts: true
# platforms: linux/amd64,linux/arm64/v8
# platforms_pr: linux/amd64
ARG BASE=debian
ARG TAG=bullseye
FROM ${BASE}:${TAG} AS sunshine-base
ENV DEBIAN_FRONTEND=noninteractive
FROM sunshine-base as sunshine-build
ARG TARGETPLATFORM
RUN echo "target_platform: ${TARGETPLATFORM}"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install dependencies
RUN <<_DEPS
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends \
build-essential=12.9* \
cmake=3.18.4* \
libavdevice-dev=7:4.3.* \
libboost-filesystem-dev=1.74.0* \
libboost-log-dev=1.74.0* \
libboost-program-options-dev=1.74.0* \
libboost-thread-dev=1.74.0* \
libcap-dev=1:2.44* \
libcurl4-openssl-dev=7.74.0* \
libdrm-dev=2.4.104* \
libevdev-dev=1.11.0* \
libnuma-dev=2.0.12* \
libopus-dev=1.3.1* \
libpulse-dev=14.2* \
libssl-dev=1.1.1* \
libva-dev=2.10.0* \
libvdpau-dev=1.4* \
libwayland-dev=1.18.0* \
libx11-dev=2:1.7.2* \
libxcb-shm0-dev=1.14* \
libxcb-xfixes0-dev=1.14* \
libxcb1-dev=1.14* \
libxfixes-dev=1:5.0.3* \
libxrandr-dev=2:1.5.1* \
libxtst-dev=2:1.2.3* \
nodejs=12.22* \
npm=7.5.2* \
wget=1.21*
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
apt-get install -y --no-install-recommends \
libmfx-dev=21.1.0*
fi
apt-get clean
rm -rf /var/lib/apt/lists/*
_DEPS
# install cuda
WORKDIR /build/cuda
# versions: https://developer.nvidia.com/cuda-toolkit-archive
ENV CUDA_VERSION="11.8.0"
ENV CUDA_BUILD="520.61.05"
# hadolint ignore=SC3010
RUN <<_INSTALL_CUDA
#!/bin/bash
cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
cuda_suffix=""
if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cuda_suffix="_sbsa"
fi
url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run
chmod a+x ./cuda.run
./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm
rm ./cuda.run
_INSTALL_CUDA
# copy repository
WORKDIR /build/sunshine/
COPY .. .
# setup npm dependencies
RUN npm install
# setup build directory
WORKDIR /build/sunshine/build
# cmake and cpack
RUN <<_MAKE
#!/bin/bash
cmake \
-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=share/sunshine \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_CUDA=ON \
/build/sunshine
make -j "$(nproc)"
cpack -G DEB
_MAKE
FROM scratch AS artifacts
ARG BASE
ARG TAG
ARG TARGETARCH
COPY --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=artifacts /sunshine*.deb /sunshine.deb
# install sunshine
RUN <<_INSTALL_SUNSHINE
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends /sunshine.deb
apt-get clean
rm -rf /var/lib/apt/lists/*
_INSTALL_SUNSHINE
# network setup
EXPOSE 47984-47990/tcp
EXPOSE 48010
EXPOSE 47998-48000/udp
# setup user
ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}
ENV TZ="UTC"
ARG UNAME=lizard
ENV UNAME=${UNAME}
ENV HOME=/home/$UNAME
# setup user
RUN <<_SETUP_USER
groupadd -f -g "${PGID}" "${UNAME}"
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -G input -u "${PUID}" "${UNAME}"
mkdir -p ${HOME}/.config/sunshine
ln -s ${HOME}/.config/sunshine /config
chown -R ${UNAME} ${HOME}
_SETUP_USER
USER ${UNAME}
WORKDIR ${HOME}
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine"]

154
docker/fedora-36.dockerfile Normal file
View File

@@ -0,0 +1,154 @@
# syntax=docker/dockerfile:1.4
# artifacts: true
# platforms: linux/amd64,linux/arm64/v8
# platforms_pr: linux/amd64
ARG BASE=fedora
ARG TAG=36
FROM ${BASE}:${TAG} AS sunshine-base
FROM sunshine-base as sunshine-build
ARG TARGETPLATFORM
RUN echo "target_platform: ${TARGETPLATFORM}"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install dependencies
# hadolint ignore=DL3041
RUN <<_DEPS
#!/bin/bash
dnf -y update
dnf -y group install "Development Tools"
dnf -y install \
boost-devel-1.76.0* \
cmake-3.22.2* \
gcc-12.0.1* \
gcc-c++-12.0.1* \
libcap-devel-2.48* \
libcurl-devel-7.82.0* \
libdrm-devel-2.4.110* \
libevdev-devel-1.12.0* \
libva-devel-2.14.0* \
libvdpau-devel-1.5* \
libX11-devel-1.7.3* \
libxcb-devel-1.13.1* \
libXcursor-devel-1.2.0* \
libXfixes-devel-6.0.0* \
libXi-devel-1.8* \
libXinerama-devel-1.1.4* \
libXrandr-devel-1.5.2* \
libXtst-devel-1.2.3* \
mesa-libGL-devel-22.0.1* \
npm-8.3.1* \
numactl-devel-2.0.14* \
openssl-devel-3.0.2* \
opus-devel-1.3.1* \
pulseaudio-libs-devel-15.0* \
rpm-build-4.17.0* \
wget-1.21.3* \
which-2.21*
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
dnf -y install intel-mediasdk-devel-22.3.0*
fi
dnf clean all
rm -rf /var/cache/yum
_DEPS
# install cuda
WORKDIR /build/cuda
# versions: https://developer.nvidia.com/cuda-toolkit-archive
ENV CUDA_VERSION="12.0.0"
ENV CUDA_BUILD="525.60.13"
# hadolint ignore=SC3010
RUN <<_INSTALL_CUDA
#!/bin/bash
cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
cuda_suffix=""
if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cuda_suffix="_sbsa"
fi
url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run
chmod a+x ./cuda.run
./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm
rm ./cuda.run
_INSTALL_CUDA
# copy repository
WORKDIR /build/sunshine/
COPY .. .
# setup npm dependencies
RUN npm install
# setup build directory
WORKDIR /build/sunshine/build
# cmake and cpack
RUN <<_MAKE
#!/bin/bash
cmake \
-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=share/sunshine \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_CUDA=ON \
/build/sunshine
make -j "$(nproc)"
cpack -G RPM
_MAKE
FROM scratch AS artifacts
ARG BASE
ARG TAG
ARG TARGETARCH
COPY --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.rpm /sunshine-${BASE}-${TAG}-${TARGETARCH}.rpm
FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=artifacts /sunshine*.rpm /sunshine.rpm
# install sunshine
RUN <<_INSTALL_SUNSHINE
#!/bin/bash
dnf -y update
dnf -y install /sunshine.rpm
dnf clean all
rm -rf /var/cache/yum
_INSTALL_SUNSHINE
# network setup
EXPOSE 47984-47990/tcp
EXPOSE 48010
EXPOSE 47998-48000/udp
# setup user
ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}
ENV TZ="UTC"
ARG UNAME=lizard
ENV UNAME=${UNAME}
ENV HOME=/home/$UNAME
# setup user
RUN <<_SETUP_USER
groupadd -f -g "${PGID}" "${UNAME}"
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -G input -u "${PUID}" "${UNAME}"
mkdir -p ${HOME}/.config/sunshine
ln -s ${HOME}/.config/sunshine /config
chown -R ${UNAME} ${HOME}
_SETUP_USER
USER ${UNAME}
WORKDIR ${HOME}
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine"]

154
docker/fedora-37.dockerfile Normal file
View File

@@ -0,0 +1,154 @@
# syntax=docker/dockerfile:1.4
# artifacts: true
# platforms: linux/amd64,linux/arm64/v8
# platforms_pr: linux/amd64
ARG BASE=fedora
ARG TAG=37
FROM ${BASE}:${TAG} AS sunshine-base
FROM sunshine-base as sunshine-build
ARG TARGETPLATFORM
RUN echo "target_platform: ${TARGETPLATFORM}"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install dependencies
# hadolint ignore=DL3041
RUN <<_DEPS
#!/bin/bash
dnf -y update
dnf -y group install "Development Tools"
dnf -y install \
boost-devel-1.78.0* \
cmake-3.24.1* \
gcc-12.2.1* \
gcc-c++-12.2.1* \
libcap-devel-2.48* \
libcurl-devel-7.85.0* \
libdrm-devel-2.4.112* \
libevdev-devel-1.13.0* \
libva-devel-2.15.0* \
libvdpau-devel-1.5* \
libX11-devel-1.8.1* \
libxcb-devel-1.13.1* \
libXcursor-devel-1.2.1* \
libXfixes-devel-6.0.0* \
libXi-devel-1.8* \
libXinerama-devel-1.1.4* \
libXrandr-devel-1.5.2* \
libXtst-devel-1.2.3* \
mesa-libGL-devel-22.2.2* \
npm-8.15.0* \
numactl-devel-2.0.14* \
openssl-devel-3.0.5* \
opus-devel-1.3.1* \
pulseaudio-libs-devel-16.1* \
rpm-build-4.18.0* \
wget-1.21.3* \
which-2.21*
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
dnf -y install intel-mediasdk-devel-22.4.4*
fi
dnf clean all
rm -rf /var/cache/yum
_DEPS
# install cuda
WORKDIR /build/cuda
# versions: https://developer.nvidia.com/cuda-toolkit-archive
ENV CUDA_VERSION="12.0.0"
ENV CUDA_BUILD="525.60.13"
# hadolint ignore=SC3010
RUN <<_INSTALL_CUDA
#!/bin/bash
cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
cuda_suffix=""
if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cuda_suffix="_sbsa"
fi
url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run
chmod a+x ./cuda.run
./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm
rm ./cuda.run
_INSTALL_CUDA
# copy repository
WORKDIR /build/sunshine/
COPY .. .
# setup npm dependencies
RUN npm install
# setup build directory
WORKDIR /build/sunshine/build
# cmake and cpack
RUN <<_MAKE
#!/bin/bash
cmake \
-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=share/sunshine \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_CUDA=ON \
/build/sunshine
make -j "$(nproc)"
cpack -G RPM
_MAKE
FROM scratch AS artifacts
ARG BASE
ARG TAG
ARG TARGETARCH
COPY --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.rpm /sunshine-${BASE}-${TAG}-${TARGETARCH}.rpm
FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=artifacts /sunshine*.rpm /sunshine.rpm
# install sunshine
RUN <<_INSTALL_SUNSHINE
#!/bin/bash
dnf -y update
dnf -y install /sunshine.rpm
dnf clean all
rm -rf /var/cache/yum
_INSTALL_SUNSHINE
# network setup
EXPOSE 47984-47990/tcp
EXPOSE 48010
EXPOSE 47998-48000/udp
# setup user
ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}
ENV TZ="UTC"
ARG UNAME=lizard
ENV UNAME=${UNAME}
ENV HOME=/home/$UNAME
# setup user
RUN <<_SETUP_USER
groupadd -f -g "${PGID}" "${UNAME}"
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -G input -u "${PUID}" "${UNAME}"
mkdir -p ${HOME}/.config/sunshine
ln -s ${HOME}/.config/sunshine /config
chown -R ${UNAME} ${HOME}
_SETUP_USER
USER ${UNAME}
WORKDIR ${HOME}
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine"]

View File

@@ -0,0 +1,210 @@
# syntax=docker/dockerfile:1.4
# artifacts: true
# platforms: linux/amd64,linux/arm64/v8
# platforms_pr: linux/amd64
ARG BASE=ubuntu
ARG TAG=18.04
FROM ${BASE}:${TAG} AS sunshine-base
ENV DEBIAN_FRONTEND=noninteractive
FROM sunshine-base as sunshine-build
ARG TARGETPLATFORM
RUN echo "target_platform: ${TARGETPLATFORM}"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install dependencies
RUN <<_DEPS
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends \
software-properties-common=0.96.24.32.18
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get install -y --no-install-recommends \
bison=2:3.0.4* \
build-essential=12.4* \
gcc-10=10.3.0* \
g++-10=10.3.0* \
libavdevice-dev=7:3.4.* \
libcap-dev=1:2.25* \
libcurl-openssl1.0-dev=7.58.0* \
libdrm-dev=2.4.101* \
libevdev-dev=1.5.8* \
libnuma-dev=2.0.11* \
libopus-dev=1.1.2* \
libpulse-dev=1:11.1* \
libssl1.0-dev=1.0.2* \
libva-dev=2.1.0* \
libvdpau-dev=1.1.1* \
libwayland-dev=1.16.0* \
libx11-dev=2:1.6.4* \
libxcb-shm0-dev=1.13* \
libxcb-xfixes0-dev=1.13* \
libxcb1-dev=1.13* \
libxfixes-dev=1:5.0.3* \
libxrandr-dev=2:1.5.1* \
libxtst-dev=2:1.2.3* \
npm=3.5.2* \
node-gyp=3.6.2* \
nodejs-dev=8.10.0* \
wget=1.19.4*
apt-get clean
rm -rf /var/lib/apt/lists/*
_DEPS
# Update gcc alias
# https://stackoverflow.com/a/70653945/11214013
RUN <<_GCC_ALIAS
#!/bin/bash
update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-10 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-10 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10
_GCC_ALIAS
# install boost
# cannot install boost for aarch64 using ppa:savoury1/boost-defaults-1.71
# otherwise add the repository and the following packages
# libboost-filesystem1.71-dev=1.71.0* \
# libboost-log1.71-dev=1.71.0* \
# libboost-program-options1.71-dev=1.71.0* \
# libboost-regex1.71-dev=1.71.0* \
# libboost-thread1.71-dev=1.71.0* \
WORKDIR /build/tmp
RUN <<_INSTALL_BOOST
url="https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2"
wget "${url}" --progress=bar:force:noscroll -q --show-progress -O ./boost.tar.bz2
tar --bzip2 -xf boost.tar.bz2 --directory /build
mv /build/boost_*/ /build/boost
ls -a /build/boost
cd /build/boost
./bootstrap.sh --with-libraries=system,thread,log,program_options && \
./b2 install variant=release link=static,shared runtime-link=shared -j "$(nproc)"
_INSTALL_BOOST
# install cmake
# sunshine requires cmake >= 3.18
WORKDIR /build/cmake
# https://cmake.org/download/
ENV CMAKE_VERSION="3.25.1"
# hadolint ignore=SC3010
RUN <<_INSTALL_CMAKE
#!/bin/bash
cmake_prefix="https://github.com/Kitware/CMake/releases/download/v"
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
cmake_arch="x86_64"
elif [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cmake_arch="aarch64"
fi
url="${cmake_prefix}${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.sh"
echo "cmake url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cmake.sh
sh ./cmake.sh --prefix=/usr/local --skip-license
cmake --version
_INSTALL_CMAKE
# install cuda
WORKDIR /build/cuda
# versions: https://developer.nvidia.com/cuda-toolkit-archive
ENV CUDA_VERSION="11.8.0"
ENV CUDA_BUILD="520.61.05"
# hadolint ignore=SC3010
RUN <<_INSTALL_CUDA
#!/bin/bash
cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
cuda_suffix=""
if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cuda_suffix="_sbsa"
fi
url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run
chmod a+x ./cuda.run
./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm
rm ./cuda.run
_INSTALL_CUDA
# todo - install libmfx
# https://github.com/Intel-Media-SDK/MediaSDK
# copy repository
WORKDIR /build/sunshine/
COPY .. .
# setup npm dependencies
RUN npm install
# setup build directory
WORKDIR /build/sunshine/build
# cmake and cpack
RUN <<_MAKE
#!/bin/bash
cmake \
-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=share/sunshine \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_CUDA=ON \
/build/sunshine
make -j "$(nproc)"
cpack -G DEB
_MAKE
FROM scratch AS artifacts
ARG BASE
ARG TAG
ARG TARGETARCH
COPY --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=artifacts /sunshine*.deb /sunshine.deb
# install sunshine
RUN <<_INSTALL_SUNSHINE
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends /sunshine.deb
apt-get clean
rm -rf /var/lib/apt/lists/*
_INSTALL_SUNSHINE
# network setup
EXPOSE 47984-47990/tcp
EXPOSE 48010
EXPOSE 47998-48000/udp
# setup user
ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}
ENV TZ="UTC"
ARG UNAME=lizard
ENV UNAME=${UNAME}
ENV HOME=/home/$UNAME
# setup user
RUN <<_SETUP_USER
groupadd -f -g "${PGID}" "${UNAME}"
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -G input -u "${PUID}" "${UNAME}"
mkdir -p ${HOME}/.config/sunshine
ln -s ${HOME}/.config/sunshine /config
chown -R ${UNAME} ${HOME}
_SETUP_USER
USER ${UNAME}
WORKDIR ${HOME}
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine"]

View File

@@ -0,0 +1,190 @@
# syntax=docker/dockerfile:1.4
# artifacts: true
# platforms: linux/amd64,linux/arm64/v8
# platforms_pr: linux/amd64
ARG BASE=ubuntu
ARG TAG=20.04
FROM ${BASE}:${TAG} AS sunshine-base
ENV DEBIAN_FRONTEND=noninteractive
FROM sunshine-base as sunshine-build
ARG TARGETPLATFORM
RUN echo "target_platform: ${TARGETPLATFORM}"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install dependencies
RUN <<_DEPS
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends \
build-essential=12.8* \
gcc-10=10.3.0* \
g++-10=10.3.0* \
libavdevice-dev=7:4.2.* \
libboost-filesystem-dev=1.71.0* \
libboost-log-dev=1.71.0* \
libboost-program-options-dev=1.71.0* \
libboost-thread-dev=1.71.0* \
libcap-dev=1:2.32* \
libcurl4-openssl-dev=7.68.0* \
libdrm-dev=2.4.107* \
libevdev-dev=1.9.0* \
libnuma-dev=2.0.12* \
libopus-dev=1.3.1* \
libpulse-dev=1:13.99.1* \
libssl-dev=1.1.1* \
libva-dev=2.7.0* \
libvdpau-dev=1.3* \
libwayland-dev=1.18.0* \
libx11-dev=2:1.6.9* \
libxcb-shm0-dev=1.14* \
libxcb-xfixes0-dev=1.14* \
libxcb1-dev=1.14* \
libxfixes-dev=1:5.0.3* \
libxrandr-dev=2:1.5.2* \
libxtst-dev=2:1.2.3* \
nodejs=10.19.0* \
npm=6.14.4* \
wget=1.20.3*
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
apt-get install -y --no-install-recommends \
libmfx-dev=20.1.0*
fi
apt-get clean
rm -rf /var/lib/apt/lists/*
_DEPS
# Update gcc alias
# https://stackoverflow.com/a/70653945/11214013
RUN <<_GCC_ALIAS
#!/bin/bash
update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-10 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-10 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10
_GCC_ALIAS
# install cmake
# sunshine requires cmake >= 3.18
WORKDIR /build/cmake
# https://cmake.org/download/
ENV CMAKE_VERSION="3.25.1"
# hadolint ignore=SC3010
RUN <<_INSTALL_CMAKE
#!/bin/bash
cmake_prefix="https://github.com/Kitware/CMake/releases/download/v"
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
cmake_arch="x86_64"
elif [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cmake_arch="aarch64"
fi
url="${cmake_prefix}${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.sh"
echo "cmake url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cmake.sh
sh ./cmake.sh --prefix=/usr/local --skip-license
cmake --version
_INSTALL_CMAKE
# install cuda
WORKDIR /build/cuda
# versions: https://developer.nvidia.com/cuda-toolkit-archive
ENV CUDA_VERSION="11.8.0"
ENV CUDA_BUILD="520.61.05"
# hadolint ignore=SC3010
RUN <<_INSTALL_CUDA
#!/bin/bash
cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
cuda_suffix=""
if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cuda_suffix="_sbsa"
fi
url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run
chmod a+x ./cuda.run
./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm
rm ./cuda.run
_INSTALL_CUDA
# copy repository
WORKDIR /build/sunshine/
COPY .. .
# setup npm dependencies
RUN npm install
# setup build directory
WORKDIR /build/sunshine/build
# cmake and cpack
RUN <<_MAKE
#!/bin/bash
cmake \
-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=share/sunshine \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_CUDA=ON \
/build/sunshine
make -j "$(nproc)"
cpack -G DEB
_MAKE
FROM scratch AS artifacts
ARG BASE
ARG TAG
ARG TARGETARCH
COPY --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=artifacts /sunshine*.deb /sunshine.deb
# install sunshine
RUN <<_INSTALL_SUNSHINE
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends /sunshine.deb
apt-get clean
rm -rf /var/lib/apt/lists/*
_INSTALL_SUNSHINE
# network setup
EXPOSE 47984-47990/tcp
EXPOSE 48010
EXPOSE 47998-48000/udp
# setup user
ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}
ENV TZ="UTC"
ARG UNAME=lizard
ENV UNAME=${UNAME}
ENV HOME=/home/$UNAME
# setup user
RUN <<_SETUP_USER
groupadd -f -g "${PGID}" "${UNAME}"
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -G input -u "${PUID}" "${UNAME}"
mkdir -p ${HOME}/.config/sunshine
ln -s ${HOME}/.config/sunshine /config
chown -R ${UNAME} ${HOME}
_SETUP_USER
USER ${UNAME}
WORKDIR ${HOME}
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine"]

View File

@@ -0,0 +1,156 @@
# syntax=docker/dockerfile:1.4
# artifacts: true
# platforms: linux/amd64,linux/arm64/v8
# platforms_pr: linux/amd64
ARG BASE=ubuntu
ARG TAG=22.04
FROM ${BASE}:${TAG} AS sunshine-base
ENV DEBIAN_FRONTEND=noninteractive
FROM sunshine-base as sunshine-build
ARG TARGETPLATFORM
RUN echo "target_platform: ${TARGETPLATFORM}"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install dependencies
RUN <<_DEPS
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends \
build-essential=12.9* \
cmake=3.22.1* \
libavdevice-dev=7:4.4.* \
libboost-filesystem-dev=1.74.0* \
libboost-log-dev=1.74.0* \
libboost-program-options-dev=1.74.0* \
libboost-thread-dev=1.74.0* \
libcap-dev=1:2.44* \
libcurl4-openssl-dev=7.81.0* \
libdrm-dev=2.4.113* \
libevdev-dev=1.12.1* \
libnuma-dev=2.0.14* \
libopus-dev=1.3.1* \
libpulse-dev=1:15.99.1* \
libssl-dev=3.0.2* \
libva-dev=2.14.0* \
libvdpau-dev=1.4* \
libwayland-dev=1.20.0* \
libx11-dev=2:1.7.5* \
libxcb-shm0-dev=1.14* \
libxcb-xfixes0-dev=1.14* \
libxcb1-dev=1.14* \
libxfixes-dev=1:6.0.0* \
libxrandr-dev=2:1.5.2* \
libxtst-dev=2:1.2.3* \
nodejs=12.22.9* \
npm=8.5.1* \
wget=1.21.2*
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
apt-get install -y --no-install-recommends \
libmfx-dev=22.3.0*
fi
apt-get clean
rm -rf /var/lib/apt/lists/*
_DEPS
# install cuda
WORKDIR /build/cuda
# versions: https://developer.nvidia.com/cuda-toolkit-archive
ENV CUDA_VERSION="11.8.0"
ENV CUDA_BUILD="520.61.05"
# hadolint ignore=SC3010
RUN <<_INSTALL_CUDA
#!/bin/bash
cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
cuda_suffix=""
if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then
cuda_suffix="_sbsa"
fi
url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run
chmod a+x ./cuda.run
./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm
rm ./cuda.run
_INSTALL_CUDA
# copy repository
WORKDIR /build/sunshine/
COPY .. .
# setup npm dependencies
RUN npm install
# setup build directory
WORKDIR /build/sunshine/build
# cmake and cpack
RUN <<_MAKE
#!/bin/bash
cmake \
-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=share/sunshine \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DSUNSHINE_ENABLE_WAYLAND=ON \
-DSUNSHINE_ENABLE_X11=ON \
-DSUNSHINE_ENABLE_DRM=ON \
-DSUNSHINE_ENABLE_CUDA=ON \
/build/sunshine
make -j "$(nproc)"
cpack -G DEB
_MAKE
FROM scratch AS artifacts
ARG BASE
ARG TAG
ARG TARGETARCH
COPY --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=artifacts /sunshine*.deb /sunshine.deb
# install sunshine
RUN <<_INSTALL_SUNSHINE
#!/bin/bash
apt-get update -y
apt-get install -y --no-install-recommends /sunshine.deb
apt-get clean
rm -rf /var/lib/apt/lists/*
_INSTALL_SUNSHINE
# network setup
EXPOSE 47984-47990/tcp
EXPOSE 48010
EXPOSE 47998-48000/udp
# setup user
ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}
ENV TZ="UTC"
ARG UNAME=lizard
ENV UNAME=${UNAME}
ENV HOME=/home/$UNAME
# setup user
RUN <<_SETUP_USER
groupadd -f -g "${PGID}" "${UNAME}"
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -G input -u "${PUID}" "${UNAME}"
mkdir -p ${HOME}/.config/sunshine
ln -s ${HOME}/.config/sunshine /config
chown -R ${UNAME} ${HOME}
_SETUP_USER
USER ${UNAME}
WORKDIR ${HOME}
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine"]

20
docs/Makefile Normal file
View File

@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

35
docs/make.bat Normal file
View File

@@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

4
docs/requirements.txt Normal file
View File

@@ -0,0 +1,4 @@
furo==2022.12.7
m2r2==0.3.3.post2
Sphinx==6.1.3
sphinx-copybutton==0.5.1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
:github_url: https://github.com/LizardByte/Sunshine/tree/nightly/docs/DOCKER_README.md
.. mdinclude:: ../../../DOCKER_README.md

View File

@@ -0,0 +1,243 @@
Installation
============
The recommended method for running Sunshine is to use the `binaries`_ bundled with the `latest release`_.
.. Attention:: Additional setup is required after installation. See
:ref:`Setup <about/usage:setup>`.
Binaries
--------
Binaries of Sunshine are created for each release. They are available for Linux, macOS, and Windows.
Binaries can be found in the `latest release`_.
.. Tip:: Some third party packages also exist. See
:ref:`Third Party Packages <about/third_party_packages:third party packages>`.
Docker
------
Docker images are available on `Dockerhub.io`_ and `ghcr.io`_.
See :ref:`Docker <about/docker:docker>` for additional information.
Linux
-----
Follow the instructions for your preferred package type below.
**CUDA Compatibility**
CUDA is used for NVFBC capture.
.. Tip:: See `CUDA GPUS <https://developer.nvidia.com/cuda-gpus>`_ to cross reference Compute Capability to your GPU.
.. table::
:widths: auto
=========================================== ============== ============== ================================
Package CUDA Version Min Driver CUDA Compute Capabilities
=========================================== ============== ============== ================================
https://aur.archlinux.org/packages/sunshine User dependent User dependent User dependent
sunshine.AppImage 11.8.0 450.80.02 50;52;60;61;62;70;75;80;86;90;35
sunshine_{arch}.flatpak 11.8.0 450.80.02 50;52;60;61;62;70;75;80;86;90;35
sunshine-debian-bullseye-{arch}.deb 11.8.0 450.80.02 50;52;60;61;62;70;75;80;86;90;35
sunshine-fedora-36-{arch}.rpm 12.0.0 525.60.13 50;52;60;61;62;70;75;80;86;90
sunshine-fedora-37-{arch}.rpm 12.0.0 525.60.13 50;52;60;61;62;70;75;80;86;90
sunshine-ubuntu-20.04-{arch}.deb 11.8.0 450.80.02 50;52;60;61;62;70;75;80;86;90;35
sunshine-ubuntu-22.04-{arch}.deb 11.8.0 450.80.02 50;52;60;61;62;70;75;80;86;90;35
=========================================== ============== ============== ================================
AppImage
^^^^^^^^
According to AppImageLint the supported distro matrix of the AppImage is below.
- [✖] Debian oldstable (buster)
- [✔] Debian stable (bullseye)
- [✔] Debian testing (bookworm)
- [✔] Debian unstable (sid)
- [✔] Ubuntu kinetic
- [✔] Ubuntu jammy
- [✔] Ubuntu focal
- [✖] Ubuntu bionic
- [✖] Ubuntu xenial
- [✖] Ubuntu trusty
- [✖] CentOS 7
#. Download ``sunshine.AppImage`` to your home directory.
#. Open terminal and run the following code.
.. code-block:: bash
./sunshine.AppImage --install
Start:
.. code-block:: bash
./sunshine.AppImage --install && ./sunshine.AppImage
Uninstall:
.. code-block:: bash
./sunshine.AppImage --remove
AUR Package
^^^^^^^^^^^
#. Open terminal and run the following code.
.. code-block:: bash
git clone https://aur.archlinux.org/sunshine.git
cd sunshine
makepkg -fi
Uninstall:
.. code-block:: bash
pacman -R sunshine
Debian Package
^^^^^^^^^^^^^^
#. Download ``sunshine-{ubuntu-version}.deb`` and run the following code.
.. code-block:: bash
sudo apt install -f ./sunshine-{ubuntu-version}.deb
.. Note:: The ``{ubuntu-version}`` is the version of ubuntu we built the package on. If you are not using Ubuntu and
have an issue with one package, you can try another.
.. Tip:: You can double click the deb file to see details about the package and begin installation.
Uninstall:
.. code-block:: bash
sudo apt remove sunshine
Flatpak Package
^^^^^^^^^^^^^^^
#. Install `Flatpak <https://flatpak.org/setup/>`_ as required.
#. Download ``sunshine_{arch}.flatpak`` and run the following code.
.. Note:: Be sure to replace ``{arch}`` with the architecture for your operating system.
System level (recommended)
.. code-block:: bash
flatpak install --system ./sunshine_{arch}.flatpak
User level
.. code-block:: bash
flatpak install --user ./sunshine_{arch}.flatpak
Additional installation (required)
.. code-block:: bash
flatpak run --command=additional-install.sh dev.lizardbyte.sunshine
Start:
X11 and NVFBC capture (X11 Only)
.. code-block:: bash
flatpak run dev.lizardbyte.sunshine
KMS capture (Wayland & X11)
.. code-block:: bash
sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run dev.lizardbyte.sunshine
Uninstall:
.. code-block:: bash
flatpak run --command=remove-additional-install.sh dev.lizardbyte.sunshine
flatpak uninstall --delete-data dev.lizardbyte.sunshine
RPM Package
^^^^^^^^^^^
#. Add `rpmfusion` repositories by running the following code.
.. code-block:: bash
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
#. Download ``sunshine.rpm`` and run the following code.
.. code-block:: bash
sudo dnf install ./sunshine.rpm
.. Tip:: You can double click the rpm file to see details about the package and begin installation.
Uninstall:
.. code-block:: bash
sudo dnf remove sunshine
macOS
-----
Sunshine on macOS is experimental. Gamepads do not work. Other features may not work as expected.
pkg
^^^
.. Warning:: The `pkg` does not include runtime dependencies.
#. Download the ``sunshine.pkg`` file and install it as normal.
Uninstall:
.. code-block:: bash
cd /etc/sunshine/assets
uninstall_pkg.sh
Portfile
^^^^^^^^
#. Install `MacPorts <https://www.macports.org>`_
#. Update the Macports sources.
.. code-block:: bash
sudo nano /opt/local/etc/macports/sources.conf
Add this line, replacing your username, below the line that starts with ``rsync``.
``file:///Users/<username>/ports``
``Ctrl+x``, then ``Y`` to exit and save changes.
#. Download the ``Portfile`` to ``~/Downloads`` and run the following code.
.. code-block:: bash
mkdir -p ~/ports/multimedia/sunshine
mv ~/Downloads/Portfile ~/ports/multimedia/sunshine/
cd ~/ports
portindex
sudo port install sunshine
#. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone.
Uninstall:
.. code-block:: bash
sudo port uninstall sunshine
Windows
-------
Installer
^^^^^^^^^
#. Download and install ``sunshine-windows.exe``
.. Attention:: You should carefully select or unselect the options you want to install. Do not blindly install or enable
features.
To uninstall, find Sunshine in the list `here <ms-settings:installed-apps>`_ and select "Uninstall" from the overflow
menu. Different versions of Windows may provide slightly different steps for uninstall.
Standalone
^^^^^^^^^^
#. Download and extract ``sunshine-windows.zip``
To uninstall, delete the extracted directory which contains the ``sunshine.exe`` file.
.. _latest release: https://github.com/LizardByte/Sunshine/releases/latest
.. _Dockerhub.io: https://hub.docker.com/repository/docker/lizardbyte/sunshine
.. _ghcr.io: https://github.com/orgs/LizardByte/packages?repo_name=sunshine

View File

@@ -0,0 +1 @@
.. include:: ../../../README.rst

View File

@@ -0,0 +1,54 @@
Third Party Packages
====================
.. Danger:: These packages are not maintained by LizardByte. Use at your own risk.
Chocolatey
----------
.. image:: https://img.shields.io/chocolatey/v/Sunshine?style=for-the-badge&logo=chocolatey
:alt: Chocolatey Version
:target: https://community.chocolatey.org/packages/sunshine
.. image:: https://img.shields.io/chocolatey/dt/sunshine?style=for-the-badge&logo=chocolatey
:alt: Chocolatey
nixpkgs
-------
.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=nixpkgs&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27nix_unstable%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=nixos
:alt: nixpgs Version
:target: https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sunshine/default.nix
Scoop
-----
.. image:: https://img.shields.io/scoop/v/sunshine?bucket=extras&style=for-the-badge
:alt: Scoop Version (extras bucket)
:target: https://scoop.sh/#/apps?s=0&d=1&o=true&q=sunshine
Solus
-----
.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=Solus&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27solus%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=solus
:alt: Solus Version
:target: https://dev.getsol.us/source/sunshine
Winget
------
.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=Winget&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27winget%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=microsoft
:alt: Winget Version
:target: https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine
Legacy GitHub Repo
------------------
.. Attention:: This repo is not maintained. Thank you to Loki for bringing this amazing project to life!
.. image:: https://img.shields.io/static/v1?label=repo&message=loki-47-6F-64/sunshine&color=blue&style=for-the-badge&logo=github
:alt: GitHub Maintainer
:target: https://github.com/loki-47-6F-64/sunshine/releases
.. image:: https://img.shields.io/github/last-commit/loki-47-6F-64/sunshine?style=for-the-badge&logo=github
:alt: GitHub last commit
.. image:: https://img.shields.io/github/release-date/loki-47-6F-64/sunshine?style=for-the-badge&logo=github
:alt: GitHub Release Date

281
docs/source/about/usage.rst Normal file
View File

@@ -0,0 +1,281 @@
Usage
=====
#. See the `setup`_ section for your specific OS.
#. If you did not install the service, then start sunshine with the following command, unless a start command is listed
in the specified package :ref:`installation <about/installation:installation>` instructions.
.. Note:: A service is a process that runs in the background. Running multiple instances of Sunshine is not
advised.
**Basic usage**
.. code-block:: bash
sunshine
**Specify config file**
.. code-block:: bash
sunshine <directory of conf file>/sunshine.conf
.. Note:: You do not need to specify a config file. If no config file is entered the default location will be used.
.. Attention:: The configuration file specified will be created if it doesn't exist.
#. Configure Sunshine in the web ui
The web ui is available on `https://localhost:47990 <https://localhost:47990>`_ by default. You may replace
`localhost` with your internal ip address.
.. Attention:: Ignore any warning given by your browser about "insecure website". This is due to the SSL certificate
being self signed.
.. Caution:: If running for the first time, make sure to note the username and password that you created.
**Add games and applications.**
This can be configured in the web ui.
.. Note:: Additionally, apps can be configured manually. `src_assets/<os>/config/apps.json` is an example of a
list of applications that are started just before running a stream. This is the directory within the GitHub
repo.
#. In Moonlight, you may need to add the PC manually.
#. When Moonlight request you insert the correct pin on sunshine:
- Login to the web ui
- Go to "PIN" in the Navbar
- Type in your PIN and press Enter, you should get a Success Message
- In Moonlight, select one of the Applications listed
Network
-------
The Sunshine user interface will be available on port 47990 by default.
.. Warning:: Exposing ports to the internet can be dangerous. Do this at your own risk.
Arguments
---------
To get a list of available arguments run the following:
.. code-block:: bash
sunshine --help
Setup
-----
Linux
^^^^^
The `deb`, `rpm`, `Flatpak` and `AppImage` packages handle these steps automatically. Third party packages may not.
Sunshine needs access to `uinput` to create mouse and gamepad events.
#. Add user to group `input`, if this is the first time installing.
.. code-block:: bash
sudo usermod -a -G input $USER
#. Create `udev` rules.
.. code-block::
echo 'KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"' | \
sudo tee /etc/udev/rules.d/85-sunshine-input.rules
#. Optionally, configure autostart service
- filename: ``~/.config/systemd/user/sunshine.service``
- contents:
.. code-block::
[Unit]
Description=Sunshine self-hosted game stream host for Moonlight.
StartLimitIntervalSec=500
StartLimitBurst=5
[Service]
ExecStart=<see table>
Restart=on-failure
RestartSec=5s
#Flatpak Only
#ExecStop=flatpak kill dev.lizardbyte.sunshine
[Install]
WantedBy=graphical-session.target
.. table::
:widths: auto
======== ============================================== ===============
package ExecStart Auto Configured
======== ============================================== ===============
aur /usr/bin/sunshine ✔
deb /usr/bin/sunshine ✔
rpm /usr/bin/sunshine ✔
AppImage ~/sunshine.AppImage ✔
Flatpak flatpak run dev.lizardbyte.sunshine ✔
======== ============================================== ===============
**Start once**
.. code-block:: bash
systemctl --user start sunshine
**Start on boot**
.. code-block:: bash
systemctl --user enable sunshine
#. Additional Setup for KMS
.. Note:: ``cap_sys_admin`` may as well be root, except you don't need to be root to run it. It is necessary to
allow Sunshine to use KMS.
**Enable**
.. code-block:: bash
sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))
**Disable (for Xorg/X11)**
.. code-block:: bash
sudo setcap -r $(readlink -f $(which sunshine))
#. Reboot
.. code-block:: bash
sudo reboot now
macOS
^^^^^
Sunshine can only access microphones on macOS due to system limitations. To stream system audio use
`Soundflower <https://github.com/mattingalls/Soundflower>`_ or
`BlackHole <https://github.com/ExistentialAudio/BlackHole>`_.
.. Note:: Command Keys are not forwarded by Moonlight. Right Option-Key is mapped to CMD-Key.
.. Caution:: Gamepads are not currently supported.
Configure autostart service
**MacPorts**
.. code-block:: bash
sudo port load Sunshine
Windows
^^^^^^^
For gamepad support, install `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`_
Sunshine firewall
**Add rule**
.. code-block:: batch
cd /d "C:\Program Files\Sunshine\scripts"
add-firewall-rule.bat
**Remove rule**
.. code-block:: batch
cd /d "C:\Program Files\Sunshine\scripts"
remove-firewall-rule.bat
Sunshine service
**Enable**
.. code-block:: batch
cd /d "C:\Program Files\Sunshine\scripts"
install-service.bat
**Disable**
.. code-block:: batch
cd /d "C:\Program Files\Sunshine\scripts"
uninstall-service.bat
Shortcuts
---------
All shortcuts start with ``CTRL + ALT + SHIFT``, just like Moonlight
- ``CTRL + ALT + SHIFT + N`` - Hide/Unhide the cursor (This may be useful for Remote Desktop Mode for Moonlight)
- ``CTRL + ALT + SHIFT + F1/F12`` - Switch to different monitor for Streaming
Application List
----------------
- Applications should be configured via the web UI.
- A basic understanding of working directories and commands is required.
- You can use Environment variables in place of values
- ``$(HOME)`` will be replaced by the value of ``$HOME``
- ``$$`` will be replaced by ``$``, e.g. ``$$(HOME)`` will be become ``$(HOME)``
- ``env`` - Adds or overwrites Environment variables for the commands/applications run by Sunshine
- ``"Variable name":"Variable value"``
- ``apps`` - The list of applications
- Advanced users may want to edit the application list manually. The format is ``json``.
- Example application:
.. code-block:: json
{
"cmd": "command to open app",
"detached": [
"some-command",
"another-command"
],
"image-path": "/full-path/to/png-image",
"name": "An App",
"output": "/full-path/to/command-log-file",
"prep-cmd": [
{
"do": "some-command",
"undo": "undo-that-command"
}
],
"working-dir": "/full-path/to/working-directory"
}
- ``cmd`` - The main application
- ``detached`` - A list of commands to be run and forgotten about
- If not specified, a process is started that sleeps indefinitely
- ``image-path`` - The full path to the cover art image to use.
- ``name`` - The name of the application/game
- ``output`` - The file where the output of the command is stored
- ``prep-cmd`` - A list of commands to be run before/after the application
- If any of the prep-commands fail, starting the application is aborted
- ``do`` - Run before the application
- If it fails, all ``undo`` commands of the previously succeeded ``do`` commands are run
- ``undo`` - Run after the application has terminated
- Failures of ``undo`` commands are ignored
- ``working-dir`` - The working directory to use. If not specified, Sunshine will use the application directory.
Considerations
--------------
- When an application is started, if there is an application already running, it will be terminated.
- When the application has been shutdown, the stream shuts down as well.
- For example, if you attempt to run ``steam`` as a ``cmd`` instead of ``detached`` the stream will immediately fail.
This is due to the method in which the steam process is executed. Other applications may behave similarly.
- In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application,
instead it simply starts a stream.
- For the Linux flatpak you must prepend commands with ``flatpak-spawn --host``.
HDR Support
-----------
Streaming HDR content is supported for Windows hosts with NVIDIA, AMD, or Intel GPUs that support encoding HEVC Main 10.
You must have an HDR-capable display or EDID emulator dongle connected to your host PC to activate HDR in Windows.
- Ensure you enable the HDR option in your Moonlight client settings, otherwise the stream will be SDR.
- A good HDR experience relies on proper HDR display calibration both in Windows and in game. HDR calibration can differ significantly between client and host displays.
- We recommend calibrating the display by streaming the Windows HDR Calibration app to your client device and saving an HDR calibration profile to use while streaming.
- You may also need to tune the brightness slider or HDR calibration options in game to the different HDR brightness capabilities of your client's display.
- Older games that use NVIDIA-specific NVAPI HDR rather than native Windows 10 OS HDR support may not display in HDR.
- Some GPUs can produce lower image quality or encoding performance when streaming in HDR compared to SDR.
Tutorials
---------
Tutorial videos are available `here <https://www.youtube.com/playlist?list=PLMYr5_xSeuXAbhxYHz86hA1eCDugoxXY0>`_.
.. admonition:: Community!
Tutorials are community generated. Want to contribute? Reach out to us on our discord server.

View File

@@ -0,0 +1,32 @@
Build
=====
Sunshine binaries are built using `CMake <https://cmake.org/>`_. Cross compilation is not
supported. That means the binaries must be built on the target operating system and architecture.
Building Locally
----------------
Clone
^^^^^
Ensure `git <https://git-scm.com/>`_ is installed and run the following:
.. code-block:: bash
git clone https://github.com/lizardbyte/sunshine.git --recurse-submodules
cd sunshine && mkdir build && cd build
Compile
^^^^^^^
See the section specific to your OS.
- :ref:`Linux <building/linux:linux>`
- :ref:`macOS <building/macos:macos>`
- :ref:`Windows <building/windows:windows>`
Remote Build
------------
It may be beneficial to build remotely in some cases. This will enable easier building on different operating systems.
#. Fork the project
#. Activate workflows
#. Trigger the `CI` workflow manually
#. Download the artifacts/binaries from the workflow run summary

View File

@@ -0,0 +1,204 @@
Linux
=====
Requirements
------------
Debian Bullseye
^^^^^^^^^^^^^^^
End of Life: TBD
Install Requirements
.. code-block:: bash
sudo apt update && sudo apt install \
build-essential \
cmake \
libavdevice-dev \
libboost-filesystem-dev \
libboost-log-dev \
libboost-program-options-dev \
libboost-thread-dev \
libcap-dev \ # KMS
libcurl4-openssl-dev \
libdrm-dev \ # KMS
libevdev-dev \
libmfx-dev \ # x86_64 only
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \ # Wayland
libx11-dev \ # X11
libxcb-shm0-dev \ # X11
libxcb-xfixes0-dev \ # X11
libxcb1-dev \ # X11
libxfixes-dev \ # X11
libxrandr-dev \ # X11
libxtst-dev \ # X11
nodejs \
npm \
nvidia-cuda-dev \ # Cuda, NvFBC
nvidia-cuda-toolkit # Cuda, NvFBC
Fedora 36, 37
^^^^^^^^^^^^^
End of Life: TBD
Install Requirements
.. code-block:: bash
sudo dnf update && \
sudo dnf group install "Development Tools" && \
sudo dnf install \
boost-devel \
cmake \
gcc \
gcc-c++ \
intel-mediasdk-devel \ # x86_64 only
libcap-devel \
libcurl-devel \
libdrm-devel \
libevdev-devel \
libva-devel \
libvdpau-devel \
libX11-devel \ # X11
libxcb-devel \ # X11
libXcursor-devel \ # X11
libXfixes-devel \ # X11
libXi-devel \ # X11
libXinerama-devel \ # X11
libXrandr-devel \ # X11
libXtst-devel \ # X11
mesa-libGL-devel \
npm \
numactl-devel \
openssl-devel \
opus-devel \
pulseaudio-libs-devel \
rpm-build \ # if you want to build an RPM binary package
wget \ # necessary for cuda install with `run` file
which # necessary for cuda install with `run` file
Ubuntu 20.04
^^^^^^^^^^^^
End of Life: April 2030
Install Requirements
.. code-block:: bash
sudo apt update && sudo apt install \
build-essential \
cmake \
g++-10 \
libavdevice-dev \
libboost-filesystem-dev \
libboost-log-dev \
libboost-thread-dev \
libboost-program-options-dev \
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libmfx-dev \ # x86_64 only
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \ # Wayland
libx11-dev \ # X11
libxcb-shm0-dev \ # X11
libxcb-xfixes0-dev \ # X11
libxcb1-dev \ # X11
libxfixes-dev \ # X11
libxrandr-dev \ # X11
libxtst-dev \ # X11
nodejs \
npm \
wget # necessary for cuda install with `run` file
Update gcc alias
.. code-block:: bash
update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-10 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-10 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10
Ubuntu 22.04
^^^^^^^^^^^^
End of Life: April 2027
Install Requirements
.. code-block:: bash
sudo apt update && sudo apt install \
build-essential \
cmake \
libavdevice-dev \
libboost-filesystem-dev \
libboost-log-dev \
libboost-thread-dev \
libboost-program-options-dev \
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libmfx-dev \ # x86_64 only
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libwayland-dev \ # Wayland
libx11-dev \ # X11
libxcb-shm0-dev \ # X11
libxcb-xfixes0-dev \ # X11
libxcb1-dev \ # X11
libxfixes-dev \ # X11
libxrandr-dev \ # X11
libxtst-dev \ # X11
nodejs \
npm \
nvidia-cuda-dev \ # CUDA, NvFBC
nvidia-cuda-toolkit # CUDA, NvFBC
CUDA
----
If the version of CUDA available from your distro is not adequate, manually install CUDA.
.. Tip:: The version of CUDA you use will determine compatibility with various GPU generations.
See `CUDA compatibility <https://docs.nvidia.com/deploy/cuda-compatibility/index.html>`_ for more info.
Select the appropriate run file based on your desired CUDA version and architecture according to
`CUDA Toolkit Archive <https://developer.nvidia.com/cuda-toolkit-archive>`_.
.. code-block:: bash
wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run \
--progress=bar:force:noscroll -q --show-progress -O ./cuda.run
chmod a+x ./cuda.run
./cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm
rm ./cuda.run
npm dependencies
----------------
Install npm dependencies.
.. code-block:: bash
npm install
Build
-----
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
.. code-block:: bash
cmake ..
make -j ${nproc}
cpack -G DEB # optionally, create a deb package
cpack -G RPM # optionally, create a rpm package

View File

@@ -0,0 +1,46 @@
macOS
=====
Requirements
------------
macOS Big Sur and Xcode 12.5+
Use either `MacPorts <https://www.macports.org>`_ or `Homebrew <https://brew.sh>`_
MacPorts
""""""""
Install Requirements
.. code-block:: bash
sudo port install avahi boost180 cmake curl libopus npm9 pkgconfig
Homebrew
""""""""
Install Requirements
.. code-block:: bash
brew install boost cmake node opus
# if there are issues with an SSL header that is not found:
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
npm dependencies
----------------
Install npm dependencies.
.. code-block:: bash
npm install
Build
-----
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
.. code-block:: bash
cmake ..
make -j ${nproc}
cpack -G DragNDrop # optionally, create a macOS dmg package
If cmake fails complaining to find Boost, try to set the path explicitly.
``cmake -DBOOST_ROOT=[boost path] ..``, e.g., ``cmake -DBOOST_ROOT=/opt/local/libexec/boost/1.80 ..``

View File

@@ -0,0 +1,41 @@
Windows
=======
Requirements
------------
First you need to install `MSYS2 <https://www.msys2.org>`_, then startup "MSYS2 MinGW 64-bit" and execute the following
codes.
Update all packages:
.. code-block:: bash
pacman -Suy
Install dependencies:
.. code-block:: bash
pacman -S base-devel cmake diffutils gcc git make mingw-w64-x86_64-binutils \
mingw-w64-x86_64-boost mingw-w64-x86_64-cmake mingw-w64-x86_64-curl \
mingw-w64-x86_64-libmfx mingw-w64-x86_64-openssl mingw-w64-x86_64-opus \
mingw-w64-x86_64-toolchain
npm dependencies
----------------
Install nodejs and npm. Downloads available `here <https://nodejs.org/en/download/>`_.
Install npm dependencies.
.. code-block:: bash
npm install
Build
-----
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
.. code-block:: bash
cmake -G "MinGW Makefiles" ..
mingw32-make -j$(nproc)
cpack -G NSIS # optionally, create a windows installer
cpack -G ZIP # optionally, create a windows standalone package

85
docs/source/conf.py Normal file
View File

@@ -0,0 +1,85 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# standard imports
from datetime import datetime
import os
import re
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
script_dir = os.path.dirname(os.path.abspath(__file__)) # the directory of this file
source_dir = os.path.dirname(script_dir) # the source folder directory
root_dir = os.path.dirname(source_dir) # the root folder directory
# -- Project information -----------------------------------------------------
project = 'Sunshine'
copyright = f'{datetime.now ().year}, {project}'
author = 'ReenigneArcher'
# The full version, including alpha/beta/rc tags
with open(os.path.join(root_dir, 'CMakeLists.txt'), 'r') as f:
version = re.search(r"project\(Sunshine VERSION ((\d+)\.(\d+)\.(\d+))", str(f.read())).group(1)
"""
To use cmake method for obtaining version instead of regex,
1. Within CMakeLists.txt add the following line without backticks:
``configure_file(docs/source/conf.py.in "${CMAKE_CURRENT_SOURCE_DIR}/docs/source/conf.py" @ONLY)``
2. Rename this file to ``conf.py.in``
3. Uncomment the next line
"""
# version = '@PROJECT_VERSION@' # use this for cmake configure_file method
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'm2r2', # enable markdown files
'sphinx.ext.autosectionlabel',
'sphinx.ext.todo', # enable to-do sections
'sphinx.ext.viewcode', # add links to view source code
'sphinx_copybutton', # add a copy button to code blocks
]
# Add any paths that contain templates here, relative to this directory.
# templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['toc.rst']
# Extensions to include.
source_suffix = ['.rst', '.md']
# -- Options for HTML output -------------------------------------------------
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
html_logo = os.path.join(root_dir, 'sunshine.png')
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'furo'
html_theme_options = {
"top_of_page_button": "edit",
"source_edit_link": "https://github.com/lizardbyte/sunshine/tree/nightly/docs/source/{filename}",
}
# extension config options
autosectionlabel_prefix_document = True # Make sure the target is unique
todo_include_todos = True

View File

@@ -0,0 +1,5 @@
Contributing
============
Read our contribution guide in our organization level
`docs <https://lizardbyte.readthedocs.io/en/latest/developers/contributing.html>`_.

View File

@@ -0,0 +1,81 @@
Localization
============
Sunshine is being localized into various languages. The default language is `en` (English) and is highlighted green.
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=de&style=for-the-badge&query=%24.progress.0.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
.. image:: https://img.shields.io/badge/dynamic/json?color=green&label=en&style=for-the-badge&query=%24.progress.1.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=en-GB&style=for-the-badge&query=%24.progress.2.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=en-US&style=for-the-badge&query=%24.progress.3.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=es-ES&style=for-the-badge&query=%24.progress.4.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=fr&style=for-the-badge&query=%24.progress.5.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=it&style=for-the-badge&query=%24.progress.6.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=ru&style=for-the-badge&query=%24.progress.7.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
Graph
.. image:: https://badges.awesome-crowdin.com/translation-15178612-503956.png
CrowdIn
-------
The translations occur on
`CrowdIn <https://crowdin.com/project/sunshinestream>`_. Feel free to contribute to localization there.
Only elements of the API are planned to be translated.
.. Attention:: The rest API has not yet been implemented.
**Translations Basics**
- The brand names `LizardByte` and `Sunshine` should never be translated.
- Other brand names should never be translated.
Examples:
- AMD
- Nvidia
**CrowdIn Integration**
How does it work?
When a change is made to sunshine source code, a workflow generates new translation templates
that get pushed to CrowdIn automatically.
When translations are updated on CrowdIn, a push gets made to the `l10n_nightly` branch and a PR is made against the
`nightly` branch. Once PR is merged, all updated translations are part of the project and will be included in the
next release.
Extraction
----------
There should be minimal cases where strings need to be extracted from source code; however it may be necessary in some
situations. For example if a system tray icon is added it should be localized as it is user interfacing.
- Wrap the string to be extracted in a function as shown.
.. code-block:: cpp
#include <boost/locale.hpp>
boost::locale::translate("Hello world!")
.. Tip:: More examples can be found in the documentation for
`boost locale <https://www.boost.org/doc/libs/1_70_0/libs/locale/doc/html/messages_formatting.html>`_.
.. Warning:: This is for information only. Contributors should never include manually updated template files, or
manually compiled language files in Pull Requests.
Strings are automatically extracted from the code to the `locale/sunshine.po` template file. The generated file is
used by CrowdIn to generate language specific template files. The file is generated using the
`.github/workflows/localize.yml` workflow and is run on any push event into the `nightly` branch. Jobs are only run if
any of the following paths are modified.
.. code-block:: yaml
- 'src/**'
When testing locally it may be desirable to manually extract, initialize, update, and compile strings. Python is
required for this, along with the python dependencies in the `./scripts/requirements.txt` file. Additionally,
`xgettext <https://www.gnu.org/software/gettext/>`_ must be installed.
**Extract, initialize, and update**
.. code-block:: bash
python ./scripts/_locale.py --extract --init --update
**Compile**
.. code-block:: bash
python ./scripts/_locale.py --compile

View File

@@ -0,0 +1,38 @@
Testing
=======
Clang Format
------------
Source code is tested against the `.clang-format` file for linting errors. The workflow file responsible for clang
format testing is `.github/workflows/cpp-clang-format-lint.yml`.
Test clang-format locally.
.. code-block:: bash
find ./ -iname *.cpp -o -iname *.h -iname *.m -iname *.mm | xargs clang-format -i
Sphinx
------
Sunshine uses `Sphinx <https://www.sphinx-doc.org/en/master/>`_ for documentation building. Sphinx, along with other
required documentation depencies are included in the `./docs/requirements.txt` file. Python is required to build
sphinx docs. Installation and setup of python will not be covered here.
The config file for Sphinx is `docs/source/conf.py`. This is already included in the repo and should not be modified.
Test with Sphinx
.. code-block:: bash
cd docs
make html
Alternatively
.. code-block:: bash
cd docs
sphinx-build -b html source build
Unit Testing
------------
.. Todo:: Sunshine does not currently have any unit tests. If you would like to help us improve please get in contact
with us, or make a PR with suggested changes.

View File

@@ -0,0 +1,20 @@
GameStream
==========
Nvidia announced that their GameStream service for Nvidia Games clients will be discontinued in February 2023.
Luckily, Sunshine performance is now on par with Nvidia GameStream. Many users have even reported that Sunshine
outperforms GameStream, so rest assured that Sunshine will be equally performant moving forward.
Migration
---------
We have developed a simple migration tool to help you migrate your GameStream games and apps to Sunshine automatically.
Please check out our `GSMS <https://github.com/LizardByte/GSMS>`_ project if you're interested in an automated
migration option. At the time of writing this GSMS offers the ability to migrate your custom games and apps. The
working directory, command, and image are all set in Sunshine's ``apps.json`` file. The box-art image is also copied
to a specified directory.
Limitations
-----------
Sunshine does have some limitations, as compared to Nvidia GameStream.
- Automatic game/application list.
- Changing game settings automatically, to optimize streaming.

5
docs/source/index.rst Normal file
View File

@@ -0,0 +1,5 @@
:github_url: https://github.com/LizardByte/Sunshine/tree/nightly/docs/source/index.rst
Table of Contents
=================
.. include:: toc.rst

View File

@@ -0,0 +1,21 @@
Legal
=====
.. Attention:: This documentation is for informational purposes only and is not intended as legal advice. If you have
any legal questions or concerns about using Sunshine, we recommend consulting with a lawyer.
Sunshine is licensed under the GPL-3.0 license, which allows for free use and modification of the software.
The full text of the license can be reviewed `here <https://github.com/LizardByte/Sunshine/blob/master/LICENSE>`_.
Commercial Use
--------------
Sunshine can be used in commercial applications without any limitations. This means that businesses and organizations
can use Sunshine to create and sell products or services without needing to seek permission or pay a fee.
However, it is important to note that the GPL-3.0 license does not grant any rights to distribute or sell the encoders
contained within Sunshine. If you plan to sell access to Sunshine as part of their distribution, you are responsible
for obtaining the necessary licenses to do so. This may include obtaining a license from the
Motion Picture Experts Group (MPEG-LA) and/or any other necessary licensing requirements.
In summary, while Sunshine is free to use, it is the user's responsibility to ensure compliance with all applicable
licensing requirements when redistributing the software as part of a commercial offering. If you have any questions or
concerns about using Sunshine in a commercial setting, we recommend consulting with a lawyer.

48
docs/source/toc.rst Normal file
View File

@@ -0,0 +1,48 @@
.. toctree::
:maxdepth: 2
:caption: About
about/overview
about/installation
about/docker
about/third_party_packages
about/usage
about/advanced_usage
.. toctree::
:maxdepth: 2
:caption: GameStream
gamestream/gamestream
.. toctree::
:maxdepth: 2
:caption: Troubleshooting
troubleshooting/general
troubleshooting/linux
troubleshooting/macos
troubleshooting/windows
.. toctree::
:maxdepth: 2
:caption: Build
building/build
building/linux
building/macos
building/windows
.. toctree::
:maxdepth: 2
:caption: Contributing
contributing/contributing
contributing/localization
contributing/testing
.. toctree::
:maxdepth: 2
:caption: Legal
legal/legal

View File

@@ -0,0 +1,24 @@
General
=======
Forgotten Credentials
---------------------
If you forgot your credentials to the web UI, try this.
.. code-block:: bash
sunshine --creds <new username> <new password>
Web UI Access
-------------
Can't access the web UI?
#. Check firewall rules.
Nvidia issues
-------------
NvFBC, NvENC, or general issues with Nvidia graphics card.
- Consumer grade Nvidia cards are software limited to a specific number of encodes. See
`Video Encode and Decode GPU Support Matrix <https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new>`_
for more info.
- You can usually bypass the restriction with a driver patch. See Keylase's
`Linux <https://github.com/keylase/nvidia-patch>`_
or `Windows <https://github.com/keylase/nvidia-patch/blob/master/win>`_ patches for more guidance.

View File

@@ -0,0 +1,9 @@
Linux
=====
KMS Streaming fails
-------------------
If screencasting fails with KMS, you may need to run the following to force unprivileged screencasting.
.. code-block:: bash
sudo setcap -r $(readlink -f $(which sunshine))

View File

@@ -0,0 +1,13 @@
macOS
=====
Dynamic session lookup failed
-----------------------------
If you get this error:
`Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that
org.freedesktop.dbus-session.plist is loaded!`
Try this.
.. code-block:: bash
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

View File

@@ -0,0 +1,6 @@
Windows
=======
No gamepad detected
-------------------
#. Verify that you've installed `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`_.

View File

@@ -1,76 +0,0 @@
#!/bin/sh
if [ ! "@SUNSHINE_UNDEFINED_VARIABLE@" = "" ]; then
echo "Please run gen-deb generated by cmake inside the build directory"
exit 1
fi
if [ -d package-deb ]; then
echo "package-deb already exists: It will be replaced"
rm -rf package-deb
fi
export DEBIAN=package-deb/sunshine/DEBIAN
export RULES=package-deb/sunshine/etc/udev/rules.d
export BIN=package-deb/sunshine/usr/bin
export ASSETS=package-deb/sunshine/etc/sunshine
mkdir -p $DEBIAN
mkdir -p $RULES
mkdir -p $BIN
mkdir -p $ASSETS
if [ ! -f sunshine ]; then
echo "Error: Can't find sunshine"
exit 1
fi
cat << 'EOF' > $DEBIAN/conffiles
/etc/sunshine/sunshine.conf
/etc/sunshine/apps_linux.json
EOF
cat << 'EOF' > $DEBIAN/control
Package: sunshine
Architecture: amd64
Maintainer: @loki
Priority: optional
Version: 0.2.1
Depends: libssl1.1, libavdevice58, libboost-thread1.71.0, libboost-filesystem1.71.0, libboost-log1.71.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0
Description: Gamestream host for Moonlight
EOF
cat << 'EOF' > $DEBIAN/postinst
#!/bin/sh
export GROUP_INPUT=input
if [ -f /etc/group ]; then
if ! grep -q $GROUP_INPUT /etc/group; then
echo "Creating group $GROUP_INPUT"
groupadd $GROUP_INPUT
fi
else
echo "Warning: /etc/group not found"
fi
EOF
cat << 'EOF' > $RULES/85-sunshine-rules.rules
KERNEL=="uinput", GROUP="input", MODE="0660"
EOF
cp sunshine $BIN/sunshine
cp @CMAKE_CURRENT_SOURCE_DIR@/assets/apps_linux.json $ASSETS/apps_linux.json
cp @CMAKE_CURRENT_SOURCE_DIR@/assets/sunshine.conf $ASSETS/sunshine.conf
chmod 755 $DEBIAN/postinst
chmod 755 $BIN/sunshine
chmod 644 $RULES/85-sunshine-rules.rules
cd package-deb
if fakeroot dpkg-deb --build sunshine; then
echo "generated debian package: @CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine.deb"
fi
cd ..

7
package.json Normal file
View File

@@ -0,0 +1,7 @@
{
"dependencies": {
"@fortawesome/fontawesome-free": "6.2.1",
"bootstrap": "5.2.3",
"vue": "2.6.12"
}
}

View File

@@ -0,0 +1,110 @@
#!/bin/bash
# custom AppRun for Sunshine AppImage
# path of the extracted AppRun
HERE="$(dirname "$(readlink -f "${0}")")"
SUNSHINE_PATH=/usr/bin/sunshine
SUNSHINE_BIN_HERE=$HERE/usr/bin/sunshine
SUNSHINE_SHARE_HERE=$HERE/usr/share/sunshine
# Set APPDIR when running directly from the AppDir:
if [ -z "$APPDIR" ]; then
ARGV0="AppRun"
fi
cd "$HERE" || exit 1
function help() {
echo "
------------------------------
Sunshine AppImage package.
------------------------------
sunshine.AppImage options
------------------------
Usage: $ARGV0 --help, -h
------ # This message
$ARGV0 --install, -i
# Install input rules sunshine.service files. Restart required.
$ARGV0 --remove, -r
# Remove input rules sunshine.service files.
$ARGV0 --appimage-help
# Show available AppImage options
sunshine options
----------------
"
# print sunshine binary help, replacing the sunshine command in usage statement
"$SUNSHINE_BIN_HERE" --help | sed -e "s#$SUNSHINE_BIN_HERE#$ARGV0#g"
}
function install() {
# user input rules
sudo usermod -a -G input $USER
# shellcheck disable=SC2002
cat "$SUNSHINE_SHARE_HERE/udev/rules.d/85-sunshine.rules" | sudo tee /etc/udev/85-sunshine.rules
# sunshine service
mkdir -p ~/.config/systemd/user
cp -r "$SUNSHINE_SHARE_HERE/systemd/user/" ~/.config/systemd/
# patch service executable path
sed -i -e "s#$SUNSHINE_PATH#$(readlink -f $ARGV0)#g" ~/.config/systemd/user/sunshine.service
# setcap
sudo setcap cap_sys_admin+p "$(readlink -f "$SUNSHINE_BIN_HERE")"
while true
do
read -r -p "This installation requires a reboot. Do you want to reboot NOW? [y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
sudo reboot now
;;
[nN][oO]|[nN])
echo "No"
break
;;
*)
echo "Invalid input..."
;;
esac
done
}
function remove() {
# remove input rules
sudo rm -f /etc/udev/rules.d/85-sunshine.rules
# remove service
sudo rm -f ~/.config/systemd/user/sunshine.service
}
# process arguments
if [ "x$1" == "xhelp" ] || [ "x$1" == "x--help" ] || [ "x$1" == "x-h" ] ; then
help
exit $?
fi
if [ "x$1" == "xinstall" ] || [ "x$1" == "x--install" ] || [ "x$1" == "x-i" ] ; then
install
exit $?
fi
if [ "x$1" == "xremove" ] || [ "x$1" == "x--remove" ] || [ "x$1" == "x-r" ] ; then
remove
exit $?
fi
# create config directory if it doesn't exist
# https://github.com/LizardByte/Sunshine/issues/324
mkdir -p ~/.config/sunshine
# run sunshine
"$SUNSHINE_BIN_HERE" $@

View File

@@ -0,0 +1,50 @@
# Edit on github: https://github.com/LizardByte/Sunshine/tree/nightly/packaging/linux/aur/PKGBUILD
# Reference: https://wiki.archlinux.org/title/PKGBUILD
pkgname=@SUNSHINE_AUR_PKG@
pkgver=@PROJECT_VERSION@@SUNSHINE_SUB_VERSION@
pkgrel=1
pkgdesc="@PROJECT_DESCRIPTION@"
arch=('x86_64' 'i686')
url=@PROJECT_HOMEPAGE_URL@
license=('GPL3')
depends=('avahi' 'boost-libs' 'curl' 'libevdev' 'libmfx' 'libpulse' 'libva' 'libvdpau' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'numactl' 'openssl' 'opus' 'udev')
makedepends=('boost' 'cmake' 'git' 'make' 'nodejs' 'npm')
optdepends=('cuda: NvFBC capture support'
'libcap'
'libdrm')
provides=(@SUNSHINE_AUR_PROVIDES@)
conflicts=(@SUNSHINE_AUR_CONFLICTS@)
source=("$pkgname::git+@GITHUB_CLONE_URL@#commit=@GITHUB_COMMIT@")
sha256sums=('SKIP')
prepare() {
cd "$pkgname"
git submodule update --recursive --init
}
build() {
pushd "$pkgname"
npm install
popd
export CFLAGS="${CFLAGS/-Werror=format-security/}"
export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
cmake \
-S "$pkgname" \
-B build \
-Wno-dev \
-D CMAKE_INSTALL_PREFIX=/usr \
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-D SUNSHINE_ASSETS_DIR="share/sunshine"
make -C build
}
package() {
make -C build install DESTDIR="$pkgdir"
}

View File

@@ -0,0 +1,243 @@
---
app-id: dev.lizardbyte.sunshine
runtime: org.freedesktop.Platform
runtime-version: "21.08"
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.node18
command: sunshine
separate-locales: false
finish-args:
- --device=all # access all devices
- --env=PULSE_PROP_media.category=Manager # allow sunshine to manage audio sinks
- --filesystem=home # need to save files in user's home directory
- --share=ipc # required for X11 shared memory extension
- --share=network # access network
- --socket=pulseaudio # play sounds using pulseaudio
- --socket=wayland # show windows using Wayland
- --socket=x11 # show windows using X11
- --system-talk-name=org.freedesktop.Avahi # talk to avahi on the system bus
- --talk-name=org.freedesktop.Flatpak # talk to flatpak on the session bus
cleanup:
- /include
- /lib/cmake
- /lib/pkgconfig
- /lib/*.la
- /lib/*.a
- /share/man
modules:
- name: boost
disabled: false
buildsystem: simple
build-commands:
- cd tools/build && bison -y -d -o src/engine/jamgram.cpp src/engine/jamgram.y
- ./bootstrap.sh --prefix=$FLATPAK_DEST --with-libraries=system,thread,log,program_options || cat bootstrap.log
- ./b2 install variant=release link=shared runtime-link=shared cxxflags="$CXXFLAGS" linkflags="$LDFLAGS"
-j $FLATPAK_BUILDER_N_JOBS
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/b/boost1.74/boost1.74_1.74.0.orig.tar.xz
sha256: 2467be4af625b5ae4b3c93fc7af196a09eba39c11a7338cd9e8b356fa44d2f45
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/b/boost1.74/boost1.74_1.74.0-17ubuntu1.debian.tar.xz
sha256: 22e623d98c84eb3fec57e19ea371157a5bc8225ba4c5907f7e5155072317a31d
- type: shell
commands:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done
- name: avahi
disabled: false
cleanup:
- /bin
- /lib/avahi
- /share
config-opts:
- --with-distro=none
- --disable-gobject
- --disable-introspection
- --disable-qt3
- --disable-qt4
- --disable-qt5
- --disable-gtk
- --disable-core-docs
- --disable-manpages
- --disable-libdaemon
- --disable-python
- --disable-pygobject
- --disable-mono
- --disable-monodoc
- --disable-autoipd
- --disable-doxygen-doc
- --disable-doxygen-dot
- --disable-doxygen-xml
- --disable-doxygen-html
- --disable-manpages
- --disable-xmltoman
- --disable-libevent
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/avahi_0.8.orig.tar.gz
sha256: 060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/avahi_0.8-6ubuntu1.debian.tar.xz
sha256: ebf1dfe5e853b6bc6843e3bd784cb6af632041f305abd0e5415114f80c1dcea4
- type: shell
commands:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done
- autoreconf -ivf
- name: libevdev
disabled: false
buildsystem: meson
config-opts:
- -Ddocumentation=disabled
- -Dtests=disabled
cleanup:
- /bin
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/libe/libevdev/libevdev_1.13.0+dfsg.orig.tar.xz
sha256: a882e13ef1dd6bd227318080cabf60fe5af3c06471259d3acfc9dbfb202351a7
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/libe/libevdev/libevdev_1.13.0+dfsg-1.debian.tar.xz
sha256: d33c56acbbfff2dc540e45c57a38d92210b5e7fd0947ac47fbe48183468aad74
- type: shell
commands:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done
- name: intel-mediasdk
disabled: false
buildsystem: cmake
config-opts:
- -DENABLE_OPENCL=ON
- -DENABLE_X11_DRI3=ON
- -DENABLE_WAYLAND=ON
- -DENABLE_ITT=OFF
- -DENABLE_TEXTLOG=OFF
- -DENABLE_STAT=OFF
- -DBUILD_ALL=OFF
- -DBUILD_RUNTIME=ON
- -DBUILD_SAMPLES=OFF
- -DBUILD_TESTS=OFF
- -DBUILD_TOOLS=OFF
- -DUSE_SYSTEM_GTEST=OFF
- -DMFX_ENABLE_KERNELS=ON
only-arches:
- x86_64
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/universe/i/intel-mediasdk/intel-mediasdk_22.3.0.orig.tar.gz
sha256: e1e74229f409e969b70c2b35b1955068de3d40db85ecc42bd6ff501468bc76d7
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/universe/i/intel-mediasdk/intel-mediasdk_22.3.0-1.debian.tar.xz
sha256: 024d98d2f63443d2765a90cfe997d104e7b897694889f199ca8fb4d9ffdcf1dc
- type: shell
commands:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done
modules:
- name: libdrm
disabled: false
buildsystem: meson
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm_2.4.110.orig.tar.xz
sha256: eecee4c4b47ed6d6ce1a9be3d6d92102548ea35e442282216d47d05293cf9737
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm_2.4.110-1ubuntu1.debian.tar.xz
sha256: 464b9553861f39beddfaee6b8924734b02a0febfae3968e4ca1360f2972bba8b
- type: shell
commands:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done
- name: numactl
buildsystem: autotools
make-args:
- install
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/n/numactl/numactl_2.0.14.orig.tar.gz
sha256: 1ee27abd07ff6ba140aaf9bc6379b37825e54496e01d6f7343330cf1a4487035
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/main/n/numactl/numactl_2.0.14-3ubuntu2.debian.tar.xz
sha256: 49089e5be5367f6367f8b0389d1d523944432607783b53f0605705792e1015ee
- type: shell
commands:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done
cleanup:
- "/bin"
# Caching is configured until here, not including CUDA
- name: cuda
disabled: false
buildsystem: simple
only-arches:
- x86_64
- aarch64
cleanup:
- "*"
build-commands:
- chmod u+x ./cuda.run
- ./cuda.run --silent --toolkit --toolkitpath=$FLATPAK_DEST/cuda --no-opengl-libs --no-man-page --no-drm
--tmpdir=$FLATPAK_BUILDER_BUILDDIR
- rm -r $FLATPAK_DEST/cuda/nsight-systems-*
- rm ./cuda.run
sources:
- type: file
only-arches:
- x86_64
url: https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
sha256: 9223c4af3aebe4a7bbed9abd9b163b03a1b34b855fbc2b4a0d1b706ac09a5a16
dest-filename: cuda.run
- type: file
only-arches:
- aarch64
url: https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux_sbsa.run # yamllint disable-line rule:line-length
sha256: e6e9a8d31163c9776b5e313fd7590877c5684e1ecddee741154f95704d4ed27c
dest-filename: cuda.run
- name: sunshine
disabled: false
buildsystem: cmake
no-make-install: false
builddir: true
build-options:
append-path: /usr/lib/sdk/node18/bin
build-args:
- --share=network
cxxflags: -I${C_INCLUDE_PATH}/libevdev-1.0
env:
npm_config_nodedir: /usr/lib/sdk/node18
NPM_CONFIG_LOGLEVEL: info
build-commands:
# Install npm dependencies
- cd ${FLATPAK_BUILDER_BUILDDIR} && npm install
config-opts:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/app
- -DCMAKE_CUDA_COMPILER=/app/cuda/bin/nvcc
- -DSUNSHINE_ASSETS_DIR=share/sunshine
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
- -DSUNSHINE_ENABLE_WAYLAND=ON
- -DSUNSHINE_ENABLE_X11=ON
- -DSUNSHINE_ENABLE_DRM=ON
- -DSUNSHINE_ENABLE_CUDA=ON
- -DSUNSHINE_CONFIGURE_FLATPAK=ON
sources:
- type: git
url: "@GITHUB_CLONE_URL@"
branch: "@GITHUB_BRANCH@"
commit: "@GITHUB_COMMIT@"
post-install:
# use `sed` to update apps.json with prefixes required for flatpak
# -r (regex)
# -z (handle new lines) https://linuxhint.com/sed-replace-newline-with-space
# `/gm` global and multiline
- sed -r -z -i -e
's/("((do)|(undo)|(cmd)|(detached))"\s*:\s*\[?\n*\s*")(.*")/\1flatpak-spawn --host \7/gm'
/app/share/sunshine/apps.json
- sed -i
's%/app/bin/sunshine%flatpak run dev.lizardbyte.sunshine\nExecStop=flatpak kill dev.lizardbyte.sunshine%g'
/app/share/sunshine/systemd/user/sunshine.service
- install -D $FLATPAK_BUILDER_BUILDDIR/packaging/linux/flatpak/scripts/* /app/bin

View File

@@ -0,0 +1,13 @@
#!/bin/sh
# User Service
mkdir -p ~/.config/systemd/user
cp /app/share/sunshine/systemd/user/sunshine.service $HOME/.config/systemd/user/sunshine.service
echo Sunshine User Service has been installed.
echo Use [systemctl --user enable sunshine] once to autostart Sunshine on login.
# Udev rule and input group
UDEV=$(cat /app/share/sunshine/udev/rules.d/85-sunshine.rules)
echo Configuring mouse permission.
flatpak-spawn --host pkexec sh -c "usermod -a -G input $USER && echo '$UDEV' > /etc/udev/rules.d/85-sunshine.rules"
echo Restart computer for mouse permission to take effect.

View File

@@ -0,0 +1,11 @@
#!/bin/sh
# User Service
systemctl --user stop sunshine
rm $HOME/.config/systemd/user/sunshine.service
systemctl --user daemon-reload
echo Sunshine User Service has been removed.
# Udev rule and input group
flatpak-spawn --host pkexec sh -c "gpasswd -d $USER input && rm /etc/udev/rules.d/85-sunshine.rules"
echo Mouse permission removed. Restart computer to take effect.

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=@PROJECT_NAME@
Exec=sunshine
Version=1.0
Comment=@PROJECT_DESCRIPTION@
Icon=sunshine
Categories=Utility;
Terminal=true
X-AppImage-Name=sunshine
X-AppImage-Version=@PROJECT_VERSION@
X-AppImage-Arch=x86_64

65
packaging/macos/Portfile Normal file
View File

@@ -0,0 +1,65 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# initial PR into macports: https://github.com/macports/macports-ports/pull/15143
PortSystem 1.0
PortGroup cmake 1.1
PortGroup github 1.0
PortGroup boost 1.0
name @PROJECT_NAME@
version @PROJECT_VERSION@
revision 0
categories multimedia emulators games
platforms darwin
license GPL-3
maintainers @LizardByte
description @PROJECT_DESCRIPTION@
# long_description will not be split into multiple lines as it's configured by CMakeLists
long_description @PROJECT_LONG_DESCRIPTION@
homepage @PROJECT_HOMEPAGE_URL@
master_sites https://github.com/lizardbyte/sunshine/releases
compiler.cxx_standard 2017
fetch.type git
git.url @GITHUB_CLONE_URL@
git.branch @GITHUB_COMMIT@
post-fetch {
system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive"
}
depends_lib port:avahi \
port:curl \
port:libopus \
port:npm9 \
port:pkgconfig
boost.version 1.80
configure.args -DCMAKE_INSTALL_PREFIX=${prefix} \
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets
startupitem.create yes
startupitem.executable "${prefix}/bin/{$name}"
startupitem.location LaunchDaemons
startupitem.name ${name}
startupitem.netchange yes
platform darwin {
if { ${os.major} < 20 } {
# See: https://github.com/LizardByte/Sunshine/discussions/117#discussioncomment-2513494
notes-append "Port is limited to software encoding, when used with macOS releases prior to Big Sur."
}
}
pre-build {
system -W ${worksrcpath} "npm install"
}
notes-append "Run @PROJECT_NAME@ by executing 'sunshine <path to user config>', e.g. 'sunshine ~/sunshine.conf' "
notes-append "The config file will be created if it doesn't exist."
notes-append "It is recommended to set a location for the apps file in the config."
notes-append "See our documentation at 'https://docs.lizardbyte.dev/projects/sunshine/en/v@PROJECT_VERSION@/' for further info."

Submodule pre-compiled deleted from afd9a9bbfc

170
scripts/_locale.py Normal file
View File

@@ -0,0 +1,170 @@
"""
..
_locale.py
Functions related to building, initializing, updating, and compiling localization translations.
Borrowed from RetroArcher.
"""
# standard imports
import argparse
import datetime
import os
import subprocess
project_name = 'Sunshine'
project_owner = 'LizardByte'
script_dir = os.path.dirname(os.path.abspath(__file__))
root_dir = os.path.dirname(script_dir)
locale_dir = os.path.join(root_dir, 'locale')
project_dir = os.path.join(root_dir, 'src')
year = datetime.datetime.now().year
# retroarcher target locales
target_locales = [
'de', # Deutsch
'en', # English
'en_GB', # English (United Kingdom)
'en_US', # English (United States)
'es', # español
'fr', # français
'it', # italiano
'ru', # русский
]
def x_extract():
"""Executes `xgettext extraction` in subprocess."""
pot_filepath = os.path.join(locale_dir, f'{project_name.lower()}.po')
commands = [
'xgettext',
'--keyword=translate:1,1t',
'--keyword=translate:1c,2,2t',
'--keyword=translate:1,2,3t',
'--keyword=translate:1c,2,3,4t',
'--keyword=gettext:1',
'--keyword=pgettext:1c,2',
'--keyword=ngettext:1,2',
'--keyword=npgettext:1c,2,3',
f'--default-domain={project_name.lower()}',
f'--output={pot_filepath}',
'--language=C++',
'--boost',
'--from-code=utf-8',
'-F',
f'--msgid-bugs-address=github.com/{project_owner.lower()}/{project_name.lower()}',
f'--copyright-holder={project_owner}',
f'--package-name={project_name}',
'--package-version=v0'
]
extensions = ['cpp', 'h', 'm', 'mm']
# find input files
for root, dirs, files in os.walk(project_dir, topdown=True):
for name in files:
filename = os.path.join(root, name)
extension = filename.rsplit('.', 1)[-1]
if extension in extensions: # append input files
commands.append(filename)
print(commands)
subprocess.check_output(args=commands, cwd=root_dir)
try:
# fix header
body = ""
with open(file=pot_filepath, mode='r') as file:
for line in file.readlines():
if line != '"Language: \\n"\n': # do not include this line
if line == '# SOME DESCRIPTIVE TITLE.\n':
body += f'# Translations template for {project_name}.\n'
elif line.startswith('#') and 'YEAR' in line:
body += line.replace('YEAR', str(year))
elif line.startswith('#') and 'PACKAGE' in line:
body += line.replace('PACKAGE', project_name)
else:
body += line
# rewrite pot file with updated header
with open(file=pot_filepath, mode='w+') as file:
file.write(body)
except FileNotFoundError:
pass
def babel_init(locale_code: str):
"""Executes `pybabel init` in subprocess.
:param locale_code: str - locale code
"""
commands = [
'pybabel',
'init',
'-i', os.path.join(locale_dir, f'{project_name.lower()}.po'),
'-d', locale_dir,
'-D', project_name.lower(),
'-l', locale_code
]
print(commands)
subprocess.check_output(args=commands, cwd=root_dir)
def babel_update():
"""Executes `pybabel update` in subprocess."""
commands = [
'pybabel',
'update',
'-i', os.path.join(locale_dir, f'{project_name.lower()}.po'),
'-d', locale_dir,
'-D', project_name.lower(),
'--update-header-comment'
]
print(commands)
subprocess.check_output(args=commands, cwd=root_dir)
def babel_compile():
"""Executes `pybabel compile` in subprocess."""
commands = [
'pybabel',
'compile',
'-d', locale_dir,
'-D', project_name.lower()
]
print(commands)
subprocess.check_output(args=commands, cwd=root_dir)
if __name__ == '__main__':
# Set up and gather command line arguments
parser = argparse.ArgumentParser(
description='Script helps update locale translations. Translations must be done manually.')
parser.add_argument('--extract', action='store_true', help='Extract messages from c++ files.')
parser.add_argument('--init', action='store_true', help='Initialize any new locales specified in target locales.')
parser.add_argument('--update', action='store_true', help='Update existing locales.')
parser.add_argument('--compile', action='store_true', help='Compile translated locales.')
args = parser.parse_args()
if args.extract:
x_extract()
if args.init:
for locale_id in target_locales:
if not os.path.isdir(os.path.join(locale_dir, locale_id)):
babel_init(locale_code=locale_id)
if args.update:
babel_update()
if args.compile:
babel_compile()

1
scripts/requirements.txt Normal file
View File

@@ -0,0 +1 @@
Babel==2.11.0

281
src/audio.cpp Normal file
View File

@@ -0,0 +1,281 @@
#include <thread>
#include <opus/opus_multistream.h>
#include "platform/common.h"
#include "audio.h"
#include "config.h"
#include "main.h"
#include "thread_safe.h"
#include "utility.h"
namespace audio {
using namespace std::literals;
using opus_t = util::safe_ptr<OpusMSEncoder, opus_multistream_encoder_destroy>;
using sample_queue_t = std::shared_ptr<safe::queue_t<std::vector<std::int16_t>>>;
struct audio_ctx_t {
// We want to change the sink for the first stream only
std::unique_ptr<std::atomic_bool> sink_flag;
std::unique_ptr<platf::audio_control_t> control;
bool restore_sink;
platf::sink_t sink;
};
static int start_audio_control(audio_ctx_t &ctx);
static void stop_audio_control(audio_ctx_t &);
int map_stream(int channels, bool quality);
constexpr auto SAMPLE_RATE = 48000;
opus_stream_config_t stream_configs[MAX_STREAM_CONFIG] {
{
SAMPLE_RATE,
2,
1,
1,
platf::speaker::map_stereo,
96000,
},
{
SAMPLE_RATE,
2,
1,
1,
platf::speaker::map_stereo,
512000,
},
{
SAMPLE_RATE,
6,
4,
2,
platf::speaker::map_surround51,
256000,
},
{
SAMPLE_RATE,
6,
6,
0,
platf::speaker::map_surround51,
1536000,
},
{
SAMPLE_RATE,
8,
5,
3,
platf::speaker::map_surround71,
450000,
},
{
SAMPLE_RATE,
8,
8,
0,
platf::speaker::map_surround71,
2048000,
},
};
auto control_shared = safe::make_shared<audio_ctx_t>(start_audio_control, stop_audio_control);
void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
auto packets = mail::man->queue<packet_t>(mail::audio_packets);
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
// Encoding takes place on this thread
platf::adjust_thread_priority(platf::thread_priority_e::high);
opus_t opus { opus_multistream_encoder_create(
stream->sampleRate,
stream->channelCount,
stream->streams,
stream->coupledStreams,
stream->mapping,
OPUS_APPLICATION_RESTRICTED_LOWDELAY,
nullptr) };
opus_multistream_encoder_ctl(opus.get(), OPUS_SET_BITRATE(stream->bitrate));
opus_multistream_encoder_ctl(opus.get(), OPUS_SET_VBR(0));
auto frame_size = config.packetDuration * stream->sampleRate / 1000;
while(auto sample = samples->pop()) {
buffer_t packet { 1400 };
int bytes = opus_multistream_encode(opus.get(), sample->data(), frame_size, std::begin(packet), packet.size());
if(bytes < 0) {
BOOST_LOG(error) << "Couldn't encode audio: "sv << opus_strerror(bytes);
packets->stop();
return;
}
packet.fake_resize(bytes);
packets->raise(channel_data, std::move(packet));
}
}
void capture(safe::mail_t mail, config_t config, void *channel_data) {
auto shutdown_event = mail->event<bool>(mail::shutdown);
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
auto ref = control_shared.ref();
if(!ref) {
return;
}
auto &control = ref->control;
if(!control) {
shutdown_event->view();
return;
}
// Order of priority:
// 1. Config
// 2. Virtual if available
// 3. Host
std::string *sink = &ref->sink.host;
if(!config::audio.sink.empty()) {
sink = &config::audio.sink;
}
else if(ref->sink.null) {
auto &null = *ref->sink.null;
switch(stream->channelCount) {
case 2:
sink = &null.stereo;
break;
case 6:
sink = &null.surround51;
break;
case 8:
sink = &null.surround71;
break;
}
}
// Only the first to start a session may change the default sink
if(!ref->sink_flag->exchange(true, std::memory_order_acquire)) {
ref->restore_sink = !config.flags[config_t::HOST_AUDIO];
// If the sink is empty (Host has no sink!), definately switch to the virtual.
if(ref->sink.host.empty()) {
if(control->set_sink(*sink)) {
return;
}
}
// If the client requests audio on the host, don't change the default sink
else if(!config.flags[config_t::HOST_AUDIO] && control->set_sink(*sink)) {
return;
}
}
// Capture takes place on this thread
platf::adjust_thread_priority(platf::thread_priority_e::critical);
auto samples = std::make_shared<sample_queue_t::element_type>(30);
std::thread thread { encodeThread, samples, config, channel_data };
auto fg = util::fail_guard([&]() {
samples->stop();
thread.join();
shutdown_event->view();
});
auto frame_size = config.packetDuration * stream->sampleRate / 1000;
int samples_per_frame = frame_size * stream->channelCount;
auto mic = control->microphone(stream->mapping, stream->channelCount, stream->sampleRate, frame_size);
if(!mic) {
BOOST_LOG(error) << "Couldn't create audio input"sv;
return;
}
while(!shutdown_event->peek()) {
std::vector<std::int16_t> sample_buffer;
sample_buffer.resize(samples_per_frame);
auto status = mic->sample(sample_buffer);
switch(status) {
case platf::capture_e::ok:
break;
case platf::capture_e::timeout:
continue;
case platf::capture_e::reinit:
mic.reset();
mic = control->microphone(stream->mapping, stream->channelCount, stream->sampleRate, frame_size);
if(!mic) {
BOOST_LOG(error) << "Couldn't re-initialize audio input"sv;
return;
}
return;
default:
return;
}
samples->raise(std::move(sample_buffer));
}
}
int map_stream(int channels, bool quality) {
int shift = quality ? 1 : 0;
switch(channels) {
case 2:
return STEREO + shift;
case 6:
return SURROUND51 + shift;
case 8:
return SURROUND71 + shift;
}
return STEREO;
}
int start_audio_control(audio_ctx_t &ctx) {
auto fg = util::fail_guard([]() {
BOOST_LOG(warning) << "There will be no audio"sv;
});
ctx.sink_flag = std::make_unique<std::atomic_bool>(false);
// The default sink has not been replaced yet.
ctx.restore_sink = false;
if(!(ctx.control = platf::audio_control())) {
return 0;
}
auto sink = ctx.control->sink_info();
if(!sink) {
// Let the calling code know it failed
ctx.control.reset();
return 0;
}
ctx.sink = std::move(*sink);
fg.disable();
return 0;
}
void stop_audio_control(audio_ctx_t &ctx) {
// restore audio-sink if applicable
if(!ctx.restore_sink) {
return;
}
const std::string &sink = config::audio.sink.empty() ? ctx.sink.host : config::audio.sink;
if(!sink.empty()) {
// Best effort, it's allowed to fail
ctx.control->set_sink(sink);
}
}
} // namespace audio

47
src/audio.h Normal file
View File

@@ -0,0 +1,47 @@
#ifndef SUNSHINE_AUDIO_H
#define SUNSHINE_AUDIO_H
#include "thread_safe.h"
#include "utility.h"
namespace audio {
enum stream_config_e : int {
STEREO,
HIGH_STEREO,
SURROUND51,
HIGH_SURROUND51,
SURROUND71,
HIGH_SURROUND71,
MAX_STREAM_CONFIG
};
struct opus_stream_config_t {
std::int32_t sampleRate;
int channelCount;
int streams;
int coupledStreams;
const std::uint8_t *mapping;
int bitrate;
};
extern opus_stream_config_t stream_configs[MAX_STREAM_CONFIG];
struct config_t {
enum flags_e : int {
HIGH_QUALITY,
HOST_AUDIO,
MAX_FLAGS
};
int packetDuration;
int channels;
int mask;
std::bitset<MAX_FLAGS> flags;
};
using buffer_t = util::buffer_t<std::uint8_t>;
using packet_t = std::pair<void *, buffer_t>;
void capture(safe::mail_t mail, config_t config, void *channel_data);
} // namespace audio
#endif

300
src/cbs.cpp Normal file
View File

@@ -0,0 +1,300 @@
extern "C" {
#include <cbs/cbs_h264.h>
#include <cbs/cbs_h265.h>
#include <cbs/h264_levels.h>
#include <libavcodec/avcodec.h>
#include <libavutil/pixdesc.h>
}
#include "cbs.h"
#include "main.h"
#include "utility.h"
using namespace std::literals;
namespace cbs {
void close(CodedBitstreamContext *c) {
ff_cbs_close(&c);
}
using ctx_t = util::safe_ptr<CodedBitstreamContext, close>;
class frag_t : public CodedBitstreamFragment {
public:
frag_t(frag_t &&o) {
std::copy((std::uint8_t *)&o, (std::uint8_t *)(&o + 1), (std::uint8_t *)this);
o.data = nullptr;
o.units = nullptr;
};
frag_t() {
std::fill_n((std::uint8_t *)this, sizeof(*this), 0);
}
frag_t &operator=(frag_t &&o) {
std::copy((std::uint8_t *)&o, (std::uint8_t *)(&o + 1), (std::uint8_t *)this);
o.data = nullptr;
o.units = nullptr;
return *this;
};
~frag_t() {
if(data || units) {
ff_cbs_fragment_free(this);
}
}
};
util::buffer_t<std::uint8_t> write(const cbs::ctx_t &cbs_ctx, std::uint8_t nal, void *uh, AVCodecID codec_id) {
cbs::frag_t frag;
auto err = ff_cbs_insert_unit_content(&frag, -1, nal, uh, nullptr);
if(err < 0) {
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
BOOST_LOG(error) << "Could not insert NAL unit SPS: "sv << av_make_error_string(err_str, AV_ERROR_MAX_STRING_SIZE, err);
return {};
}
err = ff_cbs_write_fragment_data(cbs_ctx.get(), &frag);
if(err < 0) {
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
BOOST_LOG(error) << "Could not write fragment data: "sv << av_make_error_string(err_str, AV_ERROR_MAX_STRING_SIZE, err);
return {};
}
// frag.data_size * 8 - frag.data_bit_padding == bits in fragment
util::buffer_t<std::uint8_t> data { frag.data_size };
std::copy_n(frag.data, frag.data_size, std::begin(data));
return data;
}
util::buffer_t<std::uint8_t> write(std::uint8_t nal, void *uh, AVCodecID codec_id) {
cbs::ctx_t cbs_ctx;
ff_cbs_init(&cbs_ctx, codec_id, nullptr);
return write(cbs_ctx, nal, uh, codec_id);
}
util::buffer_t<std::uint8_t> make_sps_h264(const AVCodecContext *ctx) {
H264RawSPS sps {};
/* b_per_p == ctx->max_b_frames for h264 */
/* desired_b_depth == avoption("b_depth") == 1 */
/* max_b_depth == std::min(av_log2(ctx->b_per_p) + 1, desired_b_depth) ==> 1 */
auto max_b_depth = 1;
auto dpb_frame = ctx->gop_size == 1 ? 0 : 1 + max_b_depth;
auto mb_width = (FFALIGN(ctx->width, 16) / 16) * 16;
auto mb_height = (FFALIGN(ctx->height, 16) / 16) * 16;
sps.nal_unit_header.nal_ref_idc = 3;
sps.nal_unit_header.nal_unit_type = H264_NAL_SPS;
sps.profile_idc = FF_PROFILE_H264_HIGH & 0xFF;
sps.constraint_set1_flag = 1;
if(ctx->level != FF_LEVEL_UNKNOWN) {
sps.level_idc = ctx->level;
}
else {
auto framerate = ctx->framerate;
auto level = ff_h264_guess_level(
sps.profile_idc,
ctx->bit_rate,
framerate.num / framerate.den,
mb_width,
mb_height,
dpb_frame);
if(!level) {
BOOST_LOG(error) << "Could not guess h264 level"sv;
return {};
}
sps.level_idc = level->level_idc;
}
sps.seq_parameter_set_id = 0;
sps.chroma_format_idc = 1;
sps.log2_max_frame_num_minus4 = 3; // 4;
sps.pic_order_cnt_type = 0;
sps.log2_max_pic_order_cnt_lsb_minus4 = 0; // 4;
sps.max_num_ref_frames = dpb_frame;
sps.pic_width_in_mbs_minus1 = mb_width / 16 - 1;
sps.pic_height_in_map_units_minus1 = mb_height / 16 - 1;
sps.frame_mbs_only_flag = 1;
sps.direct_8x8_inference_flag = 1;
if(ctx->width != mb_width || ctx->height != mb_height) {
sps.frame_cropping_flag = 1;
sps.frame_crop_left_offset = 0;
sps.frame_crop_top_offset = 0;
sps.frame_crop_right_offset = (mb_width - ctx->width) / 2;
sps.frame_crop_bottom_offset = (mb_height - ctx->height) / 2;
}
sps.vui_parameters_present_flag = 1;
auto &vui = sps.vui;
vui.video_format = 5;
vui.colour_description_present_flag = 1;
vui.video_signal_type_present_flag = 1;
vui.video_full_range_flag = ctx->color_range == AVCOL_RANGE_JPEG;
vui.colour_primaries = ctx->color_primaries;
vui.transfer_characteristics = ctx->color_trc;
vui.matrix_coefficients = ctx->colorspace;
vui.low_delay_hrd_flag = 1 - vui.fixed_frame_rate_flag;
vui.bitstream_restriction_flag = 1;
vui.motion_vectors_over_pic_boundaries_flag = 1;
vui.log2_max_mv_length_horizontal = 15;
vui.log2_max_mv_length_vertical = 15;
vui.max_num_reorder_frames = max_b_depth;
vui.max_dec_frame_buffering = max_b_depth + 1;
return write(sps.nal_unit_header.nal_unit_type, (void *)&sps.nal_unit_header, AV_CODEC_ID_H264);
}
hevc_t make_sps_hevc(const AVCodecContext *avctx, const AVPacket *packet) {
cbs::ctx_t ctx;
if(ff_cbs_init(&ctx, AV_CODEC_ID_H265, nullptr)) {
return {};
}
cbs::frag_t frag;
int err = ff_cbs_read_packet(ctx.get(), &frag, packet);
if(err < 0) {
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
BOOST_LOG(error) << "Couldn't read packet: "sv << av_make_error_string(err_str, AV_ERROR_MAX_STRING_SIZE, err);
return {};
}
auto vps_p = ((CodedBitstreamH265Context *)ctx->priv_data)->active_vps;
auto sps_p = ((CodedBitstreamH265Context *)ctx->priv_data)->active_sps;
H265RawSPS sps { *sps_p };
H265RawVPS vps { *vps_p };
vps.profile_tier_level.general_profile_compatibility_flag[4] = 1;
sps.profile_tier_level.general_profile_compatibility_flag[4] = 1;
auto &vui = sps.vui;
std::memset(&vui, 0, sizeof(vui));
sps.vui_parameters_present_flag = 1;
// skip sample aspect ratio
vui.video_format = 5;
vui.colour_description_present_flag = 1;
vui.video_signal_type_present_flag = 1;
vui.video_full_range_flag = avctx->color_range == AVCOL_RANGE_JPEG;
vui.colour_primaries = avctx->color_primaries;
vui.transfer_characteristics = avctx->color_trc;
vui.matrix_coefficients = avctx->colorspace;
vui.vui_timing_info_present_flag = vps.vps_timing_info_present_flag;
vui.vui_num_units_in_tick = vps.vps_num_units_in_tick;
vui.vui_time_scale = vps.vps_time_scale;
vui.vui_poc_proportional_to_timing_flag = vps.vps_poc_proportional_to_timing_flag;
vui.vui_num_ticks_poc_diff_one_minus1 = vps.vps_num_ticks_poc_diff_one_minus1;
vui.vui_hrd_parameters_present_flag = 0;
vui.bitstream_restriction_flag = 1;
vui.motion_vectors_over_pic_boundaries_flag = 1;
vui.restricted_ref_pic_lists_flag = 1;
vui.max_bytes_per_pic_denom = 0;
vui.max_bits_per_min_cu_denom = 0;
vui.log2_max_mv_length_horizontal = 15;
vui.log2_max_mv_length_vertical = 15;
cbs::ctx_t write_ctx;
ff_cbs_init(&write_ctx, AV_CODEC_ID_H265, nullptr);
return hevc_t {
nal_t {
write(write_ctx, vps.nal_unit_header.nal_unit_type, (void *)&vps.nal_unit_header, AV_CODEC_ID_H265),
write(ctx, vps_p->nal_unit_header.nal_unit_type, (void *)&vps_p->nal_unit_header, AV_CODEC_ID_H265),
},
nal_t {
write(write_ctx, sps.nal_unit_header.nal_unit_type, (void *)&sps.nal_unit_header, AV_CODEC_ID_H265),
write(ctx, sps_p->nal_unit_header.nal_unit_type, (void *)&sps_p->nal_unit_header, AV_CODEC_ID_H265),
},
};
}
util::buffer_t<std::uint8_t> read_sps_h264(const AVPacket *packet) {
cbs::ctx_t ctx;
if(ff_cbs_init(&ctx, AV_CODEC_ID_H264, nullptr)) {
return {};
}
cbs::frag_t frag;
int err = ff_cbs_read_packet(ctx.get(), &frag, &*packet);
if(err < 0) {
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
BOOST_LOG(error) << "Couldn't read packet: "sv << av_make_error_string(err_str, AV_ERROR_MAX_STRING_SIZE, err);
return {};
}
auto h264 = (H264RawNALUnitHeader *)((CodedBitstreamH264Context *)ctx->priv_data)->active_sps;
return write(h264->nal_unit_type, (void *)h264, AV_CODEC_ID_H264);
}
h264_t make_sps_h264(const AVCodecContext *ctx, const AVPacket *packet) {
return h264_t {
make_sps_h264(ctx),
read_sps_h264(packet),
};
}
bool validate_sps(const AVPacket *packet, int codec_id) {
cbs::ctx_t ctx;
if(ff_cbs_init(&ctx, (AVCodecID)codec_id, nullptr)) {
return false;
}
cbs::frag_t frag;
int err = ff_cbs_read_packet(ctx.get(), &frag, packet);
if(err < 0) {
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
BOOST_LOG(error) << "Couldn't read packet: "sv << av_make_error_string(err_str, AV_ERROR_MAX_STRING_SIZE, err);
return false;
}
if(codec_id == AV_CODEC_ID_H264) {
auto h264 = (CodedBitstreamH264Context *)ctx->priv_data;
if(!h264->active_sps->vui_parameters_present_flag) {
return false;
}
return true;
}
return ((CodedBitstreamH265Context *)ctx->priv_data)->active_sps->vui_parameters_present_flag;
}
} // namespace cbs

34
src/cbs.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef SUNSHINE_CBS_H
#define SUNSHINE_CBS_H
#include "utility.h"
struct AVPacket;
struct AVCodecContext;
namespace cbs {
struct nal_t {
util::buffer_t<std::uint8_t> _new;
util::buffer_t<std::uint8_t> old;
};
struct hevc_t {
nal_t vps;
nal_t sps;
};
struct h264_t {
nal_t sps;
};
hevc_t make_sps_hevc(const AVCodecContext *ctx, const AVPacket *packet);
h264_t make_sps_h264(const AVCodecContext *ctx, const AVPacket *packet);
/**
* Check if SPS->VUI is present
*/
bool validate_sps(const AVPacket *packet, int codec_id);
} // namespace cbs
#endif

1078
src/config.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,17 @@
#ifndef SUNSHINE_CONFIG_H
#define SUNSHINE_CONFIG_H
#include <chrono>
#include <string>
#include <bitset>
#include <chrono>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
namespace config {
struct video_t {
// ffmpeg params
int crf; // higher == more compression and less quality
int qp; // higher == more compression and less quality, ignored if crf != 0
int qp; // higher == more compression and less quality
int hevc_mode;
@@ -22,17 +23,44 @@ struct video_t {
struct {
std::optional<int> preset;
std::optional<int> tune;
std::optional<int> rc;
int coder;
} nv;
struct {
std::optional<int> preset;
std::optional<int> cavlc;
} qsv;
struct {
std::optional<int> quality_h264;
std::optional<int> quality_hevc;
std::optional<int> rc_h264;
std::optional<int> rc_hevc;
std::optional<int> usage_h264;
std::optional<int> usage_hevc;
std::optional<int> preanalysis;
std::optional<int> vbaq;
int coder;
} amd;
struct {
int allow_sw;
int require_sw;
int realtime;
int coder;
} vt;
std::string encoder;
std::string adapter_name;
std::string output_name;
bool dwmflush;
};
struct audio_t {
std::string sink;
std::string virtual_sink;
};
struct stream_t {
@@ -50,6 +78,7 @@ struct nvhttp_t {
// Could be any of the following values:
// pc|lan|wan
std::string origin_pin_allowed;
std::string origin_web_ui_allowed;
std::string pkey; // must be 2048 bits
std::string cert; // must be signed with a key of 2048 bits
@@ -59,26 +88,50 @@ struct nvhttp_t {
std::string file_state;
std::string external_ip;
std::vector<std::string> resolutions;
std::vector<int> fps;
};
struct input_t {
std::unordered_map<int, int> keybindings;
std::chrono::milliseconds back_button_timeout;
std::chrono::milliseconds key_repeat_delay;
std::chrono::duration<double> key_repeat_period;
std::string gamepad;
};
namespace flag {
enum flag_e : std::size_t {
PIN_STDIN = 0, // Read PIN from stdin instead of http
FRESH_STATE, // Do not load or save state
PIN_STDIN = 0, // Read PIN from stdin instead of http
FRESH_STATE, // Do not load or save state
FORCE_VIDEO_HEADER_REPLACE, // force replacing headers inside video data
UPNP, // Try Universal Plug 'n Play
CONST_PIN, // Use "universal" pin
FLAG_SIZE
};
}
struct sunshine_t {
int min_log_level;
std::bitset<flag::FLAG_SIZE> flags;
std::string credentials_file;
std::string username;
std::string password;
std::string salt;
std::string config_file;
struct cmd_t {
std::string name;
int argc;
char **argv;
} cmd;
std::uint16_t port;
std::string log_file;
};
extern video_t video;
@@ -89,6 +142,6 @@ extern input_t input;
extern sunshine_t sunshine;
int parse(int argc, char *argv[]);
}
std::unordered_map<std::string, std::string> parse_config(const std::string_view &file_content);
} // namespace config
#endif

761
src/confighttp.cpp Normal file
View File

@@ -0,0 +1,761 @@
// Created by TheElixZammuto on 2021-05-09.
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include "process.h"
#include <filesystem>
#include <set>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/asio/ssl/context.hpp>
#include <boost/filesystem.hpp>
#include <Simple-Web-Server/crypto.hpp>
#include <Simple-Web-Server/server_https.hpp>
#include <boost/asio/ssl/context_base.hpp>
#include "config.h"
#include "confighttp.h"
#include "crypto.h"
#include "httpcommon.h"
#include "main.h"
#include "network.h"
#include "nvhttp.h"
#include "platform/common.h"
#include "rtsp.h"
#include "utility.h"
#include "uuid.h"
using namespace std::literals;
namespace confighttp {
namespace fs = std::filesystem;
namespace pt = boost::property_tree;
using https_server_t = SimpleWeb::Server<SimpleWeb::HTTPS>;
using args_t = SimpleWeb::CaseInsensitiveMultimap;
using resp_https_t = std::shared_ptr<typename SimpleWeb::ServerBase<SimpleWeb::HTTPS>::Response>;
using req_https_t = std::shared_ptr<typename SimpleWeb::ServerBase<SimpleWeb::HTTPS>::Request>;
enum class op_e {
ADD,
REMOVE
};
void print_req(const req_https_t &request) {
BOOST_LOG(debug) << "METHOD :: "sv << request->method;
BOOST_LOG(debug) << "DESTINATION :: "sv << request->path;
for(auto &[name, val] : request->header) {
BOOST_LOG(debug) << name << " -- " << (name == "Authorization" ? "CREDENTIALS REDACTED" : val);
}
BOOST_LOG(debug) << " [--] "sv;
for(auto &[name, val] : request->parse_query_string()) {
BOOST_LOG(debug) << name << " -- " << val;
}
BOOST_LOG(debug) << " [--] "sv;
}
void send_unauthorized(resp_https_t response, req_https_t request) {
auto address = request->remote_endpoint().address().to_string();
BOOST_LOG(info) << "Web UI: ["sv << address << "] -- not authorized"sv;
const SimpleWeb::CaseInsensitiveMultimap headers {
{ "WWW-Authenticate", R"(Basic realm="Sunshine Gamestream Host", charset="UTF-8")" }
};
response->write(SimpleWeb::StatusCode::client_error_unauthorized, headers);
}
void send_redirect(resp_https_t response, req_https_t request, const char *path) {
auto address = request->remote_endpoint().address().to_string();
BOOST_LOG(info) << "Web UI: ["sv << address << "] -- not authorized"sv;
const SimpleWeb::CaseInsensitiveMultimap headers {
{ "Location", path }
};
response->write(SimpleWeb::StatusCode::redirection_temporary_redirect, headers);
}
bool authenticate(resp_https_t response, req_https_t request) {
auto address = request->remote_endpoint().address().to_string();
auto ip_type = net::from_address(address);
if(ip_type > http::origin_web_ui_allowed) {
BOOST_LOG(info) << "Web UI: ["sv << address << "] -- denied"sv;
response->write(SimpleWeb::StatusCode::client_error_forbidden);
return false;
}
// If credentials are shown, redirect the user to a /welcome page
if(config::sunshine.username.empty()) {
send_redirect(response, request, "/welcome");
return false;
}
auto fg = util::fail_guard([&]() {
send_unauthorized(response, request);
});
auto auth = request->header.find("authorization");
if(auth == request->header.end()) {
return false;
}
auto &rawAuth = auth->second;
auto authData = SimpleWeb::Crypto::Base64::decode(rawAuth.substr("Basic "sv.length()));
int index = authData.find(':');
if(index >= authData.size() - 1) {
return false;
}
auto username = authData.substr(0, index);
auto password = authData.substr(index + 1);
auto hash = util::hex(crypto::hash(password + config::sunshine.salt)).to_string();
if(username != config::sunshine.username || hash != config::sunshine.password) {
return false;
}
fg.disable();
return true;
}
void not_found(resp_https_t response, req_https_t request) {
pt::ptree tree;
tree.put("root.<xmlattr>.status_code", 404);
std::ostringstream data;
pt::write_xml(data, tree);
response->write(data.str());
*response << "HTTP/1.1 404 NOT FOUND\r\n"
<< data.str();
}
// todo - combine these functions into a single function that accepts the page, i.e "index", "pin", "apps"
void getIndexPage(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string header = read_file(WEB_DIR "header.html");
std::string content = read_file(WEB_DIR "index.html");
response->write(header + content);
}
void getPinPage(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string header = read_file(WEB_DIR "header.html");
std::string content = read_file(WEB_DIR "pin.html");
response->write(header + content);
}
void getAppsPage(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
SimpleWeb::CaseInsensitiveMultimap headers;
headers.emplace("Access-Control-Allow-Origin", "https://images.igdb.com/");
std::string header = read_file(WEB_DIR "header.html");
std::string content = read_file(WEB_DIR "apps.html");
response->write(header + content, headers);
}
void getClientsPage(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string header = read_file(WEB_DIR "header.html");
std::string content = read_file(WEB_DIR "clients.html");
response->write(header + content);
}
void getConfigPage(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string header = read_file(WEB_DIR "header.html");
std::string content = read_file(WEB_DIR "config.html");
response->write(header + content);
}
void getPasswordPage(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string header = read_file(WEB_DIR "header.html");
std::string content = read_file(WEB_DIR "password.html");
response->write(header + content);
}
void getWelcomePage(resp_https_t response, req_https_t request) {
print_req(request);
if(!config::sunshine.username.empty()) {
send_redirect(response, request, "/");
return;
}
std::string header = read_file(WEB_DIR "header-no-nav.html");
std::string content = read_file(WEB_DIR "welcome.html");
response->write(header + content);
}
void getTroubleshootingPage(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string header = read_file(WEB_DIR "header.html");
std::string content = read_file(WEB_DIR "troubleshooting.html");
response->write(header + content);
}
void getFaviconImage(resp_https_t response, req_https_t request) {
// todo - combine function with getSunshineLogoImage and possibly getNodeModules
// todo - use mime_types map
print_req(request);
std::ifstream in(WEB_DIR "images/favicon.ico", std::ios::binary);
SimpleWeb::CaseInsensitiveMultimap headers;
headers.emplace("Content-Type", "image/x-icon");
response->write(SimpleWeb::StatusCode::success_ok, in, headers);
}
void getSunshineLogoImage(resp_https_t response, req_https_t request) {
// todo - combine function with getFaviconImage and possibly getNodeModules
// todo - use mime_types map
print_req(request);
std::ifstream in(WEB_DIR "images/logo-sunshine-45.png", std::ios::binary);
SimpleWeb::CaseInsensitiveMultimap headers;
headers.emplace("Content-Type", "image/png");
response->write(SimpleWeb::StatusCode::success_ok, in, headers);
}
bool isChildPath(fs::path const &base, fs::path const &query) {
auto relPath = fs::relative(base, query);
return *(relPath.begin()) != fs::path("..");
}
void getNodeModules(resp_https_t response, req_https_t request) {
print_req(request);
fs::path webDirPath(WEB_DIR);
fs::path nodeModulesPath(webDirPath / "node_modules");
// .relative_path is needed to shed any leading slash that might exist in the request path
auto filePath = fs::weakly_canonical(webDirPath / fs::path(request->path).relative_path());
// Don't do anything if file does not exist or is outside the node_modules directory
if(!isChildPath(filePath, nodeModulesPath)) {
BOOST_LOG(warning) << "Someone requested a path " << filePath << " that is outside the node_modules folder";
response->write(SimpleWeb::StatusCode::client_error_bad_request, "Bad Request");
}
else if(!fs::exists(filePath)) {
response->write(SimpleWeb::StatusCode::client_error_not_found);
}
else {
auto relPath = fs::relative(filePath, webDirPath);
// get the mime type from the file extension mime_types map
// remove the leading period from the extension
auto mimeType = mime_types.find(relPath.extension().string().substr(1));
// check if the extension is in the map at the x position
if(mimeType != mime_types.end()) {
// if it is, set the content type to the mime type
SimpleWeb::CaseInsensitiveMultimap headers;
headers.emplace("Content-Type", mimeType->second);
std::ifstream in(filePath.string(), std::ios::binary);
response->write(SimpleWeb::StatusCode::success_ok, in, headers);
}
// do not return any file if the type is not in the map
}
}
void getApps(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string content = read_file(config::stream.file_apps.c_str());
response->write(content);
}
void getLogs(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::string content = read_file(config::sunshine.log_file.c_str());
SimpleWeb::CaseInsensitiveMultimap headers;
headers.emplace("Content-Type", "text/plain");
response->write(SimpleWeb::StatusCode::success_ok, content, headers);
}
void saveApp(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::stringstream ss;
ss << request->content.rdbuf();
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
pt::ptree inputTree, fileTree;
BOOST_LOG(fatal) << config::stream.file_apps;
try {
// TODO: Input Validation
pt::read_json(ss, inputTree);
pt::read_json(config::stream.file_apps, fileTree);
if(inputTree.get_child("prep-cmd").empty()) {
inputTree.erase("prep-cmd");
}
if(inputTree.get_child("detached").empty()) {
inputTree.erase("detached");
}
auto &apps_node = fileTree.get_child("apps"s);
int index = inputTree.get<int>("index");
inputTree.erase("index");
if(index == -1) {
apps_node.push_back(std::make_pair("", inputTree));
}
else {
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
pt::ptree newApps;
int i = 0;
for(const auto &kv : apps_node) {
if(i == index) {
newApps.push_back(std::make_pair("", inputTree));
}
else {
newApps.push_back(std::make_pair("", kv.second));
}
i++;
}
fileTree.erase("apps");
fileTree.push_back(std::make_pair("apps", newApps));
}
pt::write_json(config::stream.file_apps, fileTree);
}
catch(std::exception &e) {
BOOST_LOG(warning) << "SaveApp: "sv << e.what();
outputTree.put("status", "false");
outputTree.put("error", "Invalid Input JSON");
return;
}
outputTree.put("status", "true");
proc::refresh(config::stream.file_apps);
}
void deleteApp(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
pt::ptree fileTree;
try {
pt::read_json(config::stream.file_apps, fileTree);
auto &apps_node = fileTree.get_child("apps"s);
int index = stoi(request->path_match[1]);
if(index < 0) {
outputTree.put("status", "false");
outputTree.put("error", "Invalid Index");
return;
}
else {
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
pt::ptree newApps;
int i = 0;
for(const auto &kv : apps_node) {
if(i++ != index) {
newApps.push_back(std::make_pair("", kv.second));
}
}
fileTree.erase("apps");
fileTree.push_back(std::make_pair("apps", newApps));
}
pt::write_json(config::stream.file_apps, fileTree);
}
catch(std::exception &e) {
BOOST_LOG(warning) << "DeleteApp: "sv << e.what();
outputTree.put("status", "false");
outputTree.put("error", "Invalid File JSON");
return;
}
outputTree.put("status", "true");
proc::refresh(config::stream.file_apps);
}
void uploadCover(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
std::stringstream ss;
std::stringstream configStream;
ss << request->content.rdbuf();
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
SimpleWeb::StatusCode code = SimpleWeb::StatusCode::success_ok;
if(outputTree.get_child_optional("error").has_value()) {
code = SimpleWeb::StatusCode::client_error_bad_request;
}
pt::write_json(data, outputTree);
response->write(code, data.str());
});
pt::ptree inputTree;
try {
pt::read_json(ss, inputTree);
}
catch(std::exception &e) {
BOOST_LOG(warning) << "UploadCover: "sv << e.what();
outputTree.put("status", "false");
outputTree.put("error", e.what());
return;
}
auto key = inputTree.get("key", "");
if(key.empty()) {
outputTree.put("error", "Cover key is required");
return;
}
auto url = inputTree.get("url", "");
const std::string coverdir = platf::appdata().string() + "/covers/";
if(!boost::filesystem::exists(coverdir)) {
boost::filesystem::create_directory(coverdir);
}
std::basic_string path = coverdir + http::url_escape(key) + ".png";
if(!url.empty()) {
if(http::url_get_host(url) != "images.igdb.com") {
outputTree.put("error", "Only images.igdb.com is allowed");
return;
}
if(!http::download_file(url, path)) {
outputTree.put("error", "Failed to download cover");
return;
}
}
else {
auto data = SimpleWeb::Crypto::Base64::decode(inputTree.get<std::string>("data"));
std::ofstream imgfile(path);
imgfile.write(data.data(), (int)data.size());
}
outputTree.put("path", path);
}
void getConfig(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
outputTree.put("status", "true");
outputTree.put("platform", SUNSHINE_PLATFORM);
outputTree.put("restart_supported", platf::restart_supported());
auto vars = config::parse_config(read_file(config::sunshine.config_file.c_str()));
for(auto &[name, value] : vars) {
outputTree.put(std::move(name), std::move(value));
}
}
void saveConfig(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::stringstream ss;
std::stringstream configStream;
ss << request->content.rdbuf();
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
pt::ptree inputTree;
try {
// TODO: Input Validation
pt::read_json(ss, inputTree);
for(const auto &kv : inputTree) {
std::string value = inputTree.get<std::string>(kv.first);
if(value.length() == 0 || value.compare("null") == 0) continue;
configStream << kv.first << " = " << value << std::endl;
}
write_file(config::sunshine.config_file.c_str(), configStream.str());
}
catch(std::exception &e) {
BOOST_LOG(warning) << "SaveConfig: "sv << e.what();
outputTree.put("status", "false");
outputTree.put("error", e.what());
return;
}
}
void restart(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::stringstream ss;
std::stringstream configStream;
ss << request->content.rdbuf();
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
if(!platf::restart_supported()) {
outputTree.put("status", false);
outputTree.put("error", "Restart is not currently supported on this platform");
return;
}
if(!platf::restart()) {
outputTree.put("status", false);
outputTree.put("error", "Restart failed");
return;
}
outputTree.put("status", true);
}
void savePassword(resp_https_t response, req_https_t request) {
if(!config::sunshine.username.empty() && !authenticate(response, request)) return;
print_req(request);
std::stringstream ss;
std::stringstream configStream;
ss << request->content.rdbuf();
pt::ptree inputTree, outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
try {
// TODO: Input Validation
pt::read_json(ss, inputTree);
auto username = inputTree.count("currentUsername") > 0 ? inputTree.get<std::string>("currentUsername") : "";
auto newUsername = inputTree.get<std::string>("newUsername");
auto password = inputTree.count("currentPassword") > 0 ? inputTree.get<std::string>("currentPassword") : "";
auto newPassword = inputTree.count("newPassword") > 0 ? inputTree.get<std::string>("newPassword") : "";
auto confirmPassword = inputTree.count("confirmNewPassword") > 0 ? inputTree.get<std::string>("confirmNewPassword") : "";
if(newUsername.length() == 0) newUsername = username;
if(newUsername.length() == 0) {
outputTree.put("status", false);
outputTree.put("error", "Invalid Username");
}
else {
auto hash = util::hex(crypto::hash(password + config::sunshine.salt)).to_string();
if(config::sunshine.username.empty() || (username == config::sunshine.username && hash == config::sunshine.password)) {
if(newPassword.empty() || newPassword != confirmPassword) {
outputTree.put("status", false);
outputTree.put("error", "Password Mismatch");
}
else {
http::save_user_creds(config::sunshine.credentials_file, newUsername, newPassword);
http::reload_user_creds(config::sunshine.credentials_file);
outputTree.put("status", true);
}
}
else {
outputTree.put("status", false);
outputTree.put("error", "Invalid Current Credentials");
}
}
}
catch(std::exception &e) {
BOOST_LOG(warning) << "SavePassword: "sv << e.what();
outputTree.put("status", false);
outputTree.put("error", e.what());
return;
}
}
void savePin(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
std::stringstream ss;
ss << request->content.rdbuf();
pt::ptree inputTree, outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
try {
// TODO: Input Validation
pt::read_json(ss, inputTree);
std::string pin = inputTree.get<std::string>("pin");
outputTree.put("status", nvhttp::pin(pin));
}
catch(std::exception &e) {
BOOST_LOG(warning) << "SavePin: "sv << e.what();
outputTree.put("status", false);
outputTree.put("error", e.what());
return;
}
}
void unpairAll(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
nvhttp::erase_all_clients();
outputTree.put("status", true);
}
void closeApp(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
pt::ptree outputTree;
auto g = util::fail_guard([&]() {
std::ostringstream data;
pt::write_json(data, outputTree);
response->write(data.str());
});
proc::proc.terminate();
outputTree.put("status", true);
}
void start() {
auto shutdown_event = mail::man->event<bool>(mail::shutdown);
auto port_https = map_port(PORT_HTTPS);
https_server_t server { config::nvhttp.cert, config::nvhttp.pkey };
server.default_resource["GET"] = not_found;
server.resource["^/$"]["GET"] = getIndexPage;
server.resource["^/pin$"]["GET"] = getPinPage;
server.resource["^/apps$"]["GET"] = getAppsPage;
server.resource["^/clients$"]["GET"] = getClientsPage;
server.resource["^/config$"]["GET"] = getConfigPage;
server.resource["^/password$"]["GET"] = getPasswordPage;
server.resource["^/welcome$"]["GET"] = getWelcomePage;
server.resource["^/troubleshooting$"]["GET"] = getTroubleshootingPage;
server.resource["^/api/pin$"]["POST"] = savePin;
server.resource["^/api/apps$"]["GET"] = getApps;
server.resource["^/api/logs$"]["GET"] = getLogs;
server.resource["^/api/apps$"]["POST"] = saveApp;
server.resource["^/api/config$"]["GET"] = getConfig;
server.resource["^/api/config$"]["POST"] = saveConfig;
server.resource["^/api/restart$"]["POST"] = restart;
server.resource["^/api/password$"]["POST"] = savePassword;
server.resource["^/api/apps/([0-9]+)$"]["DELETE"] = deleteApp;
server.resource["^/api/clients/unpair$"]["POST"] = unpairAll;
server.resource["^/api/apps/close$"]["POST"] = closeApp;
server.resource["^/api/covers/upload$"]["POST"] = uploadCover;
server.resource["^/images/favicon.ico$"]["GET"] = getFaviconImage;
server.resource["^/images/logo-sunshine-45.png$"]["GET"] = getSunshineLogoImage;
server.resource["^/node_modules\\/.+$"]["GET"] = getNodeModules;
server.config.reuse_address = true;
server.config.address = "0.0.0.0"s;
server.config.port = port_https;
auto accept_and_run = [&](auto *server) {
try {
server->start([](unsigned short port) {
BOOST_LOG(info) << "Configuration UI available at [https://localhost:"sv << port << "]";
});
}
catch(boost::system::system_error &err) {
// It's possible the exception gets thrown after calling server->stop() from a different thread
if(shutdown_event->peek()) {
return;
}
BOOST_LOG(fatal) << "Couldn't start Configuration HTTPS server on port ["sv << port_https << "]: "sv << err.what();
shutdown_event->raise(true);
return;
}
};
std::thread tcp { accept_and_run, &server };
// Wait for any event
shutdown_event->view();
server.stop();
tcp.join();
}
} // namespace confighttp

38
src/confighttp.h Normal file
View File

@@ -0,0 +1,38 @@
// Created by loki on 6/3/19.
#ifndef SUNSHINE_CONFIGHTTP_H
#define SUNSHINE_CONFIGHTTP_H
#include <functional>
#include <string>
#include "thread_safe.h"
#define WEB_DIR SUNSHINE_ASSETS_DIR "/web/"
namespace confighttp {
constexpr auto PORT_HTTPS = 1;
void start();
} // namespace confighttp
// mime types map
const std::map<std::string, std::string> mime_types = {
{ "css", "text/css" },
{ "gif", "image/gif" },
{ "htm", "text/html" },
{ "html", "text/html" },
{ "ico", "image/x-icon" },
{ "jpeg", "image/jpeg" },
{ "jpg", "image/jpeg" },
{ "js", "application/javascript" },
{ "json", "application/json" },
{ "png", "image/png" },
{ "svg", "image/svg+xml" },
{ "ttf", "font/ttf" },
{ "txt", "text/plain" },
{ "woff2", "font/woff2" },
{ "xml", "text/xml" },
};
#endif // SUNSHINE_CONFIGHTTP_H

489
src/crypto.cpp Normal file
View File

@@ -0,0 +1,489 @@
// Created by loki on 5/31/19.
#include "crypto.h"
#include <openssl/pem.h>
namespace crypto {
using asn1_string_t = util::safe_ptr<ASN1_STRING, ASN1_STRING_free>;
cert_chain_t::cert_chain_t() : _certs {}, _cert_ctx { X509_STORE_CTX_new() } {}
void cert_chain_t::add(x509_t &&cert) {
x509_store_t x509_store { X509_STORE_new() };
X509_STORE_add_cert(x509_store.get(), cert.get());
_certs.emplace_back(std::make_pair(std::move(cert), std::move(x509_store)));
}
static int openssl_verify_cb(int ok, X509_STORE_CTX *ctx) {
int err_code = X509_STORE_CTX_get_error(ctx);
switch(err_code) {
// FIXME: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get mmonlight-embedded to work on the raspberry pi
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
return 1;
// Expired or not-yet-valid certificates are fine. Sometimes Moonlight is running on embedded devices
// that don't have accurate clocks (or haven't yet synchronized by the time Moonlight first runs).
// This behavior also matches what GeForce Experience does.
case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_CERT_HAS_EXPIRED:
return 1;
default:
return ok;
}
}
/*
* When certificates from two or more instances of Moonlight have been added to x509_store_t,
* only one of them will be verified by X509_verify_cert, resulting in only a single instance of
* Moonlight to be able to use Sunshine
*
* To circumvent this, x509_store_t instance will be created for each instance of the certificates.
*/
const char *cert_chain_t::verify(x509_t::element_type *cert) {
int err_code = 0;
for(auto &[_, x509_store] : _certs) {
auto fg = util::fail_guard([this]() {
X509_STORE_CTX_cleanup(_cert_ctx.get());
});
X509_STORE_CTX_init(_cert_ctx.get(), x509_store.get(), cert, nullptr);
X509_STORE_CTX_set_verify_cb(_cert_ctx.get(), openssl_verify_cb);
// We don't care to validate the entire chain for the purposes of client auth.
// Some versions of clients forked from Moonlight Embedded produce client certs
// that OpenSSL doesn't detect as self-signed due to some X509v3 extensions.
X509_STORE_CTX_set_flags(_cert_ctx.get(), X509_V_FLAG_PARTIAL_CHAIN);
auto err = X509_verify_cert(_cert_ctx.get());
if(err == 1) {
return nullptr;
}
err_code = X509_STORE_CTX_get_error(_cert_ctx.get());
if(err_code != X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT && err_code != X509_V_ERR_INVALID_CA) {
return X509_verify_cert_error_string(err_code);
}
}
return X509_verify_cert_error_string(err_code);
}
namespace cipher {
static int init_decrypt_gcm(cipher_ctx_t &ctx, aes_t *key, aes_t *iv, bool padding) {
ctx.reset(EVP_CIPHER_CTX_new());
if(!ctx) {
return -1;
}
if(EVP_DecryptInit_ex(ctx.get(), EVP_aes_128_gcm(), nullptr, nullptr, nullptr) != 1) {
return -1;
}
if(EVP_CIPHER_CTX_ctrl(ctx.get(), EVP_CTRL_GCM_SET_IVLEN, iv->size(), nullptr) != 1) {
return -1;
}
if(EVP_DecryptInit_ex(ctx.get(), nullptr, nullptr, key->data(), iv->data()) != 1) {
return -1;
}
EVP_CIPHER_CTX_set_padding(ctx.get(), padding);
return 0;
}
static int init_encrypt_gcm(cipher_ctx_t &ctx, aes_t *key, aes_t *iv, bool padding) {
ctx.reset(EVP_CIPHER_CTX_new());
// Gen 7 servers use 128-bit AES ECB
if(EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_gcm(), nullptr, nullptr, nullptr) != 1) {
return -1;
}
if(EVP_CIPHER_CTX_ctrl(ctx.get(), EVP_CTRL_GCM_SET_IVLEN, iv->size(), nullptr) != 1) {
return -1;
}
if(EVP_EncryptInit_ex(ctx.get(), nullptr, nullptr, key->data(), iv->data()) != 1) {
return -1;
}
EVP_CIPHER_CTX_set_padding(ctx.get(), padding);
return 0;
}
static int init_encrypt_cbc(cipher_ctx_t &ctx, aes_t *key, aes_t *iv, bool padding) {
ctx.reset(EVP_CIPHER_CTX_new());
// Gen 7 servers use 128-bit AES ECB
if(EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_cbc(), nullptr, key->data(), iv->data()) != 1) {
return -1;
}
EVP_CIPHER_CTX_set_padding(ctx.get(), padding);
return 0;
}
int gcm_t::decrypt(const std::string_view &tagged_cipher, std::vector<std::uint8_t> &plaintext, aes_t *iv) {
if(!decrypt_ctx && init_decrypt_gcm(decrypt_ctx, &key, iv, padding)) {
return -1;
}
// Calling with cipher == nullptr results in a parameter change
// without requiring a reallocation of the internal cipher ctx.
if(EVP_DecryptInit_ex(decrypt_ctx.get(), nullptr, nullptr, nullptr, iv->data()) != 1) {
return false;
}
auto cipher = tagged_cipher.substr(tag_size);
auto tag = tagged_cipher.substr(0, tag_size);
plaintext.resize((cipher.size() + 15) / 16 * 16);
int size;
if(EVP_DecryptUpdate(decrypt_ctx.get(), plaintext.data(), &size, (const std::uint8_t *)cipher.data(), cipher.size()) != 1) {
return -1;
}
if(EVP_CIPHER_CTX_ctrl(decrypt_ctx.get(), EVP_CTRL_GCM_SET_TAG, tag.size(), const_cast<char *>(tag.data())) != 1) {
return -1;
}
int len = size;
if(EVP_DecryptFinal_ex(decrypt_ctx.get(), plaintext.data() + size, &len) != 1) {
return -1;
}
plaintext.resize(size + len);
return 0;
}
int gcm_t::encrypt(const std::string_view &plaintext, std::uint8_t *tagged_cipher, aes_t *iv) {
if(!encrypt_ctx && init_encrypt_gcm(encrypt_ctx, &key, iv, padding)) {
return -1;
}
// Calling with cipher == nullptr results in a parameter change
// without requiring a reallocation of the internal cipher ctx.
if(EVP_EncryptInit_ex(encrypt_ctx.get(), nullptr, nullptr, nullptr, iv->data()) != 1) {
return -1;
}
auto tag = tagged_cipher;
auto cipher = tag + tag_size;
int len;
int size = round_to_pkcs7_padded(plaintext.size());
// Encrypt into the caller's buffer
if(EVP_EncryptUpdate(encrypt_ctx.get(), cipher, &size, (const std::uint8_t *)plaintext.data(), plaintext.size()) != 1) {
return -1;
}
// GCM encryption won't ever fill ciphertext here but we have to call it anyway
if(EVP_EncryptFinal_ex(encrypt_ctx.get(), cipher + size, &len) != 1) {
return -1;
}
if(EVP_CIPHER_CTX_ctrl(encrypt_ctx.get(), EVP_CTRL_GCM_GET_TAG, tag_size, tag) != 1) {
return -1;
}
return len + size;
}
int ecb_t::decrypt(const std::string_view &cipher, std::vector<std::uint8_t> &plaintext) {
int len;
auto fg = util::fail_guard([this]() {
EVP_CIPHER_CTX_reset(decrypt_ctx.get());
});
// Gen 7 servers use 128-bit AES ECB
if(EVP_DecryptInit_ex(decrypt_ctx.get(), EVP_aes_128_ecb(), nullptr, key.data(), nullptr) != 1) {
return -1;
}
EVP_CIPHER_CTX_set_padding(decrypt_ctx.get(), padding);
plaintext.resize((cipher.size() + 15) / 16 * 16);
auto size = (int)plaintext.size();
// Decrypt into the caller's buffer, leaving room for the auth tag to be prepended
if(EVP_DecryptUpdate(decrypt_ctx.get(), plaintext.data(), &size, (const std::uint8_t *)cipher.data(), cipher.size()) != 1) {
return -1;
}
if(EVP_DecryptFinal_ex(decrypt_ctx.get(), plaintext.data(), &len) != 1) {
return -1;
}
plaintext.resize(len + size);
return 0;
}
int ecb_t::encrypt(const std::string_view &plaintext, std::vector<std::uint8_t> &cipher) {
auto fg = util::fail_guard([this]() {
EVP_CIPHER_CTX_reset(encrypt_ctx.get());
});
// Gen 7 servers use 128-bit AES ECB
if(EVP_EncryptInit_ex(encrypt_ctx.get(), EVP_aes_128_ecb(), nullptr, key.data(), nullptr) != 1) {
return -1;
}
EVP_CIPHER_CTX_set_padding(encrypt_ctx.get(), padding);
int len;
cipher.resize((plaintext.size() + 15) / 16 * 16);
auto size = (int)cipher.size();
// Encrypt into the caller's buffer
if(EVP_EncryptUpdate(encrypt_ctx.get(), cipher.data(), &size, (const std::uint8_t *)plaintext.data(), plaintext.size()) != 1) {
return -1;
}
if(EVP_EncryptFinal_ex(encrypt_ctx.get(), cipher.data() + size, &len) != 1) {
return -1;
}
cipher.resize(len + size);
return 0;
}
int cbc_t::encrypt(const std::string_view &plaintext, std::uint8_t *cipher, aes_t *iv) {
if(!encrypt_ctx && init_encrypt_cbc(encrypt_ctx, &key, iv, padding)) {
return -1;
}
// Calling with cipher == nullptr results in a parameter change
// without requiring a reallocation of the internal cipher ctx.
if(EVP_EncryptInit_ex(encrypt_ctx.get(), nullptr, nullptr, nullptr, iv->data()) != 1) {
return false;
}
int len;
int size = plaintext.size(); // round_to_pkcs7_padded(plaintext.size());
// Encrypt into the caller's buffer
if(EVP_EncryptUpdate(encrypt_ctx.get(), cipher, &size, (const std::uint8_t *)plaintext.data(), plaintext.size()) != 1) {
return -1;
}
if(EVP_EncryptFinal_ex(encrypt_ctx.get(), cipher + size, &len) != 1) {
return -1;
}
return size + len;
}
ecb_t::ecb_t(const aes_t &key, bool padding)
: cipher_t { EVP_CIPHER_CTX_new(), EVP_CIPHER_CTX_new(), key, padding } {}
cbc_t::cbc_t(const aes_t &key, bool padding)
: cipher_t { nullptr, nullptr, key, padding } {}
gcm_t::gcm_t(const crypto::aes_t &key, bool padding)
: cipher_t { nullptr, nullptr, key, padding } {}
} // namespace cipher
aes_t gen_aes_key(const std::array<uint8_t, 16> &salt, const std::string_view &pin) {
aes_t key;
std::string salt_pin;
salt_pin.reserve(salt.size() + pin.size());
salt_pin.insert(std::end(salt_pin), std::begin(salt), std::end(salt));
salt_pin.insert(std::end(salt_pin), std::begin(pin), std::end(pin));
auto hsh = hash(salt_pin);
std::copy(std::begin(hsh), std::begin(hsh) + key.size(), std::begin(key));
return key;
}
sha256_t hash(const std::string_view &plaintext) {
sha256_t hsh;
EVP_Digest(plaintext.data(), plaintext.size(), hsh.data(), nullptr, EVP_sha256(), nullptr);
return hsh;
}
x509_t x509(const std::string_view &x) {
bio_t io { BIO_new(BIO_s_mem()) };
BIO_write(io.get(), x.data(), x.size());
x509_t p;
PEM_read_bio_X509(io.get(), &p, nullptr, nullptr);
return p;
}
pkey_t pkey(const std::string_view &k) {
bio_t io { BIO_new(BIO_s_mem()) };
BIO_write(io.get(), k.data(), k.size());
pkey_t p = nullptr;
PEM_read_bio_PrivateKey(io.get(), &p, nullptr, nullptr);
return p;
}
std::string pem(x509_t &x509) {
bio_t bio { BIO_new(BIO_s_mem()) };
PEM_write_bio_X509(bio.get(), x509.get());
BUF_MEM *mem_ptr;
BIO_get_mem_ptr(bio.get(), &mem_ptr);
return { mem_ptr->data, mem_ptr->length };
}
std::string pem(pkey_t &pkey) {
bio_t bio { BIO_new(BIO_s_mem()) };
PEM_write_bio_PrivateKey(bio.get(), pkey.get(), nullptr, nullptr, 0, nullptr, nullptr);
BUF_MEM *mem_ptr;
BIO_get_mem_ptr(bio.get(), &mem_ptr);
return { mem_ptr->data, mem_ptr->length };
}
std::string_view signature(const x509_t &x) {
// X509_ALGOR *_ = nullptr;
const ASN1_BIT_STRING *asn1 = nullptr;
X509_get0_signature(&asn1, nullptr, x.get());
return { (const char *)asn1->data, (std::size_t)asn1->length };
}
std::string rand(std::size_t bytes) {
std::string r;
r.resize(bytes);
RAND_bytes((uint8_t *)r.data(), r.size());
return r;
}
std::vector<uint8_t> sign(const pkey_t &pkey, const std::string_view &data, const EVP_MD *md) {
md_ctx_t ctx { EVP_MD_CTX_create() };
if(EVP_DigestSignInit(ctx.get(), nullptr, md, nullptr, pkey.get()) != 1) {
return {};
}
if(EVP_DigestSignUpdate(ctx.get(), data.data(), data.size()) != 1) {
return {};
}
std::size_t slen = digest_size;
std::vector<uint8_t> digest;
digest.resize(slen);
if(EVP_DigestSignFinal(ctx.get(), digest.data(), &slen) != 1) {
return {};
}
return digest;
}
creds_t gen_creds(const std::string_view &cn, std::uint32_t key_bits) {
x509_t x509 { X509_new() };
pkey_ctx_t ctx { EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, nullptr) };
pkey_t pkey;
EVP_PKEY_keygen_init(ctx.get());
EVP_PKEY_CTX_set_rsa_keygen_bits(ctx.get(), key_bits);
EVP_PKEY_keygen(ctx.get(), &pkey);
X509_set_version(x509.get(), 2);
// Generate a real serial number to avoid SEC_ERROR_REUSED_ISSUER_AND_SERIAL with Firefox
bignum_t serial { BN_new() };
BN_rand(serial.get(), 159, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY); // 159 bits to fit in 20 bytes in DER format
BN_set_negative(serial.get(), 0); // Serial numbers must be positive
BN_to_ASN1_INTEGER(serial.get(), X509_get_serialNumber(x509.get()));
constexpr auto year = 60 * 60 * 24 * 365;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
X509_gmtime_adj(X509_get_notBefore(x509.get()), 0);
X509_gmtime_adj(X509_get_notAfter(x509.get()), 20 * year);
#else
asn1_string_t not_before { ASN1_STRING_dup(X509_get0_notBefore(x509.get())) };
asn1_string_t not_after { ASN1_STRING_dup(X509_get0_notAfter(x509.get())) };
X509_gmtime_adj(not_before.get(), 0);
X509_gmtime_adj(not_after.get(), 20 * year);
X509_set1_notBefore(x509.get(), not_before.get());
X509_set1_notAfter(x509.get(), not_after.get());
#endif
X509_set_pubkey(x509.get(), pkey.get());
auto name = X509_get_subject_name(x509.get());
X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC,
(const std::uint8_t *)cn.data(), cn.size(),
-1, 0);
X509_set_issuer_name(x509.get(), name);
X509_sign(x509.get(), pkey.get(), EVP_sha256());
return { pem(x509), pem(pkey) };
}
std::vector<uint8_t> sign256(const pkey_t &pkey, const std::string_view &data) {
return sign(pkey, data, EVP_sha256());
}
bool verify(const x509_t &x509, const std::string_view &data, const std::string_view &signature, const EVP_MD *md) {
auto pkey = X509_get_pubkey(x509.get());
md_ctx_t ctx { EVP_MD_CTX_create() };
if(EVP_DigestVerifyInit(ctx.get(), nullptr, md, nullptr, pkey) != 1) {
return false;
}
if(EVP_DigestVerifyUpdate(ctx.get(), data.data(), data.size()) != 1) {
return false;
}
if(EVP_DigestVerifyFinal(ctx.get(), (const uint8_t *)signature.data(), signature.size()) != 1) {
return false;
}
return true;
}
bool verify256(const x509_t &x509, const std::string_view &data, const std::string_view &signature) {
return verify(x509, data, signature, EVP_sha256());
}
void md_ctx_destroy(EVP_MD_CTX *ctx) {
EVP_MD_CTX_destroy(ctx);
}
std::string rand_alphabet(std::size_t bytes, const std::string_view &alphabet) {
auto value = rand(bytes);
for(std::size_t i = 0; i != value.size(); ++i) {
value[i] = alphabet[value[i] % alphabet.length()];
}
return value;
}
} // namespace crypto

135
src/crypto.h Normal file
View File

@@ -0,0 +1,135 @@
// Created by loki on 6/1/19.
#ifndef SUNSHINE_CRYPTO_H
#define SUNSHINE_CRYPTO_H
#include <array>
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/x509.h>
#include "utility.h"
namespace crypto {
struct creds_t {
std::string x509;
std::string pkey;
};
constexpr std::size_t digest_size = 256;
void md_ctx_destroy(EVP_MD_CTX *);
using sha256_t = std::array<std::uint8_t, SHA256_DIGEST_LENGTH>;
using aes_t = std::array<std::uint8_t, 16>;
using x509_t = util::safe_ptr<X509, X509_free>;
using x509_store_t = util::safe_ptr<X509_STORE, X509_STORE_free>;
using x509_store_ctx_t = util::safe_ptr<X509_STORE_CTX, X509_STORE_CTX_free>;
using cipher_ctx_t = util::safe_ptr<EVP_CIPHER_CTX, EVP_CIPHER_CTX_free>;
using md_ctx_t = util::safe_ptr<EVP_MD_CTX, md_ctx_destroy>;
using bio_t = util::safe_ptr<BIO, BIO_free_all>;
using pkey_t = util::safe_ptr<EVP_PKEY, EVP_PKEY_free>;
using pkey_ctx_t = util::safe_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_free>;
using bignum_t = util::safe_ptr<BIGNUM, BN_free>;
sha256_t hash(const std::string_view &plaintext);
aes_t gen_aes_key(const std::array<uint8_t, 16> &salt, const std::string_view &pin);
x509_t x509(const std::string_view &x);
pkey_t pkey(const std::string_view &k);
std::string pem(x509_t &x509);
std::string pem(pkey_t &pkey);
std::vector<uint8_t> sign256(const pkey_t &pkey, const std::string_view &data);
bool verify256(const x509_t &x509, const std::string_view &data, const std::string_view &signature);
creds_t gen_creds(const std::string_view &cn, std::uint32_t key_bits);
std::string_view signature(const x509_t &x);
std::string rand(std::size_t bytes);
std::string rand_alphabet(std::size_t bytes,
const std::string_view &alphabet = std::string_view { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!%&()=-" });
class cert_chain_t {
public:
KITTY_DECL_CONSTR(cert_chain_t)
void add(x509_t &&cert);
const char *verify(x509_t::element_type *cert);
private:
std::vector<std::pair<x509_t, x509_store_t>> _certs;
x509_store_ctx_t _cert_ctx;
};
namespace cipher {
constexpr std::size_t tag_size = 16;
constexpr std::size_t round_to_pkcs7_padded(std::size_t size) {
return ((size + 15) / 16) * 16;
}
class cipher_t {
public:
cipher_ctx_t decrypt_ctx;
cipher_ctx_t encrypt_ctx;
aes_t key;
bool padding;
};
class ecb_t : public cipher_t {
public:
ecb_t() = default;
ecb_t(ecb_t &&) noexcept = default;
ecb_t &operator=(ecb_t &&) noexcept = default;
ecb_t(const aes_t &key, bool padding = true);
int encrypt(const std::string_view &plaintext, std::vector<std::uint8_t> &cipher);
int decrypt(const std::string_view &cipher, std::vector<std::uint8_t> &plaintext);
};
class gcm_t : public cipher_t {
public:
gcm_t() = default;
gcm_t(gcm_t &&) noexcept = default;
gcm_t &operator=(gcm_t &&) noexcept = default;
gcm_t(const crypto::aes_t &key, bool padding = true);
/**
* length of cipher must be at least: round_to_pkcs7_padded(plaintext.size()) + crypto::cipher::tag_size
*
* return -1 on error
* return bytes written on success
*/
int encrypt(const std::string_view &plaintext, std::uint8_t *tagged_cipher, aes_t *iv);
int decrypt(const std::string_view &cipher, std::vector<std::uint8_t> &plaintext, aes_t *iv);
};
class cbc_t : public cipher_t {
public:
cbc_t() = default;
cbc_t(cbc_t &&) noexcept = default;
cbc_t &operator=(cbc_t &&) noexcept = default;
cbc_t(const crypto::aes_t &key, bool padding = true);
/**
* length of cipher must be at least: round_to_pkcs7_padded(plaintext.size())
*
* return -1 on error
* return bytes written on success
*/
int encrypt(const std::string_view &plaintext, std::uint8_t *cipher, aes_t *iv);
};
} // namespace cipher
} // namespace crypto
#endif //SUNSHINE_CRYPTO_H

235
src/httpcommon.cpp Normal file
View File

@@ -0,0 +1,235 @@
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include "process.h"
#include <filesystem>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/asio/ssl/context.hpp>
#include <Simple-Web-Server/server_http.hpp>
#include <Simple-Web-Server/server_https.hpp>
#include <boost/asio/ssl/context_base.hpp>
#include <curl/curl.h>
#include "config.h"
#include "crypto.h"
#include "httpcommon.h"
#include "main.h"
#include "network.h"
#include "nvhttp.h"
#include "platform/common.h"
#include "rtsp.h"
#include "utility.h"
#include "uuid.h"
namespace http {
using namespace std::literals;
namespace fs = std::filesystem;
namespace pt = boost::property_tree;
int reload_user_creds(const std::string &file);
bool user_creds_exist(const std::string &file);
std::string unique_id;
net::net_e origin_pin_allowed;
net::net_e origin_web_ui_allowed;
int init() {
bool clean_slate = config::sunshine.flags[config::flag::FRESH_STATE];
origin_pin_allowed = net::from_enum_string(config::nvhttp.origin_pin_allowed);
origin_web_ui_allowed = net::from_enum_string(config::nvhttp.origin_web_ui_allowed);
if(clean_slate) {
unique_id = util::uuid_t::generate().string();
auto dir = std::filesystem::temp_directory_path() / "Sunshine"sv;
config::nvhttp.cert = (dir / ("cert-"s + unique_id)).string();
config::nvhttp.pkey = (dir / ("pkey-"s + unique_id)).string();
}
if(!fs::exists(config::nvhttp.pkey) || !fs::exists(config::nvhttp.cert)) {
if(create_creds(config::nvhttp.pkey, config::nvhttp.cert)) {
return -1;
}
}
if(user_creds_exist(config::sunshine.credentials_file)) {
if(reload_user_creds(config::sunshine.credentials_file)) return -1;
}
else {
BOOST_LOG(info) << "Open the Web UI to set your new username and password and getting started";
}
return 0;
}
int save_user_creds(const std::string &file, const std::string &username, const std::string &password, bool run_our_mouth) {
pt::ptree outputTree;
if(fs::exists(file)) {
try {
pt::read_json(file, outputTree);
}
catch(std::exception &e) {
BOOST_LOG(error) << "Couldn't read user credentials: "sv << e.what();
return -1;
}
}
auto salt = crypto::rand_alphabet(16);
outputTree.put("username", username);
outputTree.put("salt", salt);
outputTree.put("password", util::hex(crypto::hash(password + salt)).to_string());
try {
pt::write_json(file, outputTree);
}
catch(std::exception &e) {
BOOST_LOG(error) << "generating user credentials: "sv << e.what();
return -1;
}
BOOST_LOG(info) << "New credentials have been created"sv;
return 0;
}
bool user_creds_exist(const std::string &file) {
if(!fs::exists(file)) {
return false;
}
pt::ptree inputTree;
try {
pt::read_json(file, inputTree);
return inputTree.find("username") != inputTree.not_found() &&
inputTree.find("password") != inputTree.not_found() &&
inputTree.find("salt") != inputTree.not_found();
}
catch(std::exception &e) {
BOOST_LOG(error) << "validating user credentials: "sv << e.what();
}
return false;
}
int reload_user_creds(const std::string &file) {
pt::ptree inputTree;
try {
pt::read_json(file, inputTree);
config::sunshine.username = inputTree.get<std::string>("username");
config::sunshine.password = inputTree.get<std::string>("password");
config::sunshine.salt = inputTree.get<std::string>("salt");
}
catch(std::exception &e) {
BOOST_LOG(error) << "loading user credentials: "sv << e.what();
return -1;
}
return 0;
}
int create_creds(const std::string &pkey, const std::string &cert) {
fs::path pkey_path = pkey;
fs::path cert_path = cert;
auto creds = crypto::gen_creds("Sunshine Gamestream Host"sv, 2048);
auto pkey_dir = pkey_path;
auto cert_dir = cert_path;
pkey_dir.remove_filename();
cert_dir.remove_filename();
std::error_code err_code {};
fs::create_directories(pkey_dir, err_code);
if(err_code) {
BOOST_LOG(error) << "Couldn't create directory ["sv << pkey_dir << "] :"sv << err_code.message();
return -1;
}
fs::create_directories(cert_dir, err_code);
if(err_code) {
BOOST_LOG(error) << "Couldn't create directory ["sv << cert_dir << "] :"sv << err_code.message();
return -1;
}
if(write_file(pkey.c_str(), creds.pkey)) {
BOOST_LOG(error) << "Couldn't open ["sv << config::nvhttp.pkey << ']';
return -1;
}
if(write_file(cert.c_str(), creds.x509)) {
BOOST_LOG(error) << "Couldn't open ["sv << config::nvhttp.cert << ']';
return -1;
}
fs::permissions(pkey_path,
fs::perms::owner_read | fs::perms::owner_write,
fs::perm_options::replace, err_code);
if(err_code) {
BOOST_LOG(error) << "Couldn't change permissions of ["sv << config::nvhttp.pkey << "] :"sv << err_code.message();
return -1;
}
fs::permissions(cert_path,
fs::perms::owner_read | fs::perms::group_read | fs::perms::others_read | fs::perms::owner_write,
fs::perm_options::replace, err_code);
if(err_code) {
BOOST_LOG(error) << "Couldn't change permissions of ["sv << config::nvhttp.cert << "] :"sv << err_code.message();
return -1;
}
return 0;
}
bool download_file(const std::string &url, const std::string &file) {
CURL *curl = curl_easy_init();
if(!curl) {
BOOST_LOG(error) << "Couldn't create CURL instance";
return false;
}
FILE *fp = fopen(file.c_str(), "wb");
if(!fp) {
BOOST_LOG(error) << "Couldn't open ["sv << file << ']';
curl_easy_cleanup(curl);
return false;
}
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
#ifdef _WIN32
curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
#endif
CURLcode result = curl_easy_perform(curl);
if(result != CURLE_OK) {
BOOST_LOG(error) << "Couldn't download ["sv << url << ", code:" << result << ']';
}
curl_easy_cleanup(curl);
fclose(fp);
return result == CURLE_OK;
}
std::string url_escape(const std::string &url) {
CURL *curl = curl_easy_init();
char *string = curl_easy_escape(curl, url.c_str(), url.length());
std::string result(string);
curl_free(string);
curl_easy_cleanup(curl);
return result;
}
std::string url_get_host(const std::string &url) {
CURLU *curlu = curl_url();
curl_url_set(curlu, CURLUPART_URL, url.c_str(), url.length());
char *host;
if(curl_url_get(curlu, CURLUPART_HOST, &host, 0) != CURLUE_OK) {
curl_url_cleanup(curlu);
return "";
}
std::string result(host);
curl_free(host);
curl_url_cleanup(curlu);
return result;
}
} // namespace http

23
src/httpcommon.h Normal file
View File

@@ -0,0 +1,23 @@
#include "network.h"
#include "thread_safe.h"
namespace http {
int init();
int create_creds(const std::string &pkey, const std::string &cert);
int save_user_creds(
const std::string &file,
const std::string &username,
const std::string &password,
bool run_our_mouth = false);
int reload_user_creds(const std::string &file);
bool download_file(const std::string &url, const std::string &file);
std::string url_escape(const std::string &url);
std::string url_get_host(const std::string &url);
extern std::string unique_id;
extern net::net_e origin_pin_allowed;
extern net::net_e origin_web_ui_allowed;
} // namespace http

Some files were not shown because too many files have changed in this diff Show More