I packaged up riot-web as a snap to make it super easy to install on Linux. snap install riot-web works. I have done this since 1.2.0, which worked well. However, since 1.2.2, the client presents this error on first launch for a user who has clean installed the application.

Previously, in 1.2.0 and 1.2.1, the application loaded fine, and you'd be greeted with this, as expected.

Here's the terminal output when launching.
alan@KinkPad-K450:~$ riot-web
No update_base_url is defined: auto update is disabled
Attempting to migrate data between origins
Loading path: /snap/riot-web/10/resources/origin_migrator/source.html
No session to migrate from old origin
There are approximately 1K users with the snap installed. Anything above 1.2.1 fails to launch if it's newly installed. If the application was installed at 1.2.0 or 1.2.1 and updated to 1.2.2 or above, the user is fine.
On a system which supports snaps.
snap install riot-web
Or follow the instructions at https://snapcraft.io/riot-web
In a terminal run riot-web.
You'll see the first screenshot above.
I'm building inside a clean Ubuntu 16.04.6 lxc container, using a simple script which modifies the package.json to enable snap builds. Here's the diff showing the changes I make.
root@riot-web-20190719-174241:~/riot-web# git diff package.json
diff --git a/package.json b/package.json
index 13f3249..315185e 100644
--- a/package.json
+++ b/package.json
@@ -82,7 +82,8 @@
"react-dom": "^15.6.0",
"sanitize-html": "^1.19.1",
"ua-parser-js": "^0.7.19",
- "url": "^0.11.0"
+ "url": "^0.11.0",
+ "electron-updater": "^4.0.0"
},
"devDependencies": {
"autoprefixer": "^6.6.0",
@@ -167,7 +168,7 @@
"origin_migrator/**/*"
],
"linux": {
- "target": "deb",
+ "target": "snap",
"category": "Network;InstantMessaging;Chat",
"maintainer": "[email protected]",
"desktop": {
@@ -186,6 +187,18 @@
"buildResources": "electron_app/build",
"output": "electron_app/dist",
"app": "electron_app"
+ },
+ "snap": {
+ "environment": {
+ "DISABLE_WAYLAND": "1",
+ "WAYLAND_DISPLAY": "no-display",
+ "XDG_CURRENT_DESKTOP": "Unity"
+ },
+ "plugs": [
+ "default",
+ "wayland",
+ "camera"
+ ]
}
}
}
I then build using the following commands, with node 10.16.
yarn install
yarn dist
yarn run build:electron:linux
The snap ends up in electron_app/dist/*.snap which can be manually installed via snap install riot-web_1.3.0_amd64.snap --dangerous (the --dangerous is only needed if you're installing manually rather than a signed package from the store).
I'd expect 1.2.2 and above to behave the same way 1.2.0 did, which enables new users to sign into a remote matrix instance.
I have tested each release and only 1.22 and above have this issue.
For the desktop app:
Thanks for filing an issue. (I've actually been trying to reach you on Twitter about this!)
Recent versions of Riot now require a default server to be configured because simply opening Riot actually creates a guest account, and we want self-hosted installs of the webapp to make a conscious choice about which homeserver that connection goes to.
However, for your snaps, you most likely want to arrive at something similar to our Debian packages of the Electron app. I think the key difference between your steps and the ones we use for our Debian packages, is we do something equivalent to:
cp electron_app/riot.im/config.json .
before building, which will default to matrix.org homeserver among other settings. You likely want the same content, but with the key update_base_url removed (so that the built-in updater is disabled).
We regularly change this file each version, so it would be best to start from the content in electron_app/riot.im/config.json and strip out update_base_url with jq or a similar JSON tool.
I started the conversation on twitter.
I installed a homeserver on my own and tried to use the snap to test it - I wanted to use snap to get a sandboxed version of riot-web. I'm not really fine with third party apt-repositories...
If you may give the chance to enter a homeserver url on the first startup....
Terribly sorry I didn't get back to you on twitter. Thanks so much to you both for raising the issue. I have updated the build script with the recommendations from @jryans and pushed version 1.3.0 (revision 11) to the stable channel. Tested locally and works as expected.
Thanks again!
I just remembered that the updater is always disabled for Linux anyway... 馃槄 So, you could just copy the file and be done. Sorry for inventing extra steps...
Hah! It's a one-line sed, I'll remove it, putting the line back, vanilla.
Is there any plan to enable it on Linux in the future?
Is there any plan to enable it on Linux in the future?
I am not aware of any plans to do so via the Electron app directly. I believe most Linux users would prefer updating via some package like deb, snap, appimage, etc. I'll keep a note to be sure to contact you in case plans change. 馃槃
Recent versions of Riot now require a default server to be configured because simply opening Riot actually creates a guest account, and we want self-hosted installs of the webapp to make a conscious choice about which homeserver that connection goes to.
@jryans Please do not take offense to my reasoning or lack of... First kudos on using Electron, I love it too. I downloaded the DMG of v1.5.6 and have the same error. Being a developer I understand what needs to be done to remedy this. But from the perspective of a typical user (or someone just wanting to test it out I think this is not a good thing. I was merely wanting to see what it looked like on a 'native app' but there are no options built into the menu to define the server of choice.
Obviously, if I were an admin and planning to distribute the app I would want to define the homeserver in the background (possibly not even introducing the confusion of additional servers, especially if it were being rebranded or what not). But I wonder why push out a .dmg at all if it can't be used for testing without recompiling? I mean if we need to be pressing out our own .dmg after a minor tweak to the json file why were the dmg files even published since this change? I am just curious, not trying to sound impolite.
Is the goal just to have those testing to simply use the web app? Aside from the menu I would assume the web version is virtually the same, yes?
Again great work, looking forward to getting under the hood soon and walking away from rocketchat.
https://riot.im/app/ opened via chrome, also "Invalid homeserver discovery response", how to solve this situation
https://riot.im/app/ opened via chrome, also "Invalid homeserver discovery response", how to solve this situation
If you are visiting that URL and seeing an error, it sounds different to this issue, so please file a new one with more details.
Most helpful comment
Thanks for filing an issue. (I've actually been trying to reach you on Twitter about this!)
Recent versions of Riot now require a default server to be configured because simply opening Riot actually creates a guest account, and we want self-hosted installs of the webapp to make a conscious choice about which homeserver that connection goes to.
However, for your snaps, you most likely want to arrive at something similar to our Debian packages of the Electron app. I think the key difference between your steps and the ones we use for our Debian packages, is we do something equivalent to:
before building, which will default to matrix.org homeserver among other settings. You likely want the same content, but with the key
update_base_urlremoved (so that the built-in updater is disabled).We regularly change this file each version, so it would be best to start from the content in
electron_app/riot.im/config.jsonand strip outupdate_base_urlwithjqor a similar JSON tool.