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

Overly-broad permissions added for Electron's StatusNotifier #283

Open
jntesteves opened this issue Apr 9, 2023 · 7 comments
Open

Overly-broad permissions added for Electron's StatusNotifier #283

jntesteves opened this issue Apr 9, 2023 · 7 comments
Labels
enhancement Issues where an enhancement could be made to the application help wanted Issues where help is wanted upstream Issues that we can't fix because they are Discord's

Comments

@jntesteves
Copy link

I'm creating an issue to track the resolution of the overly-broad permissions added by commit f1f6302.

Recent Electron updates have moved from libappindicator to directly using StatusNotifier.

Unfortunately the initial version of this required a sandbox escape.

This will be fixed in a future release of electron: electron/electron#37053

Related to: electron/electron#37053

Was this really necessary? Could this app keep using an older Electron until the issue is resolved upstream? As is, I've masked the app on my system until this issue is resolved.

@TingPing
Copy link
Member

TingPing commented Apr 10, 2023

Could this app keep using an older Electron until the issue is resolved upstream?

No. Discord is proprietary and developed against whatever version of Electron they wish.

@TingPing
Copy link
Member

TingPing commented Apr 10, 2023

As is, I've masked the app on my system until this issue is resolved.

Discord also doesn't actually support old versions of the app. We disable the update checker but if the app works or not is up to luck.

@jntesteves
Copy link
Author

Hi, thanks for the answers.

We disable the update checker but if the app works or not is up to luck.

Unrelated to this issue, but does this mean the auto-updater on the app is supposed to be disabled? Because I think I've been getting updates within the app, or at least I get the green arrow notification in-app saying there's an update, and it seems to apply when clicking on it or restarting the app.

@TingPing
Copy link
Member

The normal behavior of Discord is upon start it refuses to run unless the core app is updated. We bypass that: https://github.com/flathub/com.discordapp.Discord/blob/master/disable-breaking-updates.py

I'm not certain what types of updates it can still apply to itself. The app binary we launch will always remain unchanged. But it can probably update some data.

@lionirdeadman
Copy link
Collaborator

lionirdeadman commented Apr 20, 2023

So my understanding is that there are two types of updates that Discord pushes.

  1. Node module and web interface updates
  2. Binary app updates

The first type should always work as it simply updates modifiable stuff and they handle that well.

The second will block the app at startup and locks the software version with electron. It will ask people using the app to download a tarball or a deb file, neither of which are likely to be wanted by a person using this and it's just generally overly confusing to people.

The setting we apply is supposed to be respected by Discord and block the second type of updates. We do this because otherwise people get locked up very quickly and puts a lot of pressure on us to update unreasonably quickly.

@lionirdeadman lionirdeadman added enhancement Issues where an enhancement could be made to the application upstream Issues that we can't fix because they are Discord's waiting Issues waiting for something else to happen labels Apr 29, 2023
@jntesteves
Copy link
Author

jntesteves commented Oct 24, 2023

Hi, I think the permission --own-name=org.kde.* might not be necessary anymore. Today I unmasked Discord (I had it masked since this change) and the first thing I did was to override this permission before launching the app, and the tray icon appeared and is working as usual.

My test is on Gnome 45 (Fedora Silverblue 39).

Edit: To make it clear — because Gnome doesn't support App Indicators by default — I'm using the AppIndicator and KStatusNotifierItem Support extension for gnome-shell.

@guihkx
Copy link
Collaborator

guihkx commented Oct 3, 2024

Latest Discord now ships with Electron 32.0.0, so if anyone is still interested on this, feel free to send a PR, because I'm not entirely sure the exact permissions we should remove.

Plus, I can only really do my testing on X11, but I'd like to have someone test this on Wayland as well.

@guihkx guihkx added help wanted Issues where help is wanted and removed waiting Issues waiting for something else to happen labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues where an enhancement could be made to the application help wanted Issues where help is wanted upstream Issues that we can't fix because they are Discord's
Projects
None yet
Development

No branches or pull requests

4 participants