Signal Desktop (Update)

My weekend adventures got me as far as a running Election branch. Something was obviously a little weird as it was opening with a javascript debugger taking up the right third of the app window. Not ideal, but easy to close.

And then i tried to link it to the account on my phone… no dice.

What i’d built was the development version, which defaults to connecting to the test / staging servers. For any of this experiment to be useful it needs to connect to the production servers.

These are all defined in the /config directory, but it wasn’t obvious to me how to change to another config. In the package.json there were references to ${env.SIGNAL_ENV} but exporting that to the shell with a value of ‘production’ didn’t help.

A little reading about my new friend ‘yarn’ showed that there was a ‘–production=true’ CLI option. Passing that along with ‘yarn install’ broke things.. but the command:

$ yarn start --production=true

Moves things along and makes it possible to link to a phone account. The process is actually pretty smooth – you just take a picture of a QRCode, give the client a name and you’re done.

What i’ve still not worked out is how to tell my other new friend ‘electron-packager’ to package the production version. Until that is worked out i’m stuck with the Muon version… which isn’t a bad place – it has been very stable thus far.

Edit: It seems ‘electron-packager’ was not my friend after all, ‘yarn’ however i’m starting to like! The ‘package.json’ contains a ‘scripts’ section defining a bunch of targets, one of which ‘pack-prod’ is ‘SIGNAL_ENV=production npm run dist’ which seems exactly what i need. And, indeed:

$ yarn pack-prod

spat out a ‘dist’ dir containing a working ‘production’ Signal.app.

The end.

Advertisements