Compare commits

...

368 Commits

Author SHA1 Message Date
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
232 changed files with 11232 additions and 5332 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

1
.docker_platforms Normal file
View File

@@ -0,0 +1 @@
linux/amd64

16
.dockerignore Normal file
View File

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

7
.flake8 Normal file
View File

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

View File

@@ -1,3 +1,4 @@
---
name: Bug Report
description: Create a bug report to help us improve.
body:
@@ -5,7 +6,22 @@ body:
attributes:
value: >
**THIS IS NOT THE PLACE TO ASK FOR SUPPORT!**
Please use [Github Discussions](https://github.com/SunshineStream/Sunshine/discussions) for support issues.
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: textarea
id: description
attributes:
@@ -23,35 +39,68 @@ body:
attributes:
label: Additional Context
description: Add any other context about the bug here.
- type: input
- type: dropdown
id: os
attributes:
label: Sunshine Host Operating System and Version
placeholder: eg. Windows 10, macOS 10.15, Ubuntu 20.04, etc.
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: input
id: architecture
- type: dropdown
id: os-architecture
attributes:
label: Architecture
placeholder: e.g. 32 bit, 64 bit, arm
validations:
required: true
options:
- 32 bit
- 64 bit
- arm
- other, n/a
- type: input
id: version
attributes:
label: Sunshine Version
placeholder: eg. 0.11.1
label: Sunshine commit or version
placeholder: eg. 0.14.0
validations:
required: true
- type: input
- type: dropdown
id: package_type
attributes:
label: Package
description: The package you installed
options:
- Linux - AppImage
- Linux - deb
- 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.
placeholder: e.g. Intel, AMD, Nvidia
validations:
required: true
options:
- AMD
- Intel
- Nvidia
- none (software encoding)
- type: input
id: graphics_model
attributes:
@@ -72,11 +121,20 @@ body:
id: capture_method
attributes:
label: Capture Method (Linux Only)
description: The driver/mesa version of the installed graphics card.
placeholder: e.g. PipeWire/KVM/X11
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.
Make sure to close your issue when it's solved! If you found the solution yourself please comment
so that others benefit from it.

View File

@@ -1,8 +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: Github Discussions
url: https://github.com/SunshineStream/Sunshine/discussions
about: General discussion, support, feature requests and more!
- name: Discord support
url: https://discord.com/invite/CGg5JxN
about: Ask question about Sunshine in Discord
- 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

38
.github/dependabot.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.
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
time: "00:00"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "00:00"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
time: "00:00"
target-branch: "nightly"
open-pull-requests-limit: 10
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "00:00"
target-branch: "nightly"
open-pull-requests-limit: 10

View File

@@ -1,13 +1,16 @@
---
# 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.
@@ -23,7 +26,7 @@ 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
[Discord Server](https://discord.com/invite/CGg5JxN) to get help. Thanks.
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks.
close: true
lock: true
lock-reason: 'off-topic'

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

@@ -0,0 +1,24 @@
## 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)
- [ ] Documentation update (changes to documentation)
- [ ] Repository update (changes to repository files)
## Changelog Summary
<!--- Summarize all the changes in a bulleted list. --->

View File

@@ -1,26 +0,0 @@
## Description
Please include a summary of the changes.
### Screenshot
Include screenshots if the changes are UI-related.
### Issues Fixed or Closed
- Fixes #(issue)
## Type of Change
Please delete options that are not relevant.
- [ ] 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)
## Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated the documentation blocks for new or existing components

1019
.github/workflows/CI.yml vendored

File diff suppressed because it is too large Load Diff

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

@@ -0,0 +1,31 @@
---
# 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.
name: Auto create PR
on:
push:
branches:
- 'nightly'
jobs:
create_pr:
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 }}

59
.github/workflows/automerge.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.
name: Automerge PR
on:
pull_request:
types:
- opened
- synchronize
jobs:
autoapprove:
if: >
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
contains(fromJson('["LizardByte-bot"]'), github.actor)
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:
needs: [autoapprove]
runs-on: ubuntu-latest
concurrency:
group: automerge-${{ github.ref }}
cancel-in-progress: true
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: ""
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

32
.github/workflows/autoupdate.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.
# This workflow is designed to work with:
# - automerge workflows
# It uses GitHub 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.
name: autoupdate
on:
push:
branches:
- 'nightly'
jobs:
autoupdate-for-bot:
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:
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
PR_FILTER: "labelled"
PR_LABELS: "autoupdate"
PR_READY_STATE: "ready_for_review"
MERGE_CONFLICT_ACTION: "ignore"

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

@@ -0,0 +1,203 @@
---
# 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.
name: CI Docker
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
push:
branches: [master, nightly]
workflow_dispatch:
jobs:
check_dockerfile:
name: Check Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check
id: check
run: |
if [ -f "./Dockerfile" ]
then
FOUND=true
else
FOUND=false
fi
echo "dockerfile=${FOUND}" >> $GITHUB_OUTPUT
outputs:
dockerfile: ${{ steps.check.outputs.dockerfile }}
lint_dockerfile:
name: Lint Dockerfile
needs: [check_dockerfile]
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Hadolint
id: hadolint
uses: hadolint/hadolint-action@v2.1.0
with:
dockerfile: ./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
check_changelog:
name: Check Changelog
needs: [check_dockerfile]
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
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 }}
docker:
name: Docker
needs: [check_dockerfile, check_changelog]
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare
id: prepare
env:
NEXT_VERSION: ${{ 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},ghcr.io/${BASE_TAG}:${COMMIT:0:7}"
if [[ $GITHUB_REF == refs/heads/master ]]; then
TAGS="${TAGS},${BASE_TAG}:latest,ghcr.io/${BASE_TAG}:latest"
TAGS="${TAGS},${BASE_TAG}:master,ghcr.io/${BASE_TAG}:master"
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then
TAGS="${TAGS},${BASE_TAG}:nightly,ghcr.io/${BASE_TAG}:nightly"
else
TAGS="${TAGS},${BASE_TAG}:test,ghcr.io/${BASE_TAG}:test"
fi
if [[ ${NEXT_VERSION} != "" ]]; then
TAGS="${TAGS},${BASE_TAG}:${NEXT_VERSION},ghcr.io/${BASE_TAG}:${NEXT_VERSION}"
fi
# read the platforms from `.docker_platforms`
PLATFORMS=$(<.docker_platforms)
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "commit=${COMMIT}" >> $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: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- 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 and push
uses: docker/build-push-action@v3
with:
context: ./
file: ./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: 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

View File

@@ -0,0 +1,60 @@
---
# 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.
name: Clang Format Lint
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
jobs:
check_src:
name: Check src
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check
id: check
run: |
if [ -d "./src" ]
then
FOUND=true
else
FOUND=false
fi
echo "src=${FOUND}" >> $GITHUB_OUTPUT
outputs:
src: ${{ steps.check.outputs.src }}
lint:
name: Clang Format Lint
needs: [check_src]
if: ${{ needs.check_src.outputs.src == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clang format lint
uses: DoozyX/clang-format-lint-action@v0.14
with:
source: './src'
extensions: 'cpp,h,m,mm'
clangFormatVersion: 13
style: file
inplace: false
- name: Upload Artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: clang-format-fixes
path: src/

View File

@@ -1,3 +1,8 @@
---
# 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.
name: Stale Issues / PRs
on:
@@ -6,45 +11,46 @@ on:
jobs:
stale:
name: Check Issues / PRs
name: Check Stale Issues / PRs
runs-on: ubuntu-latest
steps:
- name: Stale
uses: actions/stale@v3
uses: actions/stale@v6
with:
stale-issue-message: >
This issue is stale because it has been open for 30 days with no activity.
Remove the stale label or comment, otherwise this will be closed in 5 days.
close-issue-message: >
This issue was closed because it has been stalled for 5 days with no activity.
stale-issue-label: 'stale'
exempt-issue-labels: 'added,fixed,type:enhancement,status:awaiting-triage,status:in-progress'
stale-pr-message: >
This PR is stale because it has been open for 30 days with no activity.
Remove the stale label or comment, otherwise this will be closed in 5 days.
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 5 days with no activity.
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'
exempt-pr-labels: 'status:in-progress'
days-before-stale: 30
days-before-close: 5
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@v3
uses: actions/stale@v6
with:
stale-issue-message: >
Invalid issues template.
close-issue-message: >
This issue was closed because the the template was not completed after 5 days.
stale-issue-label: 'invalid:template-incomplete'
skip-stale-issue-message: true
stale-pr-message: >
Invalid PR template.
close-pr-message: >
This PR was closed because the the template was not completed after 5 days.
stale-pr-label: 'invalid:template-incomplete'
exempt-pr-labels: 'status:in-progress'
skip-stale-pr-message: true
only-labels: 'invalid:template-incomplete'
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 }}

View File

@@ -1,10 +1,15 @@
name: Label Actions
---
# 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.
name: Issues
on:
issues:
types: [labeled, unlabeled]
discussion:
types: [ labeled, unlabeled ]
types: [labeled, unlabeled]
jobs:
label:
@@ -14,4 +19,4 @@ jobs:
- name: Label Actions
uses: dessant/label-actions@v2
with:
github-token: ${{ github.token }}
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

View File

@@ -1,3 +1,8 @@
---
# 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.
name: Pull Requests
on:
@@ -5,31 +10,18 @@ on:
types: [opened, synchronize, edited, reopened]
jobs:
check-branch:
check-pull-request:
name: Check Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Branch check
if: ( github.head_ref == 'repo-sync/common-repo-files/default' && github.base_ref == 'master' ) || ( github.head_ref == 'nightly' && github.base_ref == 'master' )
run: |
echo Base: "$GITHUB_BASE_REF"
echo Head: "$GITHUB_HEAD_REF"
echo "branch=True" >> $GITHUB_ENV
- name: Comment on Pull Request
uses: mshick/add-pr-comment@v1
if: github.base_ref != 'nightly' && env.branch != 'True'
- uses: Vankka/pr-target-branch-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: Pull requests must be made to the `nightly` branch. Thanks.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]'
- name: Fail Workflow
if: github.base_ref != 'nightly' && env.branch != 'True'
run: |
echo Base: "$GITHUB_BASE_REF"
echo Head: "$GITHUB_HEAD_REF"
exit 1
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

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

