From 6e2a56d7266194c45e6830a9987c875afb9614d0 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Fri, 18 Nov 2022 03:29:57 -0600 Subject: [PATCH] Update readme with creature comforts and MSC3030-enabled server prerequisite (#144) Spawning from https://github.com/matrix-org/matrix-public-archive/issues/142 --- README.md | 54 +++++++++++++++++++++++++++----------- config/config.default.json | 1 + 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 06e356e..c53f40f 100644 --- a/README.md +++ b/README.md @@ -33,25 +33,58 @@ the maintenance burden of supporting more event types in Hydrogen. ### Prerequisites - Node.js v16 - - We only need v16 because it includes [`require('crypto').webcrypto.subtle`](https://nodejs.org/docs/latest-v16.x/api/webcrypto.html#cryptosubtle) for [Matrix encryption (olm) which can't be disabled in Hydrogen](https://github.com/vector-im/hydrogen-web/issues/579) yet. + - We only need v16 because it includes + [`require('crypto').webcrypto.subtle`](https://nodejs.org/docs/latest-v16.x/api/webcrypto.html#cryptosubtle) + for [Matrix encryption (olm) which can't be disabled in + Hydrogen](https://github.com/vector-im/hydrogen-web/issues/579) yet. +- A Matrix homeserver that supports [MSC3030's](https://github.com/matrix-org/matrix-spec-proposals/pull/3030) `/timestamp_to_event` endpoint + - Currently, the only implementation is in Synapse under an experimental feature flag. + Adjust your homeserver config to enable it: + `homeserver.yaml` + ```yaml + experimental_features: + msc3030_enabled: true + ``` + - The `/timestamp_to_event` endpoint will soon be stabilized in Synapse which means + it will be available without the feature flag. You can track progress at + https://github.com/matrix-org/synapse/issues/14390 ### Get the app running ```sh $ npm install -# Edit config/config.user-overrides.json so that `matrixServerUrl` points to your homeserver -# and has `matrixAccessToken` defined +# Edit `config/config.user-overrides.json` so that `matrixServerUrl` points to +# your homeserver and has `matrixAccessToken` defined $ cp config/config.default.json config/config.user-overrides.json -$ npm run start-dev +$ npm run start # To enable tracing, add the `--tracing` flag -$ npm run start-dev -- --tracing +$ npm run start -- --tracing ``` ## Development ```sh +# Clone and install the `matrix-public-archive` project +$ git clone git@github.com:matrix-org/matrix-public-archive.git +$ cd matrix-public-archive +$ npm install + +# Edit `config/config.user-overrides.json` so that `matrixServerUrl` points to +# your homeserver and has `matrixAccessToken` defined +$ cp config/config.default.json config/config.user-overrides.json + +# This will watch for changes, rebuild bundles and restart the server +$ npm run start-dev +# To enable tracing, add the `--tracing` flag +$ npm run start-dev -- --tracing +``` + +If you want to make changes to the underlying Hydrogen SDK as well, you can locally link +it into this project with the following instructions: + +``` # We need to use a draft branch of Hydrogen to get the custom changes needed for # `matrix-public-archive` to run. Hopefully soon, we can get all of the custom # changes mainlined so this isn't necessary. @@ -63,19 +96,8 @@ $ yarn build:sdk $ cd target/ && npm link && cd .. $ cd .. -# Now clone and install the `matrix-public-archive` project -$ git clone git@github.com:matrix-org/matrix-public-archive.git $ cd matrix-public-archive -$ npm install $ npm link hydrogen-view-sdk -# If you just want to run the tests, you can skip to the "Running tests" section at this point -# -# Edit config/config.user-overrides.json so that `matrixServerUrl` points to your homeserver -# and has `matrixAccessToken` defined -$ cp config/config.default.json config/config.user-overrides.json - -# Now we can finally start the app -$ npm run start-dev ``` ### Running tests diff --git a/config/config.default.json b/config/config.default.json index ae93f35..ba6295f 100644 --- a/config/config.default.json +++ b/config/config.default.json @@ -1,6 +1,7 @@ { "basePort": "3050", "basePath": "http://localhost:3050", + // Requires homeserver with MSC3030 `/timestamp_to_event` endpoint available (see readme for more details) "matrixServerUrl": "http://localhost:8008/", "matrixServerName": "localhost", // Set this to 100 since that is the max that Synapse will backfill even if you do a