Browse Source

Merge branch 'develop' into travis/dockerfile-continued

pull/9426/head
Travis Ralston 3 years ago
parent
commit
9bf5828079
  1. 33
      .buildkite/pipeline.yaml
  2. 2
      .github/ISSUE_TEMPLATE.md
  3. 55
      .github/ISSUE_TEMPLATE/bug_report.md
  4. 20
      .github/ISSUE_TEMPLATE/suggestion-or-feature-request.md
  5. 57
      .github/ISSUE_TEMPLATE/user-interface-or-usability-bug-report.md
  6. 3
      .gitignore
  7. 28
      .travis.yml
  8. 296
      CHANGELOG.md
  9. 2
      CONTRIBUTING.rst
  10. 246
      README.md
  11. 1
      config.sample.json
  12. 32
      docs/labs.md
  13. 11
      docs/shortcuts.md
  14. 8
      docs/translating-dev.md
  15. BIN
      electron_app/build/icon.icns
  16. BIN
      electron_app/build/icon.ico
  17. BIN
      electron_app/build/icons/128x128.png
  18. BIN
      electron_app/build/icons/16x16.png
  19. BIN
      electron_app/build/icons/24x24.png
  20. BIN
      electron_app/build/icons/256x256.png
  21. BIN
      electron_app/build/icons/48x48.png
  22. BIN
      electron_app/build/icons/512x512.png
  23. BIN
      electron_app/build/icons/64x64.png
  24. BIN
      electron_app/build/icons/96x96.png
  25. BIN
      electron_app/build/install-spinner.gif
  26. BIN
      electron_app/img/riot.ico
  27. BIN
      electron_app/img/riot.png
  28. 3
      electron_app/package.json
  29. 1
      electron_app/riot.im/config.json
  30. 235
      electron_app/src/electron-main.js
  31. 62
      electron_app/src/originMigrator.js
  32. 24
      electron_app/src/preload.js
  33. 6
      electron_app/src/vectormenu.js
  34. 73
      electron_app/src/webcontents-handler.js
  35. 837
      electron_app/yarn.lock
  36. 10
      karma.conf.js
  37. 19
      origin_migrator/dest/browser-matrix.min.js
  38. 6
      origin_migrator/dest/dest.html
  39. 125
      origin_migrator/dest/dest.js
  40. 7
      origin_migrator/source.html
  41. 210
      origin_migrator/source.js
  42. 14710
      package-lock.json
  43. 65
      package.json
  44. 11
      release.sh
  45. 192
      res/home-status.html
  46. 292
      res/home.html
  47. 76
      res/home/images/logo.svg
  48. BIN
      res/home/rooms/bridging.png
  49. BIN
      res/home/rooms/dendrite-dev.png
  50. BIN
      res/home/rooms/dendrite.png
  51. BIN
      res/home/rooms/e2e.png
  52. BIN
      res/home/rooms/homeowners.png
  53. BIN
      res/home/rooms/identity.jpg
  54. BIN
      res/home/rooms/identity.png
  55. BIN
      res/home/rooms/irc.png
  56. BIN
      res/home/rooms/matrix-dev.png
  57. BIN
      res/home/rooms/matrix.png
  58. BIN
      res/home/rooms/riot-android.png
  59. BIN
      res/home/rooms/riot-bot.png
  60. BIN
      res/home/rooms/riot-dev.png
  61. BIN
      res/home/rooms/riot-ios.png
  62. BIN
      res/home/rooms/riot-translations.png
  63. BIN
      res/home/rooms/riot.png
  64. BIN
      res/home/rooms/synapse.png
  65. BIN
      res/home/rooms/vr.png
  66. BIN
      res/home/rooms/webrtc.png
  67. BIN
      res/themes/riot/img/backgrounds/valley.jpg
  68. BIN
      res/themes/riot/img/logos/riot-im-logo-1.png
  69. 158
      res/themes/riot/img/logos/riot-im-logo-1.svg
  70. 165
      res/themes/riot/img/logos/riot-im-logo-2.svg
  71. 173
      res/themes/riot/img/logos/riot-im-logo-3.svg
  72. 185
      res/themes/riot/img/logos/riot-im-logo-4.svg
  73. 110
      res/themes/riot/img/logos/riot-im-logo-5.svg
  74. BIN
      res/themes/riot/img/logos/riot-im-logo-black-text.png
  75. 17
      res/themes/riot/img/logos/riot-im-logo-black-text.svg
  76. BIN
      res/themes/riot/img/logos/riot-im-logo.png
  77. 17
      res/themes/riot/img/logos/riot-im-logo.svg
  78. 1
      res/themes/riot/img/logos/riot-logo-1.svg
  79. 1
      res/themes/riot/img/logos/riot-logo-2.svg
  80. 1
      res/themes/riot/img/logos/riot-logo-3.svg
  81. 1
      res/themes/riot/img/logos/riot-logo-4.svg
  82. 1
      res/themes/riot/img/logos/riot-logo-5.svg
  83. 1
      res/themes/riot/img/logos/riot-logo-bw.svg
  84. 32
      res/themes/riot/img/logos/riot-logo.svg
  85. 169
      res/themes/riot/img/logos/riot.im logo.svg
  86. 232
      res/themes/status/css/_StatusLogin.scss
  87. 293
      res/themes/status/css/_status.scss
  88. 4
      res/themes/status/css/status.scss
  89. 1
      res/themes/status/fonts/README
  90. BIN
      res/themes/status/img/a.png
  91. BIN
      res/themes/status/img/d.png
  92. 1
      res/themes/status/img/dot.svg
  93. BIN
      res/themes/status/img/g.png
  94. BIN
      res/themes/status/img/i.png
  95. 16
      res/themes/status/img/logo.svg
  96. BIN
      res/themes/status/img/n.png
  97. BIN
      res/vector-icons/android-chrome-144x144.png
  98. BIN
      res/vector-icons/android-chrome-192x192.png
  99. BIN
      res/vector-icons/android-chrome-36x36.png
  100. BIN
      res/vector-icons/android-chrome-48x48.png
  101. Some files were not shown because too many files have changed in this diff Show More

33
.buildkite/pipeline.yaml

@ -0,0 +1,33 @@
steps:
- label: ":eslint: Lint"
command:
- "yarn install"
- "yarn lint"
plugins:
- docker#v3.0.1:
image: "node:10"
- label: ":karma: Tests"
agents:
# We use a medium sized instance instead of the normal small ones because
# webpack loves to gorge itself on resources.
queue: "medium"
command:
# Install chrome
- "echo '--- Installing Chrome'"
- "wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -"
- "sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google.list'"
- "apt-get update"
- "apt-get install -y google-chrome-stable"
# Run tests
- "echo '--- Fetching Dependencies'"
- "./scripts/fetch-develop.deps.sh --depth 1"
- "yarn install"
- "echo '+++ Running Tests'"
- "yarn test"
env:
CHROME_BIN: "/usr/bin/google-chrome-stable"
plugins:
- docker#v3.0.1:
image: "node:10"
propagate-environment: true