@@ -0,0 +1,31 @@
---
# 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.
name: flake8
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
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: |
python -m pip install --upgrade pip setuptools flake8
- 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

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

@@ -0,0 +1,81 @@
---
# 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.
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:
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:
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:
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:
runs-on: ubuntu-latest
steps:
- name: reddit
uses: bluwy/release-for-reddit-action@v1 # 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:
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 }}

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

@@ -0,0 +1,61 @@
---
# 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.
name: yaml lint
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
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
if: failure()
run: |
cat "${{ steps.yaml-lint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY

20
.gitignore vendored
View File

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

3
.gitmodules vendored
View File

@@ -13,3 +13,6 @@
[submodule "third-party/nv-codec-headers"]
path = third-party/nv-codec-headers
url = https://github.com/FFmpeg/nv-codec-headers
[submodule "third-party/TPCircularBuffer"]
path = third-party/TPCircularBuffer
url = https://github.com/michaeltyson/TPCircularBuffer

45
.readthedocs.yaml Normal file
View File

@@ -0,0 +1,45 @@
---
# .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
# - ffmpeg
# - 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

View File

@@ -1,5 +1,61 @@
# Changelog
## [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`

View File

@@ -1,8 +1,38 @@
cmake_minimum_required(VERSION 3.0)
project(Sunshine VERSION 0.12.0)
project(Sunshine VERSION 0.15.0
DESCRIPTION "Sunshine is a Gamestream host for Moonlight."
HOMEPAGE_URL "https://app.lizardbyte.dev"
)
set(PROJECT_LONG_DESCRIPTION "Sunshine is a self hosted, low latency, cloud gaming solution with support for AMD, \
Intel, and Nvidia GPUs. It is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield. \
Connect to Sunshine from any Moonlight client, available for nearly any device imaginable.")
option(SUNSHINE_CONFIGURE_APPIMAGE "Configuration specific for AppImage." OFF)
option(SUNSHINE_CONFIGURE_AUR "Configure files required for AUR." OFF)
option(SUNSHINE_CONFIGURE_FLATPAK_MAN "Configure manifest file required for Flatpak build." OFF)
option(SUNSHINE_CONFIGURE_FLATPAK "Configuration specific for Flatpak." OFF)
option(SUNSHINE_CONFIGURE_PORTFILE "Configure macOS Portfile." OFF)
option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF)
if(${SUNSHINE_CONFIGURE_APPIMAGE})
configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY)
elseif(${SUNSHINE_CONFIGURE_AUR})
configure_file(packaging/linux/aur/PKGBUILD PKGBUILD @ONLY)
elseif(${SUNSHINE_CONFIGURE_FLATPAK_MAN})
configure_file(packaging/linux/flatpak/dev.lizardbyte.sunshine.yml dev.lizardbyte.sunshine.yml @ONLY)
elseif(${SUNSHINE_CONFIGURE_PORTFILE})
configure_file(packaging/macos/Portfile Portfile @ONLY)
endif()
# return if configure only is set
if(${SUNSHINE_CONFIGURE_ONLY})
return()
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(SUNSHINE_SOURCE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src_assets")
if(WIN32)
# Ugly hack to compile with #include <qos2.h>
@@ -11,6 +41,22 @@ if(WIN32)
PQOS_FLOWID=UINT32*
QOS_NON_ADAPTIVE_FLOW=2)
endif()
if(APPLE)
macro(ADD_FRAMEWORK fwname appname)
find_library(FRAMEWORK_${fwname}
NAMES ${fwname}
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH)
if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND)
MESSAGE(ERROR ": Framework ${fwname} not found")
else()
TARGET_LINK_LIBRARIES(${appname} "${FRAMEWORK_${fwname}}/${fwname}")
MESSAGE(STATUS "Framework ${fwname} found at ${FRAMEWORK_${fwname}}")
endif()
endmacro(ADD_FRAMEWORK)
endif()
add_subdirectory(third-party/moonlight-common-c/enet)
add_subdirectory(third-party/Simple-Web-Server)
@@ -23,7 +69,9 @@ include_directories(third-party/miniupnp)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
set(Boost_USE_STATIC_LIBS ON)
if(NOT APPLE)
set(Boost_USE_STATIC_LIBS ON)
endif()
find_package(Boost COMPONENTS log filesystem REQUIRED)
list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-missing-braces -Wno-maybe-uninitialized -Wno-sign-compare)
@@ -40,33 +88,31 @@ if(WIN32)
INPUT "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip"
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pre-compiled)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
if(NOT DEFINED SUNSHINE_PREPARED_BINARIES)
set(SUNSHINE_PREPARED_BINARIES "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled/windows")
endif()
add_compile_definitions(SUNSHINE_PLATFORM="windows")
add_subdirectory(tools) #This is temporary, only tools for Windows are needed, for now
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_windows.json")
add_subdirectory(tools) # This is temporary, only tools for Windows are needed, for now
include_directories(third-party/ViGEmClient/include)
if(NOT DEFINED SUNSHINE_ICON_PATH)
set(SUNSHINE_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sunshine.ico")
endif()
configure_file(sunshine/platform/windows/windows.rs.in windows.rc @ONLY)
configure_file(src/platform/windows/windows.rs.in windows.rc @ONLY)
set(PLATFORM_TARGET_FILES
"${CMAKE_CURRENT_BINARY_DIR}/windows.rc"
sunshine/platform/windows/publish.cpp
sunshine/platform/windows/misc.h
sunshine/platform/windows/misc.cpp
sunshine/platform/windows/input.cpp
sunshine/platform/windows/display.h
sunshine/platform/windows/display_base.cpp
sunshine/platform/windows/display_vram.cpp
sunshine/platform/windows/display_ram.cpp
sunshine/platform/windows/audio.cpp
src/platform/windows/publish.cpp
src/platform/windows/misc.h
src/platform/windows/misc.cpp
src/platform/windows/input.cpp
src/platform/windows/display.h
src/platform/windows/display_base.cpp
src/platform/windows/display_vram.cpp
src/platform/windows/display_ram.cpp
src/platform/windows/audio.cpp
third-party/ViGEmClient/src/ViGEmClient.cpp
third-party/ViGEmClient/include/ViGEm/Client.h
third-party/ViGEmClient/include/ViGEm/Common.h
@@ -102,13 +148,57 @@ if(WIN32)
ws2_32
d3d11 dxgi D3DCompiler
setupapi
dwmapi
)
set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp PROPERTIES COMPILE_DEFINITIONS "UNICODE=1;ERROR_INVALID_DEVICE_OBJECT_PARAMETER=650")
set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp PROPERTIES COMPILE_FLAGS "-Wno-unknown-pragmas -Wno-misleading-indentation -Wno-class-memaccess")
elseif(APPLE)
add_compile_definitions(SUNSHINE_PLATFORM="macos")
option(SUNSHINE_MACOS_PACKAGE "Should only be used when creating a MACOS package/dmg." OFF)
link_directories(/opt/local/lib)
link_directories(/usr/local/lib)
ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
find_package(FFmpeg REQUIRED)
FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation )
FIND_LIBRARY(CORE_MEDIA_LIBRARY CoreMedia )
FIND_LIBRARY(CORE_VIDEO_LIBRARY CoreVideo )
FIND_LIBRARY(FOUNDATION_LIBRARY Foundation )
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${APP_SERVICES_LIBRARY}
${AV_FOUNDATION_LIBRARY}
${CORE_MEDIA_LIBRARY}
${CORE_VIDEO_LIBRARY}
${FOUNDATION_LIBRARY})
set(PLATFORM_INCLUDE_DIRS
${Boost_INCLUDE_DIR})
set(APPLE_PLIST_FILE ${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/Info.plist)
set(PLATFORM_TARGET_FILES
src/platform/macos/av_audio.h
src/platform/macos/av_audio.m
src/platform/macos/av_img_t.h
src/platform/macos/av_video.h
src/platform/macos/av_video.m
src/platform/macos/display.mm
src/platform/macos/input.cpp
src/platform/macos/microphone.mm
src/platform/macos/misc.cpp
src/platform/macos/misc.h
src/platform/macos/nv12_zero_device.cpp
src/platform/macos/nv12_zero_device.h
src/platform/macos/publish.cpp
third-party/TPCircularBuffer/TPCircularBuffer.c
third-party/TPCircularBuffer/TPCircularBuffer.h
${APPLE_PLIST_FILE})
else()
add_compile_definitions(SUNSHINE_PLATFORM="linux")
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_linux.json")
option(SUNSHINE_ENABLE_DRM "Enable KMS grab if available" ON)
option(SUNSHINE_ENABLE_X11 "Enable X11 grab if available" ON)
@@ -153,14 +243,14 @@ else()
if(X11_FOUND)
add_compile_definitions(SUNSHINE_BUILD_X11)
include_directories(${X11_INCLUDE_DIR})
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/x11grab.cpp)
list(APPEND PLATFORM_TARGET_FILES src/platform/linux/x11grab.cpp)
endif()
if(CUDA_FOUND)
include_directories(third-party/nvfbc)
list(APPEND PLATFORM_TARGET_FILES
sunshine/platform/linux/cuda.cu
sunshine/platform/linux/cuda.cpp
src/platform/linux/cuda.cu
src/platform/linux/cuda.cpp
third-party/nvfbc/NvFBC.h)
add_compile_definitions(SUNSHINE_BUILD_CUDA)
@@ -170,7 +260,7 @@ else()
add_compile_definitions(SUNSHINE_BUILD_DRM)
include_directories(${LIBDRM_INCLUDE_DIRS} ${LIBCAP_INCLUDE_DIRS})
list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES} ${LIBCAP_LIBRARIES})
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/kmsgrab.cpp)
list(APPEND PLATFORM_TARGET_FILES src/platform/linux/kmsgrab.cpp)
list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1)
elseif(LIBDRM_FOUND)
message(WARNING "Found libdrm, yet there is no libcap")
@@ -212,40 +302,40 @@ else()
list(APPEND PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES})
list(APPEND PLATFORM_TARGET_FILES
sunshine/platform/linux/wlgrab.cpp
sunshine/platform/linux/wayland.cpp)
src/platform/linux/wlgrab.cpp
src/platform/linux/wayland.cpp)
endif()
if(NOT ${X11_FOUND} AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND}) AND NOT ${WAYLAND_FOUND} AND NOT ${})
message(FATAL_ERROR "Couldn't find either x11, wayland, cuda or (libdrm and libcap)")
endif()
list(APPEND PLATFORM_TARGET_FILES
sunshine/platform/linux/publish.cpp
sunshine/platform/linux/vaapi.h
sunshine/platform/linux/vaapi.cpp
sunshine/platform/linux/cuda.h
sunshine/platform/linux/graphics.h
sunshine/platform/linux/graphics.cpp
sunshine/platform/linux/misc.h
sunshine/platform/linux/misc.cpp
sunshine/platform/linux/audio.cpp
sunshine/platform/linux/input.cpp
sunshine/platform/linux/x11grab.h
sunshine/platform/linux/wayland.h
src/platform/linux/publish.cpp
src/platform/linux/vaapi.h
src/platform/linux/vaapi.cpp
src/platform/linux/cuda.h
src/platform/linux/graphics.h
src/platform/linux/graphics.cpp
src/platform/linux/misc.h
src/platform/linux/misc.cpp
src/platform/linux/audio.cpp
src/platform/linux/input.cpp
src/platform/linux/x11grab.h
src/platform/linux/wayland.h
third-party/glad/src/egl.c
third-party/glad/src/gl.c
third-party/glad/include/EGL/eglplatform.h
third-party/glad/include/KHR/khrplatform.h
third-party/glad/include/glad/gl.h
third-party/glad/include/glad/egl.h)
list(APPEND PLATFORM_LIBRARIES
dl
evdev
pulse
pulse-simple
)
include_directories(
/usr/include/libevdev-1.0
third-party/nv-codec-headers/include
@@ -254,7 +344,6 @@ else()
if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH)
set(SUNSHINE_EXECUTABLE_PATH "sunshine")
endif()
configure_file(gen-deb.in gen-deb @ONLY)
configure_file(sunshine.service.in sunshine.service @ONLY)
endif()
@@ -268,47 +357,47 @@ set(SUNSHINE_TARGET_FILES
third-party/moonlight-common-c/src/Rtsp.h
third-party/moonlight-common-c/src/RtspParser.c
third-party/moonlight-common-c/src/Video.h
sunshine/upnp.cpp
sunshine/upnp.h
sunshine/cbs.cpp
sunshine/utility.h
sunshine/uuid.h
sunshine/config.h
sunshine/config.cpp
sunshine/main.cpp
sunshine/main.h
sunshine/crypto.cpp
sunshine/crypto.h
sunshine/nvhttp.cpp
sunshine/nvhttp.h
sunshine/httpcommon.cpp
sunshine/httpcommon.h
sunshine/confighttp.cpp
sunshine/confighttp.h
sunshine/rtsp.cpp
sunshine/rtsp.h
sunshine/stream.cpp
sunshine/stream.h
sunshine/video.cpp
sunshine/video.h
sunshine/input.cpp
sunshine/input.h
sunshine/audio.cpp
sunshine/audio.h
sunshine/platform/common.h
sunshine/process.cpp
sunshine/process.h
sunshine/network.cpp
sunshine/network.h
sunshine/move_by_copy.h
sunshine/task_pool.h
sunshine/thread_pool.h
sunshine/thread_safe.h
sunshine/sync.h
sunshine/round_robin.h
src/upnp.cpp
src/upnp.h
src/cbs.cpp
src/utility.h
src/uuid.h
src/config.h
src/config.cpp
src/main.cpp
src/main.h
src/crypto.cpp
src/crypto.h
src/nvhttp.cpp
src/nvhttp.h
src/httpcommon.cpp
src/httpcommon.h
src/confighttp.cpp
src/confighttp.h
src/rtsp.cpp
src/rtsp.h
src/stream.cpp
src/stream.h
src/video.cpp
src/video.h
src/input.cpp
src/input.h
src/audio.cpp
src/audio.h
src/platform/common.h
src/process.cpp
src/process.h
src/network.cpp
src/network.h
src/move_by_copy.h
src/task_pool.h
src/thread_pool.h
src/thread_safe.h
src/sync.h
src/round_robin.h
${PLATFORM_TARGET_FILES})
set_source_files_properties(sunshine/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)
set_source_files_properties(src/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
@@ -326,24 +415,29 @@ string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
list(APPEND SUNSHINE_COMPILE_OPTIONS -O0 -ggdb3)
if(WIN32)
set_source_files_properties(sunshine/nvhttp.cpp PROPERTIES COMPILE_FLAGS -O2)
set_source_files_properties(src/nvhttp.cpp PROPERTIES COMPILE_FLAGS -O2)
endif()
else()
add_definitions(-DNDEBUG)
list(APPEND SUNSHINE_COMPILE_OPTIONS -O3)
endif()
# setup assets directory
if(NOT SUNSHINE_ASSETS_DIR)
set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assets")
set(SUNSHINE_ASSETS_DIR "assets")
endif()
if(UNIX)
set(SUNSHINE_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_ASSETS_DIR}")
endif()
if(NOT SUNSHINE_CONFIG_DIR)
set(SUNSHINE_CONFIG_DIR "${SUNSHINE_ASSETS_DIR}")
# use relative assets path for AppImage... maybe for all unix
if(${SUNSHINE_CONFIGURE_APPIMAGE})
string(REPLACE "${CMAKE_INSTALL_PREFIX}" ".${CMAKE_INSTALL_PREFIX}" SUNSHINE_ASSETS_DIR_DEF ${SUNSHINE_ASSETS_DIR})
else()
set(SUNSHINE_ASSETS_DIR_DEF "${SUNSHINE_ASSETS_DIR}")
endif()
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR_DEF}")
if(NOT SUNSHINE_DEFAULT_DIR)
set(SUNSHINE_DEFAULT_DIR "${SUNSHINE_ASSETS_DIR}")
endif()
list(APPEND CBS_EXTERNAL_LIBRARIES
cbs)
@@ -352,7 +446,6 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
libminiupnpc-static
${CBS_EXTERNAL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
stdc++fs
enet
opus
${FFMPEG_LIBRARIES}
@@ -360,15 +453,12 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${OPENSSL_LIBRARIES}
${PLATFORM_LIBRARIES})
if (NOT WIN32)
if(NOT WIN32)
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES Boost::log)
endif()
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR}")
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_CONFIG_DIR="${SUNSHINE_CONFIG_DIR}")
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_DEFAULT_DIR="${SUNSHINE_DEFAULT_DIR}")
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES})
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
set_target_properties(sunshine PROPERTIES CXX_STANDARD 17
VERSION ${PROJECT_VERSION}
@@ -380,8 +470,187 @@ if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
if(APPLE)
target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${APPLE_PLIST_FILE})
endif()
foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS)
list(APPEND SUNSHINE_COMPILE_OPTIONS_CUDA "$<$<COMPILE_LANGUAGE:CUDA>:--compiler-options=${flag}>")
endforeach()
target_compile_options(sunshine PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SUNSHINE_COMPILE_OPTIONS}>;$<$<COMPILE_LANGUAGE:CUDA>:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>)
# CPACK / Packaging
# Common options
set(CPACK_PACKAGE_NAME "Sunshine")
set(CPACK_PACKAGE_VENDOR "LizardByte")
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpack_artifacts)
set(CPACK_PACKAGE_CONTACT "https://app.lizardbyte.dev")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/LizardByte")
set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION})
set(CPACK_PACKAGE_HOMEPAGE_URL ${CMAKE_PROJECT_HOMEPAGE_URL})
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE)
set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png)
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_STRIP_FILES YES)
# Platform specific options
if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.html
install(TARGETS sunshine RUNTIME DESTINATION "." COMPONENT application)
# Adding tools
install(TARGETS dxgi-info RUNTIME DESTINATION "tools" COMPONENT dxgi)
install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio)
install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc)
# scripts
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/firewall/" DESTINATION "scripts" COMPONENT firewall)
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/service/" DESTINATION "scripts" COMPONENT service)
# Sunshine assets
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico")
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") # The name of the directory that will be created in C:/Program files/
string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here
# Extra install commands
# Sets permissions on the installed folder so that we can write in it
# Install service
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
ExecWait 'icacls \\\"$INSTDIR\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)'
ExecWait '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
ExecWait '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
")
# Extra uninstall commands
# Uninstall service
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
"${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
ExecWait '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"'
ExecWait '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"'
MessageBox MB_YESNO|MB_ICONQUESTION 'Do you want to completely remove the directory $INSTDIR and all of its contents?' IDNO NoDelete
RMDir /r \\\"$INSTDIR\\\" ; skipped if no
NoDelete:
")
# Adding an option for the start menu and PATH
set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but is not working https://gitlab.kitware.com/cmake/cmake/-/issues/15635
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CMAKE_PROJECT_NAME}.exe")
set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings
set(CPACK_NSIS_CREATE_ICONS_EXTRA
"${CPACK_NSIS_CREATE_ICONS_EXTRA}
CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe'
")
set(CPACK_NSIS_DELETE_ICONS_EXTRA
"${CPACK_NSIS_DELETE_ICONS_EXTRA}
Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME}.lnk'
")
# Checking for previous installed versions
# set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") # TODO: doesn't work on my machine when Sunshine is already installed
set(CPACK_NSIS_HELP_LINK "https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html")
set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}")
set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support")
# Setting components groups and dependencies
# sunshine binary
set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_COMPONENT_APPLICATION_DESCRIPTION "${CMAKE_PROJECT_NAME} main application.")
set(CPACK_COMPONENT_APPLICATION_GROUP "core")
set(CPACK_COMPONENT_APPLICATION_REQUIRED true)
set(CPACK_COMPONENT_APPLICATION_DEPENDS assets)
# assets
set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "assets")
set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web ui.")
set(CPACK_COMPONENT_ASSETS_GROUP "core")
set(CPACK_COMPONENT_ASSETS_REQUIRED true)
# audio tool
set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info")
set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool providing information about sound devices.")
set(CPACK_COMPONENT_AUDIO_GROUP "tools")
# display tool
set(CPACK_COMPONENT_DXGI_DISPLAY_NAME "dxgi-info")
set(CPACK_COMPONENT_DXGI_DESCRIPTION "CLI tool providing information about graphics cards and displays.")
set(CPACK_COMPONENT_DXGI_GROUP "tools")
# service
set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc")
set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool providing ability to enable/disable the Sunshine service.")
set(CPACK_COMPONENT_SUNSHINESVC_GROUP "tools")
# service scripts
set(CPACK_COMPONENT_SERVICE_DISPLAY_NAME "service-scripts")
set(CPACK_COMPONENT_SERVICE_DESCRIPTION "Scripts to enable/disable the service.")
set(CPACK_COMPONENT_SERVICE_GROUP "scripts")
set(CPACK_COMPONENT_SERVICE_DEPENDS sunshinesvc)
# firewall scripts
set(CPACK_COMPONENT_FIREWALL_DISPLAY_NAME "firewall-scripts")
set(CPACK_COMPONENT_FIREWALL_DESCRIPTION "Scripts to enable or disable firewall rules.")
set(CPACK_COMPONENT_FIREWALL_GROUP "scripts")
endif()
if(APPLE)
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_BUNDLE_PLIST "${APPLE_PLIST_FILE}")
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
# set(CPACK_BUNDLE_STARTUP_COMMAND "${INSTALL_RUNTIME_DIR}/sunshine")
endif()
if(APPLE AND SUNSHINE_MACOS_PACKAGE) # TODO
set(prefix "${CMAKE_PROJECT_NAME}.app/Contents")
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
install(TARGETS sunshine
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime)
elseif(UNIX)
# Installation destination dir
set(CPACK_SET_DESTDIR true)
if(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/share/sunshine")
endif()
install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
if(APPLE)
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/misc/uninstall_pkg.sh" DESTINATION "${SUNSHINE_ASSETS_DIR}")
else()
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
if(${SUNSHINE_CONFIGURE_APPIMAGE} OR ${SUNSHINE_CONFIGURE_FLATPAK})
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${SUNSHINE_ASSETS_DIR}/udev/rules.d")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${SUNSHINE_ASSETS_DIR}/systemd/user")
else()
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${CMAKE_INSTALL_LIBDIR}/udev/rules.d")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
endif()
# Post install
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst")
# Dependencies
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2")
set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config
endif()
endif()
include(CPack)

