mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
Compare commits
1 Commits
build/dock
...
feat/api/a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b863f760b |
12
.github/ISSUE_TEMPLATE/config.yml
vendored
12
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -5,15 +5,9 @@
|
|||||||
|
|
||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Discussions
|
|
||||||
url: https://github.com/orgs/LizardByte/discussions
|
|
||||||
about: Community discussions
|
|
||||||
- name: Questions
|
|
||||||
url: https://github.com/orgs/LizardByte/discussions
|
|
||||||
about: Ask questions
|
|
||||||
- name: Feature Requests
|
|
||||||
url: https://github.com/orgs/LizardByte/discussions
|
|
||||||
about: Request new features
|
|
||||||
- name: Support Center
|
- name: Support Center
|
||||||
url: https://app.lizardbyte.dev/support
|
url: https://app.lizardbyte.dev/support
|
||||||
about: Official LizardByte support
|
about: Official LizardByte support
|
||||||
|
- name: Discussions
|
||||||
|
url: https://github.com/orgs/LizardByte/discussions
|
||||||
|
about: Community discussions, questions, and feature requests
|
||||||
|
|||||||
2
.github/workflows/ci-docker.yml
vendored
2
.github/workflows/ci-docker.yml
vendored
@@ -123,7 +123,7 @@ jobs:
|
|||||||
docker:
|
docker:
|
||||||
needs: [check_dockerfiles, setup_release]
|
needs: [check_dockerfiles, setup_release]
|
||||||
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
|
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: write
|
contents: write
|
||||||
|
|||||||
17
api/components/responses/400.yml
Normal file
17
api/components/responses/400.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
description: Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status_code:
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
example:
|
||||||
|
status_code: 400
|
||||||
|
status: false
|
||||||
|
error: "Bad Request"
|
||||||
17
api/components/responses/401.yml
Normal file
17
api/components/responses/401.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
description: Unauthorized - The request requires user authentication.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status_code:
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
example:
|
||||||
|
status_code: 401
|
||||||
|
status: false
|
||||||
|
error: "Unauthorized"
|
||||||
7
api/components/responses/403.yml
Normal file
7
api/components/responses/403.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
description: Forbidden - The server understood the request, but is refusing to fulfill it.
|
||||||
|
content:
|
||||||
|
# TODO: return JSON response.
|
||||||
|
text/plain:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
15
api/components/responses/404.yml
Normal file
15
api/components/responses/404.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
description: Not Found - The requested resource could not be found.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status_code:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
example:
|
||||||
|
status_code: 404
|
||||||
|
error: "Not Found"
|
||||||
48
api/components/schemas/app.yml
Normal file
48
api/components/schemas/app.yml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
---
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Application Name, as shown on Moonlight
|
||||||
|
output:
|
||||||
|
type: string
|
||||||
|
description: The file where the output of the command is stored, if it is not specified, the output is ignored
|
||||||
|
cmd:
|
||||||
|
$ref: "./cmd.yml"
|
||||||
|
description: The main application to start. If blank, no application will be started.
|
||||||
|
exclude-global-prep-cmd:
|
||||||
|
type: boolean
|
||||||
|
description: Enable/Disable the execution of Global Prep Commands for this application.
|
||||||
|
elevated:
|
||||||
|
type: boolean
|
||||||
|
description: Run the application as an elevated process.
|
||||||
|
auto-detach:
|
||||||
|
type: boolean
|
||||||
|
description: Continue streaming if the application exits quickly
|
||||||
|
wait-all:
|
||||||
|
type: boolean
|
||||||
|
description: Continue streaming until all app processes exit
|
||||||
|
exit-timeout:
|
||||||
|
type: integer
|
||||||
|
description: Number of seconds to wait for all app processes to gracefully exit when requested to quit.
|
||||||
|
image-path:
|
||||||
|
type: string
|
||||||
|
description: |
|
||||||
|
Application icon/picture/image path that will be sent to client. Image must be a PNG file.
|
||||||
|
If not set, Sunshine will send default box image.
|
||||||
|
working-dir:
|
||||||
|
type: string
|
||||||
|
description: |
|
||||||
|
The working directory that should be passed to the process.
|
||||||
|
For example, some applications use the working directory to search for configuration files.
|
||||||
|
If not set, Sunshine will default to the parent directory of the command
|
||||||
|
prep-cmd:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "./prep-cmd.yml"
|
||||||
|
detached:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "./cmd.yml"
|
||||||
3
api/components/schemas/cmd.yml
Normal file
3
api/components/schemas/cmd.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
type: string
|
||||||
|
description: Command to execute
|
||||||
16
api/components/schemas/prep-cmd.yml
Normal file
16
api/components/schemas/prep-cmd.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- do
|
||||||
|
- undo
|
||||||
|
- elevated
|
||||||
|
properties:
|
||||||
|
do:
|
||||||
|
$ref: "./cmd.yml"
|
||||||
|
description: Command to run before the application starts.
|
||||||
|
undo:
|
||||||
|
$ref: "./cmd.yml"
|
||||||
|
description: Command to run after the application exits.
|
||||||
|
elevated:
|
||||||
|
type: boolean
|
||||||
|
description: Run the command as an elevated process.
|
||||||
44
api/openapi.yml
Normal file
44
api/openapi.yml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
# https://openapi.tools
|
||||||
|
|
||||||
|
openapi: 3.1.0
|
||||||
|
|
||||||
|
info:
|
||||||
|
title: Sunshine
|
||||||
|
summary: Self-hosted game stream host for Moonlight.
|
||||||
|
version: 0.0.0
|
||||||
|
contact:
|
||||||
|
name: LizardByte
|
||||||
|
url: https://app.lizardbyte.dev/support
|
||||||
|
license:
|
||||||
|
name: GNU General Public License v3.0 only
|
||||||
|
url: https://github.com/LizardByte/Sunshine/blob/master/LICENSE
|
||||||
|
|
||||||
|
servers:
|
||||||
|
- url: "https://{host}:{ui-port}"
|
||||||
|
description: Sunshine server
|
||||||
|
variables:
|
||||||
|
host:
|
||||||
|
default: "localhost"
|
||||||
|
ui-port:
|
||||||
|
default: 47990
|
||||||
|
|
||||||
|
security:
|
||||||
|
- basicAuth: []
|
||||||
|
|
||||||
|
components:
|
||||||
|
securitySchemes:
|
||||||
|
# TODO: update when JWT is implemented (https://github.com/LizardByte/Sunshine/pull/2995)
|
||||||
|
# https://swagger.io/specification/#security-scheme-object-examples
|
||||||
|
basicAuth:
|
||||||
|
description: HTTP Basic authentication
|
||||||
|
type: http
|
||||||
|
scheme: basic
|
||||||
|
|
||||||
|
paths:
|
||||||
|
/api/apps:
|
||||||
|
$ref: "./paths/confighttp/apps/apps.yml"
|
||||||
|
/api/apps/{index}:
|
||||||
|
$ref: "./paths/confighttp/apps/apps-by-index.yml"
|
||||||
|
/api/logs:
|
||||||
|
$ref: "./paths/confighttp/logs/logs.yml"
|
||||||
37
api/paths/confighttp/apps/apps-by-index.yml
Normal file
37
api/paths/confighttp/apps/apps-by-index.yml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
delete:
|
||||||
|
summary: Delete an application.
|
||||||
|
description: |
|
||||||
|
Delete an application.
|
||||||
|
operationId: deleteApps
|
||||||
|
tags:
|
||||||
|
- Apps
|
||||||
|
parameters:
|
||||||
|
- name: index
|
||||||
|
in: path
|
||||||
|
description: The index of the application to delete.
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: The application was deleted successfully.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
result:
|
||||||
|
type: string
|
||||||
|
example:
|
||||||
|
status: true
|
||||||
|
result: "application 9999 deleted"
|
||||||
|
'400':
|
||||||
|
$ref: "../../../components/responses/400.yml"
|
||||||
|
'401':
|
||||||
|
$ref: "../../../components/responses/401.yml"
|
||||||
|
'403':
|
||||||
|
$ref: "../../../components/responses/403.yml"
|
||||||
151
api/paths/confighttp/apps/apps.yml
Normal file
151
api/paths/confighttp/apps/apps.yml
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
---
|
||||||
|
get:
|
||||||
|
summary: Get the list of available applications.
|
||||||
|
description: |
|
||||||
|
Get the list of available applications.
|
||||||
|
operationId: getApps
|
||||||
|
tags:
|
||||||
|
- Apps
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: A list of available applications.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "../../../components/schemas/app.yml"
|
||||||
|
example:
|
||||||
|
- name: "Example App"
|
||||||
|
output: "/path/to/output.log"
|
||||||
|
cmd: "example-command"
|
||||||
|
exclude-global-prep-cmd: false
|
||||||
|
elevated: false
|
||||||
|
auto-detach: true
|
||||||
|
wait-all: false
|
||||||
|
exit-timeout: 30
|
||||||
|
image-path: "/path/to/image.png"
|
||||||
|
working-dir: "/path/to/working-dir"
|
||||||
|
prep-cmd:
|
||||||
|
- do: "prep-command-1"
|
||||||
|
undo: "undo-command-1"
|
||||||
|
elevated: false
|
||||||
|
detached:
|
||||||
|
- "detached-command-1"
|
||||||
|
'401':
|
||||||
|
$ref: "../../../components/responses/401.yml"
|
||||||
|
'403':
|
||||||
|
$ref: "../../../components/responses/403.yml"
|
||||||
|
|
||||||
|
post:
|
||||||
|
summary: Save an application.
|
||||||
|
description: |
|
||||||
|
Save an application.
|
||||||
|
To save a new application the index must be `-1`.
|
||||||
|
To update an existing application, you must provide the current index of the application.
|
||||||
|
operationId: postApps
|
||||||
|
tags:
|
||||||
|
- Apps
|
||||||
|
parameters:
|
||||||
|
- name: index
|
||||||
|
in: query
|
||||||
|
description: The index of the application to update. If the index is -1, a new application will be created.
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
- name: name
|
||||||
|
in: query
|
||||||
|
description: Application Name
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: output
|
||||||
|
in: query
|
||||||
|
description: Log Output Path
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: cmd
|
||||||
|
in: query
|
||||||
|
description: Command to run the application
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
$ref: "../../../components/schemas/cmd.yml"
|
||||||
|
- name: exclude-global-prep-cmd
|
||||||
|
in: query
|
||||||
|
description: Enable/Disable the execution of Global Prep Commands for this application.
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
- name: elevated
|
||||||
|
in: query
|
||||||
|
description: Run the application as an elevated process.
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
- name: auto-detach
|
||||||
|
in: query
|
||||||
|
description: Continue streaming if the application exits quickly
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
- name: wait-all
|
||||||
|
in: query
|
||||||
|
description: Continue streaming until all app processes exit
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
- name: exit-timeout
|
||||||
|
in: query
|
||||||
|
description: Number of seconds to wait for all app processes to gracefully exit when requested to quit.
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
- name: prep-cmd
|
||||||
|
in: query
|
||||||
|
description: Commands to run before the main application
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "../../../components/schemas/prep-cmd.yml"
|
||||||
|
- name: detached
|
||||||
|
in: query
|
||||||
|
description: Commands to run in detached processes
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "../../../components/schemas/cmd.yml"
|
||||||
|
- name: image-path
|
||||||
|
in: query
|
||||||
|
description: Full path to the application image. Must be a png file.
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: working-dir
|
||||||
|
in: query
|
||||||
|
description: The working directory that should be passed to the process.
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: The application was saved successfully.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
example:
|
||||||
|
status: true
|
||||||
|
'400':
|
||||||
|
$ref: "../../../components/responses/400.yml"
|
||||||
|
'401':
|
||||||
|
$ref: "../../../components/responses/401.yml"
|
||||||
|
'403':
|
||||||
|
$ref: "../../../components/responses/403.yml"
|
||||||
20
api/paths/confighttp/logs/logs.yml
Normal file
20
api/paths/confighttp/logs/logs.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
get:
|
||||||
|
summary: Get the logs from the log file.
|
||||||
|
description: |
|
||||||
|
Get the logs from the log file.
|
||||||
|
operationId: getLogs
|
||||||
|
tags:
|
||||||
|
- Logs
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: The contents of the log file.
|
||||||
|
content:
|
||||||
|
text/plain:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: '[2025-01-15 17:07:58.131]: Info: Sunshine version: v...'
|
||||||
|
'401':
|
||||||
|
$ref: "../../../components/responses/401.yml"
|
||||||
|
'403':
|
||||||
|
$ref: "../../../components/responses/403.yml"
|
||||||
@@ -1,19 +1,16 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
# artifacts: true
|
# artifacts: true
|
||||||
# platforms: linux/amd64,linux/arm64/v8
|
# platforms: linux/amd64,linux/arm64/v8
|
||||||
# platforms_pr: linux/amd64,linux/arm64/v8
|
# platforms_pr: linux/amd64
|
||||||
# no-cache-filters: sunshine-base,artifacts,sunshine
|
# no-cache-filters: sunshine-base,artifacts,sunshine
|
||||||
ARG BASE=debian
|
ARG BASE=debian
|
||||||
ARG TAG=bookworm
|
ARG TAG=bookworm
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ARG BASE
|
FROM sunshine-base AS sunshine-build
|
||||||
ARG TAG
|
|
||||||
FROM --platform=$BUILDPLATFORM ${BASE}:${TAG} AS sunshine-build
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
ARG BRANCH
|
ARG BRANCH
|
||||||
ARG BUILD_VERSION
|
ARG BUILD_VERSION
|
||||||
ARG COMMIT
|
ARG COMMIT
|
||||||
@@ -33,33 +30,8 @@ COPY --link .. .
|
|||||||
RUN <<_BUILD
|
RUN <<_BUILD
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [[ "${BUILDPLATFORM}" != "${TARGETPLATFORM}" ]]; then
|
|
||||||
cross_compile="--cross-compile"
|
|
||||||
else
|
|
||||||
cross_compile=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${TARGETPLATFORM}" in
|
|
||||||
linux/amd64)
|
|
||||||
cc_target_tuple="x86_64-linux-gnu"
|
|
||||||
cc_target_arch="amd64"
|
|
||||||
;;
|
|
||||||
linux/arm64)
|
|
||||||
cc_target_tuple="aarch64-linux-gnu"
|
|
||||||
cc_target_arch="arm64"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "unsupported platform: ${TARGETPLATFORM}";
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
chmod +x ./scripts/linux_build.sh
|
chmod +x ./scripts/linux_build.sh
|
||||||
./scripts/linux_build.sh \
|
./scripts/linux_build.sh \
|
||||||
${cross_compile} \
|
|
||||||
--cc-target-tuple="${cc_target_tuple}" \
|
|
||||||
--cc-target-arch="${cc_target_arch}" \
|
|
||||||
--publisher-name='LizardByte' \
|
--publisher-name='LizardByte' \
|
||||||
--publisher-website='https://app.lizardbyte.dev' \
|
--publisher-website='https://app.lizardbyte.dev' \
|
||||||
--publisher-issue-url='https://app.lizardbyte.dev/support' \
|
--publisher-issue-url='https://app.lizardbyte.dev/support' \
|
||||||
|
|||||||
@@ -3,11 +3,6 @@ set -e
|
|||||||
|
|
||||||
# Default value for arguments
|
# Default value for arguments
|
||||||
appimage_build=0
|
appimage_build=0
|
||||||
cc_install_root="/mnt/cross"
|
|
||||||
cc_target_tuple="$(uname -m)-linux-gnu"
|
|
||||||
cc_target_arch="$(dpkg --print-architecture || rpm --eval '%{_host}')"
|
|
||||||
cross_compile=0
|
|
||||||
num_processors=$(nproc)
|
|
||||||
publisher_name="Third Party Publisher"
|
publisher_name="Third Party Publisher"
|
||||||
publisher_website=""
|
publisher_website=""
|
||||||
publisher_issue_url="https://app.lizardbyte.dev/support"
|
publisher_issue_url="https://app.lizardbyte.dev/support"
|
||||||
@@ -32,11 +27,6 @@ Options:
|
|||||||
-h, --help Display this help message.
|
-h, --help Display this help message.
|
||||||
-s, --sudo-off Disable sudo command.
|
-s, --sudo-off Disable sudo command.
|
||||||
--appimage-build Compile for AppImage, this will not create the AppImage, just the executable.
|
--appimage-build Compile for AppImage, this will not create the AppImage, just the executable.
|
||||||
--cc-install-root The root directory to install the cross compiler. Default is /mnt/cross. (Fedora only)
|
|
||||||
--cc-target-tuple The target tuple for the cross compiler.
|
|
||||||
--cc-target-arch The target architecture for the cross compiler.
|
|
||||||
--cross-compile Enable cross compilation.
|
|
||||||
--num-processors The number of processors to use for compilation. Default is the value of 'nproc'.
|
|
||||||
--publisher-name The name of the publisher (not developer) of the application.
|
--publisher-name The name of the publisher (not developer) of the application.
|
||||||
--publisher-website The URL of the publisher's website.
|
--publisher-website The URL of the publisher's website.
|
||||||
--publisher-issue-url The URL of the publisher's support site or issue tracker.
|
--publisher-issue-url The URL of the publisher's support site or issue tracker.
|
||||||
@@ -63,19 +53,6 @@ while getopts ":hs-:" opt; do
|
|||||||
appimage_build=1
|
appimage_build=1
|
||||||
skip_libva=1
|
skip_libva=1
|
||||||
;;
|
;;
|
||||||
cc-install-root=*)
|
|
||||||
cc_install_root="${OPTARG#*=}"
|
|
||||||
;;
|
|
||||||
cc-target-tuple=*)
|
|
||||||
cc_target_tuple="${OPTARG#*=}"
|
|
||||||
;;
|
|
||||||
cc-target-arch=*)
|
|
||||||
cc_target_arch="${OPTARG#*=}"
|
|
||||||
;;
|
|
||||||
cross-compile) cross_compile=1 ;;
|
|
||||||
num-processors=*)
|
|
||||||
num_processors="${OPTARG#*=}"
|
|
||||||
;;
|
|
||||||
publisher-name=*)
|
publisher-name=*)
|
||||||
publisher_name="${OPTARG#*=}"
|
publisher_name="${OPTARG#*=}"
|
||||||
;;
|
;;
|
||||||
@@ -115,28 +92,28 @@ function add_debain_based_deps() {
|
|||||||
"cmake"
|
"cmake"
|
||||||
"doxygen"
|
"doxygen"
|
||||||
"flex" # required if we need to compile doxygen
|
"flex" # required if we need to compile doxygen
|
||||||
"gcc-${gcc_version}:${cc_target_arch}"
|
"gcc-${gcc_version}"
|
||||||
"g++-${gcc_version}:${cc_target_arch}"
|
"g++-${gcc_version}"
|
||||||
"git"
|
"git"
|
||||||
"graphviz"
|
"graphviz"
|
||||||
"libcap-dev:${cc_target_arch}" # KMS
|
"libcap-dev" # KMS
|
||||||
"libcurl4-openssl-dev:${cc_target_arch}"
|
"libcurl4-openssl-dev"
|
||||||
"libdrm-dev:${cc_target_arch}" # KMS
|
"libdrm-dev" # KMS
|
||||||
"libevdev-dev:${cc_target_arch}"
|
"libevdev-dev"
|
||||||
"libminiupnpc-dev:${cc_target_arch}"
|
"libminiupnpc-dev"
|
||||||
"libnotify-dev:${cc_target_arch}"
|
"libnotify-dev"
|
||||||
"libnuma-dev:${cc_target_arch}"
|
"libnuma-dev"
|
||||||
"libopus-dev:${cc_target_arch}"
|
"libopus-dev"
|
||||||
"libpulse-dev:${cc_target_arch}"
|
"libpulse-dev"
|
||||||
"libssl-dev:${cc_target_arch}"
|
"libssl-dev"
|
||||||
"libwayland-dev:${cc_target_arch}" # Wayland
|
"libwayland-dev" # Wayland
|
||||||
"libx11-dev:${cc_target_arch}" # X11
|
"libx11-dev" # X11
|
||||||
"libxcb-shm0-dev:${cc_target_arch}" # X11
|
"libxcb-shm0-dev" # X11
|
||||||
"libxcb-xfixes0-dev:${cc_target_arch}" # X11
|
"libxcb-xfixes0-dev" # X11
|
||||||
"libxcb1-dev:${cc_target_arch}" # X11
|
"libxcb1-dev" # X11
|
||||||
"libxfixes-dev:${cc_target_arch}" # X11
|
"libxfixes-dev" # X11
|
||||||
"libxrandr-dev:${cc_target_arch}" # X11
|
"libxrandr-dev" # X11
|
||||||
"libxtst-dev:${cc_target_arch}" # X11
|
"libxtst-dev" # X11
|
||||||
"ninja-build"
|
"ninja-build"
|
||||||
"npm" # web-ui
|
"npm" # web-ui
|
||||||
"udev"
|
"udev"
|
||||||
@@ -146,13 +123,7 @@ function add_debain_based_deps() {
|
|||||||
|
|
||||||
if [ "$skip_libva" == 0 ]; then
|
if [ "$skip_libva" == 0 ]; then
|
||||||
dependencies+=(
|
dependencies+=(
|
||||||
"libva-dev:${cc_target_arch}" # VA-API
|
"libva-dev" # VA-API
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$cross_compile" == 1 ]; then
|
|
||||||
dependencies+=(
|
|
||||||
"crossbuild-essential-${cc_target_arch}"
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -160,7 +131,7 @@ function add_debain_based_deps() {
|
|||||||
function add_debain_deps() {
|
function add_debain_deps() {
|
||||||
add_debain_based_deps
|
add_debain_based_deps
|
||||||
dependencies+=(
|
dependencies+=(
|
||||||
"libayatana-appindicator3-dev:${cc_target_arch}"
|
"libayatana-appindicator3-dev"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +143,7 @@ function add_ubuntu_deps() {
|
|||||||
|
|
||||||
add_debain_based_deps
|
add_debain_based_deps
|
||||||
dependencies+=(
|
dependencies+=(
|
||||||
"libappindicator3-dev:${cc_target_arch}"
|
"libappindicator3-dev"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,19 +151,10 @@ function add_fedora_deps() {
|
|||||||
dependencies+=(
|
dependencies+=(
|
||||||
"cmake"
|
"cmake"
|
||||||
"doxygen"
|
"doxygen"
|
||||||
"git"
|
|
||||||
"graphviz"
|
|
||||||
"ninja-build"
|
|
||||||
"npm"
|
|
||||||
"rpm-build" # if you want to build an RPM binary package
|
|
||||||
"wget" # necessary for cuda install with `run` file
|
|
||||||
"which" # necessary for cuda install with `run` file
|
|
||||||
"xorg-x11-server-Xvfb" # necessary for headless unit testing
|
|
||||||
)
|
|
||||||
|
|
||||||
arch_dependencies=(
|
|
||||||
"gcc"
|
"gcc"
|
||||||
"g++"
|
"g++"
|
||||||
|
"git"
|
||||||
|
"graphviz"
|
||||||
"libappindicator-gtk3-devel"
|
"libappindicator-gtk3-devel"
|
||||||
"libcap-devel"
|
"libcap-devel"
|
||||||
"libcurl-devel"
|
"libcurl-devel"
|
||||||
@@ -209,14 +171,20 @@ function add_fedora_deps() {
|
|||||||
"libXtst-devel" # X11
|
"libXtst-devel" # X11
|
||||||
"mesa-libGL-devel"
|
"mesa-libGL-devel"
|
||||||
"miniupnpc-devel"
|
"miniupnpc-devel"
|
||||||
|
"ninja-build"
|
||||||
|
"npm"
|
||||||
"numactl-devel"
|
"numactl-devel"
|
||||||
"openssl-devel"
|
"openssl-devel"
|
||||||
"opus-devel"
|
"opus-devel"
|
||||||
"pulseaudio-libs-devel"
|
"pulseaudio-libs-devel"
|
||||||
|
"rpm-build" # if you want to build an RPM binary package
|
||||||
|
"wget" # necessary for cuda install with `run` file
|
||||||
|
"which" # necessary for cuda install with `run` file
|
||||||
|
"xorg-x11-server-Xvfb" # necessary for headless unit testing
|
||||||
)
|
)
|
||||||
|
|
||||||
if [ "$skip_libva" == 0 ]; then
|
if [ "$skip_libva" == 0 ]; then
|
||||||
arch_dependencies+=(
|
dependencies+=(
|
||||||
"libva-devel" # VA-API
|
"libva-devel" # VA-API
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
@@ -231,15 +199,15 @@ function install_cuda() {
|
|||||||
|
|
||||||
local cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
|
local cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
|
||||||
local cuda_suffix=""
|
local cuda_suffix=""
|
||||||
if [ "$cc_target_arch" == "aarch64" ]; then
|
if [ "$architecture" == "aarch64" ]; then
|
||||||
local cuda_suffix="_sbsa"
|
local cuda_suffix="_sbsa"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$cc_target_arch" == "aarch64" ]; then
|
if [ "$architecture" == "aarch64" ]; then
|
||||||
# we need to patch the math-vector.h file for aarch64 fedora
|
# we need to patch the math-vector.h file for aarch64 fedora
|
||||||
# back up /usr/include/bits/math-vector.h
|
# back up /usr/include/bits/math-vector.h
|
||||||
math_vector_file=""
|
math_vector_file=""
|
||||||
if [ "$distro" == "ubuntu" ] && [ "$version" == "24.04" ]; then
|
if [ "$distro" == "ubuntu" ] || [ "$version" == "24.04" ]; then
|
||||||
math_vector_file="/usr/include/aarch64-linux-gnu/bits/math-vector.h"
|
math_vector_file="/usr/include/aarch64-linux-gnu/bits/math-vector.h"
|
||||||
elif [ "$distro" == "fedora" ]; then
|
elif [ "$distro" == "fedora" ]; then
|
||||||
math_vector_file="/usr/include/bits/math-vector.h"
|
math_vector_file="/usr/include/bits/math-vector.h"
|
||||||
@@ -310,11 +278,6 @@ function run_install() {
|
|||||||
"-DSUNSHINE_ENABLE_DRM=ON"
|
"-DSUNSHINE_ENABLE_DRM=ON"
|
||||||
)
|
)
|
||||||
|
|
||||||
if [ "$cross_compile" == 1 ]; then
|
|
||||||
cmake_args+=("-DCMAKE_C_COMPILER=${cc_target_tuple}-gcc")
|
|
||||||
cmake_args+=("-DCMAKE_CXX_COMPILER=${cc_target_tuple}-g++")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$appimage_build" == 1 ]; then
|
if [ "$appimage_build" == 1 ]; then
|
||||||
cmake_args+=("-DSUNSHINE_BUILD_APPIMAGE=ON")
|
cmake_args+=("-DSUNSHINE_BUILD_APPIMAGE=ON")
|
||||||
fi
|
fi
|
||||||
@@ -345,11 +308,6 @@ function run_install() {
|
|||||||
# Install the dependencies
|
# Install the dependencies
|
||||||
$package_install_command "${dependencies[@]}"
|
$package_install_command "${dependencies[@]}"
|
||||||
|
|
||||||
# Fedora has a special command for installing architecture specific packages
|
|
||||||
if [ "$distro" == "fedora" ]; then
|
|
||||||
$package_install_command_arch "${arch_dependencies[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# reload the environment
|
# reload the environment
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
@@ -409,7 +367,7 @@ function run_install() {
|
|||||||
tar -xzf "${build_dir}/doxygen.tar.gz"
|
tar -xzf "${build_dir}/doxygen.tar.gz"
|
||||||
cd "doxygen-${doxygen_min}"
|
cd "doxygen-${doxygen_min}"
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -G="Ninja" -B="build" -S="."
|
cmake -DCMAKE_BUILD_TYPE=Release -G="Ninja" -B="build" -S="."
|
||||||
ninja -C "build" -j"${num_processors}"
|
ninja -C "build"
|
||||||
ninja -C "build" install
|
ninja -C "build" install
|
||||||
else
|
else
|
||||||
echo "Doxygen version too low, skipping docs"
|
echo "Doxygen version too low, skipping docs"
|
||||||
@@ -485,11 +443,6 @@ elif grep -q "PLATFORM_ID=\"platform:f39\"" /etc/os-release; then
|
|||||||
version="39"
|
version="39"
|
||||||
package_update_command="${sudo_cmd} dnf update -y"
|
package_update_command="${sudo_cmd} dnf update -y"
|
||||||
package_install_command="${sudo_cmd} dnf install -y"
|
package_install_command="${sudo_cmd} dnf install -y"
|
||||||
if [ "$cross_compile" == 0 ]; then
|
|
||||||
package_install_command_arch="${sudo_cmd} dnf -y --releasever=39 --forcearch=${cc_target_arch} install"
|
|
||||||
else
|
|
||||||
package_install_command_arch="${sudo_cmd} dnf -y --installroot=${cc_install_root} --releasever=39 --forcearch=${cc_target_arch} install"
|
|
||||||
fi
|
|
||||||
cuda_version="12.4.0"
|
cuda_version="12.4.0"
|
||||||
cuda_build="550.54.14"
|
cuda_build="550.54.14"
|
||||||
gcc_version="13"
|
gcc_version="13"
|
||||||
@@ -499,11 +452,6 @@ elif grep -q "PLATFORM_ID=\"platform:f40\"" /etc/os-release; then
|
|||||||
version="40"
|
version="40"
|
||||||
package_update_command="${sudo_cmd} dnf update -y"
|
package_update_command="${sudo_cmd} dnf update -y"
|
||||||
package_install_command="${sudo_cmd} dnf install -y"
|
package_install_command="${sudo_cmd} dnf install -y"
|
||||||
if [ "$cross_compile" == 0 ]; then
|
|
||||||
package_install_command_arch="${sudo_cmd} dnf -y --releasever=39 --forcearch=${cc_target_arch} install"
|
|
||||||
else
|
|
||||||
package_install_command_arch="${sudo_cmd} dnf -y --installroot=${cc_install_root} --releasever=39 --forcearch=${cc_target_arch} install"
|
|
||||||
fi
|
|
||||||
cuda_version=
|
cuda_version=
|
||||||
cuda_build=
|
cuda_build=
|
||||||
gcc_version="13"
|
gcc_version="13"
|
||||||
|
|||||||
@@ -441,7 +441,7 @@
|
|||||||
);
|
);
|
||||||
if (resp) {
|
if (resp) {
|
||||||
fetch("./api/apps/" + id, { method: "DELETE" }).then((r) => {
|
fetch("./api/apps/" + id, { method: "DELETE" }).then((r) => {
|
||||||
if (r.status === 200) document.location.reload();
|
if (r.status == 200) document.location.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -557,7 +557,7 @@
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(this.editForm),
|
body: JSON.stringify(this.editForm),
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
if (r.status === 200) document.location.reload();
|
if (r.status == 200) document.location.reload();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -94,10 +94,10 @@
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(this.passwordData),
|
body: JSON.stringify(this.passwordData),
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
if (r.status === 200) {
|
if (r.status == 200) {
|
||||||
r.json().then((rj) => {
|
r.json().then((rj) => {
|
||||||
this.success = rj.status;
|
if (rj.status.toString() === "true") {
|
||||||
if (this.success === true) {
|
this.success = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.location.reload();
|
document.location.reload();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
fetch("./api/pin", {method: "POST", body: b})
|
fetch("./api/pin", {method: "POST", body: b})
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.status === true) {
|
if (response.status.toString().toLowerCase() === "true") {
|
||||||
document.querySelector(
|
document.querySelector(
|
||||||
"#status"
|
"#status"
|
||||||
).innerHTML = `<div class="alert alert-success" role="alert">${this.i18n.t('pin.pair_success')}</div>`;
|
).innerHTML = `<div class="alert alert-success" role="alert">${this.i18n.t('pin.pair_success')}</div>`;
|
||||||
|
|||||||
@@ -120,8 +120,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul id="client-list" class="list-group list-group-flush list-group-item-light" v-if="clients && clients.length > 0">
|
<ul id="client-list" class="list-group list-group-flush list-group-item-light" v-if="clients && clients.length > 0">
|
||||||
<div v-for="client in clients" class="list-group-item d-flex">
|
<div v-for="client in clients" class="list-group-item d-flex">
|
||||||
<div class="p-2 flex-grow-1">{{ client.name !== "" ? client.name : $t('troubleshooting.unpair_single_unknown') }}</div>
|
<div class="p-2 flex-grow-1">{{client.name != "" ? client.name : $t('troubleshooting.unpair_single_unknown')}}</div><div class="me-2 ms-auto btn btn-danger" @click="unpairSingle(client.uuid)"><i class="fas fa-trash"></i></div>
|
||||||
<div class="me-2 ms-auto btn btn-danger" @click="unpairSingle(client.uuid)"><i class="fas fa-trash"></i></div>
|
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul v-else class="list-group list-group-flush list-group-item-light">
|
<ul v-else class="list-group list-group-flush list-group-item-light">
|
||||||
@@ -177,7 +176,7 @@
|
|||||||
actualLogs() {
|
actualLogs() {
|
||||||
if (!this.logFilter) return this.logs;
|
if (!this.logFilter) return this.logs;
|
||||||
let lines = this.logs.split("\n");
|
let lines = this.logs.split("\n");
|
||||||
lines = lines.filter(x => x.indexOf(this.logFilter) !== -1);
|
lines = lines.filter(x => x.indexOf(this.logFilter) != -1);
|
||||||
return lines.join("\n");
|
return lines.join("\n");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -211,7 +210,7 @@
|
|||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
this.closeAppPressed = false;
|
this.closeAppPressed = false;
|
||||||
this.closeAppStatus = r.status;
|
this.closeAppStatus = r.status.toString() === "true";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.closeAppStatus = null;
|
this.closeAppStatus = null;
|
||||||
}, 5000);
|
}, 5000);
|
||||||
@@ -223,7 +222,7 @@
|
|||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
this.unpairAllPressed = false;
|
this.unpairAllPressed = false;
|
||||||
this.unpairAllStatus = r.status;
|
this.unpairAllStatus = r.status.toString() === "true";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.unpairAllStatus = null;
|
this.unpairAllStatus = null;
|
||||||
}, 5000);
|
}, 5000);
|
||||||
@@ -241,9 +240,9 @@
|
|||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const clientList = document.querySelector("#client-list");
|
const clientList = document.querySelector("#client-list");
|
||||||
if (response.status === true && response.named_certs && response.named_certs.length) {
|
if (response.status === 'true' && response.named_certs && response.named_certs.length) {
|
||||||
this.clients = response.named_certs.sort((a, b) => {
|
this.clients = response.named_certs.sort((a, b) => {
|
||||||
return (a.name.toLowerCase() > b.name.toLowerCase() || a.name === "" ? 1 : -1)
|
return (a.name.toLowerCase() > b.name.toLowerCase() || a.name == "" ? 1 : -1)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.clients = [];
|
this.clients = [];
|
||||||
@@ -271,7 +270,7 @@
|
|||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
this.ddResetPressed = false;
|
this.ddResetPressed = false;
|
||||||
this.ddResetStatus = r.status;
|
this.ddResetStatus = r.status.toString() === "true";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.ddResetStatus = null;
|
this.ddResetStatus = null;
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|||||||
@@ -81,10 +81,10 @@
|
|||||||
body: JSON.stringify(this.passwordData),
|
body: JSON.stringify(this.passwordData),
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (r.status === 200) {
|
if (r.status == 200) {
|
||||||
r.json().then((rj) => {
|
r.json().then((rj) => {
|
||||||
this.success = rj.status;
|
if (rj.status.toString() === "true") {
|
||||||
if (this.success === true) {
|
this.success = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.location.reload();
|
document.location.reload();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|||||||
Reference in New Issue
Block a user