2
.github/ISSUE_TEMPLATE.md

@ -43,4 +43,4 @@ For the web app:
For the desktop app:
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **Version**: 0.x.y <!-- check the user settings panel if unsure -->
- **Version**: 1.x.y <!-- check the user settings panel if unsure -->

55
.github/ISSUE_TEMPLATE/bug_report.md

@ -0,0 +1,55 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
<!-- Please report security issues by email to security@matrix.org -->
<!-- This is a bug report template. By following the instructions below and
filling out the sections with your information, you will help the us to get all
the necessary data to fix your issue.
You can also preview your report before submitting it. You may remove sections
that aren't relevant to your particular case.
Text between <!-- and --> marks will be invisible in the report.
-->
### Description
Describe here the problem that you are experiencing, or the feature you are requesting.
### Steps to reproduce
- For bugs, list the steps
- that reproduce the bug
- using hyphens as bullet points
Describe how what happens differs from what you expected.
Log: sent/not sent? <!-- You can send us the app's logs via the 'Report bug'
link on the 'Settings' page. Very important for hard-to-reproduce bugs. Please
file a bug here too! -->
<!-- Include screenshots if possible: you can drag and drop images below. -->
### Version information
<!-- IMPORTANT: please answer the following questions, to help us narrow down the problem -->
- **Platform**: web (in-browser) or desktop?
For the web app:
- **Browser**: Chrome, Safari, Firefox? which version?
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web?
For the desktop app:
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **Version**: 1.x.y <!-- check the user settings panel if unsure -->

20
.github/ISSUE_TEMPLATE/suggestion-or-feature-request.md

@ -0,0 +1,20 @@
---
name: Suggestion or Feature request
about: Suggest an idea for this project
title: ''
labels: suggestion
assignees: ''
---
**Is your suggestion related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

57
.github/ISSUE_TEMPLATE/user-interface-or-usability-bug-report.md

@ -0,0 +1,57 @@
---
name: User Interface or Usability Bug report
about: Please include screenshots in UI/UX bug reports
title: ''
labels: ''
assignees: ''
---
<!-- A picture's worth a thousand words: PLEASE INCLUDE A SCREENSHOT :P -->
<!-- Please report security issues by email to security@matrix.org -->
<!-- This is a bug report template. By following the instructions below and
filling out the sections with your information, you will help the us to get all
the necessary data to fix your issue.
You can also preview your report before submitting it. You may remove sections
that aren't relevant to your particular case.
Text between <!-- and --> marks will be invisible in the report.
-->
### Description
Describe here the problem that you are experiencing, or the feature you are requesting.
### Steps to reproduce
- For bugs, list the steps
- that reproduce the bug
- using hyphens as bullet points
Describe how what happens differs from what you expected.
Log: sent/not sent? <!-- You can send us the app's logs via the 'Report bug'
link on the 'Settings' page. Very important for hard-to-reproduce bugs. Please
file a bug here too! -->
<!-- Include screenshots if possible: you can drag and drop images below. -->
### Version information
<!-- IMPORTANT: please answer the following questions, to help us narrow down the problem -->
- **Platform**: web (in-browser) or desktop?
For the web app:
- **Browser**: Chrome, Safari, Firefox? which version?
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web?
For the desktop app:
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **Version**: 1.x.y <!-- check the user settings panel if unsure -->

3
.gitignore vendored

@ -10,8 +10,9 @@
/packages/
/webapp
/.npmrc
/*.log
package-lock.json
.DS_Store
npm-debug.log
electron/dist
electron/pub
**/.idea

28
.travis.yml

@ -1,28 +0,0 @@
# we need trusty for the chrome addon
dist: trusty
# we don't need sudo, so can run in a container, which makes startup much
# quicker.
#
# unfortunately we do temporarily require sudo as a workaround for
# https://github.com/travis-ci/travis-ci/issues/8836
sudo: required
language: node_js
node_js:
# make sure we work with a range of node versions.
#
# Current status of node versions: https://github.com/nodejs/LTS/
# We don't work with node 6 because it doesn't support package-lock
# files which we need to avoid the broken version of base-x
- 8
- 10
addons:
chrome: stable
install:
# clone the deps with depth 1: we know we will only ever need that one
# commit.
- npm install && scripts/fetch-develop.deps.sh --depth 1
script:
- npm run test
- npm run lint

296
CHANGELOG.md