96
DOCKER_README.md Normal file
View File

@@ -0,0 +1,96 @@
# Docker
## 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
FROM lizardbyte/sunshine
# install Steam, Wayland, etc.
ENTRYPOINT steam && sunshine
```
## 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 [here][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.

92
Dockerfile Normal file
View File

@@ -0,0 +1,92 @@
FROM ubuntu:22.04 AS sunshine-base
ARG DEBIAN_FRONTEND=noninteractive
FROM sunshine-base as sunshine-build
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN 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-thread-dev=1.74.0* \
libcap-dev=1:2.44* \
libdrm-dev=2.4.110* \
libevdev-dev=1.12.1* \
libpulse-dev=1:15.99.1* \
libopus-dev=1.3.1* \
libssl-dev=3.0.2* \
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* \
nvidia-cuda-dev=11.5.1* \
nvidia-cuda-toolkit=11.5.1* \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# copy repository
WORKDIR /root/sunshine-build/
COPY . .
# setup build directory
WORKDIR /root/sunshine-build/build
# cmake and cpack
RUN 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 \
/root/sunshine-build \
&& make -j "$(nproc)" \
&& cpack -G DEB
FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=sunshine-build /root/sunshine-build/build/cpack_artifacts/Sunshine.deb /sunshine.deb
# install sunshine
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends /sunshine.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# 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
RUN 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}
USER ${UNAME}
WORKDIR ${HOME}
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine"]

245
README.md
View File

@@ -1,245 +0,0 @@
![Sunshine icon](gamepad.png "Sunshine")
# 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
If you do not wish to clutter your PC with development files, yet you want the very latest version...
You can use these [build scripts](scripts/README.md)
They make use of docker to handle building Sunshine automatically
### Requirements:
Ubuntu 20.04:
Install the following:
#### Common
```
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 libevdev-dev
```
#### X11
```
sudo apt install libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
```
#### KMS
This requires additional [setup](README.md#Setup).
```
sudo apt install libdrm-dev libcap-dev
```
#### Wayland
This is for wlroots based compositores, such as Sway
```
sudo apt install libwayland-dev
```
#### Cuda + NvFBC
This requires proprietary software
On Ubuntu 20.04, the cuda compiler will fail since it's version is too old, it's recommended you compile the sources with the [build scripts](scripts/README.md)
```
sudo apt install nvidia-cuda-dev nvidia-cuda-toolkit
```
#### Warning:
You might require ffmpeg version >= 4.3. Check the troubleshooting section for more information.
### Compilation:
- `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+p 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. Check whether you're using Pulseaudio or Pipewire
- Pulseaudio: Use `pacmd list-sources | grep "name:"`
- Pipewire: Use `pactl info | grep Source`. In some causes you'd need to use the `sink` device. Try `pactl info | grep Sink`, if _Source_ doesn't work.
2. Copy the name to the configuration option "audio_sink"
3. Restart sunshine
- If you get "Error: Failed to create client: Daemon not running", ensure that your avahi-daemon is running:
- `systemctl status avahi-daemon`
- If you use hardware acceleration on Linux using an Intel or an AMD GPU (with VAAPI), you will get tons of [graphical issues](https://github.com/loki-47-6F-64/sunshine/issues/228) if your ffmpeg version is < 4.3. If it is not available in your distribution's repositories, consider using a newer version of your distribution.
- Ubuntu started to ship ffmpeg 4.3 starting with groovy (20.10). If you're using an older version, you could use [this PPA](https://launchpad.net/%7Esavoury1/+archive/ubuntu/ffmpeg4) instead of upgrading. **Using PPAs is dangerous and may break your system. Use it at your own risk.**
## 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-binutils 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)
- [Twitter emoji](https://github.com/twitter/twemoji/blob/master/LICENSE-GRAPHICS) (Sunshine's icon is made of twemoji)
## 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\""}
]
}
]
}
```

71
README.rst Normal file
View File

@@ -0,0 +1,71 @@
Overview
========
LizardByte has the full documentation hosted on `Read the Docs <https://sunshinestream.readthedocs.io/>`_.
About
-----
Sunshine is a Game stream host for Moonlight.
Sunshine is a self hosted, low latency, cloud gaming solution with support for AMD, Intel, and Nvidia gpus.
It is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield.
Connect to Sunshine from any Moonlight client, available for nearly any device imaginable.
These are the advantages of Sunshine over GeForce Experience.
- FOSS (Free and Open Source Software)
- Multi-platform
- Linux
- macOS
- Windows
- Pair over web ui
- Supports AMD, Intel, and Nvidia GPUs for encoding
- Supports software encoding
- Supports streaming to multiple clients
- Web UI for configuration
Integrations
------------
.. image:: https://img.shields.io/github/workflow/status/lizardbyte/sunshine/CI/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/workflow/status/lizardbyte/sunshine/localize/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

