flathub / io.freetubeapp.FreeTube

https://flathub.org/apps/details/io.freetubeapp.FreeTube
15 stars 10 forks source link

Add MPV and possibly Flatpak talk permissions #74

Open DEFCON001 opened 2 years ago

DEFCON001 commented 2 years ago

Adding the MPV and Flatpak session talk permissions by default will allow these workarounds for the mpv external player (https://github.com/FreeTubeApp/FreeTube/issues/1735#issuecomment-1029445701) and mpv flatpak player (https://github.com/FreeTubeApp/FreeTube/issues/1735#issuecomment-1141670904) to work without the use of flatpak-overide or Flatseal after 0b495c9. Once the code takes into account that it is installed in a flatpak, this will be required by default for the app to work smoothly. I can understand not implementing the talk bus for the entirety of Flatpak on the system (ie: the workaround for when mpv is installed as a Flatpak), but the MPV talk permission (for when MPV is installed as a binary on the system) only access one program and would seem safe from easily "escaping the sandbox".

org.freedesktop.Flatpak is the dbus bus name for flatpak, but I don't know the bus name for mpv you would need to use for the talks permission, and can't seem to find it online (it might be io.mpv.Mpv as that is what flatpak calls it, but I honestly don't know if flatpak names and dbus bus names are connected at all).

bbhtt commented 1 year ago

Flatpak spawn is a huge access and doesn't make sense to me when A) FreeTube can play the videos by itself B) External player is optional and there are too many to support C) Maybe it'd be better to include at least MPV in this flatpak at the cost of increased size/maintenance

The alternative is to wait for a portal solution. I've closed my PR that did the solution OP wanted.

stdedos commented 5 months ago

Is there any way I can use e.g. Flatseal for now to make it work?

I have added the bus via Flatseal to Freetube

image

but it doesn't seem to start the host mpv (FWIW, I don't even see flatpak-spawn, mpv, etc via e.g. htop)

I can appreciate the (maybe theoretical) permissions issue, but I'd like a solution "for now"

bbhtt commented 5 months ago

Add org.freedesktop.Flatpak as an override in the talk section. Then in Freetube edit the command.

Flatpaked MPV https://github.com/FreeTubeApp/FreeTube/issues/1735#issuecomment-1141670904

Host MPV https://github.com/FreeTubeApp/FreeTube/issues/1735#issuecomment-1029445701

stdedos commented 5 months ago

Okay, so I guess I am doing it right. I have this https://github.com/FreeTubeApp/FreeTube/discussions/5188 issue now. It seems to me that maybe my mpv is out-of-date (and subsequently its youtube-dl) - I'm trying to update it now.

So, yes - the instructions still work. What doesn't work is "external playback of a playlist" (https://github.com/FreeTubeApp/FreeTube/discussions/5188), which is a bug (maybe known already). Thank you @bbhtt