From 15e51203ba8ca63fbf414b86f00502c097508f14 Mon Sep 17 00:00:00 2001 From: Jorys Paulin Date: Fri, 25 Jun 2021 14:36:21 +0200 Subject: [PATCH 01/10] Update Bootstrap to v5.0.2 --- assets/web/header.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/web/header.html b/assets/web/header.html index 1c9702e6..7a2f30c8 100644 --- a/assets/web/header.html +++ b/assets/web/header.html @@ -6,12 +6,12 @@ Sunshine - - - + + + From 7fca6adedef046e9b910a7dcdc6d3103741108cf Mon Sep 17 00:00:00 2001 From: Jorys Paulin Date: Fri, 25 Jun 2021 14:36:59 +0200 Subject: [PATCH 02/10] Added footer to HTML pages --- assets/web/footer.html | 3 +++ sunshine/confighttp.cpp | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 assets/web/footer.html diff --git a/assets/web/footer.html b/assets/web/footer.html new file mode 100644 index 00000000..98709269 --- /dev/null +++ b/assets/web/footer.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/sunshine/confighttp.cpp b/sunshine/confighttp.cpp index ed0a3b88..6e278ce8 100644 --- a/sunshine/confighttp.cpp +++ b/sunshine/confighttp.cpp @@ -133,7 +133,8 @@ void getIndexPage(resp_https_t response, req_https_t request) { std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "index.html"); - response->write(header + content); + std::string footer = read_file(WEB_DIR "footer.html"); + response->write(header + content + footer); } void getPinPage(resp_https_t response, req_https_t request) { @@ -143,7 +144,8 @@ void getPinPage(resp_https_t response, req_https_t request) { std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "pin.html"); - response->write(header + content); + std::string footer = read_file(WEB_DIR "footer.html"); + response->write(header + content + footer); } void getAppsPage(resp_https_t response, req_https_t request) { @@ -153,7 +155,8 @@ void getAppsPage(resp_https_t response, req_https_t request) { std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "apps.html"); - response->write(header + content); + std::string footer = read_file(WEB_DIR "footer.html"); + response->write(header + content + footer); } void getClientsPage(resp_https_t response, req_https_t request) { @@ -163,7 +166,8 @@ void getClientsPage(resp_https_t response, req_https_t request) { std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "clients.html"); - response->write(header + content); + std::string footer = read_file(WEB_DIR "footer.html"); + response->write(header + content + footer); } void getConfigPage(resp_https_t response, req_https_t request) { @@ -173,7 +177,8 @@ void getConfigPage(resp_https_t response, req_https_t request) { std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "config.html"); - response->write(header + content); + std::string footer = read_file(WEB_DIR "footer.html"); + response->write(header + content + footer); } void getPasswordPage(resp_https_t response, req_https_t request) { @@ -183,7 +188,8 @@ void getPasswordPage(resp_https_t response, req_https_t request) { std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "password.html"); - response->write(header + content); + std::string footer = read_file(WEB_DIR "footer.html"); + response->write(header + content + footer); } void getApps(resp_https_t response, req_https_t request) { From 66ec727da103a829e5510d787b0b3e287a792ff4 Mon Sep 17 00:00:00 2001 From: Jorys Paulin Date: Fri, 25 Jun 2021 14:58:32 +0200 Subject: [PATCH 03/10] Update the PIN page --- assets/web/pin.html | 87 +++++++++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/assets/web/pin.html b/assets/web/pin.html index 89e5b704..d4beec11 100644 --- a/assets/web/pin.html +++ b/assets/web/pin.html @@ -1,31 +1,64 @@ - -
-

PIN Pairing

-
-
- - -
-
- Warning! Make sure you have access to the client you are pairing with.
- This software can give total control to your computer, so be careful! +
+
+
+

Pair a new device

+

Allow a new client to connect to this computer by entering the PIN code given by Moonlight here. +

+
+
+
+
+
+
+ + +
+ + +
Pairing successful! Please check Moonlight to continue!
+
The given PIN code doesn't match, please check that it's typed correctly. +
+
+ +
-
- -
+
+
+
+ \ No newline at end of file From 43df48b5a8d0deb04c9139da24835e6575f37c2b Mon Sep 17 00:00:00 2001 From: Jorys Paulin Date: Sun, 27 Jun 2021 18:06:20 +0200 Subject: [PATCH 04/10] Update the password page --- assets/web/password.html | 178 +++++++++++++++++++++------------------ 1 file changed, 98 insertions(+), 80 deletions(-) diff --git a/assets/web/password.html b/assets/web/password.html index 3e3f2140..4206b16d 100644 --- a/assets/web/password.html +++ b/assets/web/password.html @@ -1,97 +1,115 @@ -
-

Password Change

-
-
-
-

Current Credentials

-
- - -
 
-
-
- - -
-
-
-

New Credentials

-
- - -
If not specified, the username will not change +
+
+
+

Update credentials

+

Update the credentials used to connect to this web interface, including the username and + password.

+
+
+
+
+ +
+
+ + +
+
+

Current credentials

+

You need to enter your current credentials to change them, you need to enter both the + username and password.

+
+ + +
+
+ + +
+
+
+

New credentials

+

Enter the new credentials you want to use, if you just want to change the password you can + leave the username field empty.

+
+ + +
+
+ + +
+
+ + +
+
+
+
-
- - -
-
- - -
-
-
-
Error: {{error}}
-
Success! This page will reload soon, your browser will ask you for the new credentials
-
- +
- -
+
+ - - \ No newline at end of file + body: JSON.stringify(this.passwordData), + }) + .then((r) => { + this.isLoading = false; + if (r.status == 200) { + r.json().then((rj) => { + if (rj.status.toString() === "true") { + this.success = true; + setTimeout(() => { + document.location.reload(); + }, 5000); + } else { + this.error = rj.error; + } + }); + } else { + this.error = "Internal Server Error"; + } + }) + .catch((err) => { + this.isLoading = false; + console.error(err); + }); + }, + }, + }); + \ No newline at end of file From ed4643e17dec7a7c641554cefc8d6e563361b702 Mon Sep 17 00:00:00 2001 From: Jorys Paulin Date: Sun, 27 Jun 2021 18:10:22 +0200 Subject: [PATCH 05/10] Update index page --- assets/web/index.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/assets/web/index.html b/assets/web/index.html index 4b02f845..8643a4ff 100644 --- a/assets/web/index.html +++ b/assets/web/index.html @@ -1,9 +1,13 @@ -
-
-
-

Hello, Sunshine!

-

Sunshine is a Gamestream host for Moonlight

- Official GitHub Repository +
+
+
+
+
+

Hello, Sunshine!

+

Sunshine is a Gamestream host for Moonlight

+

Official GitHub Repository

+
+
-
\ No newline at end of file + \ No newline at end of file From 18915c932b77fa93fe27946fcd576e14bae1a0df Mon Sep 17 00:00:00 2001 From: Jorys Paulin Date: Sun, 27 Jun 2021 18:10:40 +0200 Subject: [PATCH 06/10] Update clients page --- assets/web/clients.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/assets/web/clients.html b/assets/web/clients.html index c2d03025..09610d12 100644 --- a/assets/web/clients.html +++ b/assets/web/clients.html @@ -1,3 +1,14 @@ -
-

Clients

-
\ No newline at end of file +
+
+
+

Clients

+
+
+
+
+

Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi, perspiciatis possimus cupiditate repellat + ducimus, accusantium, voluptatem recusandae ipsa non commodi aliquam fugit reprehenderit nostrum soluta + tenetur molestias corporis quia! Debitis!

+
+
+
\ No newline at end of file From a7eb1f0c89a1777f4668bf9e7a38b2ae13eaed99 Mon Sep 17 00:00:00 2001 From: Jorys Paulin Date: Thu, 1 Jul 2021 12:48:15 +0200 Subject: [PATCH 07/10] Update config page --- assets/web/config.html | 928 +++++++++++++++++++++-------------------- 1 file changed, 478 insertions(+), 450 deletions(-) diff --git a/assets/web/config.html b/assets/web/config.html index 8002ef45..b8924320 100644 --- a/assets/web/config.html +++ b/assets/web/config.html @@ -1,467 +1,495 @@ -
-

Configuration

-
- - - -
- -
- - -
The name displayed by Moonlight. If not specified, the PC's hostname is used -
-
- -
- - -
The minimum log level printed to standard out
-
- -
- - -
The origin of the remote endpoint address that is not denied access to Web UI -
-
- -
- - -
Automatically configure port forwarding
-
- -
- - -
How long to wait in milliseconds for data from moonlight before shutting down the - stream
-
- -
- -
- -
-
- {{r}} - × +
+
+
+

Configuration

+
+
+
+
+
+ + + +
+ +
+ + +
The name displayed by Moonlight. If not specified, the PC's hostname is + used
-
- - -
-
-
- -
-
- {{f}} - × + +
+ + +
The minimum log level printed to standard out
+
+ +
+ + +
The origin of the remote endpoint address that is not denied access to + Web UI +
+
+ +
+ + +
Automatically configure port forwarding
+
+ +
+ + +
How long to wait in milliseconds for data from moonlight before shutting + down the + stream
+
+ +
+ +
+ +
+
+ {{r}} + × +
+
+ + +
+
+
+
+ +
+
+ {{f}} + × +
+
+ + +
+
+
+
+ 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.
-
- - -
-
- 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. -
-
-
- -
- -
- - -
The private key must be 2048 bits
-
- -
- - -
The certificate must be signed with a 2048 bit key
-
+ +
+ +
+ + +
The private key must be 2048 bits
+
+ +
+ + +
The certificate must be signed with a 2048 bit key
+
- -
- - -
The file where current state of Sunshine is stored
-
- -
- - -
The file where current apps of Sunshine are stored
-
-
-
- -
- - -
- 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
-
-
- -
- - -
- Control how fast keys will repeat themselves
- The initial delay in milliseconds before repeating keys -
-
- -
- - -
- How often keys repeat every second
- This configurable option supports decimals -
-
-
- -
- -
- - -
- The name of the audio sink used for Audio Loopback
- You can find the name of the audio sink using the following command:
-
tools\audio-info.exe
-
-
-
- - -
- 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 either command:
-
pacmd list-sinks | grep "name:"
-
pactl info | grep Source