View File

@@ -1,44 +0,0 @@
services:
- docker
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
DOCKERFILE: Dockerfile-ubuntu_20_04
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
DOCKERFILE: Dockerfile-ubuntu_21_04
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
DOCKERFILE: Dockerfile-debian
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: Release
install:
- cmd: C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-binutils 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:
- cmd: git submodule update --init --recursive
- cmd: mkdir build
- cmd: cd build
- sh: cd scripts
- sh: ./build-container.sh -f $DOCKERFILE
build_script:
- cmd: set OLDPATH=%PATH%
- cmd: set PATH=C:\msys64\mingw64\bin
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
- cmd: mingw32-make -j2
- cmd: set PATH=%OLDPATH%
- sh: ./build-sunshine.sh -pu
after_build:
- 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 sunshine-build/sunshine.deb

View File

@@ -1,20 +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"],
"image-path":"./assets/steam.png"
}
]
}

View File

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

View File

@@ -1,290 +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
# ]
# It may be possible that you cannot send the Windows Key from Moonlight directly.
# In those cases it may be useful to make Sunshine think the Right Alt key is the Windows key
# key_rightalt_to_key_win = enabled
# 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
# pPipewire: Use `pactl info | grep Source`. In some causes you'd need to use the `sink` device. Try `pactl info | grep Sink`, if _Source_ doesn't work
# 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_quality = 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,30 +0,0 @@
<div id="content" class="container">
<h1 class="my-4">Hello, Sunshine!</h1>
<p>Sunshine is a Gamestream host for Moonlight</p>
<!--Resources-->
<div class="card p-2 my-4">
<div class="card-body">
<h2>Resources</h2>
<br />
<p>
Resources for Sunshine!
</p>
<a class="btn btn-primary" href="https://sunshinestream.github.io" target="_blank">Official Website</a>
<a class="btn btn-warning" href="https://github.com/SunshineStream/Sunshine/discussions" target="_blank"><i class="fab fa-fw fa-github"></i> Github Discussions</a>
<a class="btn btn-warning" href="https://sunshinestream.github.io/discord" target="_blank"><i class="fas fa-fw fa-sun"></i><i class="fab fa-fw fa-discord"></i> Sunshine Discord</a>
<a class="btn btn-warning" href="https://moonlight-stream.org/discord" target="_blank"><i class="fas fa-fw fa-moon"></i><i class="fab fa-fw fa-discord"></i> Moonlight Discord</a>
</div>
</div>
<!--Legal-->
<div class="card p-2 my-4">
<div class="card-body">
<h2>Legal</h2>
<br />
<p>
By continuing to use this software you agree to the terms and conditions in the following documents.
</p>
<a class="btn btn-danger" href="https://github.com/SunshineStream/Sunshine/blob/master/LICENSE" target="_blank"><i class="fas fa-fw fa-file-alt"></i> License</a>
<a class="btn btn-danger" href="https://github.com/SunshineStream/Sunshine/blob/master/NOTICE" target="_blank"><i class="fas fa-fw fa-exclamation"></i> Third Party Notice</a>
</div>
</div>
</div>

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"
}
}
}
]

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.9.29
m2r2==0.3.3
Sphinx==5.3.0
sphinx-copybutton==0.5.0

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,231 @@
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
-----
First, follow the instructions for your preferred package type below.
Then start sunshine with the following command, unless a start command is listed in the specified package.
.. code-block:: bash
sunshine
AppImage
^^^^^^^^
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:appimage?logo=github&style=for-the-badge
:alt: GitHub issues by-label
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 jammy
- [✔] Ubuntu impish
- [✔] Ubuntu focal
- [✖] Ubuntu bionic
- [✖] Ubuntu xenial
- [✖] Ubuntu trusty
- [✖] CentOS 7
#. Download ``sunshine-appimage.zip`` and extract the contents 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
^^^^^^^^^^^^^^
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:deb?logo=github&style=for-the-badge
:alt: GitHub issues by-label
#. Download ``sunshine.deb`` and run the following code.
.. code-block:: bash
sudo apt install -f ./sunshine.deb
.. 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
^^^^^^^^^^^^^^^
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:flatpak?logo=github&style=for-the-badge
:alt: GitHub issues by-label
#. Install `Flatpak <https://flatpak.org/setup/>`_ as required.
#. Download ``sunshine.flatpak`` and run the following code.
System level (recommended)
.. code-block:: bash
flatpak install --system sunshine.flatpak
User level
.. code-block:: bash
flatpak install --user sunshine.flatpak
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 uninstall --delete-data sunshine.flatpak
RPM Package
^^^^^^^^^^^
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:rpm?logo=github&style=for-the-badge
:alt: GitHub issues by-label
#. 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
-----
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:macos?logo=github&style=for-the-badge
:alt: GitHub issues by-label
pkg
^^^
.. Warning:: The `pkg` does not include runtime dependencies and should be considered experimental.
#. 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
-------
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:windows:10?logo=github&style=for-the-badge
:alt: GitHub issues by-label
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:windows:11?logo=github&style=for-the-badge
:alt: GitHub issues by-label
Installer
^^^^^^^^^
#. Download and install ``sunshine-windows.exe``
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,57 @@
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
.. image:: https://img.shields.io/github/downloads/loki-47-6F-64/sunshine/total?style=for-the-badge&logo=github
:alt: GitHub Releases

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

