Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunshine module - tray icon not loading and apps.json created as read-only. #361790

Closed
velen2077 opened this issue Dec 4, 2024 · 6 comments · Fixed by #364438
Closed

Sunshine module - tray icon not loading and apps.json created as read-only. #361790

velen2077 opened this issue Dec 4, 2024 · 6 comments · Fixed by #364438
Labels
0.kind: bug Something is broken

Comments

@velen2077
Copy link

Describe the bug

Using NixOS 24.11 and GNOME as the DE. When enabling the Sunshine module with capSysAdmin = true; the tray icon does not load. The service does start though. Just the tray icon is not present. The tray icon does load if you omit capSysAdmin = true; but this causes the application to fail on Wayland.

Another oddity is that the apps.json file gets created in .config/sunshine as read-only, so no apps can be added to Sunshine by default. Manually marking the file as read-write works. This issue is irrespective of capSysAdmin = true; being set or not.

Steps To Reproduce

Enable Sunshine in the NixOS config as below and perform a nixos-rebuild switch. The apps.json file is created as read-only and the tray icon is not present, despite the service running.

services.sunshine = {
      enable = true;
      autoStart = true;
      capSysAdmin = true;
      openFirewall = true;
};

Expected behavior

The tray icon is present while the service is running, and the apps.json file is created with read-write permissions so it can be edited through the GUI.

Notify maintainers

@devusb

Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@velen2077 velen2077 added the 0.kind: bug Something is broken label Dec 4, 2024
@devusb
Copy link
Contributor

devusb commented Dec 5, 2024

@velen2077 apps.json not being writable may be because Sunshine seems to be copying it from the assets directory in the Nix store, where it is not writable. See this line and

❯ ll result/assets
.r--r--r--  552 root 31 Dec  1969  apps.json
.r--r--r--  680 root 31 Dec  1969  box.png
.r--r--r-- 8.7k root 31 Dec  1969  desktop-alt.png
.r--r--r-- 8.2k root 31 Dec  1969  desktop.png
dr-xr-xr-x    - root 31 Dec  1969  shaders
.r--r--r--  25k root 31 Dec  1969  steam.png
dr-xr-xr-x    - root 31 Dec  1969  web

The copied file seems to inherit the permissions of the one in the store; not sure of an easy way around this other than maybe a patch? But would rather not add more complexity to the build. Possible we could also try to upstream it.

As for the tray icon, it does work for me with capSysAdmin = true on Plasma + Wayland, but per this upstream issue seems like I may be an outlier.
Can you try having Sunshine use boost 1.85 as mentioned in that issue by

services.sunshine.package = pkgs.sunshine.override {
   boost = pkgs.boost185;
};

and see if that makes a difference?

@velen2077
Copy link
Author

@velen2077 apps.json not being writable may be because Sunshine seems to be copying it from the assets directory in tne Nix store, where it is not writable. See this line and

❯ ll result/assets
.r--r--r--  552 root 31 Dec  1969  apps.json
.r--r--r--  680 root 31 Dec  1969  box.png
.r--r--r-- 8.7k root 31 Dec  1969  desktop-alt.png
.r--r--r-- 8.2k root 31 Dec  1969  desktop.png
dr-xr-xr-x    - root 31 Dec  1969  shaders
.r--r--r--  25k root 31 Dec  1969  steam.png
dr-xr-xr-x    - root 31 Dec  1969  web

The copied file seems to inherit the permissions of the one in the store; not sure of an easy way around this other than maybe a patch? But would rather not add more complexity to the build. Possible we could also try to upstream it.

As for the tray icon, it does work for me with capSysAdmin = true on Plasma + Wayland, but per this upstream issue seems like I may be an outlier. Can you try having Sunshine use boost 1.85 as mentioned in that issue by

services.sunshine.package = pkgs.sunshine.override {
   boost = pkgs.boost185;
};

and see if that makes a difference?

So with the boost 1.85 package, the icon appears as normal, but when clicking open Sunshine, nothing appears, and I get an error in the log file: Warning: Couldn't open URL [https://localhost:47990]: System: No such file or directory

I should probably add that I get that experience and error when CapSysAdmin is off (and icon loads as normal on the original package) too.

@devusb
Copy link
Contributor

devusb commented Dec 10, 2024

@velen2077 yeah, I can reproduce that error. will take a look -- maybe something resolvable.

@devusb
Copy link
Contributor

devusb commented Dec 10, 2024

https://github.com/LizardByte/Sunshine/blob/f73eb88ba9f35477ab0466048e7a60ffdf93317c/src/platform/linux/misc.cpp#L273 probably this -- I bet we just need to patch the path. it still may not work with CAP_SYS_ADMIN or as a service because xdg-open might not like that, but it may at least work if run as normal user.

@devusb
Copy link
Contributor

devusb commented Dec 12, 2024

@velen2077 please try #364438 -- I drafted for now because there is an unrelated issue with the NixOS test that I want to try to get in as well. For what it's worth xdg-open doesn't work for me still with CAP_SYS_ADMIN running as a service, but it does work when I run Sunshine as an application.

@devusb
Copy link
Contributor

devusb commented Dec 17, 2024

@velen2077 think I got the tray icon links working when run as a service too -- fix in #364438 should be complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants