在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):vector-im/element-web开源软件地址(OpenSource Url):https://github.com/vector-im/element-web开源编程语言(OpenSource Language):TypeScript 38.2%开源软件介绍(OpenSource Introduction):ElementElement (formerly known as Vector and Riot) is a Matrix web client built using the Matrix React SDK. Supported EnvironmentsElement has several tiers of support for different environments:
For accessing Element on an Android or iOS device, we currently recommend the native apps element-android and element-ios. Getting StartedThe easiest way to test Element is to just use the hosted copy at https://app.element.io.
The To host your own copy of Element, the quickest bet is to use a pre-built released version of Element:
Releases are signed using gpg and the OpenPGP standard, and can be checked against the public key located at https://packages.riot.im/element-release-key.asc. Note that for the security of your chats will need to serve Element over HTTPS. Major browsers also do not allow you to use VoIP/video chats over HTTP, as WebRTC is only usable over HTTPS. There are some exceptions like when using localhost, which is considered a secure context and thus allowed. To install Element as a desktop application, see Running as a desktop app below. Important Security NotesSeparate domainsWe do not recommend running Element from the same domain name as your Matrix homeserver. The reason is the risk of XSS (cross-site-scripting) vulnerabilities that could occur if someone caused Element to load and render malicious user generated content from a Matrix API which then had trusted access to Element (or other apps) due to sharing the same domain. We have put some coarse mitigations into place to try to protect against this situation, but it's still not good practice to do it in the first place. See #1977 for more details. Configuration best practicesUnless you have special requirements, you will want to add the following to your web server configuration when hosting Element Web:
If you are using nginx, this would look something like the following:
Note: In case you are already setting a Building From SourceElement 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
Note that Running as a Desktop appElement can also be run as a desktop app, wrapped in Electron. You can download a pre-built version from https://element.io/get-started or, if you prefer, build it yourself. To build it yourself, follow the instructions at https://github.com/vector-im/element-desktop. Many thanks to @aviraldg for the initial work on the Electron integration. Other options for running as a desktop app:
yarn global add nativefier
nativefier https://app.element.io/ The configuration docs show how to override the desktop app's default settings if desired. Running from DockerThe Docker image can be used to serve element-web as a web server. The easiest way to use it is to use the prebuilt image: docker run -p 80:80 vectorim/element-web To supply your own custom docker run -p 80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web To build the image yourself: git clone https://github.com/vector-im/element-web.git element-web
cd element-web
git checkout master
docker build . If you're building a custom branch, or want to use the develop branch, check out the appropriate element-web branch and then run: docker build -t \
--build-arg USE_CUSTOM_SDKS=true \
--build-arg REACT_SDK_REPO="https://github.com/matrix-org/matrix-react-sdk.git" \
--build-arg REACT_SDK_BRANCH="develop" \
--build-arg JS_SDK_REPO="https://github.com/matrix-org/matrix-js-sdk.git" \
--build-arg JS_SDK_BRANCH="develop" \
. Running in KubernetesThe provided element-web docker image can also be run from within a Kubernetes cluster. See the Kubernetes example for more details. config.jsonElement supports a variety of settings to configure default servers, behaviour, themes, etc. See the configuration docs for more details. Labs FeaturesSome features of Element may be enabled by flags in the Caching requirementsElement requires the following URLs not to be cached, when/if you are serving Element from your own webserver:
We also recommend that you force browsers to re-validate any cached copy of Element on page load by configuring your
webserver to return DevelopmentBefore attempting to develop on Element you must read the developer guide
for Read the Choosing an issue page for some guidance about where to start. Before starting work on a feature, it's best to ensure your plan aligns well with our vision for Element. Please chat with the team in #element-dev:matrix.org before you start so we can ensure it's something we'd be willing to merge. You should also familiarise yourself with the "Here be Dragons" guide to the tame & not-so-tame dragons (gotchas) which exist in the codebase. The idea of Element is to be a relatively lightweight "skin" of customisations on
top of the underlying Please note that Element is intended to run correctly without access to the public internet. So please don't depend on resources (JS libs, CSS, images, fonts) hosted by external CDNs or servers but instead please package all dependencies into Element itself. CSS hot-reload is available as an opt-in development feature. You can enable it
by defining a Setting up a dev environmentMuch of the functionality in Element is actually in the First clone and build git clone https://github.com/matrix-org/matrix-js-sdk.git
pushd matrix-js-sdk
yarn link
yarn install
popd Then similarly with git clone https://github.com/matrix-org/matrix-react-sdk.git
pushd matrix-react-sdk
yarn link
yarn link matrix-js-sdk
yarn install
popd Clone the repo and switch to the git clone https://github.com/vector-im/element-web.git
cd element-web Configure the app by copying Finally, build and start Element itself: 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:
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. Open http://127.0.0.1:8080/ in your browser to see your newly built Element. Note: The build script uses inotify by default on Linux to monitor directories
for changes. If the inotify limits are too low your build will fail silently or with
You may be interested in issues #15750 and #15774 for further details. To set a new inotify watch and instance limit, execute:
If you wish, you can make the new limits permanent, by executing:
When you make changes to If any of these steps error with, Running the testsThere are a number of application-level tests in the
End-to-End testsSee matrix-react-sdk for how to run the end-to-end tests. TranslationsTo add a new translation, head to the translating doc. For a developer guide, see the translating dev doc. Triaging issuesIssues are triaged by community members and the Web App Team, following the triage process. We use issue labels to sort all incoming issues. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论