@@ -0,0 +1,215 @@
Usage
=====
#. See the `setup`_ section for your specific OS.
#. Run ``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.
.. Tip:: If using the Linux AppImage, replace ``sunshine`` with ``./sunshine.AppImage``
#. 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".
.. Caution:: If running for the first time, make sure to note the username and password Sunshine showed to you,
since you cannot get back later!
**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.
.. Attention:: Application list is not fully supported on macOS
#. 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`, and `AppImage` packages handle these steps automatically. The flatpak does not, third party packages
also 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 Gamestream Server for Moonlight
[Service]
ExecStart=<see table>
[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**
.. 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>`_
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/F13`` - 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 recommended.
- 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
- Example application:
.. code-block:: json
{
"name":"An App",
"cmd":"command to open app",
"prep-cmd":[
{
"do":"some-command",
"undo":"undo-that-command"
}
],
"detached":[
"some-command",
"another-command"
]
}
- ``name`` - The name of the application/game
- ``output`` - The file where the output of the command is stored
- ``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`` - 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`` - The main application
- If not specified, a process is started that sleeps indefinitely
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``.

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,229 @@
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-thread-dev \
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libopus-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
nvidia-cuda-dev \ # Cuda, NvFBC
nvidia-cuda-toolkit \ # Cuda, NvFBC
Fedora 35
^^^^^^^^^
End of Life: TBD
Install Repositories
.. code-block:: bash
sudo dnf update && \
sudo dnf group install "Development Tools" && \
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
Install Requirements
.. code-block:: bash
sudo dnf install \
boost-devel \
boost-static.x86_64 \
cmake \
ffmpeg-devel \
gcc-c++ \
libevdev-devel \
libX11-devel \ # X11
libxcb-devel \ # X11
libXcursor-devel \ # X11
libXfixes-devel \ # X11
libXinerama-devel \ # X11
libXi-devel \ # X11
libXrandr-devel \ # X11
libXtst-devel \ # X11
mesa-libGL-devel \
openssl-devel \
opus-devel \
pulseaudio-libs-devel \
rpm-build \ # if you want to build an RPM binary package
Ubuntu 18.04
^^^^^^^^^^^^
End of Life: April 2028
Install Repositories
.. code-block:: bash
sudo apt update && sudo apt install \
software-properties-common \
&& add-apt-repository ppa:savoury1/graphics && \
add-apt-repository ppa:savoury1/multimedia && \
add-apt-repository ppa:savoury1/ffmpeg4 && \
add-apt-repository ppa:savoury1/boost-defaults-1.71 && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
Install Requirements
.. code-block:: bash
sudo apt install \
build-essential \
cmake \
gcc-10 \
g++-10 \
libavdevice-dev \
libboost-filesystem1.71-dev \
libboost-log1.71-dev \
libboost-regex1.71-dev \
libboost-thread1.71-dev \
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libopus-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
wget \
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
Install CuDA
.. 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
Install CMake
.. code-block:: bash
wget https://cmake.org/files/v3.22/cmake-3.22.2-linux-x86_64.sh
mkdir /opt/cmake
sh /cmake-3.22.2-linux-x86_64.sh --prefix=/opt/cmake --skip-license
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
cmake --version
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 \
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libopus-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
wget \
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
Install CuDA
.. 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
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 \
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libopus-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
nvidia-cuda-dev \ # Cuda, NvFBC
nvidia-cuda-toolkit \ # Cuda, NvFBC
Build
-----
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
Debian based OSes
.. code-block:: bash
cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ..
Red Hat based OSes
.. code-block:: bash
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..
Finally
.. code-block:: bash
make -j ${nproc}
cpack -G DEB # optionally, create a deb package
cpack -G RPM # optionally, create a rpm package

View File

@@ -0,0 +1,40 @@
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 cmake boost ffmpeg libopus
Homebrew
""""""""
Install Requirements
.. code-block:: bash
brew install boost cmake ffmpeg opus
# if there are issues with an SSL header that is not found:
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
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.76 ..``

View File

@@ -0,0 +1,27 @@
Windows
=======
Requirements
------------
First you need to install `MSYS2 <https://www.msys2.org>`_, then startup "MSYS2 MinGW 64-bit" and install the
following packages using:
.. code-block:: bash
pacman -S mingw-w64-x86_64-binutils 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
Build
-----
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
.. code-block:: bash
cmake -G"Unix Makefiles" ..
cmake -G"MinGW Makefiles" .. # alternatively
mingw32-make
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,40 @@
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.
.. Todo:: This documentation needs to be improved.
.. code-block:: bash
clang-format ...
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.

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

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

@@ -0,0 +1,36 @@
.. toctree::
:maxdepth: 2
:caption: About
about/overview
about/installation
about/docker
about/third_party_packages
about/usage
about/advanced_usage
.. 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

View File

@@ -0,0 +1,17 @@
General
=======
If you forgot your credentials to the web UI, try this.
.. code-block:: bash
sunshine -creds <new username> <new password>
Can't access the web UI?
#. Check firefall rules.
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,6 @@
Linux
=====
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,10 @@
macOS
=====
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,4 @@
Windows
=======
No gamepad is detected.
#. Verify that you've installed `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`_.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

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.12.0
Depends: libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2
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+p /usr/bin/sunshine"
$path_to_setcap cap_sys_admin+p /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 ..

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,54 @@
# 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' 'ffmpeg4.4' 'libevdev' 'libpulse' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'openssl' 'opus' 'udev')
makedepends=('boost' 'cmake' 'git' 'make')
optdepends=('cuda' '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() {
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" \
-D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \
-D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \
-D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \
-D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \
-D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so
make -C build
}
package() {
make -C build install DESTDIR="$pkgdir"
}

View File

@@ -0,0 +1,210 @@
---
app-id: dev.lizardbyte.sunshine
runtime: org.freedesktop.Platform
runtime-version: "21.08"
sdk: org.freedesktop.Sdk
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 || 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
- name: ffmpeg
disabled: false
config-opts:
- --enable-gpl
- --disable-static
- --enable-shared
- --disable-doc
- --disable-programs
- --disable-decoders
- --disable-vdpau
- --disable-audiotoolbox
- --disable-videotoolbox
- --disable-vulkan
- --disable-sdl2
- --disable-filters
- --disable-avfilter
- --disable-postproc
- --disable-autodetect
- --enable-nvenc
- --enable-ffnvcodec
- --enable-vaapi
- --enable-libx264
- --enable-libx265
cleanup:
- /share
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/ffmpeg_5.1.1.orig.tar.xz
sha256: 95bf3ff8c496511e71e958fb249e663c8c9c3de583c5bebc0f5a9745abbc0435
modules:
- name: x264
config-opts:
- --disable-cli
- --enable-shared
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/universe/x/x264/x264_0.164.3095+gitbaee400.orig.tar.gz
sha256: 8b237e94b08c196a1da22f2f25875f10be4cff3648df4eeff21e00da8f683fc2
- name: x265
disabled: false
buildsystem: cmake-ninja
builddir: true
subdir: source
config-opts:
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
- -DENABLE_CLI=OFF
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/universe/x/x265/x265_3.5.orig.tar.gz
sha256: e70a3335cacacbba0b3a20ec6fecd6783932288ebc8163ad74bcc9606477cae8
- name: nv-codec-headers
no-autogen: true
make-install-args:
- PREFIX=${FLATPAK_DEST}
cleanup:
- '*'
sources:
- type: archive
url: http://archive.ubuntu.com/ubuntu/pool/universe/n/nv-codec-headers/nv-codec-headers_11.1.5.1.orig.tar.gz
sha256: d095fbd56aa93772471a323be0ebe65504a0f43f06c76a30b6d25da77b06ae9c
- 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
- 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
- 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-2021.3.2
- rm ./cuda.run
sources:
- type: file
only-arches:
- x86_64
url: https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run
sha256: bbd87ca0e913f837454a796367473513cddef555082e4d86ed9a38659cc81f0a
dest-filename: cuda.run
- type: file
only-arches:
- aarch64
url: https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux_sbsa.run # yamllint disable-line rule:line-length
sha256: f2c4a52e06329606c8dfb7c5ea3f4cb4c0b28f9d3fdffeeb734fcc98daf580d8
dest-filename: cuda.run
- name: sunshine
disabled: false
buildsystem: cmake
no-make-install: false
builddir: true
build-options:
cxxflags: -I${C_INCLUDE_PATH}/libevdev-1.0
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

View File

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

59
packaging/macos/Portfile Normal file
View File

@@ -0,0 +1,59 @@
# -*- 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:ffmpeg \
port:libopus
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."
}
}
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."

