View the history of public and world readable Matrix rooms
Go to file
Eric Eastwood 7dfe8cabc9
Add lightbox support and Hydrogen URL hashes relative to the room (#12)
Add image lightbox support and Hydrogen URL hashes relative to the room

Related to https://github.com/vector-im/hydrogen-web/issues/677

Requires the changes from https://github.com/vector-im/hydrogen-web/pull/749 (split out from https://github.com/vector-im/hydrogen-web/pull/653)

![](https://user-images.githubusercontent.com/558581/172526457-38c108e8-8c46-4e0c-9979-734348ec67fc.gif)


### Hydrogen routing relative to the room (remove session and room from the URL hash)

Before:
Page URL: doesn't work
```html
<div class="Timeline_messageBody">
   <div class="media" style="max-width: 400px">
      <div class="spacer" style="padding-top: 48.75%;"></div>
      <a href="undefined">
          <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;">
      </a>
      <time>2/24 6:20 PM</time>
   </div>
   <!--node binding placeholder-->
</div>
```

Before (not relative):
Page URL: `http://localhost:3050/!HBehERstyQBxyJDLfR:my.synapse.server/date/2022/02/24#/session/123/room/!HBehERstyQBxyJDLfR:my.synapse.server/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk`
```html
<div class="Timeline_messageBody">
   <div class="media" style="max-width: 400px">
      <div class="spacer" style="padding-top: 48.75%;"></div>
      <a href="#/session/123/room/!HBehERstyQBxyJDLfR:my.synapse.server/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk">
          <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;">
      </a>
      <time>2/24 6:20 PM</time>
   </div>
   <!--node binding placeholder-->
</div>
```

After (nice relative links):
Page URL: `http://localhost:3050/!HBehERstyQBxyJDLfR:my.synapse.server/date/2022/02/24#/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk`
```html
<div class="Timeline_messageBody">
   <div class="media" style="max-width: 400px">
      <div class="spacer" style="padding-top: 48.75%;"></div>
      <a href="#/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk">
          <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;">
      </a>
      <time>2/24 6:20 PM</time>
   </div>
   <!--node binding placeholder-->
</div>
```
2022-06-08 14:03:36 -05:00
config Working e2e test 2022-02-24 03:27:53 -06:00
public Add year select fallback for Firefox 2022-02-17 21:10:36 -06:00
server Organize file and add more nodemon logging (#14) 2022-06-07 20:27:22 -05:00
shared Add lightbox support and Hydrogen URL hashes relative to the room (#12) 2022-06-08 14:03:36 -05:00
test Fix last event in day not being shown 2022-02-24 13:06:19 -06:00
.eslintignore Fix lints 2022-02-15 21:33:31 -06:00
.eslintrc.json Add lightbox support and Hydrogen URL hashes relative to the room (#12) 2022-06-08 14:03:36 -05:00
.gitignore E2E test but still failing because fetching from start of day before test events happened 2022-02-23 21:25:05 -06:00
.prettierrc.json SSR with linkedom 2022-02-03 23:44:50 -06:00
README.md E2E test but still failing because fetching from start of day before test events happened 2022-02-23 21:25:05 -06:00
package-lock.json Fix nodemon not being able to watch for changes because vite is interfering (#11) 2022-06-07 14:56:46 -05:00
package.json Fix nodemon not being able to watch for changes because vite is interfering (#11) 2022-06-07 14:56:46 -05:00
vite.config.js E2E test but still failing because fetching from start of day before test events happened 2022-02-23 21:25:05 -06:00

README.md

Matrix public archive

NB: This project is very much a work-in-progress (WIP)! Undocumented config/secrets, using a draft branch of Hydrogen, etc.

In the vein of feature parity with Gitter, the goal is to make a public archive site for world_readable Matrix rooms like Gitter's archives which search engines can index and keep all of the content accessible/available. There is already https://view.matrix.org/ (https://github.com/matrix-org/matrix-static) but there is some desire to make something with more Element-feeling polish and loading faster (avoid the slow 502's errors that are frequent on view.matrix.org).

Plan summary

The plan is to server-side render (SSR) the Hydrogen Matrix client on a Node.js server (since both use JavaScript) and serve pages on the fly (probably with some Cloudflare caching on top) when someone requests /archives/${year}/${month}/${day}. To fetch the events for a given day/time, we will use MSC3030's /timestamp_to_event endpoint to jump to a given day in the timeline and fetch the messages from a Matrix homeserver.

Re-using Hydrogen gets us pretty and native(to Element) looking styles and keeps the maintenance burden of supporting more event types in Hydrogen.

Prerequisites