-
-
- -
- - -
- The virtual sink, is the audio device that's virtual (Like Steam Streaming Speakers), it allows - Sunshine - to stream audio, while muting the speakers. -
-
- -
- - -
- You can select the video card you want to stream:
- The appropriate values can be found using the following command:
-
tools\dxgi-info.exe
-
-
- -
- - -
- You can select the video card you want to stream:
- The appropriate values can be found using the following command:
- tools\dxgi-info.exe

-
-
-
- - -
- xrandr --listmonitors
- Example output: -
   0: +HDMI-1 1920/518x1200/324+0+0 HDMI-1
-
-
-
-
- -
- - -
- Set the familly of ports used by Sunshine -
-
- -
- - -
- Constant Rate Factor. Between 1 and 52. It allows QP to go up during motion and down with still - image, - resulting in constant perceived quality
- Higher value means more compression, but less quality
- If crf == 0, then use QP directly instead + +
+ + +
The file where current state of Sunshine is stored
+
+ +
+ + +
The file where current apps of Sunshine are stored
+
-
- -
- - -
- Quantitization Parameter
- Higher value means more compression, but less quality
- If crf != 0, then this parameter is ignored +
+ +
+ + +
+ 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
+
+
+ +
+ + +
+ Control how fast keys will repeat themselves
+ The initial delay in milliseconds before repeating keys +
+
+ +
+ + +
+ How often keys repeat every second
+ This configurable option supports decimals +
+
-
- -
- - -
- 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. + +
+ +
+ + +
+ The name of the audio sink used for Audio Loopback
+ You can find the name of the audio sink using the following command:
+
tools\audio-info.exe
+
+
+
+ + +
+ 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 either command:
+
pacmd list-sinks | grep "name:"
+
pactl info | grep Source

+
+
+ +
+ + +
+ The virtual sink, is the audio device that's virtual (Like Steam Streaming Speakers), it + allows + Sunshine + to stream audio, while muting the speakers. +
+
+ +
+ + +
+ You can select the video card you want to stream:
+ The appropriate values can be found using the following command:
+
tools\dxgi-info.exe
+
+
+ +
+ + +
+ You can select the video card you want to stream:
+ The appropriate values can be found using the following command:
+ tools\dxgi-info.exe

+
+
+
+ + +
+ xrandr --listmonitors
+ Example output: +
   0: +HDMI-1 1920/518x1200/324+0+0 HDMI-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. +
+ +
+ + +
+ Set the familly of ports used by Sunshine +
+
+ +
+ + +
+ Constant Rate Factor. Between 1 and 52. It allows QP to go up during motion and down with + still + image, + resulting in constant perceived quality
+ Higher value means more compression, but less quality
+ If crf == 0, then use QP directly instead +
+
+ +
+ + +
+ Quantitization Parameter
+ Higher value means more compression, but less quality
+ If crf != 0, then this parameter is ignored +
+
+ +
+ + +
+ 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. +
+
+ +
+ + +
+ 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. +
+
+ +
+ + +
+ Force a specific encoder, otherwise Sunshine will use the first encoder that is available +
+
+ +
+ + +
+ How much error correcting packets must be send for every video.
+ This is just some random number, don't know the optimal value.
+ The higher fec_percentage, the lower space for the actual data to send per frame there is +
+
+ +
+ + +
+ When multicasting, it could be useful 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 +
+
+ +
+ + +
+ Store Username/Password seperately from Sunshine's state file. +
+
+ +
+ + +
The origin of the remote endpoint address that is not denied for HTTP + method /pin +
+
+ +
+ + +
If no external IP address is given, Sunshine will automatically detect + external + IP
+
-
- -
- - -
- Force a specific encoder, otherwise Sunshine will use the first encoder that is available + +
+
+ + +
+
+ + +
-
- -
- - -
- How much error correcting packets must be send for every video.
- This is just some random number, don't know the optimal value.
- The higher fec_percentage, the lower space for the actual data to send per frame there is + +
+ +
+ + +
+
+ + +
+
+ + +
-
- -
- - -
- When multicasting, it could be useful 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 + +
+ +
+ + +
+
+ + +
+
+ + +
-
- -
- - -
- Store Username/Password seperately from Sunshine's state file. +
+
- -
- - -
The origin of the remote endpoint address that is not denied for HTTP method /pin +
+
+ Loading...
- -
- - -
If no external IP address is given, Sunshine will automatically detect external - IP
-
-
- -
-
- - -
-
- - -
-
- -
- -
- - -
-
- - -
-
- - -
-
- -
- -
- - -
-
- - -
-
- - -
-
-
- +
Success! Restart Sunshine to apply changes
+
-
Success! Restart Sunshine to apply changes
-
- -
-
+
- - \ No newline at end of file + \ No newline at end of file