View File

@@ -1,39 +0,0 @@
FROM debian:bullseye AS sunshine-debian
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ="Europe/London"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo deb http://deb.debian.org/debian/ bullseye main contrib non-free | tee /etc/apt/sources.list.d/non-free.list
RUN apt-get update -y && \
apt-get install -y \
build-essential \
cmake \
git \
libavdevice-dev \
libboost-thread-dev \
libboost-filesystem-dev \
libboost-log-dev \
libcap-dev \
libdrm-dev \
libevdev-dev \
libpulse-dev \
libopus-dev \
libssl-dev \
libwayland-dev \
libx11-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nvidia-cuda-dev \
nvidia-cuda-toolkit \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]

View File

@@ -1,27 +0,0 @@
FROM fedora:33 AS sunshine-fedora_33
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN dnf -y update && \
dnf -y group install "Development Tools" && \
dnf -y 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 && \
dnf -y install \
boost-devel \
boost-static.x86_64 \
cmake \
ffmpeg-devel \
libevdev-devel \
libxcb-devel \
libX11-devel \
libXfixes-devel \
libXrandr-devel \
libXtst-devel \
openssl-devel \
opus-devel \
pulseaudio-libs-devel \
&& dnf clean all \
&& rm -rf /var/cache/yum
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]

View File

@@ -1,32 +0,0 @@
FROM fedora:35 AS sunshine-fedora_35
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN dnf -y update && \
dnf -y group install "Development Tools" && \
dnf -y 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 && \
dnf -y install \
boost-devel \
boost-static.x86_64 \
cmake \
ffmpeg-devel \
gcc-c++ \
libevdev-devel \
libxcb-devel \
libX11-devel \
libXcursor-devel \
libXfixes-devel \
libXinerama-devel \
libXi-devel \
libXrandr-devel \
libXtst-devel \
mesa-libGL-devel \
openssl-devel \
opus-devel \
pulseaudio-libs-devel \
&& dnf clean all \
&& rm -rf /var/cache/yum
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]

View File

@@ -1,58 +0,0 @@
FROM ubuntu:18.04 AS sunshine-ubuntu_18_04
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ="Europe/London"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update -y && \
apt-get install -y \
apt-transport-https \
ca-certificates \
gnupg \
software-properties-common \
wget \
&& wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && \
add-apt-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
add-apt-repository ppa:savoury1/graphics && \
add-apt-repository ppa:savoury1/multimedia && \
add-apt-repository ppa:savoury1/ffmpeg4 && \
apt-get update -y && \
apt-get install -y \
build-essential \
cmake \
ffmpeg \
gcc-10 \
git \
g++-10 \
libavdevice-dev \
libboost-filesystem-dev \
libboost-log-dev \
libboost-regex-dev \
libboost-thread-dev \
libcap-dev \
libdrm-dev \
libevdev-dev \
libpulse-dev \
libopus-dev \
libssl-dev \
libwayland-dev \
libx11-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
RUN 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 /root/cuda.run && chmod a+x /root/cuda.run
RUN /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && rm /root/cuda.run
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]

View File

@@ -1,42 +0,0 @@
FROM ubuntu:20.04 AS sunshine-ubuntu_20_04
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ="Europe/London"
RUN apt-get update -y && \
apt-get install -y \
build-essential \
cmake \
git \
g++-10 \
libavdevice-dev \
libboost-filesystem-dev \
libboost-log-dev \
libboost-thread-dev \
libcap-dev \
libdrm-dev \
libevdev-dev \
libpulse-dev \
libopus-dev \
libssl-dev \
libwayland-dev \
libx11-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
RUN 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 /root/cuda.run && chmod a+x /root/cuda.run
RUN /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && rm /root/cuda.run
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]

View File

@@ -1,37 +0,0 @@
FROM ubuntu:21.04 AS sunshine-ubuntu_21_04
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ="Europe/London"
RUN apt-get update -y && \
apt-get install -y \
build-essential \
cmake \
git \
libavdevice-dev \
libboost-thread-dev \
libboost-filesystem-dev \
libboost-log-dev \
libcap-dev \
libdrm-dev \
libevdev-dev \
libpulse-dev \
libopus-dev \
libssl-dev \
libwayland-dev \
libx11-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nvidia-cuda-dev \
nvidia-cuda-toolkit \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]

View File

@@ -1,37 +0,0 @@
FROM ubuntu:21.10 AS sunshine-ubuntu_21_10
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ="Europe/London"
RUN apt-get update -y && \
apt-get install -y \
build-essential \
cmake \
git \
libavdevice-dev \
libboost-thread-dev \
libboost-filesystem-dev \
libboost-log-dev \
libcap-dev \
libdrm-dev \
libevdev-dev \
libpulse-dev \
libopus-dev \
libssl-dev \
libwayland-dev \
libx11-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nvidia-cuda-dev \
nvidia-cuda-toolkit \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY build-private.sh /root/build.sh
ENTRYPOINT ["/root/build.sh"]

View File

@@ -1,53 +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)
You may wish to simply build sunshine from source, without bloating your OS with development files.
These scripts will create a docker images that have the necessary packages. As a result, removing the development files after you're done is a single command away.
These scripts use docker under the hood, as such, they can only be used to compile the Linux version
#### Requirements
```
sudo apt install docker
```
#### instructions
You'll require one of the following Dockerfiles:
* Dockerfile-2004 --> Ubuntu 20.04
* Dockerfile-2104 --> Ubuntu 21.04
* Dockerfile-debian --> Debian Bullseye
Depending on your system, the build-* scripts may need root privilleges
First, the docker container needs to be created:
```
cd scripts
./build-container.sh -f Dockerfile-<name>
```
Then, the sources will be compiled and the debian package generated:
```
./build-sunshine.sh -p -s ..
```
You can run `build-sunshine -p -s ..` again as long as the docker container exists.
```
git pull
./build-sunshine.sh -p -s ..
```
Optionally, the docker container can be removed after you're finished:
```
./build-container.sh -c delete
```
Finally install the resulting package:
```
sudo apt install -f sunshine-build/sunshine.deb
```

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()

View File