@ -1,3 +1,299 @@
Changes in [1.0.7](https://github.com/vector-im/riot-web/releases/tag/v1.0.7) (2019-04-08)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.6...v1.0.7)
* Hotfix: bump js-sdk to 1.0.4, see https://github.com/matrix-org/matrix-js-sdk/releases/tag/v1.0.4
Changes in [1.0.6](https://github.com/vector-im/riot-web/releases/tag/v1.0.6) (2019-04-01)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.6-rc.1...v1.0.6)
* Add "Save image as..." button to context menu on images
[\#9327](https://github.com/vector-im/riot-web/pull/9327)
Changes in [1.0.6-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.6-rc.1) (2019-03-27)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.5...v1.0.6-rc.1)
* Use `on_logged_in` action in tests
[\#9279](https://github.com/vector-im/riot-web/pull/9279)
* Convert away from `Promise.defer`
[\#9278](https://github.com/vector-im/riot-web/pull/9278)
* update react-sdk version in yarn lockfile
[\#9233](https://github.com/vector-im/riot-web/pull/9233)
* "Render simple counters in room header" details
[\#9154](https://github.com/vector-im/riot-web/pull/9154)
* Use medium agents for the more resource intensive builds
[\#9238](https://github.com/vector-im/riot-web/pull/9238)
* Add log grouping to buildkite
[\#9223](https://github.com/vector-im/riot-web/pull/9223)
* Switch to `git` protocol for CI dependencies
[\#9222](https://github.com/vector-im/riot-web/pull/9222)
* Support CI for matching branches on forks
[\#9212](https://github.com/vector-im/riot-web/pull/9212)
* Update from Weblate
[\#9199](https://github.com/vector-im/riot-web/pull/9199)
* Declare the officially supported browsers in the README
[\#9177](https://github.com/vector-im/riot-web/pull/9177)
* Document some desktop app things
[\#9011](https://github.com/vector-im/riot-web/pull/9011)
* Use Buildkite for CI
[\#9165](https://github.com/vector-im/riot-web/pull/9165)
* Update version number in issue templates
[\#9170](https://github.com/vector-im/riot-web/pull/9170)
* Remove node 8.x from the build matrix
[\#9159](https://github.com/vector-im/riot-web/pull/9159)
* Update Electron help menu link
[\#9157](https://github.com/vector-im/riot-web/pull/9157)
Changes in [1.0.5](https://github.com/vector-im/riot-web/releases/tag/v1.0.5) (2019-03-21)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.4...v1.0.5)
* Hotfix for [\#9205](https://github.com/vector-im/riot-web/issues/9205) disabling jump prevention for typing notifications, while we're reworking this functionally to enable it again soon.
Changes in [1.0.4](https://github.com/vector-im/riot-web/releases/tag/v1.0.4) (2019-03-18)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.4-rc.1...v1.0.4)
* No changes since rc.1
Changes in [1.0.4-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.4-rc.1) (2019-03-13)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.3...v1.0.4-rc.1)
* Update from Weblate
[\#9152](https://github.com/vector-im/riot-web/pull/9152)
* Use modern Yarn version on Travis CI
[\#9151](https://github.com/vector-im/riot-web/pull/9151)
* Switch to `yarn` for dependency management
[\#9132](https://github.com/vector-im/riot-web/pull/9132)
* Update from Weblate
[\#9104](https://github.com/vector-im/riot-web/pull/9104)
* Don't copy the 32 bit linux deb
[\#9075](https://github.com/vector-im/riot-web/pull/9075)
* Change olm dependency to normal dep
[\#9068](https://github.com/vector-im/riot-web/pull/9068)
* Add modular.im hosting link to electron app config
[\#9047](https://github.com/vector-im/riot-web/pull/9047)
* Nudge karma to 3.1.2
[\#8991](https://github.com/vector-im/riot-web/pull/8991)
* Add support for localConfig at $appData/config.json.
[\#8983](https://github.com/vector-im/riot-web/pull/8983)
Changes in [1.0.3](https://github.com/vector-im/riot-web/releases/tag/v1.0.3) (2019-03-06)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.2...v1.0.3)
* react-sdk 1.0.3 to fix ctrl+k shortcut and room list bugs
Changes in [1.0.2](https://github.com/vector-im/riot-web/releases/tag/v1.0.2) (2019-03-06)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.2-rc.3...v1.0.2)
* New react-sdk for minor hosting link fixes
Changes in [1.0.2-rc.3](https://github.com/vector-im/riot-web/releases/tag/v1.0.2-rc.3) (2019-03-05)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.2-rc.2...v1.0.2-rc.3)
* Add modular.im hosting link to electron app config
[\#9051](https://github.com/vector-im/riot-web/pull/9051)
Changes in [1.0.2-rc.2](https://github.com/vector-im/riot-web/releases/tag/v1.0.2-rc.2) (2019-03-01)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.2-rc.1...v1.0.2-rc.2)
* Update to react-sdk rc.3
Changes in [1.0.2-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.2-rc.1) (2019-03-01)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.1...v1.0.2-rc.1)
* Set a require alias for the webapp directory
[\#9014](https://github.com/vector-im/riot-web/pull/9014)
* Update from Weblate.
[\#8973](https://github.com/vector-im/riot-web/pull/8973)
* set chrome path for travis CI explicitly
[\#8987](https://github.com/vector-im/riot-web/pull/8987)
* Updated install spinner
[\#8984](https://github.com/vector-im/riot-web/pull/8984)
* Allow disabling update mechanism
[\#8911](https://github.com/vector-im/riot-web/pull/8911)
* Allow configuration of whether closing window closes or minimizes to tray
[\#8908](https://github.com/vector-im/riot-web/pull/8908)
* Fix language file path for Jenkins
[\#8854](https://github.com/vector-im/riot-web/pull/8854)
* Document and recommend `default_server_name`
[\#8832](https://github.com/vector-im/riot-web/pull/8832)
* Cache busting for icons & language files
[\#8710](https://github.com/vector-im/riot-web/pull/8710)
* Remove redesign issue template
[\#8722](https://github.com/vector-im/riot-web/pull/8722)
* Make scripts/make-icons.sh work on linux
[\#8550](https://github.com/vector-im/riot-web/pull/8550)
Changes in [1.0.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.1) (2019-02-15)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0...v1.0.1)
Changes in [1.0.0](https://github.com/vector-im/riot-web/releases/tag/v1.0.0) (2019-02-14)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0-rc.2...v1.0.0)
* Add snipping lines to welcome page without guests
[\#8634](https://github.com/vector-im/riot-web/pull/8634)
* Add home page to fix loading tests
[\#8625](https://github.com/vector-im/riot-web/pull/8625)
Changes in [1.0.0-rc.2](https://github.com/vector-im/riot-web/releases/tag/v1.0.0-rc.2) (2019-02-14)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0-rc.1...v1.0.0-rc.2)
* Update from Weblate.
[\#8615](https://github.com/vector-im/riot-web/pull/8615)
* Replace favicon assets to ones with transparent backgrounds
[\#8600](https://github.com/vector-im/riot-web/pull/8600)
* Refreshed icons
[\#8594](https://github.com/vector-im/riot-web/pull/8594)
* Fix order of fetch-develop-deps / npm install
[\#8566](https://github.com/vector-im/riot-web/pull/8566)
* Revive building dark theme
[\#8540](https://github.com/vector-im/riot-web/pull/8540)
* Update from Weblate.
[\#8546](https://github.com/vector-im/riot-web/pull/8546)
* Repair app loading tests after welcome page
[\#8525](https://github.com/vector-im/riot-web/pull/8525)
* Support configurable welcome background and logo
[\#8528](https://github.com/vector-im/riot-web/pull/8528)
* Update from Weblate.
[\#8518](https://github.com/vector-im/riot-web/pull/8518)
* Document `embeddedPages` configuration
[\#8514](https://github.com/vector-im/riot-web/pull/8514)
* README.md : Syntax Coloring
[\#8502](https://github.com/vector-im/riot-web/pull/8502)
Changes in [1.0.0-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.0-rc.1) (2019-02-08)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.9...v1.0.0-rc.1)
* Update from Weblate.
[\#8475](https://github.com/vector-im/riot-web/pull/8475)
* Add configurable welcome page
[\#8466](https://github.com/vector-im/riot-web/pull/8466)
* fix app tests after force enabling lazy loading + removing feature flag
[\#8464](https://github.com/vector-im/riot-web/pull/8464)
* Allow Electron to zoom with CommandOrControl+=
[\#8381](https://github.com/vector-im/riot-web/pull/8381)
* Hide sign in / create account for logged in users
[\#8368](https://github.com/vector-im/riot-web/pull/8368)
* Fix home page link target
[\#8365](https://github.com/vector-im/riot-web/pull/8365)
* Add auth background image and update Riot logo
[\#8364](https://github.com/vector-im/riot-web/pull/8364)
* New homepage
[\#8363](https://github.com/vector-im/riot-web/pull/8363)
* Spell homeserver correctly
[\#8358](https://github.com/vector-im/riot-web/pull/8358)
* Merge redesign into develop
[\#8321](https://github.com/vector-im/riot-web/pull/8321)
* Disable room directory test because it doesn't work
[\#8318](https://github.com/vector-im/riot-web/pull/8318)
* Tweak auth overflow on Windows and Linux
[\#8307](https://github.com/vector-im/riot-web/pull/8307)
* Clean up Custom Server Help dialog
[\#8296](https://github.com/vector-im/riot-web/pull/8296)
* Cache-bust olm.wasm
[\#8283](https://github.com/vector-im/riot-web/pull/8283)
* Completely disable other themes for now (#8277)
[\#8280](https://github.com/vector-im/riot-web/pull/8280)
* Remove support for team servers
[\#8271](https://github.com/vector-im/riot-web/pull/8271)
* Add target="_blank" to footer links
[\#8248](https://github.com/vector-im/riot-web/pull/8248)
* Fix device names on desktop
[\#8241](https://github.com/vector-im/riot-web/pull/8241)
* Fix literal &lt/&gt in notifications
[\#8238](https://github.com/vector-im/riot-web/pull/8238)
* Fix registration nextLink on desktop
[\#8239](https://github.com/vector-im/riot-web/pull/8239)
* Add returns to fetch-develop-deps
[\#8233](https://github.com/vector-im/riot-web/pull/8233)
* Update electron builder
[\#8231](https://github.com/vector-im/riot-web/pull/8231)
* Try fetching more branches for PRs
[\#8225](https://github.com/vector-im/riot-web/pull/8225)
* Use content hashing for font and image URLs
[\#8159](https://github.com/vector-im/riot-web/pull/8159)
* Develop->Experimental
[\#8156](https://github.com/vector-im/riot-web/pull/8156)
* Update from Weblate.
[\#8150](https://github.com/vector-im/riot-web/pull/8150)
* Correct the copying of e-mail addresses in the electron app
[\#8124](https://github.com/vector-im/riot-web/pull/8124)
* Start documenting keyboard shortcuts
[\#7165](https://github.com/vector-im/riot-web/pull/7165)
* Update issue templates
[\#7948](https://github.com/vector-im/riot-web/pull/7948)
* Added new colour var to all themes
[\#7927](https://github.com/vector-im/riot-web/pull/7927)
* Redesign: apply changes from dharma theme to status theme
[\#7541](https://github.com/vector-im/riot-web/pull/7541)
* Redesign: ignore setting and always show dharma theme for now
[\#7540](https://github.com/vector-im/riot-web/pull/7540)
Changes in [0.17.9](https://github.com/vector-im/riot-web/releases/tag/v0.17.9) (2019-01-22)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.9-rc.1...v0.17.9)
* Bugfix in react-sdk for setting DM rooms
Changes in [0.17.9-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.17.9-rc.1) (2019-01-17)
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.8...v0.17.9-rc.1)
* Merge develop into experimental
[\#8003](https://github.com/vector-im/riot-web/pull/8003)
* Electron: Load app from custom protocol
[\#7943](https://github.com/vector-im/riot-web/pull/7943)
* Fix the IndexedDB worker
[\#7920](https://github.com/vector-im/riot-web/pull/7920)
* Make clear that the Debian package is for desktop
[\#7919](https://github.com/vector-im/riot-web/pull/7919)
* Run the Desktop app in a sandbox
[\#7907](https://github.com/vector-im/riot-web/pull/7907)
* Update to new electron single instance API
[\#7908](https://github.com/vector-im/riot-web/pull/7908)
* Update the tests to match https://github.com/matrix-org/matrix-react-
sdk/pull/2340
[\#7834](https://github.com/vector-im/riot-web/pull/7834)
Changes in [0.17.8](https://github.com/vector-im/riot-web/releases/tag/v0.17.8) (2018-12-10)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.8-rc.1...v0.17.8)
* No changes since rc.1
Changes in [0.17.8-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.17.8-rc.1) (2018-12-06)
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.7...v0.17.8-rc.1)
* Update from Weblate.
[\#7784](https://github.com/vector-im/riot-web/pull/7784)
* Add a function to send a rageshake from the console
[\#7755](https://github.com/vector-im/riot-web/pull/7755)
* Re-apply "Run lint on travis builds and use modern node versions"
[\#7738](https://github.com/vector-im/riot-web/pull/7738)
* Revert "Run lint on travis builds and use modern node versions"
[\#7737](https://github.com/vector-im/riot-web/pull/7737)
* Run lint on travis builds and use modern node versions
[\#7490](https://github.com/vector-im/riot-web/pull/7490)
* Fix missing js-sdk logging
[\#7736](https://github.com/vector-im/riot-web/pull/7736)
* Add $accent-color-50pct as a CSS variable to the Status theme
[\#7710](https://github.com/vector-im/riot-web/pull/7710)
Changes in [0.17.7](https://github.com/vector-im/riot-web/releases/tag/v0.17.7) (2018-11-22)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.6...v0.17.7)

2
CONTRIBUTING.rst

@ -1,4 +1,4 @@
Contributing code to Riot
=========================
Riot follows the same pattern as https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst.
Riot follows the same pattern as https://github.com/matrix-org/matrix-js-sdk/blob/master/CONTRIBUTING.rst.

246
README.md

@ -1,34 +1,38 @@
Riot
====
Riot (formerly known as Vector) is a Matrix web client built using the Matrix
React SDK (https://github.com/matrix-org/matrix-react-sdk).
Riot (formerly known as Vector) is a Matrix web client built using the [Matrix React SDK](https://github.com/matrix-org/matrix-react-sdk).
Riot is officially supported on the web in modern versions of Chrome, Firefox, and Safari. Other browsers may work, however
official support is not provided. For accessing Riot on an Android or iOS device, check out [riot-android](https://github.com/vector-im/riot-android)
and [riot-ios](https://github.com/vector-im/riot-ios) - riot-web does not support mobile devices.
Getting Started
===============
The easiest way to test Riot is to just use the hosted copy at
https://riot.im/app. The develop branch is continuously deployed by Jenkins at
https://riot.im/develop for those who like living dangerously.
The easiest way to test Riot is to just use the hosted copy at https://riot.im/app.
The `develop` branch is continuously deployed by Jenkins at https://riot.im/develop
for those who like living dangerously.
To host your own copy of Riot, the quickest bet is to use a pre-built
released version of Riot:
1. Download the latest version from https://github.com/vector-im/riot-web/releases
1. Untar the tarball on your web server
1. Move (or symlink) the riot-x.x.x directory to an appropriate name
1. Move (or symlink) the `riot-x.x.x` directory to an appropriate name
1. If desired, copy `config.sample.json` to `config.json` and edit it
as desired. See below for details.
1. Enter the URL into your browser and log into Riot!
Releases are signed by PGP, and can be checked against the public key
at https://riot.im/packages/keys/riot.asc
at https://riot.im/packages/keys/riot.asc .
Note that Chrome does not allow microphone or webcam access for sites served
over http (except localhost), so for working VoIP you will need to serve Riot
over https.
### Installation Steps for Debian Stretch
### Desktop Installation for Debian Stretch
1. Add the repository to your sources.list using either of the following two options:
- Directly to sources.list: `echo "deb https://riot.im/packages/debian/ stretch main" | sudo tee -a /etc/apt/sources.list`
- As a separate entry in sources.list.d: `echo "deb https://riot.im/packages/debian/ stretch main" | sudo tee /etc/apt/sources.list.d/riot.list`
@ -61,50 +65,47 @@ progress on replacing this with something better.
Building From Source
====================
Riot is a modular webapp built with modern ES6 and requires a npm build system
to build.
Riot is a modular webapp built with modern ES6 and uses a Node.js build system.
Ensure you have the latest LTS version of Node.js installed.
Using `yarn` instead of `npm` is recommended. Please see the Yarn [install
guide](https://yarnpkg.com/docs/install/) if you do not have it already.
1. Install or update `node.js` so that your `node` is at least v8.12.0 (and `npm`
is at least v5.x).
1. Install or update `node.js` so that your `node` is at least v10.x.
1. Install `yarn` if not present already.
1. Clone the repo: `git clone https://github.com/vector-im/riot-web.git`.
1. Switch to the riot-web directory: `cd riot-web`.
1. Install the prerequisites: `yarn install`.
1. If you're using the `develop` branch then it is recommended to set up a proper
development environment ("Setting up a dev environment" below) however one can
install the develop versions of the dependencies instead:
```
```bash
scripts/fetch-develop.deps.sh
```
Whenever you git pull on riot-web you will also probably need to force an update
Whenever you git pull on `riot-web` you will also probably need to force an update
to these dependencies - the simplest way is to re-run the script, but you can also
manually update and rebuild them:
```
```bash
cd matrix-js-sdk
git pull
npm install # re-run to pull in any new dependencies
# Depending on your version of npm, npm run build may happen as part of
# the npm install above (https://docs.npmjs.com/misc/scripts#prepublish-and-prepare)
# If in doubt, run it anyway:
npm run build
yarn install # re-run to pull in any new dependencies
cd ../matrix-react-sdk
git pull
npm install
npm run build
yarn install
```
Or just use https://riot.im/develop - the continuous integration release of the
develop branch. (Note that we don't reference the develop versions in git directly
due to https://github.com/npm/npm/issues/3055.)
1. Install the prerequisites: `npm install`.
1. Configure the app by copying `config.sample.json` to `config.json` and
modifying it (see below for details).
1. `npm run dist` to build a tarball to deploy. Untaring this file will give
1. `yarn dist` to build a tarball to deploy. Untaring this file will give
a version-specific directory containing all the files that need to go on your
web server.
Note that `npm run dist` is not supported on Windows, so Windows users can run `npm
run build`, which will build all the necessary files into the `webapp`
directory. The version of Riot will not appear in Settings without
using the dist script. You can then mount the `webapp` directory on your
webserver to actually serve up the app, which is entirely static content.
Note that `yarn dist` is not supported on Windows, so Windows users can run `yarn build`,
which will build all the necessary files into the `webapp` directory. The version of Riot
will not appear in Settings without using the dist script. You can then mount the
`webapp` directory on your webserver to actually serve up the app, which is entirely static content.
config.json
===========
@ -112,24 +113,38 @@ config.json
You can configure the app by copying `config.sample.json` to
`config.json` and customising it:
For a good example, see https://riot.im/develop/config.json
1. `default_hs_url` is the default homeserver url.
1. `default_is_url` is the default identity server url (this is the server used
for verifying third party identifiers like email addresses). If this is blank,
registering with an email address, adding an email address to your account,
or inviting users via email address will not work. Matrix identity servers are
very simple web services which map third party identifiers (currently only email
addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html
for more details. Currently the only public matrix identity servers are https://matrix.org
and https://vector.im. In future identity servers will be decentralised.
For a good example, see https://riot.im/develop/config.json.
1. `default_server_name` sets the default server name to use for authentication.
This will trigger Riot to ask
`https://<server_name>/.well-known/matrix/client` for the homeserver and
identity server URLs to use. This is the recommended approach for setting a
default server. However, it is also possible to use the following to directly
configure each of the URLs:
* `default_hs_url` sets the default homeserver URL.
* `default_is_url` sets the default identity server URL (this is the server used
for verifying third party identifiers like email addresses). If this is blank,
registering with an email address, adding an email address to your account,
or inviting users via email address will not work. Matrix identity servers are
very simple web services which map third party identifiers (currently only email
addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html
for more details. Currently the only public matrix identity servers are https://matrix.org
and https://vector.im. In the future, identity servers will be decentralised.
* Riot will report an error if you accidentally configure both `default_server_name` _and_ `default_hs_url` since it's unclear which should take priority.
1. `features`: Lookup of optional features that may be `enable`d, `disable`d, or exposed to the user
in the `labs` section of settings. The available optional experimental features vary from
release to release.
1. `brand`: String to pass to your homeserver when configuring email notifications, to let the
homeserver know what email template to use when talking to you.
1. `branding`: Configures various branding and logo details, such as:
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
during authentication flows
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
authentication flows
1. `authFooterLinks`: a list of links to show in the authentication page footer:
`[{"text": "Link text", "url": "https://link.target"}, {"text": "Other link", ...}]`
1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations
server is not Riot and normally not your Home Server either. The integration server settings
server is not Riot and normally not your homeserver either. The integration server settings
may be left blank to disable integrations.
1. `integrations_rest_url`: URL to the REST interface for the integrations server.
1. `integrations_widgets_urls`: list of URLs to the REST interface for the widget integrations server.
@ -156,9 +171,14 @@ For a good example, see https://riot.im/develop/config.json
1. `whitelistedHSUrls`: a list of HS URLs to not redact from the analytics
1. `whitelistedISUrls`: a list of IS URLs to not redact from the analytics
1. `siteId`: The Piwik Site ID to use when sending analytics to the Piwik server configured above
1. `teamServerConfig`, `teamTokenMap`, `referralBaseUrl`: an obsolete precursor to communities
with referral tracking; please ignore it.
1. `welcomeUserId`: the user ID of a bot to invite whenever users register that can give them a tour
1. `embeddedPages`: Configures the pages displayed in portions of Riot that
embed static files, such as:
1. `welcomeUrl`: Initial content shown on the outside of the app when not
logged in. Defaults to `welcome.html` supplied with Riot.
1. `homeUrl`: Content shown on the inside of the app when a specific room is
not selected. By default, no home page is configured. If one is set, a
button to access it will be shown in the top left menu.
Note that `index.html` also has an og:image meta tag that is set to an image
@ -167,7 +187,7 @@ appear in some websites like Facebook, and indeed Riot itself. This has to be
static in the HTML and an absolute URL (and HTTP rather than HTTPS), so it's
not possible for this to be an option in config.json. If you'd like to change
it, you can build Riot as above, but run
`RIOT_OG_IMAGE_URL="http://example.com/logo.png" npm run build`.
`RIOT_OG_IMAGE_URL="http://example.com/logo.png" yarn build`.
Alternatively, you can edit the `og:image` meta tag in `index.html` directly
each time you download a new version of Riot.
@ -181,18 +201,17 @@ build it yourself. Requires Electron >=1.6.0
To run as a desktop app:
1. Follow the instructions in 'Building From Source' above, but run
`npm run build` instead of `npm run dist` (since we don't need the tarball).
`yarn build` instead of `yarn dist` (since we don't need the tarball).
2. Install electron and run it:
```
npm install electron
npm run electron
```bash
yarn electron
```
To build packages, use electron-builder. This is configured to output:
* dmg + zip for macOS
* exe + nupkg for Windows
* deb for Linux
* `dmg` + `zip` for macOS
* `exe` + `nupkg` for Windows
* `deb` for Linux
But this can be customised by editing the `build` section of package.json
as per https://github.com/electron-userland/electron-builder/wiki/Options
@ -200,12 +219,12 @@ See https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Bu
for dependencies required for building packages for various platforms.
The only platform that can build packages for all three platforms is macOS:
```
```bash
brew install wine --without-x11
brew install mono
brew install gnu-tar
npm install
npm run build:electron
yarn install
yarn build:electron
```
For other packages, use electron-builder manually. For example, to build a package
@ -214,36 +233,55 @@ for 64 bit Linux:
1. Follow the instructions in 'Building From Source' above
2. `node_modules/.bin/build -l --x64`
All electron packages go into `electron/dist/`
All electron packages go into `electron_app/dist/`
Many thanks to @aviraldg for the initial work on the electron integration.
Other options for running as a desktop app:
* https://github.com/krisak/vector-electron-desktop
* @asdf:matrix.org points out that you can use nativefier and it just works(tm)
```
sudo npm install nativefier -g
```bash
yarn global add nativefier
nativefier https://riot.im/app/
```
Desktop app configuration
=========================
To run multiple instances of the desktop app for different accounts, you can launch the executable with the `--profile` argument followed by a unique identifier, e.g `riot-web --profile Work` for it to run a separate profile and not interfere with the default one.
Alternatively, a custom location for the profile data can be specified using the `--profile-dir` flag followed by the desired path.
To change the config.json for the desktop app, create a config file which will be used to override values in the config which ships in the package:
+ `%APPDATA%\$NAME\config.json` on Windows
+ `$XDG_CONFIG_HOME\$NAME\config.json` or `~/.config/$NAME/config.json` on Linux
+ `~Library/Application Support/$NAME/config.json` on macOS
In the paths above, `$NAME` is typically `Riot`, unless you use `--profile $PROFILE` in which case it becomes `Riot-$PROFILE`.
Labs Features
=============
Some features of Riot may be enabled by flags in the `Labs` section of the settings.
Some of these features are described in [labs.md](https://github.com/vector-im/riot-web/blob/develop/docs/labs.md).
Development
===========
Before attempting to develop on Riot you **must** read the developer guide
for `matrix-react-sdk` at https://github.com/matrix-org/matrix-react-sdk, which
Before attempting to develop on Riot you **must** read the [developer guide
for `matrix-react-sdk`](https://github.com/matrix-org/matrix-react-sdk), which
also defines the design, architecture and style for Riot too.
You should also familiarise yourself with the "Here be Dragons" guide to the
tame & not-so-tame dragons (gotchas) which exist in the codebase:
https://docs.google.com/document/d/12jYzvkidrp1h7liEuLIe6BMdU0NUjndUYI971O06ooM
You should also familiarise yourself with the ["Here be Dragons" guide
](https://docs.google.com/document/d/12jYzvkidrp1h7liEuLIe6BMdU0NUjndUYI971O06ooM)
to the tame & not-so-tame dragons (gotchas) which exist in the codebase.
The idea of Riot is to be a relatively lightweight "skin" of customisations on
top of the underlying `matrix-react-sdk`. `matrix-react-sdk` provides both the
higher and lower level React components useful for building Matrix communication
apps using React.
After creating a new component you must run `npm run reskindex` to regenerate
After creating a new component you must run `yarn reskindex` to regenerate
the `component-index.js` for the app (used in future for skinning).
Please note that Riot is intended to run correctly without access to the public
@ -261,52 +299,64 @@ having to manually rebuild each time.
First clone and build `matrix-js-sdk`:
1. `git clone https://github.com/matrix-org/matrix-js-sdk.git`
1. `pushd matrix-js-sdk`
1. `git checkout develop`
1. `npm install`
1. `npm install source-map-loader` # because webpack is made of fail (https://github.com/webpack/webpack/issues/1472)
1. `popd`
``` bash
git clone https://github.com/matrix-org/matrix-js-sdk.git
pushd matrix-js-sdk
git checkout develop
yarn link
yarn install
popd
```
Then similarly with `matrix-react-sdk`:
1. `git clone https://github.com/matrix-org/matrix-react-sdk.git`
1. `pushd matrix-react-sdk`
1. `git checkout develop`
1. `npm link ../matrix-js-sdk`
1. `popd`
```bash
git clone https://github.com/matrix-org/matrix-react-sdk.git
pushd matrix-react-sdk
git checkout develop
yarn link
yarn link matrix-js-sdk
yarn install
popd
```
Finally, build and start Riot itself:
1. `git clone https://github.com/vector-im/riot-web.git`
1. `cd riot-web`
1. `git checkout develop`
1. `npm install`
1. `npm link ../matrix-js-sdk`
1. `npm link ../matrix-react-sdk`
1. `npm start`
1. Wait a few seconds for the initial build to finish; you should see something like:
```
Hash: b0af76309dd56d7275c8
Version: webpack 1.12.14
Time: 14533ms
Asset Size Chunks Chunk Names
bundle.js 4.2 MB 0 [emitted] main
bundle.css 91.5 kB 0 [emitted] main
bundle.js.map 5.29 MB 0 [emitted] main
bundle.css.map 116 kB 0 [emitted] main
+ 1013 hidden modules
```
```bash
git clone https://github.com/vector-im/riot-web.git
cd riot-web
git checkout develop
yarn link matrix-js-sdk
yarn link matrix-react-sdk
yarn install
yarn start
```
Wait a few seconds for the initial build to finish; you should see something like:
```
Hash: b0af76309dd56d7275c8
Version: webpack 1.12.14
Time: 14533ms
Asset Size Chunks Chunk Names
bundle.js 4.2 MB 0 [emitted] main
bundle.css 91.5 kB 0 [emitted] main
bundle.js.map 5.29 MB 0 [emitted] main
bundle.css.map 116 kB 0 [emitted] main
+ 1013 hidden modules
```
Remember, the command will not terminate since it runs the web server
and rebuilds source files when they change. This development server also
disables caching, so do NOT use it in production.
1. Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
___
When you make changes to `matrix-react-sdk` or `matrix-js-sdk` they should be
automatically picked up by webpack and built.
If you add or remove any components from the Riot skin, you will need to rebuild
the skin's index by running, `npm run reskindex`.
the skin's index by running, `yarn reskindex`.
If any of these steps error with, `file table overflow`, you are probably on a mac
which has a very low limit on max open files. Run `ulimit -Sn 1024` and try again.
@ -322,12 +372,12 @@ are designed to run in a browser instance under the control of
* Make sure you have Chrome installed (a recent version, like 59)
* Make sure you have `matrix-js-sdk` and `matrix-react-sdk` installed and
built, as above
* `npm run test`
* `yarn test`
The above will run the tests under Chrome in a `headless` mode.
You can also tell karma to run the tests in a loop (every time the source
changes), in an instance of Chrome on your desktop, with `npm run
changes), in an instance of Chrome on your desktop, with `yarn
test-multi`. This also gives you the option of running the tests in 'debug'
mode, which is useful for stepping through the tests in the developer tools.

1
config.sample.json

@ -15,7 +15,6 @@
"feature_pinning": "labs"
},
"default_federate": true,
"welcomePageUrl": "home.html",
"default_theme": "light",
"roomDirectory": {
"servers": [

32
docs/labs.md

@ -0,0 +1,32 @@
# riot-web Labs features
Some notes on the features you can enable by going to `Settings->Labs`. Not exhaustive, chat in
[#riot-web:matrix.org] for more information.
**Be warned! Labs features are not finalised, they may be fragile, they may change, they may be
dropped. Ask in the room if you are unclear about any details here.**
## Render simple counters in room header
Allows rendering of labelled counters above the message list.
Once enabled, send a custom state event to a room to set values:
1. In a room, type `/devtools` to bring up the devtools interface
2. Click "Send Custom Event"
3. Toggle from "Event" to "State Event"
4. Set the event type to: `re.jki.counter` and give it a unique key
5. Specify the content in the following format:
```
{
"link": "",
"severity": "normal",
"title": "my counter",
"value": 0
}
```
That's it. Now should see your new counter under the header.
[#riot-web:matrix.org]: https://matrix.to/#/#riot-web:matrix.org

11
docs/shortcuts.md

@ -0,0 +1,11 @@
# Keyboard Shortcuts
The modifier is <kbd>Ctrl</kbd> on Windows & Linux and <kbd></kbd> on Mac.
- <kbd>Ctrl</kbd>/<kbd></kbd>+<kbd>m</kbd> - toggle markdown
- <kbd>Ctrl</kbd>/<kbd></kbd>+<kbd>d</kbd> - toggle mic mute
- <kbd>Ctrl</kbd>/<kbd></kbd>+<kbd>e</kbd> - toggle video on/off
- <kbd>Ctrl</kbd>/<kbd></kbd>+<kbd>k</kbd> - jump to named room
- <kbd></kbd>/<kbd></kbd> - navigate within room list
- <kbd>PageUp</kbd>/<kbd>PageDown</kbd> - scroll timeline up/down
- <kbd>Ctrl</kbd>/<kbd></kbd>+<kbd>Home</kbd>/<kbd>End</kbd> - jump to timeline start/end

8
docs/translating-dev.md

@ -4,7 +4,7 @@
- A working [Development Setup](../../#setting-up-a-dev-environment)
- Including up-to-date versions of matrix-react-sdk and matrix-js-sdk
- Node 8 or later
- Latest LTS version of Node.js installed
- Be able to understand English
- Be able to understand the language you want to translate riot-web into
@ -32,14 +32,14 @@ function getColorName(hex) {
1. Check if the import ``import { _t } from 'matrix-react-sdk/lib/languageHandler';`` is present. If not add it to the other import statements. Also import `_td` if needed.
1. Add ``_t()`` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method). If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
1. Run `npm run i18n` to update ``src/i18n/strings/en_EN.json``
1. Run `yarn i18n` to update ``src/i18n/strings/en_EN.json``
1. If you added a string with a plural, you can add other English plural variants to ``src/i18n/strings/en_EN.json`` (remeber to edit the one in the same project as the source file containing your new translation).
## Editing existing strings
1. Edit every occurrence of the string inside `_t()` and `_td()` in the JSX files.
1. Run `npm run i18n` to update `src/i18n/strings/en_EN.json`. (Be sure to run this in the same project as the JSX files you just edited.)
1. Run `npm run prunei18n` to remove the old string from `src/i18n/strings/*.json`.
1. Run `yarn i18n` to update `src/i18n/strings/en_EN.json`. (Be sure to run this in the same project as the JSX files you just edited.)
1. Run `yarn prunei18n` to remove the old string from `src/i18n/strings/*.json`.
## Adding variables inside a string.

BIN
electron_app/build/icon.icns

Binary file not shown.

BIN
electron_app/build/icon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 36 KiB

BIN
electron_app/build/icons/128x128.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
electron_app/build/icons/16x16.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 702 B

BIN
electron_app/build/icons/24x24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
electron_app/build/icons/256x256.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
electron_app/build/icons/48x48.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
electron_app/build/icons/512x512.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 29 KiB

BIN
electron_app/build/icons/64x64.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
electron_app/build/icons/96x96.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
electron_app/build/install-spinner.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
electron_app/img/riot.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 36 KiB

BIN
electron_app/img/riot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

3
electron_app/package.json

@ -2,11 +2,12 @@
"name": "riot-web",
"productName": "Riot",
"main": "src/electron-main.js",
"version": "0.17.7",
"version": "1.0.7",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"dependencies": {
"auto-launch": "^5.0.1",
"electron-store": "^2.0.0",
"electron-window-state": "^4.1.0",
"minimist": "^1.2.0",
"png-to-ico": "^1.0.2"

1
electron_app/riot.im/config.json

@ -9,6 +9,7 @@
"https://scalar-staging.riot.im/scalar/api",
"https://scalar.vector.im/api"
],
"hosting_signup_link": "https://modular.im/?utm_source=riot-web&utm_medium=web",
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
"welcomeUserId": "@riot-bot:matrix.org",
"roomDirectory": {

235
electron_app/src/electron-main.js

@ -2,6 +2,7 @@
Copyright 2016 Aviral Dasgupta
Copyright 2016 OpenMarket Ltd
Copyright 2017 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -23,17 +24,27 @@ const checkSquirrelHooks = require('./squirrelhooks');
if (checkSquirrelHooks()) return;
const argv = require('minimist')(process.argv);
const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu} = require('electron');
const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol} = require('electron');
const AutoLaunch = require('auto-launch');
const path = require('path');
const tray = require('./tray');
const vectorMenu = require('./vectormenu');
const webContentsHandler = require('./webcontents-handler');
const updater = require('./updater');
const { migrateFromOldOrigin } = require('./originMigrator');
const windowStateKeeper = require('electron-window-state');
const Store = require('electron-store');
if (argv['profile']) {
// boolean flag set whilst we are doing one-time origin migration
// We only serve the origin migration script while we're actually
// migrating to mitigate any risk of it being used maliciously.
let migratingOrigin = false;
if (argv['profile-dir']) {
app.setPath('userData', argv['profile-dir']);
} else if (argv['profile']) {
app.setPath('userData', `${app.getPath('userData')}-${argv['profile']}`);
}
@ -47,8 +58,19 @@ try {
// Continue with the defaults (ie. an empty config)
}
try {
// Load local config and use it to override values from the one baked with the build
const localConfig = require(path.join(app.getPath('userData'), 'config.json'));
vectorConfig = Object.assign(vectorConfig, localConfig);
} catch (e) {
// Could not load local config, this is expected in most cases.
}
const store = new Store({ name: "electron-config" });
let mainWindow = null;
global.appQuitting = false;
global.minimizeToTray = store.get('minimizeToTray', true);
// handle uncaught errors otherwise it displays
@ -97,27 +119,82 @@ ipcMain.on('app_onAction', function(ev, payload) {
}
});
autoUpdater.on('update-downloaded', (ev, releaseNotes, releaseName, releaseDate, updateURL) => {
if (!mainWindow) return;
// forward to renderer
mainWindow.webContents.send('update-downloaded', {
releaseNotes,
releaseName,
releaseDate,
updateURL,
});
});
app.commandLine.appendSwitch('--enable-usermedia-screen-capturing');
ipcMain.on('ipcCall', async function(ev, payload) {
if (!mainWindow) return;
const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
// If other instance launched with --hidden then skip showing window
if (commandLine.includes('--hidden')) return;
const args = payload.args || [];
let ret;
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (!mainWindow.isVisible()) mainWindow.show();
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
switch (payload.name) {
case 'getUpdateFeedUrl':
ret = autoUpdater.getFeedURL();
break;
case 'getAutoLaunchEnabled':
ret = await launcher.isEnabled();
break;
case 'setAutoLaunchEnabled':
if (args[0]) {
launcher.enable();
} else {
launcher.disable();
}
break;
case 'getMinimizeToTrayEnabled':
ret = global.minimizeToTray;
break;
case 'setMinimizeToTrayEnabled':
store.set('minimizeToTray', global.minimizeToTray = args[0]);
break;
case 'getAppVersion':
ret = app.getVersion();
break;
case 'focusWindow':
if (mainWindow.isMinimized()) {
mainWindow.restore();
} else if (!mainWindow.isVisible()) {
mainWindow.show();
} else {
mainWindow.focus();
}
break;
case 'origin_migrate':
migratingOrigin = true;
await migrateFromOldOrigin();
migratingOrigin = false;
break;
default:
mainWindow.webContents.send('ipcReply', {
id: payload.id,
error: "Unknown IPC Call: " + payload.name,
});
return;
}
mainWindow.webContents.send('ipcReply', {
id: payload.id,
reply: ret,
});
});
if (shouldQuit) {
app.commandLine.appendSwitch('--enable-usermedia-screen-capturing');
const gotLock = app.requestSingleInstanceLock();
if (!gotLock) {
console.log('Other instance detected: exiting');
app.exit();
}
const launcher = new AutoLaunch({
name: vectorConfig.brand || 'Riot',
isHidden: true,
@ -126,39 +203,12 @@ const launcher = new AutoLaunch({
},
});
const settings = {
'auto-launch': {
get: launcher.isEnabled,
set: function(bool) {
if (bool) {
return launcher.enable();
} else {
return launcher.disable();
}
},
},
};
ipcMain.on('settings_get', async function(ev) {
const data = {};
try {
await Promise.all(Object.keys(settings).map(async function (setting) {
data[setting] = await settings[setting].get();
}));
ev.sender.send('settings', data);
} catch (e) {
console.error(e);
}
});
ipcMain.on('settings_set', function(ev, key, value) {
console.log(key, value);
if (settings[key] && settings[key].set) {
settings[key].set(value);
}
});
// Register the scheme the app is served from as 'standard'
// which allows things like relative URLs and IndexedDB to
// work.
// Also mark it as secure (ie. accessing resources from this
// protocol and HTTPS won't trigger mixed content warnings).
protocol.registerStandardSchemes(['vector'], {secure: true});
app.on('ready', () => {
if (argv['devtools']) {
@ -175,8 +225,70 @@ app.on('ready', () => {
}
}
protocol.registerFileProtocol('vector', (request, callback) => {
if (request.method !== 'GET') {
callback({error: -322}); // METHOD_NOT_SUPPORTED from chromium/src/net/base/net_error_list.h
return null;
}
const parsedUrl = new URL(request.url);
if (parsedUrl.protocol !== 'vector:') {
callback({error: -302}); // UNKNOWN_URL_SCHEME
return;
}
if (parsedUrl.host !== 'vector') {
callback({error: -105}); // NAME_NOT_RESOLVED
return;
}
const target = parsedUrl.pathname.split('/');
// path starts with a '/'
if (target[0] !== '') {
callback({error: -6}); // FILE_NOT_FOUND
return;
}
if (target[target.length - 1] == '') {
target[target.length - 1] = 'index.html';
}
let baseDir;
// first part of the path determines where we serve from
if (migratingOrigin && target[1] === 'origin_migrator_dest') {
// the origin migrator destination page
// (only the destination script needs to come from the
// custom protocol: the source part is loaded from a
// file:// as that's the origin we're migrating from).
baseDir = __dirname + "/../../origin_migrator/dest";
} else if (target[1] === 'webapp') {
baseDir = __dirname + "/../../webapp";
} else {
callback({error: -6}); // FILE_NOT_FOUND
return;
}
if (vectorConfig['update_base_url']) {
// Normalise the base dir and the target path separately, then make sure
// the target path isn't trying to back out beyond its root
baseDir = path.normalize(baseDir);
const relTarget = path.normalize(path.join(...target.slice(2)));
if (relTarget.startsWith('..')) {
callback({error: -6}); // FILE_NOT_FOUND
return;
}
const absTarget = path.join(baseDir, relTarget);
callback({
path: absTarget,
});
}, (error) => {
if (error) console.error('Failed to register protocol');
});