Compare commits

...

856 Commits

Author SHA1 Message Date
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
Elia Zammuto
1f239214a1 Troubleshooting page 2021-08-17 20:22:47 +02:00
287 changed files with 27410 additions and 27876 deletions

View File

@@ -1,8 +1,13 @@
---
# 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: true
AlignConsecutiveAssignments: Consecutive
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
@@ -10,7 +15,7 @@ AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
@@ -23,6 +28,7 @@ BraceWrapping:
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterUnion: false
BeforeCatch: true
BeforeElse: true
@@ -57,7 +63,7 @@ SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false

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

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

@@ -0,0 +1,46 @@
---
# 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: "pip"
directory: "/"
schedule:
interval: "daily"
time: "09:30"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
time: "10:00"
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@v1
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@v3
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@v3
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: sunshine${{ 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

10
.gitignore vendored
View File

@@ -7,4 +7,12 @@ cmake-build*
*.kdev4
.cache
.idea
.idea
# npm
node_modules/
package-lock.json
# Translations
*.mo
*.pot

44
.gitmodules vendored
View File

@@ -1,12 +1,48 @@
[submodule "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"]
branch = master
[submodule "third-party/Simple-Web-Server"]
path = third-party/Simple-Web-Server
url = https://github.com/loki-47-6F-64/Simple-Web-Server.git
[submodule "ViGEmClient"]
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
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

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

303
CHANGELOG.md Normal file
View File

@@ -0,0 +1,303 @@
# Changelog
## [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

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 | ✅ |

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.

219
README.md
View File

@@ -1,219 +0,0 @@
# Introduction
Sunshine is a Gamestream host for Moonlight
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/cgrtw2g3fq9b0b70/branch/master?svg=true)](https://ci.appveyor.com/project/loki-47-6F-64/sunshine/branch/master)
[![Downloads](https://img.shields.io/github/downloads/Loki-47-6F-64/sunshine/total)](https://github.com/Loki-47-6F-64/sunshine/releases)
- [Building](README.md#building)
- [Credits](README.md#credits)
# Building
- [Linux](README.md#linux)
- [Windows](README.md#windows-10)
## Linux
### Requirements:
Ubuntu 20.04:
Install the following:
#### X11 Only
```
sudo apt install cmake gcc-10 g++-10 libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
```
#### X11 + KMS (Requires additional setup)
KMS allows Sunshine to grab the monitor with lower latency then through X11
```
sudo apt install cmake gcc-10 g++-10 libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev
```
### Compilation:
#### X11 Only
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
- `cd sunshine && mkdir build && cd build`
- `cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DSUNSHINE_ENABLE_DRM=OFF ..`
- `make -j ${nproc}`
#### X11 + KMS
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
- `cd sunshine && mkdir build && cd build`
- `cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ..`
- `make -j ${nproc}`
### Setup:
sunshine needs access to uinput to create mouse and gamepad events:
- Add user to group 'input':
`usermod -a -G input $USER`
- Create udev rules:
- Run the following command:
`nano /etc/udev/rules.d/85-sunshine-input.rules`
- Input the following contents:
`KERNEL=="uinput", GROUP="input", MODE="0660"`
- Save the file and exit
1. `CTRL+X` to start exit
2. `Y` to save modifications
- `assets/sunshine.conf` is an example configuration file. Modify it as you see fit, then use it by running:
`sunshine path/to/sunshine.conf`
- Configure autostart service
`path/to/build/dir/sunshine.service` is used to start sunshine in the background. To use it, do the following:
1. Copy it to the users systemd, `cp sunshine.service ~/.config/systemd/user/`
2. Starting
- Onetime:
`systemctl --user start sunshine`
- Always on boot:
`systemctl --user enable sunshine`
- `assets/apps.json` is an [example](README.md#application-list) of a list of applications that are started just before running a stream
#### Additional Setup for KMS:
Please note that `cap_sys_admin` may as well be root, except you don't need to be root to run it.
It's necessary to allow Sunshine to use KMS
- `sudo setcap cap_sys_admin+ep sunshine`
### Trouleshooting:
- If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input":
- `groups $USER`
- If Sunshine sends audio from the microphone instead of the speaker, try the following steps:
1. `$ pacmd list-sources | grep "name:"` or `$ pactl info | grep Source` if running pipewire.
2. Copy the name to the configuration option "audio_sink"
3. restart sunshine
## Windows 10
### Requirements:
First you need to install [MSYS2](https://www.msys2.org), then startup "MSYS2 MinGW 64-bit" and install the following packages using `pacman -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 mingw-w64-x86_64-make cmake make gcc
### Compilation:
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recursive`
- `cd sunshine && mkdir build && cd build`
- `cmake -G"Unix Makefiles" ..`
- `mingw32-make`
### Setup:
- **OPTIONAL** Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases]
# Common
## Usage:
- run "sunshine path/to/sunshine.conf"
- If running for the first time, make sure to note the username and password Sunshine showed to you, since you **cannot get back later**!
- In Moonlight: Add PC manually
- When Moonlight request you insert the correct pin on sunshine:
- Type in the URL bar of your browser: `https://xxx.xxx.xxx.xxx:47990` where `xxx.xxx.xxx.xxx` is the IP address of your computer
- Ignore any warning given by your browser about "insecure website"
- You should compile the next page with a new username and a password, needed to login into the next step
- Press "Save" and log in using the credentials given above
- Go to "PIN" in the Header
- Type in your PIN and press Enter, you should get a Success Message
- Click on one of the Applications listed
- Have fun :)
## Shortcuts:
All shortcuts start with CTRL + ALT + SHIFT, just like Moonlight
- CTRL + ALT + SHIFT + N --> Hide/Unhide the cursor (This may be usefull for Remote Desktop Mode for Moonlight)
- CTRL + ALT + SHIFT + F1/F13 --> Switch to different monitor for Streaming
## 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 :)
- [Eretik](http://eretik.omegahg.com/) (For creating PolicyConfig.h, allowing me to change the default audio device on Windows programmatically)
## Application List:
**Note:** You can change the Application List in the "Apps" section of the User Interface `https://xxx.xxx.xxx.xxx:47990/`
- 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":"some-command",
"undo":"undo-that-command"
}
],
"detached":[
"some-command",
"another-command"
]
}
```
- name: Self explanatory
- output <optional>: The file where the output of the command is stored
- If it is not specified, the output is ignored
- detached: A list of commands to be run and forgotten about
- 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

View File

@@ -1,41 +0,0 @@
image:
- Ubuntu2004
- Visual Studio 2019
environment:
matrix:
- BUILD_TYPE: Debug
- BUILD_TYPE: Release
install:
- sh: sudo apt update --ignore-missing
- sh: sudo apt install -y build-essential fakeroot gcc-10 g++-10 cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-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_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_EXECUTABLE_PATH=sunshine -DSUNSHINE_ASSETS_DIR=/etc/sunshine ..
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -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: 7z a Sunshine-Windows.zip tools\sunshinesvc.exe
- cmd: 7z a Sunshine-Windows.zip ..\tools\install-service.bat
- cmd: 7z a Sunshine-Windows.zip ..\tools\uninstall-service.bat
- 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",
"detached":["setsid steam steam://open/bigpicture"]
}
]
}

View File

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

View File

@@ -1,286 +0,0 @@
# If no external IP address is given, Sunshine will attempt to automatically detect external ip-address
# external_ip = 123.456.789.12
# Set the familly of ports used by Sunshine
# port = 47989
# 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 = pc
# The origin of the remote endpoint address that is not denied for HTTPS Web UI
# Could be any of the following values:
# pc|lan|wan
# pc: Only localhost may access the Web Manager
# lan: Only those in LAN may access the Web Manager
# wan: Anyone may access the Web Manager
#
# origin_web_ui_allowed = lan
# If UPnP is enabled, Sunshine will attempt to open ports for streaming over the internet
# To enable it, uncomment the following line:
# upnp = on
# The file where current state of Sunshine is stored
# file_state = sunshine_state.json
# The file where user credentials for the UI are stored
# By default, credentials are stored in `file_state`
# credentials_file = sunshine_state.json
# The display modes advertised by Sunshine
#
# Some versions of Moonlight, such as Moonlight-nx (Switch),
# rely on this list to ensure that the requested resolutions and fps
# are supported.
#
# fps = [10, 30, 60, 90, 120]
# resolutions = [
# 352x240,
# 480x360,
# 858x480,
# 1280x720,
# 1920x1080,
# 2560x1080,
# 3440x1440,
# 1920x1200,
# 3860x2160,
# 3840x1600,
# ]
# Sometimes it may be usefull to map keybindings.
# Wayland won't allow clients to capture the Win Key for example
#
# See https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
#
# Note:
# keybindings needs to have a multiple of two elements
# keybindings = [
# 0x10, 0xA0,
# 0x11, 0xA2,
# 0x12, 0xA4,
# 0x4A, 0x4B
# ]
# How long to wait in milliseconds for data from moonlight before shutting down the stream
# ping_timeout = 10000
# The file where configuration for the different applications that Sunshine can run during a stream
# file_apps = apps.json
# Percentage of error correcting packets per data packet in each video frame
# Higher values can correct for more network packet loss, but at the cost of increasing bandwidth usage
# The default value of 20 is what GeForce Experience uses
#
# The value must be greater than 0 and lower than or equal to 255
# fec_percentage = 20
# 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 !!
# Gamepads supported by Sunshine
# Possible values:
# x360 -- xbox 360 controller
# ds4 -- dualshock controller (PS4)
# gamepad = x360
# 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-sinks | grep "name:" if running vanilla pulseaudio
# pactl info | grep Source` if running pipewire
# audio_sink = alsa_output.pci-0000_09_00.3.analog-stereo
#
# !! Windows only !!
# tools\audio-info.exe
# audio_sink = {0.0.0.00000000}.{FD47D9CC-4218-4135-9CE2-0C195C87405B}
#
# The virtual sink, is the audio device that's virtual (Like Steam Streaming Speakers), it allows Sunshine
# to stream audio, while muting the speakers.
# virtual_sink = {0.0.0.00000000}.{8edba70c-1125-467c-b89c-15da389bc1d4}
# !! 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
# !! Linux only !!
# Set the display number to stream.
# You can find them by the following command:
# xrandr --listmonitors
# Example output: "0: +HDMI-1 1920/518x1200/324+0+0 HDMI-1"
# ^ <-- You need this.
# output_name = 0
###############################################
# FFmpeg software encoding parameters
# Honestly, I have no idea what the optimal values would be.
# Play around with this :)
# Quantitization Parameter
# Some devices don't support Constant Bit Rate. For those devices, QP is used instead
# Higher value means more compression, but less quality
# 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 = 2
# Force a specific encoder, otherwise Sunshine will use the first encoder that is available
# supported encoders:
# nvenc
# amdvce # NOTE: alpha stage. The cursor is not yet displayed
# 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
##################################### AMD #####################################
###### presets ###########
# default
# speed
# balanced
##########################
# amd_preset = balanced
#
####### rate control #####
# auto -- let ffmpeg decide rate control
# constqp -- constant QP mode
# vbr_latency -- Latency Constrained Variable Bitrate
# vbr_peak -- Peak Contrained Variable Bitrate
# cbr -- constant bitrate
##########################
# amd_rc = auto
###### h264 entropy ######
# auto -- let ffmpeg nvenc decide the entropy encoding
# cabac
# cavlc
##########################
# amd_coder = auto
#################################### VAAPI ###################################
####### adapter ##########
# Unlike with `amdvce` and `nvenc`, it doesn't matter if video encoding is done
# on a different GPU.
# Run the following commands:
# 1. ls /dev/dri/renderD*
# to find all devices capable of VAAPI
# 2. vainfo --display drm --device /dev/dri/renderD129 | grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version"
# Lists the name and capabilities of the device.
# To be supported by Sunshine, it needs to have at the very minimum:
# VAProfileH264High : VAEntrypointEncSlice
# adapter_name = /dev/dri/renderD128
##############################################
# 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 = 012
#
# See: sunshine --help for all options under the header: flags

View File

@@ -1,244 +0,0 @@
<div id="app" class="container">
<div class="my-4">
<h1>Applications</h1>
<div>Applications are refreshed only when Client is restarted</div>
</div>
<div class="card p-4">
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<tr v-for="(app,i) in apps" :key="i">
<td>{{app.name}}</td>
<td>
<button class="btn btn-primary" @click="editApp(i)">Edit</button>
<button class="btn btn-danger" @click="showDeleteForm(i)">
Delete
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="edit-form card mt-2" v-if="showEditForm">
<div class="p-4">
<!--name-->
<div class="mb-3">
<label for="appName" class="form-label">Application Name</label>
<input
type="text"
class="form-control"
id="appName"
aria-describedby="appNameHelp"
v-model="editForm.name"
/>
<div id="appNameHelp" class="form-text">
Application Name, as shown on Moonlight
</div>
</div>
<!--output-->
<div class="mb-3">
<label for="appOutput" class="form-label">Output</label>
<input
type="text"
class="form-control monospace"
id="appOutput"
aria-describedby="appOutputHelp"
v-model="editForm.output"
/>
<div id="appOutputHelp" class="form-text">
The file where the output of the command is stored, if it is not
specified, the output is ignored
</div>
</div>
<!--prep-cmd-->
<div class="mb-3 d-flex flex-column">
<label for="appName" class="form-label">Command Preparations</label>
<div class="form-text">
A list of commands to be run before/after the application. <br />
If any of the prep-commands fail, starting the application is aborted
</div>
<table v-if="editForm['prep-cmd'].length > 0">
<thead>
<th class="precmd-head">Do</th>
<th class="precmd-head">Undo</th>
<th style="width: 48px"></th>
</thead>
<tbody>
<tr v-for="(c,i) in editForm['prep-cmd']">
<td>
<input
type="text"
class="form-control monospace"
v-model="c.do"
/>
</td>
<td>
<input
type="text"
class="form-control monospace"
v-model="c.undo"
/>
</td>
<td>
<button
class="btn btn-danger"
@click="editForm['prep-cmd'].splice(i,1)"
>
&times;
</button>
</td>
</tr>
</tbody>
</table>
<button
class="mt-2 btn btn-success"
style="margin: 0 auto"
@click="addPrepCmd"
>
&plus; Add
</button>
</div>
<!--detatched-->
<div class="mb-3">
<label for="appName" class="form-label">Detached Commands</label>
<div
v-for="(c,i) in editForm.detached"
class="d-flex justify-content-between my-2"
>
<pre>{{c}}</pre>
<button
class="btn btn-danger mx-2"
@click="editForm.detached.splice(i,1)"
>
&times;
</button>
</div>
<div class="d-flex justify-content-between">
<input
type="text"
class="form-control monospace"
v-model="detachedCmd"
/>
<button
class="btn btn-success mx-2"
@click="editForm.detached.push(detachedCmd);detachedCmd = '';"
>
+
</button>
</div>
<div class="form-text">
A list of commands to be run and forgotten about
</div>
</div>
<!--command-->
<div class="mb-3">
<label for="appCmd" class="form-label">Command</label>
<input
type="text"
class="form-control monospace"
id="appCmd"
aria-describedby="appCmdHelp"
v-model="editForm.cmd"
/>
<div id="appCmdHelp" class="form-text">
The main application, if it is not specified, a processs is started
that sleeps indefinitely
</div>
</div>
<!--buttons-->
<div class="d-flex">
<button @click="showEditForm = false" class="btn btn-secondary m-2">
Cancel
</button>
<button class="btn btn-primary m-2" @click="save">Save</button>
</div>
</div>
</div>
<div class="mt-2" v-else>
<button class="btn btn-primary" @click="newApp">+ Add New</button>
</div>
</div>
<script>
new Vue({
el: "#app",
data() {
return {
apps: [],
showEditForm: false,
editForm: null,
detachedCmd: "",
};
},
created() {
fetch("/api/apps")
.then((r) => r.json())
.then((r) => {
console.log(r);
this.apps = r.apps;
});
},
methods: {
newApp() {
this.editForm = {
name: "",
output: "",
cmd: [],
index: -1,
"prep-cmd": [],
detached: [],
};
this.editForm.index = -1;
this.showEditForm = true;
},
editApp(id) {
this.editForm = JSON.parse(JSON.stringify(this.apps[id]));
this.$set(this.editForm, "index", id);
if (this.editForm["prep-cmd"] === undefined)
this.$set(this.editForm, "prep-cmd", []);
if (this.editForm["detached"] === undefined)
this.$set(this.editForm, "detached", []);
this.showEditForm = true;
},
showDeleteForm(id) {
let resp = confirm(
"Are you sure to delete " + this.apps[id].name + "?"
);
if (resp) {
fetch("/api/apps/" + id, { method: "DELETE" }).then((r) => {
if (r.status == 200) document.location.reload();
});
}
},
addPrepCmd() {
this.editForm["prep-cmd"].push({
do: "",
undo: "",
});
},
save() {
fetch("/api/apps", {
method: "POST",
body: JSON.stringify(this.editForm),
}).then((r) => {
if (r.status == 200) document.location.reload();
});
},
},
});
</script>
<style>
.precmd-head {
width: 200px;
}
.monospace {
font-family: monospace;
}
</style>

View File

@@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sunshine</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-p34f1UUtsS3wqzfto5wAAmdvj+osOnFyQFpp4Ua3gs/ZVWx6oOypYoCJhGGScy+8"
crossorigin="anonymous"
></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js"></script>
</head>
<body></body>
</html>

View File

@@ -1,62 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sunshine</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-p34f1UUtsS3wqzfto5wAAmdvj+osOnFyQFpp4Ua3gs/ZVWx6oOypYoCJhGGScy+8"
crossorigin="anonymous"
></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js"></script>
</head>
<body>
<nav
class="navbar navbar-expand-lg navbar-light"
style="background-color: #ffc400"
>
<div class="container-fluid">
<span class="navbar-brand">Sunshine</span>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/pin">PIN</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/apps">Applications</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/config">Configuration</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/password">Change Password</a>
</li>
</ul>
</div>
</div>
</nav>
</body>
</html>

View File

@@ -1,11 +0,0 @@
<div id="content" class="container">
<div class="row">
<div class="col-md-6 py-4" style="margin: 0 auto">
<h1>Hello, Sunshine!</h1>
<p>Sunshine is a Gamestream host for Moonlight</p>
<a href="https://github.com/loki-47-6F-64/sunshine"
>Official GitHub Repository</a
>
</div>
</div>
</div>

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)

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)

View File

@@ -18,4 +18,4 @@ find_library(LIBDRM_LIBRARIES NAMES libdrm.so PATHS ${PC_LIBDRM_LIBDIR} ${PC_LIB
mark_as_advanced(LIBDRM_INCLUDE_DIRS LIBDRM_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBDRM REQUIRED_VARS LIBDRM_LIBRARIES LIBDRM_INCLUDE_DIRS)
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"]

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

@@ -0,0 +1,155 @@
# 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* \
boost-static-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"]

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

@@ -0,0 +1,155 @@
# 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* \
boost-static-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.110* \
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
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

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

@@ -0,0 +1,282 @@
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>`_ and
select their sink as audio device in `sunshine.conf`.
.. 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,206 @@
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 \
boost-static \
cmake \
gcc \
gcc-c++ \
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
# libmfx-devel is not listed for fedora, this is for x86_64 only
https://kojipkgs.fedoraproject.org//packages/libmfx/1.25/4.el8/x86_64/libmfx-devel-1.25-4.el8.x86_64.rpm
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,123 +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=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/DEBIAN
export RULES=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/etc/udev/rules.d
export BIN=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/usr/bin
export SERVICE=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/usr/lib/systemd/user
export ASSETS=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/etc/sunshine
mkdir -p $DEBIAN
mkdir -p $RULES
mkdir -p $BIN
mkdir -p $ASSETS/shaders
mkdir -p $SERVICE
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.10.2
Depends: libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0, libboost-log1.67.0 | libboost-log1.71.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2
Description: Gamestream host for Moonlight
EOF
cat << 'EOF' > $DEBIAN/preinst
#Store backup for old config files to prevent it from being overwritten
if [ -f /etc/sunshine/sunshine.conf ]; then
cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old
fi
if [ -f /etc/sunshine/apps_linux.json ]; then
cp /etc/sunshine/apps_linux.json /etc/sunshine/apps_linux.json.old
fi
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
if [ -f /etc/sunshine/sunshine.conf.old ]; then
echo "Restoring old sunshine.conf"
mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf
fi
if [ -f /etc/sunshine/apps_linux.json.old ]; then
echo "Restoring old apps_linux.json"
mv /etc/sunshine/apps_linux.json.old /etc/sunshine/apps_linux.json
fi
# Update permissions on config files for Web Manager
if [ -f /etc/sunshine/apps_linux.json ]; then
echo "chmod 666 /etc/sunshine/apps_linux.json"
chmod 666 /etc/sunshine/apps_linux.json
fi
if [ -f /etc/sunshine/sunshine.conf ]; then
echo "chmod 666 /etc/sunshine/sunshine.conf"
chmod 666 /etc/sunshine/sunshine.conf
fi
# Ensure Sunshine can grab images from KMS
path_to_setcap=$(which setcap)
if [ -x "$path_to_setcap" ] ; then
echo "$path_to_setcap cap_sys_admin+ep /usr/bin/sunshine"
$path_to_setcap cap_sys_admin+ep /usr/bin/sunshine
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
cp @CMAKE_CURRENT_BINARY_DIR@/sunshine.service $SERVICE/sunshine.service
cp -r @CMAKE_CURRENT_SOURCE_DIR@/assets/web $ASSETS/web
cp -r @CMAKE_CURRENT_SOURCE_DIR@/assets/shaders/opengl $ASSETS/shaders/opengl
chmod 755 $DEBIAN/postinst
chmod 755 $DEBIAN/preinst
chmod 755 $BIN/sunshine
chmod 644 $RULES/85-sunshine-rules.rules
chmod 666 $ASSETS/apps_linux.json
chmod 666 $ASSETS/sunshine.conf
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=static,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."

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

View File

@@ -39,6 +39,15 @@ opus_stream_config_t stream_configs[MAX_STREAM_CONFIG] {
1,
1,
platf::speaker::map_stereo,
96000,
},
{
SAMPLE_RATE,
2,
1,
1,
platf::speaker::map_stereo,
512000,
},
{
SAMPLE_RATE,
@@ -46,6 +55,7 @@ opus_stream_config_t stream_configs[MAX_STREAM_CONFIG] {
4,
2,
platf::speaker::map_surround51,
256000,
},
{
SAMPLE_RATE,
@@ -53,6 +63,7 @@ opus_stream_config_t stream_configs[MAX_STREAM_CONFIG] {
6,
0,
platf::speaker::map_surround51,
1536000,
},
{
SAMPLE_RATE,
@@ -60,6 +71,7 @@ opus_stream_config_t stream_configs[MAX_STREAM_CONFIG] {
5,
3,
platf::speaker::map_surround71,
450000,
},
{
SAMPLE_RATE,
@@ -67,6 +79,7 @@ opus_stream_config_t stream_configs[MAX_STREAM_CONFIG] {
8,
0,
platf::speaker::map_surround71,
2048000,
},
};
@@ -74,9 +87,10 @@ auto control_shared = safe::make_shared<audio_ctx_t>(start_audio_control, stop_a
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])];
//FIXME: Pick correct opus_stream_config_t based on config.channels
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,
@@ -84,17 +98,15 @@ void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
stream->streams,
stream->coupledStreams,
stream->mapping,
OPUS_APPLICATION_AUDIO,
OPUS_APPLICATION_RESTRICTED_LOWDELAY,
nullptr) };
// For some reason, audio is crackling when the encoder is set to constant bitstream.
// We simulate a constant bitstream with OPUS_SET_BITRATE(OPUS_BITRATE_MAX) -->
// which tries to occupy as much space as possible in the packet
opus_multistream_encoder_ctl(opus.get(), OPUS_SET_BITRATE(OPUS_BITRATE_MAX));
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 }; // 1KB
buffer_t packet { 1400 };
int bytes = opus_multistream_encode(opus.get(), sample->data(), frame_size, std::begin(packet), packet.size());
if(bytes < 0) {
@@ -104,14 +116,6 @@ void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
return;
}
// Even with OPUS_SET_BITRATE(OPUS_BITRATE_MAX), silent packets are smaller than the rest
// Drop silent packets to ensure Moonlight won't complain
// A packet size of 128 seems a reasonable enough threshold
if(bytes < 128) {
BOOST_LOG(verbose) << "Dropped silent packet"sv;
continue;
}
packet.fake_resize(bytes);
packets->raise(channel_data, std::move(packet));
}
@@ -119,9 +123,7 @@ void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
void capture(safe::mail_t mail, config_t config, void *channel_data) {
auto shutdown_event = mail->event<bool>(mail::shutdown);
//FIXME: Pick correct opus_stream_config_t based on config.channels
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
auto ref = control_shared.ref();
if(!ref) {
@@ -135,9 +137,15 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
return;
}
std::string *sink =
config::audio.sink.empty() ? &ref->sink.host : &config::audio.sink;
if(ref->sink.null) {
// 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:
@@ -156,12 +164,21 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
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
if(!config.flags[config_t::HOST_AUDIO] && control->set_sink(*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 };
@@ -213,7 +230,7 @@ int map_stream(int channels, bool quality) {
int shift = quality ? 1 : 0;
switch(channels) {
case 2:
return STEREO;
return STEREO + shift;
case 6:
return SURROUND51 + shift;
case 8:

View File

@@ -6,6 +6,7 @@
namespace audio {
enum stream_config_e : int {
STEREO,
HIGH_STEREO,
SURROUND51,
HIGH_SURROUND51,
SURROUND71,
@@ -19,6 +20,7 @@ struct opus_stream_config_t {
int streams;
int coupledStreams;
const std::uint8_t *mapping;
int bitrate;
};
extern opus_stream_config_t stream_configs[MAX_STREAM_CONFIG];

View File

@@ -1,7 +1,7 @@
extern "C" {
#include <cbs/cbs_h264.h>
#include <cbs/cbs_h265.h>
#include <cbs/video_levels.h>
#include <cbs/h264_levels.h>
#include <libavcodec/avcodec.h>
#include <libavutil/pixdesc.h>
}
@@ -124,9 +124,9 @@ util::buffer_t<std::uint8_t> make_sps_h264(const AVCodecContext *ctx) {
sps.seq_parameter_set_id = 0;
sps.chroma_format_idc = 1;
sps.log2_max_frame_num_minus4 = 3; //4;
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.log2_max_pic_order_cnt_lsb_minus4 = 0; // 4;
sps.max_num_ref_frames = dpb_frame;
@@ -297,4 +297,4 @@ bool validate_sps(const AVPacket *packet, int codec_id) {
return ((CodedBitstreamH265Context *)ctx->priv_data)->active_sps->vui_parameters_present_flag;
}
} // namespace cbs
} // namespace cbs

View File

@@ -31,4 +31,4 @@ h264_t make_sps_h264(const AVCodecContext *ctx, const AVPacket *packet);
bool validate_sps(const AVPacket *packet, int codec_id);
} // namespace cbs
#endif
#endif

View File

@@ -6,6 +6,7 @@
#include <unordered_map>
#include <boost/asio.hpp>
#include <boost/filesystem.hpp>
#include "config.h"
#include "main.h"
@@ -20,54 +21,75 @@ using namespace std::literals;
#define PRIVATE_KEY_FILE CA_DIR "/cakey.pem"
#define CERTIFICATE_FILE CA_DIR "/cacert.pem"
#define APPS_JSON_PATH SUNSHINE_CONFIG_DIR "/" APPS_JSON
#define APPS_JSON_PATH platf::appdata().string() + "/apps.json"
namespace config {
namespace nv {
#ifdef __APPLE__
// values accurate as of 27/12/2022, but aren't strictly necessary for MacOS build
#define NV_ENC_TUNING_INFO_HIGH_QUALITY 1
#define NV_ENC_TUNING_INFO_LOW_LATENCY 2
#define NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY 3
#define NV_ENC_TUNING_INFO_LOSSLESS 4
#define NV_ENC_PARAMS_RC_CONSTQP 0x0
#define NV_ENC_PARAMS_RC_VBR 0x1
#define NV_ENC_PARAMS_RC_CBR 0x2
#define NV_ENC_H264_ENTROPY_CODING_MODE_CABAC 1
#define NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC 2
#else
#include <ffnvcodec/nvEncodeAPI.h>
#endif
enum preset_e : int {
_default = 0,
slow,
medium,
fast,
hp,
hq,
bd,
ll_default,
llhq,
llhp,
lossless_default, // lossless presets must be the last ones
lossless_hp,
p1 = 12, // PRESET_P1, // must be kept in sync with <libavcodec/nvenc.h>
p2, // PRESET_P2,
p3, // PRESET_P3,
p4, // PRESET_P4,
p5, // PRESET_P5,
p6, // PRESET_P6,
p7 // PRESET_P7
};
enum tune_e : int {
hq = NV_ENC_TUNING_INFO_HIGH_QUALITY,
ll = NV_ENC_TUNING_INFO_LOW_LATENCY,
ull = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY,
lossless = NV_ENC_TUNING_INFO_LOSSLESS
};
enum rc_e : int {
constqp = 0x0, /**< Constant QP mode */
vbr = 0x1, /**< Variable bitrate mode */
cbr = 0x2, /**< Constant bitrate mode */
cbr_ld_hq = 0x8, /**< low-delay CBR, high quality */
cbr_hq = 0x10, /**< CBR, high quality (slower) */
vbr_hq = 0x20 /**< VBR, high quality (slower) */
constqp = NV_ENC_PARAMS_RC_CONSTQP, /**< Constant QP mode */
vbr = NV_ENC_PARAMS_RC_VBR, /**< Variable bitrate mode */
cbr = NV_ENC_PARAMS_RC_CBR /**< Constant bitrate mode */
};
enum coder_e : int {
_auto = 0,
cabac,
cavlc
cabac = NV_ENC_H264_ENTROPY_CODING_MODE_CABAC,
cavlc = NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC,
};
std::optional<preset_e> preset_from_view(const std::string_view &preset) {
#define _CONVERT_(x) \
if(preset == #x##sv) return x
_CONVERT_(slow);
_CONVERT_(medium);
_CONVERT_(fast);
_CONVERT_(hp);
_CONVERT_(bd);
_CONVERT_(ll_default);
_CONVERT_(llhq);
_CONVERT_(llhp);
_CONVERT_(lossless_default);
_CONVERT_(lossless_hp);
if(preset == "default"sv) return _default;
_CONVERT_(p1);
_CONVERT_(p2);
_CONVERT_(p3);
_CONVERT_(p4);
_CONVERT_(p5);
_CONVERT_(p6);
_CONVERT_(p7);
#undef _CONVERT_
return std::nullopt;
}
std::optional<tune_e> tune_from_view(const std::string_view &tune) {
#define _CONVERT_(x) \
if(tune == #x##sv) return x
_CONVERT_(hq);
_CONVERT_(ll);
_CONVERT_(ull);
_CONVERT_(lossless);
#undef _CONVERT_
return std::nullopt;
}
@@ -78,9 +100,6 @@ std::optional<rc_e> rc_from_view(const std::string_view &rc) {
_CONVERT_(constqp);
_CONVERT_(vbr);
_CONVERT_(cbr);
_CONVERT_(cbr_hq);
_CONVERT_(vbr_hq);
_CONVERT_(cbr_ld_hq);
#undef _CONVERT_
return std::nullopt;
}
@@ -95,41 +114,76 @@ int coder_from_view(const std::string_view &coder) {
} // namespace nv
namespace amd {
enum quality_e : int {
_default = 0,
speed,
balanced,
//quality2,
#ifdef __APPLE__
// values accurate as of 27/12/2022, but aren't strictly necessary for MacOS build
#define AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_SPEED 10
#define AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_QUALITY 0
#define AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_BALANCED 5
#define AMF_VIDEO_ENCODER_QUALITY_PRESET_SPEED 1
#define AMF_VIDEO_ENCODER_QUALITY_PRESET_QUALITY 2
#define AMF_VIDEO_ENCODER_QUALITY_PRESET_BALANCED 0
#define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CONSTANT_QP 0
#define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CBR 3
#define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR 2
#define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR 1
#define AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CONSTANT_QP 0
#define AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CBR 1
#define AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR 2
#define AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR 3
#define AMF_VIDEO_ENCODER_UNDEFINED 0
#define AMF_VIDEO_ENCODER_CABAC 1
#define AMF_VIDEO_ENCODER_CALV 2
#else
#include <AMF/components/VideoEncoderHEVC.h>
#include <AMF/components/VideoEncoderVCE.h>
#endif
enum class quality_hevc_e : int {
speed = AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_SPEED,
quality = AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_QUALITY,
balanced = AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_BALANCED
};
enum rc_e : int {
constqp, /**< Constant QP mode */
vbr_latency, /**< Latency Constrained Variable Bitrate */
vbr_peak, /**< Peak Contrained Variable Bitrate */
cbr, /**< Constant bitrate mode */
enum class quality_h264_e : int {
speed = AMF_VIDEO_ENCODER_QUALITY_PRESET_SPEED,
quality = AMF_VIDEO_ENCODER_QUALITY_PRESET_QUALITY,
balanced = AMF_VIDEO_ENCODER_QUALITY_PRESET_BALANCED
};
enum class rc_hevc_e : int {
cqp = AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CONSTANT_QP,
vbr_latency = AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR,
vbr_peak = AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR,
cbr = AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CBR
};
enum class rc_h264_e : int {
cqp = AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CONSTANT_QP,
vbr_latency = AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR,
vbr_peak = AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR,
cbr = AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CBR
};
enum coder_e : int {
_auto = 0,
cabac,
cavlc
_auto = AMF_VIDEO_ENCODER_UNDEFINED,
cabac = AMF_VIDEO_ENCODER_CABAC,
cavlc = AMF_VIDEO_ENCODER_CALV
};
std::optional<quality_e> quality_from_view(const std::string_view &quality) {
std::optional<int> quality_from_view(const std::string_view &quality_type, int codec) {
#define _CONVERT_(x) \
if(quality == #x##sv) return x
if(quality_type == #x##sv) return codec == 0 ? (int)quality_hevc_e::x : (int)quality_h264_e::x
_CONVERT_(quality);
_CONVERT_(speed);
_CONVERT_(balanced);
//_CONVERT_(quality2);
if(quality == "default"sv) return _default;
#undef _CONVERT_
return std::nullopt;
}
std::optional<rc_e> rc_from_view(const std::string_view &rc) {
std::optional<int> rc_from_view(const std::string_view &rc, int codec) {
#define _CONVERT_(x) \
if(rc == #x##sv) return x
_CONVERT_(constqp);
if(rc == #x##sv) return codec == 0 ? (int)rc_hevc_e::x : (int)rc_h264_e::x
_CONVERT_(cqp);
_CONVERT_(vbr_latency);
_CONVERT_(vbr_peak);
_CONVERT_(cbr);
@@ -146,6 +200,82 @@ int coder_from_view(const std::string_view &coder) {
}
} // namespace amd
namespace qsv {
enum preset_e : int {
veryslow = 1,
slower = 2,
slow = 3,
medium = 4,
fast = 5,
faster = 6,
veryfast = 7
};
enum cavlc_e : int {
_auto = false,
enabled = true,
disabled = false
};
std::optional<int> preset_from_view(const std::string_view &preset) {
#define _CONVERT_(x) \
if(preset == #x##sv) return x
_CONVERT_(veryslow);
_CONVERT_(slower);
_CONVERT_(slow);
_CONVERT_(medium);
_CONVERT_(fast);
_CONVERT_(faster);
_CONVERT_(veryfast);
#undef _CONVERT_
return std::nullopt;
}
std::optional<int> coder_from_view(const std::string_view &coder) {
if(coder == "auto"sv) return _auto;
if(coder == "cabac"sv || coder == "ac"sv) return disabled;
if(coder == "cavlc"sv || coder == "vlc"sv) return enabled;
return std::nullopt;
}
} // namespace qsv
namespace vt {
enum coder_e : int {
_auto = 0,
cabac,
cavlc
};
int coder_from_view(const std::string_view &coder) {
if(coder == "auto"sv) return _auto;
if(coder == "cabac"sv || coder == "ac"sv) return cabac;
if(coder == "cavlc"sv || coder == "vlc"sv) return cavlc;
return -1;
}
int allow_software_from_view(const std::string_view &software) {
if(software == "allowed"sv || software == "forced") return 1;
return 0;
}
int force_software_from_view(const std::string_view &software) {
if(software == "forced") return 1;
return 0;
}
int rt_from_view(const std::string_view &rt) {
if(rt == "disabled" || rt == "off" || rt == "0") return 0;
return 1;
}
} // namespace vt
video_t video {
28, // qp
@@ -158,18 +288,36 @@ video_t video {
}, // software
{
nv::llhq,
std::nullopt,
-1 }, // nv
nv::p4, // preset
nv::ull, // tune
nv::cbr, // rc
nv::_auto // coder
}, // nv
{
amd::balanced,
std::nullopt,
-1 }, // amd
qsv::medium, // preset
qsv::_auto, // cavlc
}, // qsv
{}, // encoder
{}, // adapter_name
{}, // output_name
{
(int)amd::quality_h264_e::balanced, // quality (h264)
(int)amd::quality_hevc_e::balanced, // quality (hevc)
(int)amd::rc_h264_e::vbr_latency, // rate control (h264)
(int)amd::rc_hevc_e::vbr_latency, // rate control (hevc)
(int)amd::coder_e::_auto, // coder
}, // amd
{
0,
0,
1,
-1,
}, // vt
{}, // encoder
{}, // adapter_name
{}, // output_name
true // dwmflush
};
audio_t audio {};
@@ -226,15 +374,16 @@ input_t input {
};
sunshine_t sunshine {
2, // min_log_level
0, // flags
{}, // User file
{}, // Username
{}, // Password
{}, // Password Salt
SUNSHINE_CONFIG_DIR "/sunshine.conf", // config file
{}, // cmd args
2, // min_log_level
0, // flags
{}, // User file
{}, // Username
{}, // Password
{}, // Password Salt
platf::appdata().string() + "/sunshine.conf", // config file
{}, // cmd args
47989,
platf::appdata().string() + "/sunshine.log", // log file
};
bool endline(char ch) {
@@ -642,7 +791,7 @@ int apply_flags(const char *line) {
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
if(!fs::exists(stream.file_apps.c_str())) {
fs::copy_file(SUNSHINE_DEFAULT_DIR "/" APPS_JSON, stream.file_apps);
fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps);
}
for(auto &[name, val] : vars) {
@@ -655,21 +804,42 @@ void apply_config(std::unordered_map<std::string, std::string> &&vars) {
string_f(vars, "sw_preset", video.sw.preset);
string_f(vars, "sw_tune", video.sw.tune);
int_f(vars, "nv_preset", video.nv.preset, nv::preset_from_view);
int_f(vars, "nv_tune", video.nv.tune, nv::tune_from_view);
int_f(vars, "nv_rc", video.nv.rc, nv::rc_from_view);
int_f(vars, "nv_coder", video.nv.coder, nv::coder_from_view);
int_f(vars, "amd_quality", video.amd.quality, amd::quality_from_view);
int_f(vars, "amd_rc", video.amd.rc, amd::rc_from_view);
int_f(vars, "qsv_preset", video.qsv.preset, qsv::preset_from_view);
int_f(vars, "qsv_coder", video.qsv.cavlc, qsv::coder_from_view);
std::string quality;
string_f(vars, "amd_quality", quality);
if(!quality.empty()) {
video.amd.quality_h264 = amd::quality_from_view(quality, 1);
video.amd.quality_hevc = amd::quality_from_view(quality, 0);
}
std::string rc;
string_f(vars, "amd_rc", rc);
int_f(vars, "amd_coder", video.amd.coder, amd::coder_from_view);
if(!rc.empty()) {
video.amd.rc_h264 = amd::rc_from_view(rc, 1);
video.amd.rc_hevc = amd::rc_from_view(rc, 0);
}
int_f(vars, "vt_coder", video.vt.coder, vt::coder_from_view);
int_f(vars, "vt_software", video.vt.allow_sw, vt::allow_software_from_view);
int_f(vars, "vt_software", video.vt.require_sw, vt::force_software_from_view);
int_f(vars, "vt_realtime", video.vt.realtime, vt::rt_from_view);
string_f(vars, "encoder", video.encoder);
string_f(vars, "adapter_name", video.adapter_name);
string_f(vars, "output_name", video.output_name);
bool_f(vars, "dwmflush", video.dwmflush);
path_f(vars, "pkey", nvhttp.pkey);
path_f(vars, "cert", nvhttp.cert);
string_f(vars, "sunshine_name", nvhttp.sunshine_name);
path_f(vars, "log_path", config::sunshine.log_file);
path_f(vars, "file_state", nvhttp.file_state);
// Must be run after "file_state"
@@ -838,8 +1008,14 @@ int parse(int argc, char *argv[]) {
}
}
// create appdata folder if it does not exist
if(!boost::filesystem::exists(platf::appdata().string())) {
boost::filesystem::create_directory(platf::appdata().string());
}
// create config file if it does not exist
if(!fs::exists(sunshine.config_file)) {
fs::copy_file(SUNSHINE_DEFAULT_DIR "/sunshine.conf", sunshine.config_file);
std::ofstream { sunshine.config_file }; // create empty config file
}
auto vars = parse_config(read_file(sunshine.config_file.c_str()));

View File

@@ -23,19 +23,35 @@ struct video_t {
struct {
std::optional<int> preset;
std::optional<int> tune;
std::optional<int> rc;
int coder;
} nv;
struct {
std::optional<int> quality;
std::optional<int> rc;
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;
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 {
@@ -111,6 +127,7 @@ struct sunshine_t {
} cmd;
std::uint16_t port;
std::string log_file;
};
extern video_t video;

View File

@@ -1,4 +1,3 @@
//
// Created by TheElixZammuto on 2021-05-09.
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
@@ -7,13 +6,18 @@
#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>
@@ -52,7 +56,7 @@ void print_req(const req_https_t &request) {
BOOST_LOG(debug) << "DESTINATION :: "sv << request->path;
for(auto &[name, val] : request->header) {
BOOST_LOG(debug) << name << " -- " << val;
BOOST_LOG(debug) << name << " -- " << (name == "Authorization" ? "CREDENTIALS REDACTED" : val);
}
BOOST_LOG(debug) << " [--] "sv;
@@ -65,7 +69,7 @@ void print_req(const req_https_t &request) {
}
void send_unauthorized(resp_https_t response, req_https_t request) {
auto address = request->remote_endpoint_address();
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")" }
@@ -74,7 +78,7 @@ void send_unauthorized(resp_https_t response, req_https_t request) {
}
void send_redirect(resp_https_t response, req_https_t request, const char *path) {
auto address = request->remote_endpoint_address();
auto address = request->remote_endpoint().address().to_string();
BOOST_LOG(info) << "Web UI: ["sv << address << "] -- not authorized"sv;
const SimpleWeb::CaseInsensitiveMultimap headers {
{ "Location", path }
@@ -83,7 +87,7 @@ void send_redirect(resp_https_t response, req_https_t request, const char *path)
}
bool authenticate(resp_https_t response, req_https_t request) {
auto address = request->remote_endpoint_address();
auto address = request->remote_endpoint().address().to_string();
auto ip_type = net::from_address(address);
if(ip_type > http::origin_web_ui_allowed) {
@@ -92,9 +96,9 @@ bool authenticate(resp_https_t response, req_https_t request) {
return false;
}
//If credentials are shown, redirect the user to a /welcome page
if(config::sunshine.username.empty()){
send_redirect(response,request,"/welcome");
// If credentials are shown, redirect the user to a /welcome page
if(config::sunshine.username.empty()) {
send_redirect(response, request, "/welcome");
return false;
}
@@ -165,9 +169,12 @@ void getAppsPage(resp_https_t response, req_https_t request) {
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);
response->write(header + content, headers);
}
void getClientsPage(resp_https_t response, req_https_t request) {
@@ -202,8 +209,8 @@ void getPasswordPage(resp_https_t response, req_https_t request) {
void getWelcomePage(resp_https_t response, req_https_t request) {
print_req(request);
if(!config::sunshine.username.empty()){
send_redirect(response,request,"/");
if(!config::sunshine.username.empty()) {
send_redirect(response, request, "/");
return;
}
std::string header = read_file(WEB_DIR "header-no-nav.html");
@@ -211,6 +218,71 @@ void getWelcomePage(resp_https_t response, req_https_t request) {
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) {
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) {
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);
if(relPath.extension() == ".ttf" or relPath.extension() == ".woff2") {
// Fonts are read differntly
SimpleWeb::CaseInsensitiveMultimap headers;
std::ifstream in((filePath).c_str(), std::ios::binary);
headers.emplace("Content-Type", "font/" + filePath.extension().string().substr(1));
response->write(SimpleWeb::StatusCode::success_ok, in, headers);
}
else {
std::string content = read_file((filePath.string()).c_str());
response->write(content);
}
}
}
void getApps(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
@@ -220,6 +292,17 @@ void getApps(resp_https_t response, req_https_t request) {
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;
@@ -240,7 +323,7 @@ void saveApp(resp_https_t response, req_https_t request) {
BOOST_LOG(fatal) << config::stream.file_apps;
try {
//TODO: Input Validation
// TODO: Input Validation
pt::read_json(ss, inputTree);
pt::read_json(config::stream.file_apps, fileTree);
@@ -261,7 +344,7 @@ void saveApp(resp_https_t response, req_https_t request) {
apps_node.push_back(std::make_pair("", inputTree));
}
else {
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
// 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) {
@@ -314,7 +397,7 @@ void deleteApp(resp_https_t response, req_https_t request) {
return;
}
else {
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
// 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) {
@@ -338,6 +421,67 @@ void deleteApp(resp_https_t response, req_https_t request) {
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;
@@ -353,6 +497,7 @@ void getConfig(resp_https_t response, req_https_t request) {
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()));
@@ -378,7 +523,7 @@ void saveConfig(resp_https_t response, req_https_t request) {
});
pt::ptree inputTree;
try {
//TODO: Input Validation
// TODO: Input Validation
pt::read_json(ss, inputTree);
for(const auto &kv : inputTree) {
std::string value = inputTree.get<std::string>(kv.first);
@@ -396,6 +541,37 @@ void saveConfig(resp_https_t response, req_https_t request) {
}
}
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;
@@ -414,7 +590,7 @@ void savePassword(resp_https_t response, req_https_t request) {
});
try {
//TODO: Input Validation
// 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");
@@ -422,16 +598,18 @@ void savePassword(resp_https_t response, req_https_t request) {
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){
if(newUsername.length() == 0) {
outputTree.put("status", false);
outputTree.put("error", "Invalid Username");
} else {
}
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 {
}
else {
http::save_user_creds(config::sunshine.credentials_file, newUsername, newPassword);
http::reload_user_creds(config::sunshine.credentials_file);
outputTree.put("status", true);
@@ -468,7 +646,7 @@ void savePin(resp_https_t response, req_https_t request) {
});
try {
//TODO: Input Validation
// TODO: Input Validation
pt::read_json(ss, inputTree);
std::string pin = inputTree.get<std::string>("pin");
outputTree.put("status", nvhttp::pin(pin));
@@ -481,47 +659,78 @@ void savePin(resp_https_t response, req_https_t request) {
}
}
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);
auto ctx = std::make_shared<boost::asio::ssl::context>(boost::asio::ssl::context::tls);
ctx->use_certificate_chain_file(config::nvhttp.cert);
ctx->use_private_key_file(config::nvhttp.pkey, boost::asio::ssl::context::pem);
https_server_t server { ctx, 0 };
server.default_resource = 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["^/api/pin"]["POST"] = savePin;
server.resource["^/api/apps$"]["GET"] = getApps;
server.resource["^/api/apps$"]["POST"] = saveApp;
server.resource["^/api/config$"]["GET"] = getConfig;
server.resource["^/api/config$"]["POST"] = saveConfig;
server.resource["^/api/password$"]["POST"] = savePassword;
server.resource["^/api/apps/([0-9]+)$"]["DELETE"] = deleteApp;
server.config.reuse_address = true;
server.config.address = "0.0.0.0"s;
server.config.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;
try {
server.bind();
BOOST_LOG(info) << "Configuration UI available at [https://localhost:"sv << port_https << "]";
}
catch(boost::system::system_error &err) {
BOOST_LOG(fatal) << "Couldn't bind http server to ports ["sv << port_https << "]: "sv << err.what();
shutdown_event->raise(true);
return;
}
auto accept_and_run = [&](auto *server) {
try {
server->accept_and_run();
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
@@ -529,7 +738,7 @@ void start() {
return;
}
BOOST_LOG(fatal) << "Couldn't start Configuration HTTPS server to port ["sv << port_https << "]: "sv << err.what();
BOOST_LOG(fatal) << "Couldn't start Configuration HTTPS server on port ["sv << port_https << "]: "sv << err.what();
shutdown_event->raise(true);
return;
}

View File

@@ -1,6 +1,4 @@
//
// Created by loki on 6/3/19.
//
#ifndef SUNSHINE_CONFIGHTTP_H
#define SUNSHINE_CONFIGHTTP_H
@@ -18,4 +16,4 @@ constexpr auto PORT_HTTPS = 1;
void start();
} // namespace confighttp
#endif //SUNSHINE_CONFIGHTTP_H
#endif // SUNSHINE_CONFIGHTTP_H

View File

@@ -1,13 +1,9 @@
//
// Created by loki on 5/31/19.
//
#include "crypto.h"
#include <openssl/pem.h>
namespace crypto {
using big_num_t = util::safe_ptr<BIGNUM, BN_free>;
//using rsa_t = util::safe_ptr<RSA, RSA_free>;
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() } {}
@@ -22,7 +18,7 @@ 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
// 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;
@@ -274,7 +270,7 @@ int cbc_t::encrypt(const std::string_view &plaintext, std::uint8_t *cipher, aes_
int len;
int size = plaintext.size(); //round_to_pkcs7_padded(plaintext.size());
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) {
@@ -317,12 +313,7 @@ aes_t gen_aes_key(const std::array<uint8_t, 16> &salt, const std::string_view &p
sha256_t hash(const std::string_view &plaintext) {
sha256_t hsh;
SHA256_CTX sha256;
SHA256_Init(&sha256);
SHA256_Update(&sha256, plaintext.data(), plaintext.size());
SHA256_Final(hsh.data(), &sha256);
EVP_Digest(plaintext.data(), plaintext.size(), hsh.data(), nullptr, EVP_sha256(), nullptr);
return hsh;
}
@@ -411,17 +402,20 @@ std::vector<uint8_t> sign(const pkey_t &pkey, const std::string_view &data, cons
creds_t gen_creds(const std::string_view &cn, std::uint32_t key_bits) {
x509_t x509 { X509_new() };
pkey_t pkey { EVP_PKEY_new() };
pkey_ctx_t ctx { EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, nullptr) };
pkey_t pkey;
big_num_t big_num { BN_new() };
BN_set_word(big_num.get(), RSA_F4);
auto rsa = RSA_new();
RSA_generate_key_ex(rsa, key_bits, big_num.get(), nullptr);
EVP_PKEY_assign_RSA(pkey.get(), rsa);
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);
ASN1_INTEGER_set(X509_get_serialNumber(x509.get()), 0);
// 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
@@ -492,4 +486,4 @@ std::string rand_alphabet(std::size_t bytes, const std::string_view &alphabet) {
return value;
}
} // namespace crypto
} // namespace crypto

View File

@@ -1,6 +1,4 @@
//
// Created by loki on 6/1/19.
//
#ifndef SUNSHINE_CRYPTO_H
#define SUNSHINE_CRYPTO_H
@@ -32,6 +30,8 @@ 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);
@@ -84,8 +84,8 @@ public:
class ecb_t : public cipher_t {
public:
ecb_t() = default;
ecb_t(ecb_t &&) noexcept = default;
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);
@@ -96,8 +96,8 @@ public:
class gcm_t : public cipher_t {
public:
gcm_t() = default;
gcm_t(gcm_t &&) noexcept = default;
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);
@@ -115,8 +115,8 @@ public:
class cbc_t : public cipher_t {
public:
cbc_t() = default;
cbc_t(cbc_t &&) noexcept = default;
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);

View File

@@ -13,6 +13,7 @@
#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"
@@ -44,7 +45,7 @@ int init() {
if(clean_slate) {
unique_id = util::uuid_t::generate().string();
auto dir = std::filesystem::temp_directory_path() / "Sushine"sv;
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();
}
@@ -56,7 +57,8 @@ int init() {
}
if(user_creds_exist(config::sunshine.credentials_file)) {
if(reload_user_creds(config::sunshine.credentials_file)) return -1;
} else {
}
else {
BOOST_LOG(info) << "Open the Web UI to set your new username and password and getting started";
}
return 0;
@@ -179,4 +181,55 @@ int create_creds(const std::string &pkey, const std::string &cert) {
return 0;
}
} // namespace http
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

View File

@@ -12,8 +12,12 @@ int save_user_creds(
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
} // namespace http

View File

@@ -1,14 +1,14 @@
//
// Created by loki on 6/20/19.
//
// define uint32_t for <moonlight-common-c/src/Input.h>
#include <cstdint>
extern "C" {
#include <moonlight-common-c/src/Input.h>
#include <moonlight-common-c/src/Limelight.h>
}
#include <bitset>
#include <unordered_map>
#include "config.h"
#include "input.h"
@@ -88,7 +88,7 @@ struct gamepad_t {
// When emulating the HOME button, we may need to artificially release the back button.
// Afterwards, the gamepad state on sunshine won't match the state on Moonlight.
// To prevent Sunshine from sending erronious input data to the active application,
// To prevent Sunshine from sending erroneous input data to the active application,
// Sunshine forces the button to be in a specific state until the gamepad state matches that of
// Moonlight once more.
button_state_e back_button_state;
@@ -155,44 +155,6 @@ inline int apply_shortcut(short keyCode) {
return 0;
}
/**
* Update flags for keyboard shortcut combo's
*/
inline void update_shortcutFlags(int *flags, short keyCode, bool release) {
switch(keyCode) {
case VKEY_SHIFT:
case VKEY_LSHIFT:
case VKEY_RSHIFT:
if(release) {
*flags &= ~input_t::SHIFT;
}
else {
*flags |= input_t::SHIFT;
}
break;
case VKEY_CONTROL:
case VKEY_LCONTROL:
case VKEY_RCONTROL:
if(release) {
*flags &= ~input_t::CTRL;
}
else {
*flags |= input_t::CTRL;
}
break;
case VKEY_MENU:
case VKEY_LMENU:
case VKEY_RMENU:
if(release) {
*flags &= ~input_t::ALT;
}
else {
*flags |= input_t::ALT;
}
break;
}
}
void print(PNV_REL_MOUSE_MOVE_PACKET packet) {
BOOST_LOG(debug)
<< "--begin relative mouse move packet--"sv << std::endl
@@ -214,7 +176,7 @@ void print(PNV_ABS_MOUSE_MOVE_PACKET packet) {
void print(PNV_MOUSE_BUTTON_PACKET packet) {
BOOST_LOG(debug)
<< "--begin mouse button packet--"sv << std::endl
<< "action ["sv << util::hex(packet->action).to_string_view() << ']' << std::endl
<< "action ["sv << util::hex(packet->header.magic).to_string_view() << ']' << std::endl
<< "button ["sv << util::hex(packet->button).to_string_view() << ']' << std::endl
<< "--end mouse button packet--"sv;
}
@@ -226,15 +188,31 @@ void print(PNV_SCROLL_PACKET packet) {
<< "--end mouse scroll packet--"sv;
}
void print(PSS_HSCROLL_PACKET packet) {
BOOST_LOG(debug)
<< "--begin mouse hscroll packet--"sv << std::endl
<< "scrollAmount ["sv << util::endian::big(packet->scrollAmount) << ']' << std::endl
<< "--end mouse hscroll packet--"sv;
}
void print(PNV_KEYBOARD_PACKET packet) {
BOOST_LOG(debug)
<< "--begin keyboard packet--"sv << std::endl
<< "keyAction ["sv << util::hex(packet->keyAction).to_string_view() << ']' << std::endl
<< "keyAction ["sv << util::hex(packet->header.magic).to_string_view() << ']' << std::endl
<< "keyCode ["sv << util::hex(packet->keyCode).to_string_view() << ']' << std::endl
<< "modifiers ["sv << util::hex(packet->modifiers).to_string_view() << ']' << std::endl
<< "flags ["sv << util::hex(packet->flags).to_string_view() << ']' << std::endl
<< "--end keyboard packet--"sv;
}
void print(PNV_UNICODE_PACKET packet) {
std::string text(packet->text, util::endian::big(packet->header.size) - sizeof(packet->header.magic));
BOOST_LOG(debug)
<< "--begin unicode packet--"sv << std::endl
<< "text ["sv << text << ']' << std::endl
<< "--end unicode packet--"sv;
}
void print(PNV_MULTI_CONTROLLER_PACKET packet) {
// Moonlight spams controller packet even when not necessary
BOOST_LOG(verbose)
@@ -251,33 +229,35 @@ void print(PNV_MULTI_CONTROLLER_PACKET packet) {
<< "--end controller packet--"sv;
}
constexpr int PACKET_TYPE_SCROLL_OR_KEYBOARD = PACKET_TYPE_SCROLL;
void print(void *input) {
int input_type = util::endian::big(*(int *)input);
void print(void *payload) {
auto header = (PNV_INPUT_HEADER)payload;
switch(input_type) {
case PACKET_TYPE_REL_MOUSE_MOVE:
print((PNV_REL_MOUSE_MOVE_PACKET)input);
switch(util::endian::little(header->magic)) {
case MOUSE_MOVE_REL_MAGIC_GEN5:
print((PNV_REL_MOUSE_MOVE_PACKET)payload);
break;
case PACKET_TYPE_ABS_MOUSE_MOVE:
print((PNV_ABS_MOUSE_MOVE_PACKET)input);
case MOUSE_MOVE_ABS_MAGIC:
print((PNV_ABS_MOUSE_MOVE_PACKET)payload);
break;
case PACKET_TYPE_MOUSE_BUTTON:
print((PNV_MOUSE_BUTTON_PACKET)input);
case MOUSE_BUTTON_DOWN_EVENT_MAGIC_GEN5:
case MOUSE_BUTTON_UP_EVENT_MAGIC_GEN5:
print((PNV_MOUSE_BUTTON_PACKET)payload);
break;
case PACKET_TYPE_SCROLL_OR_KEYBOARD: {
char *tmp_input = (char *)input + 4;
if(tmp_input[0] == 0x0A) {
print((PNV_SCROLL_PACKET)input);
}
else {
print((PNV_KEYBOARD_PACKET)input);
}
case SCROLL_MAGIC_GEN5:
print((PNV_SCROLL_PACKET)payload);
break;
}
case PACKET_TYPE_MULTI_CONTROLLER:
print((PNV_MULTI_CONTROLLER_PACKET)input);
case SS_HSCROLL_MAGIC:
print((PSS_HSCROLL_PACKET)payload);
break;
case KEY_DOWN_EVENT_MAGIC:
case KEY_UP_EVENT_MAGIC:
print((PNV_KEYBOARD_PACKET)payload);
break;
case UTF8_TEXT_EVENT_MAGIC:
print((PNV_UNICODE_PACKET)payload);
break;
case MULTI_CONTROLLER_MAGIC_GEN5:
print((PNV_MULTI_CONTROLLER_PACKET)payload);
break;
}
}
@@ -333,14 +313,8 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_ABS_MOUSE_MOVE_PACKET pack
}
void passthrough(std::shared_ptr<input_t> &input, PNV_MOUSE_BUTTON_PACKET packet) {
auto constexpr BUTTON_RELEASED = 0x09;
auto constexpr BUTTON_LEFT = 0x01;
auto constexpr BUTTON_RIGHT = 0x03;
auto release = packet->action == BUTTON_RELEASED;
auto button = util::endian::big(packet->button);
auto release = util::endian::little(packet->header.magic) == MOUSE_BUTTON_UP_EVENT_MAGIC_GEN5;
auto button = util::endian::big(packet->button);
if(button > 0 && button < mouse_press.size()) {
if(mouse_press[button] != release) {
// button state is already what we want
@@ -353,11 +327,11 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_MOUSE_BUTTON_PACKET packet
/*/
* When Moonlight sends mouse input through absolute coordinates,
* it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT.
* As a result, Sunshine will left click on hyperlinks in the browser before right clicking
* As a result, Sunshine will left-click on hyperlinks in the browser before right-clicking
*
* This can be solved by delaying BUTTON_LEFT, however, any delay on input is undesirable during gaming
* As a compromise, Sunshine will only put delays on BUTTON_LEFT when
* absolute mouse coordinates have been send.
* absolute mouse coordinates have been sent.
*
* Try to make sure BUTTON_RIGHT gets called before BUTTON_LEFT is released.
*
@@ -396,18 +370,6 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_MOUSE_BUTTON_PACKET packet
platf::button_mouse(platf_input, button, release);
}
void repeat_key(short key_code) {
// If key no longer pressed, stop repeating
if(!key_press[key_code]) {
key_press_repeat_id = nullptr;
return;
}
platf::keyboard(platf_input, key_code, false);
key_press_repeat_id = task_pool.pushDelayed(repeat_key, config::input.key_repeat_period, key_code).task_id;
}
short map_keycode(short keycode) {
auto it = config::input.keybindings.find(keycode);
if(it != std::end(config::input.keybindings)) {
@@ -417,17 +379,65 @@ short map_keycode(short keycode) {
return keycode;
}
void passthrough(std::shared_ptr<input_t> &input, PNV_KEYBOARD_PACKET packet) {
auto constexpr BUTTON_RELEASED = 0x04;
/**
* Update flags for keyboard shortcut combo's
*/
inline void update_shortcutFlags(int *flags, short keyCode, bool release) {
switch(keyCode) {
case VKEY_SHIFT:
case VKEY_LSHIFT:
case VKEY_RSHIFT:
if(release) {
*flags &= ~input_t::SHIFT;
}
else {
*flags |= input_t::SHIFT;
}
break;
case VKEY_CONTROL:
case VKEY_LCONTROL:
case VKEY_RCONTROL:
if(release) {
*flags &= ~input_t::CTRL;
}
else {
*flags |= input_t::CTRL;
}
break;
case VKEY_MENU:
case VKEY_LMENU:
case VKEY_RMENU:
if(release) {
*flags &= ~input_t::ALT;
}
else {
*flags |= input_t::ALT;
}
break;
}
}
auto release = packet->keyAction == BUTTON_RELEASED;
void repeat_key(short key_code) {
// If key no longer pressed, stop repeating
if(!key_press[key_code]) {
key_press_repeat_id = nullptr;
return;
}
platf::keyboard(platf_input, map_keycode(key_code), false);
key_press_repeat_id = task_pool.pushDelayed(repeat_key, config::input.key_repeat_period, key_code).task_id;
}
void passthrough(std::shared_ptr<input_t> &input, PNV_KEYBOARD_PACKET packet) {
auto release = util::endian::little(packet->header.magic) == KEY_UP_EVENT_MAGIC;
auto keyCode = packet->keyCode & 0x00FF;
auto &pressed = key_press[keyCode];
if(!pressed) {
if(!release) {
// A new key has been pressed down, we need to check for key combo's
// If a keycombo has been pressed down, don't pass it through
// If a key-combo has been pressed down, don't pass it through
if(input->shortcutFlags == input_t::SHORTCUT && apply_shortcut(keyCode) > 0) {
return;
}
@@ -452,7 +462,7 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_KEYBOARD_PACKET packet) {
pressed = !release;
update_shortcutFlags(&input->shortcutFlags, keyCode, release);
update_shortcutFlags(&input->shortcutFlags, map_keycode(keyCode), release);
platf::keyboard(platf_input, map_keycode(keyCode), release);
}
@@ -460,7 +470,16 @@ void passthrough(PNV_SCROLL_PACKET packet) {
platf::scroll(platf_input, util::endian::big(packet->scrollAmt1));
}
int updateGamepads(std::vector<gamepad_t> &gamepads, std::int16_t old_state, std::int16_t new_state, platf::rumble_queue_t rumble_queue) {
void passthrough(PSS_HSCROLL_PACKET packet) {
platf::hscroll(platf_input, util::endian::big(packet->scrollAmount));
}
void passthrough(PNV_UNICODE_PACKET packet) {
auto size = util::endian::big(packet->header.size) - sizeof(packet->header.magic);
platf::unicode(platf_input, packet->text, size);
}
int updateGamepads(std::vector<gamepad_t> &gamepads, std::int16_t old_state, std::int16_t new_state, const platf::rumble_queue_t &rumble_queue) {
auto xorGamepadMask = old_state ^ new_state;
if(!xorGamepadMask) {
return 0;
@@ -486,7 +505,7 @@ int updateGamepads(std::vector<gamepad_t> &gamepads, std::int16_t old_state, std
return -1;
}
if(platf::alloc_gamepad(platf_input, id, std::move(rumble_queue))) {
if(platf::alloc_gamepad(platf_input, id, rumble_queue)) {
free_id(gamepadMask, id);
// allocating a gamepad failed: solution: ignore gamepads
// The implementations of platf::alloc_gamepad already has logging
@@ -601,31 +620,33 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_MULTI_CONTROLLER_PACKET pa
void passthrough_helper(std::shared_ptr<input_t> input, std::vector<std::uint8_t> &&input_data) {
void *payload = input_data.data();
auto header = (PNV_INPUT_HEADER)payload;
int input_type = util::endian::big(*(int *)payload);
switch(input_type) {
case PACKET_TYPE_REL_MOUSE_MOVE:
switch(util::endian::little(header->magic)) {
case MOUSE_MOVE_REL_MAGIC_GEN5:
passthrough(input, (PNV_REL_MOUSE_MOVE_PACKET)payload);
break;
case PACKET_TYPE_ABS_MOUSE_MOVE:
case MOUSE_MOVE_ABS_MAGIC:
passthrough(input, (PNV_ABS_MOUSE_MOVE_PACKET)payload);
break;
case PACKET_TYPE_MOUSE_BUTTON:
case MOUSE_BUTTON_DOWN_EVENT_MAGIC_GEN5:
case MOUSE_BUTTON_UP_EVENT_MAGIC_GEN5:
passthrough(input, (PNV_MOUSE_BUTTON_PACKET)payload);
break;
case PACKET_TYPE_SCROLL_OR_KEYBOARD: {
char *tmp_input = (char *)payload + 4;
if(tmp_input[0] == 0x0A) {
passthrough((PNV_SCROLL_PACKET)payload);
}
else {
passthrough(input, (PNV_KEYBOARD_PACKET)payload);
}
case SCROLL_MAGIC_GEN5:
passthrough((PNV_SCROLL_PACKET)payload);
break;
}
case PACKET_TYPE_MULTI_CONTROLLER:
case SS_HSCROLL_MAGIC:
passthrough((PSS_HSCROLL_PACKET)payload);
break;
case KEY_DOWN_EVENT_MAGIC:
case KEY_UP_EVENT_MAGIC:
passthrough(input, (PNV_KEYBOARD_PACKET)payload);
break;
case UTF8_TEXT_EVENT_MAGIC:
passthrough((PNV_UNICODE_PACKET)payload);
break;
case MULTI_CONTROLLER_MAGIC_GEN5:
passthrough(input, (PNV_MULTI_CONTROLLER_PACKET)payload);
break;
}

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