@@ -1,179 +0,0 @@
#!/bin/bash -e
set -e
usage() {
echo "Usage: $0 [OPTIONS]"
echo " -c: command --> default [build]"
echo " | delete --> Delete the container, Dockerfile isn't mandatory"
echo " | build --> Build the container, Dockerfile is mandatory"
echo " | compile --> Builds the container, then compiles it. Dockerfile is mandatory"
echo ""
echo " -s: path: The path to the source for compilation"
echo " -n: name: Docker container name --> default [sunshine]"
echo " --> all: Build/Compile/Delete all available docker containers"
echo " -f: Dockerfile: The name of the docker file"
}
# Attempt to turn relative paths into absolute paths
absolute_path() {
RELATIVE_PATH=$1
if which realpath >/dev/null 2>/dev/null
then
RELATIVE_PATH=$(realpath $RELATIVE_PATH)
else
echo "Warning: realpath is not installed on your system, ensure [$1] is absolute"
fi
RETURN=$RELATIVE_PATH
}
CONTAINER_NAME=sunshine
COMMAND=BUILD
build_container() {
CONTAINER_NAME=$1
DOCKER_FILE=$2
if [ ! -f "$DOCKER_FILE" ]
then
echo "Error: $DOCKER_FILE doesn't exist"
exit 7
fi
echo "docker build . -t $CONTAINER_NAME -f $DOCKER_FILE"
docker build . -t "$CONTAINER_NAME" -f "$DOCKER_FILE"
}
delete() {
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
then
shopt -s nullglob
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
do
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
if docker inspect "$CURRENT_CONTAINER" > /dev/null 2> /dev/null
then
echo "docker rmi $CURRENT_CONTAINER"
docker rmi "$CURRENT_CONTAINER"
fi
done
shopt -u nullglob #revert nullglob back to it's normal default state
else
if docker inspect "$CONTAINER_NAME" > /dev/null 2> /dev/null
then
echo "docker rmi $CONTAINER_NAME"
docker rmi $CONTAINER_NAME
fi
fi
}
build() {
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
then
shopt -s nullglob
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
do
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
build_container "$CURRENT_CONTAINER" "$file"
done
shopt -u nullglob #revert nullglob back to it's normal default state
else
if [[ -z "$DOCKER_FILE" ]]
then
echo "Error: if container name isn't equal to 'all', you need to specify the Dockerfile"
exit 6
fi
build_container "$CONTAINER_NAME" "$DOCKER_FILE"
fi
}
abort() {
echo "$1"
exit 10
}
compile() {
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
then
shopt -s nullglob
# If any docker container doesn't exist, we cannot compile all of them
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
do
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
# If container doesn't exist --> abort.
docker inspect "$CURRENT_CONTAINER" > /dev/null 2> /dev/null || abort "Error: container image [$CURRENT_CONTAINER] doesn't exist"
done
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
do
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
echo "$PWD/build-sunshine.sh -p -n $CURRENT_CONTAINER $SUNSHINE_SOURCES"
"$PWD/build-sunshine.sh" -p -n "$CURRENT_CONTAINER" $SUNSHINE_SOURCES
done
shopt -u nullglob #revert nullglob back to it's normal default state
else
# If container exists
if docker inspect "$CONTAINER_NAME" > /dev/null 2> /dev/null
then
echo "$PWD/build-sunshine.sh -p -n $CONTAINER_NAME $SUNSHINE_SOURCES"
"$PWD/build-sunshine.sh" -p -n "$CONTAINER_NAME" $SUNSHINE_SOURCES
else
echo "Error: container image [$CONTAINER_NAME] doesn't exist"
exit 9
fi
fi
}
while getopts ":c:hn:f:s:" arg; do
case ${arg} in
s)
SUNSHINE_SOURCES="-s $OPTARG"
;;
c)
COMMAND=$(echo $OPTARG | tr '[:lower:]' '[:upper:]')
;;
n)
echo "Container name: $OPTARG"
CONTAINER_NAME="$OPTARG"
;;
f)
echo "Using Dockerfile [$OPTARG]"
DOCKER_FILE="$OPTARG"
;;
h)
usage
exit 0
;;
esac
done
echo "$0 set to $(echo $COMMAND | tr '[:upper:]' '[:lower:]')"
if [ "$COMMAND" = "BUILD" ]
then
echo "Start building..."
delete
build
echo "Done."
elif [ "$COMMAND" = "COMPILE" ]
then
echo "Start compiling..."
compile
echo "Done."
elif [ "$COMMAND" = "DELETE" ]
then
echo "Start deleting..."
delete
echo "Done."
else
echo "Unknown command [$(echo $COMMAND | tr '[:upper:]' '[:lower:]')]"
exit 4
fi

View File

@@ -1,35 +0,0 @@
#!/bin/bash -e
set -e
CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}"
SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}"
SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-/etc/sunshine}"
SUNSHINE_ROOT="${SUNSHINE_ROOT:-/root/sunshine}"
SUNSHINE_TAG="${SUNSHINE_TAG:-master}"
SUNSHINE_GIT_URL="${SUNSHINE_GIT_URL:-https://github.com/sunshinestream/sunshine.git}"
SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON}
SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON}
SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON}
SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON}
# For debugging, it would be usefull to have the sources on the host.
if [[ ! -d "$SUNSHINE_ROOT" ]]
then
git clone --depth 1 --branch "$SUNSHINE_TAG" "$SUNSHINE_GIT_URL" --recurse-submodules "$SUNSHINE_ROOT"
fi
if [[ ! -d /root/sunshine-build ]]
then
mkdir -p /root/sunshine-build
fi
cd /root/sunshine-build
cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "$SUNSHINE_ROOT"
make -j ${nproc}
./gen-deb

View File

@@ -1,115 +0,0 @@
#!/bin/bash -e
set -e
usage() {
echo "Usage: $0"
echo " -d: Generate a debug build"
echo " -p: Generate a debian package"
echo " -u: The input device is not a TTY"
echo " -n name: Docker container name --> default [sunshine]"
echo " -s path/to/sources/sunshine: Use local sources instead of a git repository"
echo " -c path/to/cmake/binary/dir: Store cmake output on host OS"
}
# Attempt to turn relative paths into absolute paths
absolute_path() {
RELATIVE_PATH=$1
if which realpath >/dev/null 2>/dev/null
then
RELATIVE_PATH=$(realpath $RELATIVE_PATH)
else
echo "Warning: realpath is not installed on your system, ensure [$1] is absolute"
fi
RETURN=$RELATIVE_PATH
}
CMAKE_BUILD_TYPE="-e CMAKE_BUILD_TYPE=Release"
SUNSHINE_PACKAGE_BUILD=OFF
SUNSHINE_GIT_URL=https://github.com/sunshinestream/sunshine.git
CONTAINER_NAME=sunshine
# Docker will fail if ctrl+c is passed through and the input is not a tty
DOCKER_INTERACTIVE=-ti
while getopts ":dpuhc:s:n:" arg; do
case ${arg} in
u)
echo "Input device is not a TTY"
USERNAME="$USER"
unset DOCKER_INTERACTIVE
;;
d)
echo "Creating debug build"
CMAKE_BUILD_TYPE="-e CMAKE_BUILD_TYPE=Debug"
;;
p)
echo "Creating package build"
SUNSHINE_PACKAGE_BUILD=ON
SUNSHINE_ASSETS_DIR="-e SUNSHINE_ASSETS_DIR=/etc/sunshine"
SUNSHINE_EXECUTABLE_PATH="-e SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine"
;;
s)
absolute_path "$OPTARG"
OPTARG="$RETURN"
echo "Using sources from $OPTARG"
SUNSHINE_ROOT="-v $OPTARG:/root/sunshine"
;;
c)
[ "$USERNAME" == "" ] && USERNAME=$(logname)
absolute_path "$OPTARG"
OPTARG="$RETURN"
echo "Using $OPTARG as cmake binary dir"
if [[ ! -d $OPTARG ]]
then
echo "cmake binary dir doesn't exist, a new one will be created."
mkdir -p "$OPTARG"
[ "$USERNAME" == "$USER"] || chown $USERNAME:$USERNAME "$OPTARG"
fi
CMAKE_ROOT="-v $OPTARG:/root/sunshine-build"
;;
n)
echo "Container name: $OPTARG"
CONTAINER_NAME=$OPTARG
;;
h)
usage
exit 0
;;
esac
done
[ "$USERNAME" = "" ] && USERNAME=$(logname)
BUILD_DIR="$PWD/$CONTAINER_NAME-build"
[ "$SUNSHINE_ASSETS_DIR" = "" ] && SUNSHINE_ASSETS_DIR="-e SUNSHINE_ASSETS_DIR=$BUILD_DIR/assets"
[ "$SUNSHINE_EXECUTABLE_PATH" = "" ] && SUNSHINE_EXECUTABLE_PATH="-e SUNSHINE_EXECUTABLE_PATH=$BUILD_DIR/sunshine"
echo "docker run $DOCKER_INTERACTIVE --privileged $SUNSHINE_ROOT $CMAKE_ROOT $SUNSHINE_ASSETS_DIR $SUNSHINE_EXECUTABLE_PATH $CMAKE_BUILD_TYPE --name $CONTAINER_NAME $CONTAINER_NAME"
docker run $DOCKER_INTERACTIVE --privileged $SUNSHINE_ROOT $CMAKE_ROOT $SUNSHINE_ASSETS_DIR $SUNSHINE_EXECUTABLE_PATH $CMAKE_BUILD_TYPE --name $CONTAINER_NAME $CONTAINER_NAME
exit_code=$?
if [ $exit_code -eq 0 ]
then
mkdir -p $BUILD_DIR
case $SUNSHINE_PACKAGE_BUILD in
ON)
echo "Downloading package to: $BUILD_DIR/$CONTAINER_NAME.deb"
docker cp $CONTAINER_NAME:/root/sunshine-build/package-deb/sunshine.deb "$BUILD_DIR/$CONTAINER_NAME.deb"
;;
*)
echo "Downloading binary and assets to: $BUILD_DIR"
docker cp $CONTAINER_NAME:/root/sunshine/assets "$BUILD_DIR"
docker cp $CONTAINER_NAME:/root/sunshine-build/sunshine "$BUILD_DIR"
;;
esac
echo "chown --recursive $USERNAME:$USERNAME $BUILD_DIR"
chown --recursive $USERNAME:$USERNAME "$BUILD_DIR"
fi
echo "Removing docker container $CONTAINER_NAME"
docker rm $CONTAINER_NAME

1
scripts/requirements.txt Normal file
View File

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

View File

