Skip to content

Conversation

sockbot
Copy link

@sockbot sockbot commented Aug 20, 2021

First time contributor checklist:

Contributor checklist:

Description

This PR fixes merge conflicts in @kevinsung 's fix for #5006 at #5121. I tested manually that this works and that it allowed me to successfully register a phone number. I tested this on MacOS 10.15.7.

Kevin's PR notes:
Loads the CAPTCHA that is required for verification to register a phone number with the desktop app as a standalone device for development. I adapted this from Signal-Android. When a request for SMS or voice verification is rejected with error code 402, a new window with a CAPTCHA appears, and upon successful completion of the CAPTCHA, the window closes and the request is sent again with the newly acquired credentials.

This requires the SIGNAL_ENABLE_HTTP environment variable to be set, e.g. on Linux,

SIGNAL_ENABLE_HTTP=1 yarn start

I tested manually that this works and that it allowed me to successfully register a phone number. I tested this on Arch Linux (kernel version 5.11.8-arch1-1).

Screenshots

Screen Shot 2021-08-20 at 4 20 41 PM

Screen Shot 2021-08-20 at 4 20 57 PM

Screen Shot 2021-08-20 at 4 22 45 PM

@sockbot sockbot force-pushed the load-captcha-to-enable-phone-number-verification branch 2 times, most recently from 413829c to 2cb38e7 Compare August 20, 2021 23:12
@sockbot sockbot force-pushed the load-captcha-to-enable-phone-number-verification branch from 2cb38e7 to bc5691a Compare August 20, 2021 23:49
@baptx
Copy link

baptx commented Sep 16, 2021

Is the patch still working? I tested with the latest Git version on Ubuntu 20.04.3 LTS (Lubuntu version) but when selecting "Set Up as Standalone Device", entering my French phone number and clicking the button "Send SMS", a new window "CAPTCHA Response Required" is opened but it is blank. I followed the build instructions from https://github.com/signalapp/Signal-Desktop/blob/development/CONTRIBUTING.md and in the Linux console, I can see the error (node:15405) electron: Failed to load URL: https://signalcaptchas.org/registration/generate.html?XXX with error: ERR_ACCESS_DENIED\n(Use electron --trace-warnings ... to show where the warning was created).
I replaced URL content by XXX before sharing it in case in contains private information. If I open the link in a web browser I can see the CAPTCHA but I did not receive an SMS code when completing it, I am just asked to open a signalcaptcha:// link.
The patch was downloaded on https://github.com/signalapp/Signal-Desktop/pull/5473.patch and applied with the command patch -p1 < 5473.patch.
I hope it will be possible to use the desktop app without mobile app in the official version also because not everybody uses Android or iOS.

Update: I forgot to type SIGNAL_ENABLE_HTTP=1 yarn start instead of just yarn start but when I get the SMS code and enter it, I can see the error message HTTPError: Invalid code, please try again. (original: promiseAjax: error response; code: 403). The SMS also mentioned the code is for SIGNAL Staging, does it mean we cannot talk to people that are using Signal on the official build if we use the standalone mode on the desktop app?

@dsanders11
Copy link
Contributor

@sockbot, this PR has gone stale, but I updated it to work again on my fork at dsanders11/Signal-Desktop@0b59689. It doesn't automatically refresh after successfully verifying, requires closing and start the app again, but it does work to set up the device. Feel free to use that commit to update this PR so it's no longer stale.

@baptx
Copy link

baptx commented Dec 20, 2021

@dsanders11 I tested your fork but the app does not load even after restarting it, it keeps saying "Loading..." with the loading animation. In the web console, I noticed an error message: "HTTPError: promiseAjax: error response; code: 401". Do you have a solution?

@dsanders11
Copy link
Contributor

@baptx closing and reopening should do it. But this that code may have gone stale since it was last tested.

@indutny-signal
Copy link
Contributor

Hello! Could you give a try to standalone registration in the latest beta? I think it might be working!

@baptx
Copy link

baptx commented Dec 21, 2021

@indutny-signal Hello, I tried v5.27.0-beta.2 by following the install instructions from https://github.com/signalapp/Signal-Desktop/blob/v5.27.0-beta.2/CONTRIBUTING.md which uses the command yarn generate instead of yarn grunt. After the git clone command, I switched to the tag with the command git checkout tags/v5.27.0-beta.2 (like explained on https://stackoverflow.com/questions/4330610/switch-to-another-git-tag). But I have the same error as in my previous comment, even with the command SIGNAL_ENABLE_HTTP=1 yarn start. This issue could be kept open unless it is fixed.

@indutny-signal
Copy link
Contributor

@baptx can you try installing prebuilt beta using instructions on this page and just click "Setup as Standalone Device" from the File menu (assuming you are on macOS).

@baptx
Copy link

baptx commented Dec 22, 2021

@indutny-signal I am using Linux and tried your link, the previous issue does not happen anymore but I cannot see "Setup as Standalone Device" in the File menu, there is only "Set Up as New Device" which does not change anything.

@indutny-signal
Copy link
Contributor

Oh right... It works only in development mode. Sorry for confusion. Did you run commands from this step?

@baptx
Copy link

baptx commented Dec 23, 2021

@indutny-signal thanks for sharing the instructions to use the production servers, good to know! But to fix the loading issue, I just had to remove the /home/user/.config/Signal-development/ folder on Linux, like explained on #5623 (comment).

To set up the standalone device, I had to use the fork of @dsanders11 which works, I was able to complete the CAPTCHA and send / receive messages between 2 phone numbers (tested by replacing the Signal-development folder to switch between profiles). The latest beta does not work as a standalone device probably because the contribution dsanders11@0b59689 was not added, so I think this issue can be kept open until it works in the latest development version.
I also found an article explaining how to use Signal without smartphone and the official desktop version without development mode: https://ctrl.alt.coop/en/post/signal-without-a-smartphone/ (using signal-cli, I did not try it yet)

Is there no way to enable the development mode (or at least set up a standalone device) in the official desktop version? In the future, it would be nice to be able to set up a standalone device without having to build the app in development mode, which could be useful for people without IT knowledge that don't have an Android or iOS smartphone. It would also be good to be able to use Signal without phone number because currently if someone loses their phone / it gets stolen or they change the phone number, it could be an issue to continue a conversation. A web version like WhatsApp and Telegram would be welcome also, so we can use Signal without installing an app and even if there is no app for our device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants