Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#69415 - [signal-desktop] URL schema sgnl is not handled

Attached to Project: Community Packages
Opened by Hollis Wu (holi0317) - Saturday, 23 January 2021, 13:29 GMT
Last edited by kpcyrd (kpcyrd) - Sunday, 14 February 2021, 12:54 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Levente Polyak (anthraxx)
kpcyrd (kpcyrd)
Santiago Torres (sangy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Package signal-desktop uses the URL protocol sgnl:// (MIME type x-scheme-handler/sgnl) for handling adding stickers and more.

Currently the packaged desktop entry file did not specify the application is allowed to handle that protocol. Causing browsers failed to call into signal desktop even if the application is installed.

The fix is trivial. Editing the desktop entry by followings should work:

1. Change Exec= line to Exec=signal-desktop %U
2. Add line MimeType=x-scheme-handler/sgnl;

Then run `sudo update-desktop-databaes`. Which should run in pacman hook if it is packaged correctly.

Additional info:
* package version(s): signal-desktop 1.39.6-1

Steps to reproduce:

1. Run command `xdg-open 'sgnl://addstickers/?pack_id=d0678a2671c20c9908f2bc69408ef662&pack_key=bbd42ade696d575a60fb682c2e949b7525a1b095d5c269cc234f5684c3a42522'`. It should show
a dialog in signal-desktop for adding sticker.
This task depends upon

Closed by  kpcyrd (kpcyrd)
Sunday, 14 February 2021, 12:54 GMT
Reason for closing:  Fixed
Additional comments about closing:  1.39.6-2
Comment by Fabian (Tids) - Thursday, 28 January 2021, 08:32 GMT
it should be something in the likes of

signal-desktop -- %u

Otherwise you might end up in some situations where it wont work.

I propose this as *.desktop file

```
[Desktop Entry]
Type=Application
Name=Signal
Comment=Signal - Privat Messaging
Comment[de]=Signal - Sichere Unterhaltung
Icon=signal-desktop
Exec=signal-desktop -- %u
Terminal=false
Categories=Network;InstantMessaging;
StartupWMClass=Signal
MimeType=x-scheme-handler/sgnl;
Keywords=sgnl;chat;im;messaging;messenger;sms;security;privat;
X-GNOME-UsesNotifications=true
```

It'll support sgnl-links, adds some keywords, tells gnome that it uses notifications¹ and slims down the comments. I also go for %u instead of %U, because I couldn't make it work with multiple URL² (that's what %U is for). It takes only one URL, so %u appears to be enough.

¹ https://wiki.gnome.org/Initiatives/GnomeGoals/NotificationSource
² https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
Comment by Hollis Wu (holi0317) - Thursday, 28 January 2021, 09:09 GMT
FYI this is the application definition found in the official deb package.

```
[Desktop Entry]
Name=Signal
Exec=/opt/Signal/signal-desktop --no-sandbox %U
Terminal=false
Type=Application
Icon=signal-desktop
StartupWMClass=Signal
Comment=Private messaging from your desktop
MimeType=x-scheme-handler/sgnl;
Categories=Network;InstantMessaging;Chat;
```

Somehow they are doing deb packaging but ain't uploading it to github or anywhere else.

Is that --no-sandbox flag required for running signal?
Comment by Fabian (Tids) - Thursday, 28 January 2021, 10:29 GMT
Not sure about this. From what I've seen online a lot of people have problems with electron >=5 -apps on debian based systems as long as sandbox is active (wich is the default beginning with electron 5). Also for WSL this seems to be a problem in general.

https://github.com/electron/electron/issues/15760

Sadly I don't really understand that option, what the sandbox is in general and also it seems that there are no sources around for the debian package?


EDIT
on the "why": https://github.com/signalapp/Signal-Desktop/pull/4381#issuecomment-650458310
Comment by Hollis Wu (holi0317) - Friday, 29 January 2021, 06:58 GMT
I've tested launching with --no-sandbox but it breaks opening links in chat (???). Maybe just keep it as is.
Comment by Fabian (Tids) - Friday, 29 January 2021, 07:44 GMT
I guess you would also need to unset SETUID on the chrome-sandbox (see PKGBUILD). That's how it's done in the official *.deb But I think that should be discussed in another issue :D.
Comment by kpcyrd (kpcyrd) - Sunday, 14 February 2021, 12:54 GMT
I've added the scheme-handler and it seems to be working fine. The sandbox doesn't seem to cause any issues so far so I'd prefer to keep it as-is. If there are other issues please open a new bug. Thanks for reaching out and suggesting patches!

Loading...