@@ -75,7 +75,7 @@ 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);
//FIXME: Pick correct opus_stream_config_t based on config.channels
// 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])];
opus_t opus { opus_multistream_encoder_create(
@@ -120,7 +120,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
// 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 ref = control_shared.ref();
@@ -135,9 +135,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,8 +162,14 @@ 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;
}
}

View File

@@ -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,7 +21,7 @@ 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 {
@@ -104,14 +105,14 @@ enum quality_e : int {
enum class rc_hevc_e : int {
constqp, /**< Constant QP mode */
vbr_latency, /**< Latency Constrained Variable Bitrate */
vbr_peak, /**< Peak Contrained Variable Bitrate */
vbr_peak, /**< Peak Constrained Variable Bitrate */
cbr, /**< Constant bitrate mode */
};
enum class rc_h264_e : int {
constqp, /**< Constant QP mode */
cbr, /**< Constant bitrate mode */
vbr_peak, /**< Peak Contrained Variable Bitrate */
vbr_peak, /**< Peak Constrained Variable Bitrate */
vbr_latency, /**< Latency Constrained Variable Bitrate */
};
@@ -162,6 +163,42 @@ int coder_from_view(const std::string_view &coder) {
}
} // namespace amd
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
@@ -184,9 +221,16 @@ video_t video {
std::nullopt,
-1 }, // amd
{}, // encoder
{}, // adapter_name
{}, // output_name
{
0,
0,
1,
-1 }, // vt
{}, // encoder
{}, // adapter_name
{}, // output_name
true // dwmflush
};
audio_t audio {};
@@ -243,14 +287,14 @@ 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,
};
@@ -659,7 +703,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) {
@@ -685,9 +729,15 @@ void apply_config(std::unordered_map<std::string, std::string> &&vars) {
video.amd.rc_hevc = amd::rc_hevc_from_view(rc);
}
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);
@@ -861,8 +911,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

@@ -34,9 +34,17 @@ struct video_t {
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 {

View File

@@ -1,4 +1,3 @@
//
// Created by TheElixZammuto on 2021-05-09.
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
@@ -92,9 +91,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;
}
@@ -202,8 +201,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");
@@ -314,7 +313,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);
@@ -335,7 +334,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) {
@@ -388,7 +387,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) {
@@ -452,7 +451,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);
@@ -488,7 +487,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");
@@ -496,16 +495,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);
@@ -542,7 +543,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));
@@ -555,9 +556,9 @@ void savePin(resp_https_t response, req_https_t request) {
}
}
void unpairAll(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;
@@ -571,9 +572,9 @@ void unpairAll(resp_https_t response, req_https_t request){
outputTree.put("status", true);
}
void closeApp(resp_https_t response, req_https_t request){
void closeApp(resp_https_t response, req_https_t request) {
if(!authenticate(response, request)) return;
print_req(request);
pt::ptree outputTree;
@@ -597,35 +598,35 @@ void start() {
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["^/troubleshooting$"]["GET"] = getTroubleshootingPage;
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.resource["^/api/clients/unpair$"]["POST"] = unpairAll;
server.resource["^/api/apps/close"]["POST"] = closeApp;
server.resource["^/images/favicon.ico$"]["GET"] = getFaviconImage;
server.resource["^/images/logo-sunshine-45.png$"]["GET"] = getSunshineLogoImage;
server.resource["^/third_party/bootstrap.min.css$"]["GET"] = getBootstrapCss;
server.resource["^/third_party/bootstrap.bundle.min.js$"]["GET"] = getBootstrapJs;
server.resource["^/fontawesome/css/all.min.css$"]["GET"] = getFontAwesomeCss;
server.resource["^/fontawesome/webfonts/fa-brands-400.ttf$"]["GET"] = getFontAwesomeBrands;
server.resource["^/fontawesome/webfonts/fa-solid-900.ttf$"]["GET"] = getFontAwesomeSolid;
server.resource["^/third_party/vue.js$"]["GET"] = getVueJs;
server.config.reuse_address = true;
server.config.address = "0.0.0.0"s;
server.config.port = port_https;
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["^/troubleshooting$"]["GET"] = getTroubleshootingPage;
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.resource["^/api/clients/unpair$"]["POST"] = unpairAll;
server.resource["^/api/apps/close"]["POST"] = closeApp;
server.resource["^/images/favicon.ico$"]["GET"] = getFaviconImage;
server.resource["^/images/logo-sunshine-45.png$"]["GET"] = getSunshineLogoImage;
server.resource["^/third_party/bootstrap.min.css$"]["GET"] = getBootstrapCss;
server.resource["^/third_party/bootstrap.bundle.min.js$"]["GET"] = getBootstrapJs;
server.resource["^/fontawesome/css/all.min.css$"]["GET"] = getFontAwesomeCss;
server.resource["^/fontawesome/webfonts/fa-brands-400.ttf$"]["GET"] = getFontAwesomeBrands;
server.resource["^/fontawesome/webfonts/fa-solid-900.ttf$"]["GET"] = getFontAwesomeSolid;
server.resource["^/third_party/vue.js$"]["GET"] = getVueJs;
server.config.reuse_address = true;
server.config.address = "0.0.0.0"s;
server.config.port = port_https;
try {
server.bind();

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,11 @@
//
// 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 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 +20,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 +272,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) {
@@ -492,4 +490,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

View File

@@ -44,7 +44,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 +56,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 +180,4 @@ int create_creds(const std::string &pkey, const std::string &cert) {
return 0;
}
} // namespace http
} // namespace http

View File

@@ -16,4 +16,4 @@ 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,6 +1,4 @@
//
// Created by loki on 6/20/19.
//
// define uint32_t for <moonlight-common-c/src/Input.h>
#include <cstdint>
@@ -9,6 +7,7 @@ extern "C" {
}
#include <bitset>
#include <unordered_map>
#include "config.h"
#include "input.h"
@@ -88,7 +87,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;
@@ -315,11 +314,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.
*
@@ -427,7 +426,7 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_KEYBOARD_PACKET packet) {
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;
}

View File

@@ -1,6 +1,4 @@
//
// Created by loki on 6/20/19.
//
#ifndef SUNSHINE_INPUT_H
#define SUNSHINE_INPUT_H
@@ -32,4 +30,4 @@ struct touch_port_t : public platf::touch_port_t {
};
} // namespace input
#endif //SUNSHINE_INPUT_H
#endif // SUNSHINE_INPUT_H

View File

@@ -1,6 +1,4 @@
//
// Created by loki on 5/30/19.
//
#include "process.h"
@@ -24,8 +22,8 @@
#include "rtsp.h"
#include "thread_pool.h"
#include "upnp.h"
#include "video.h"
#include "version.h"
#include "video.h"
#include "platform/common.h"
extern "C" {
@@ -57,24 +55,34 @@ struct NoDelete {
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", int)
/** Print the help to stdout.
This function prints output to stdout.
*/
void print_help(const char *name) {
std::cout
<< "Usage: "sv << name << " [options] [/path/to/configuration_file] [--cmd]"sv << std::endl
<< " Any configurable option can be overwritten with: \"name=value\""sv << std::endl
<< std::endl
<< " Note: The configuration will be created if it doesn't exist."sv << std::endl
<< std::endl
<< " --help | print help"sv << std::endl
<< " --creds username password | set user credentials for the Web manager" << std::endl
<< " --version | print the version of sunshine" << std::endl
<< " --creds username password | set user credentials for the Web manager"sv << std::endl
<< " --version | print the version of sunshine"sv << std::endl
<< std::endl
<< " flags"sv << std::endl
<< " -0 | Read PIN from stdin"sv << std::endl
<< " -1 | Do not load previously saved state and do retain any state after shutdown"sv << std::endl
<< " | Effectively starting as if for the first time without overwriting any pairings with your devices"sv << std::endl
<< " -2 | Force replacement of headers in video stream" << std::endl
<< " -p | Enable/Disable UPnP" << std::endl
<< " -2 | Force replacement of headers in video stream"sv << std::endl
<< " -p | Enable/Disable UPnP"sv << std::endl
<< std::endl;
}
/** Call the print_help function.
Calls the print_help function and then exits.
*/
namespace help {
int entry(const char *name, int argc, char *argv[]) {
print_help(name);
@@ -82,6 +90,10 @@ int entry(const char *name, int argc, char *argv[]) {
}
} // namespace help
/** Print the version details to stdout.
This function prints the version details to stdout and then exits.
*/
namespace version {
int entry(const char *name, int argc, char *argv[]) {
std::cout << PROJECT_NAME << " version: v" << PROJECT_VER << std::endl;
@@ -275,7 +287,7 @@ int main(int argc, char *argv[]) {
upnp_unmap = upnp::start();
});
//FIXME: Temporary workaround: Simple-Web_server needs to be updated or replaced
// FIXME: Temporary workaround: Simple-Web_server needs to be updated or replaced
if(shutdown_event->peek()) {
return 0;
}
@@ -326,4 +338,4 @@ int write_file(const char *path, const std::string_view &contents) {
std::uint16_t map_port(int port) {
return (std::uint16_t)((int)config::sunshine.port + port);
}
}

View File

@@ -1,6 +1,4 @@
//
// Created by loki on 12/22/19.
//
#ifndef SUNSHINE_MAIN_H
#define SUNSHINE_MAIN_H
@@ -54,4 +52,4 @@ MAIL(rumble);
} // namespace mail
#endif //SUNSHINE_MAIN_H
#endif // SUNSHINE_MAIN_H

View File

@@ -1,6 +1,4 @@
//
// Created by loki on 12/27/19.
//
#include "network.h"
#include "utility.h"
@@ -112,4 +110,4 @@ void free_host(ENetHost *host) {
enet_host_destroy(host);
}
} // namespace net
} // namespace net

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