No description
Find a file
2024-01-30 22:24:05 +01:00
lib new sizeBasedLRU implementation, with test file 2021-10-11 20:28:13 +02:00
local store media_length 2024-01-30 20:46:06 +01:00
remote Merge branch 'nixify' 2023-04-18 18:02:05 +02:00
.eslintrc.js use strict for eslintrc 2021-06-24 00:41:12 +02:00
.gitignore update gitignore 2024-01-30 21:25:39 +01:00
fix-media.js fix-media: log totals 2024-01-30 22:24:05 +01:00
index.js Merge branch 'nixify' 2023-04-18 18:02:05 +02:00
LICENSE license AGPL-3.0 2021-05-25 23:46:07 +02:00
package.json add media_length fix utility 2024-01-30 22:09:18 +01:00
README.md clarify readme 2021-06-08 10:16:32 +02:00
shell.nix allow authenticating appservices by reading them from the Synapse config file 2022-06-15 02:38:08 +02:00
test_upload.sh initial commit 2021-05-25 23:44:18 +02:00
yarn.lock add media_length fix utility 2024-01-30 22:09:18 +01:00

Synapse Media Proxy

Smart proxy that allow caching certain media repo operations on a machine with faster network than Synapse. Should be seamless to drop-in and remove, by still forwarding the slow operations to Synapse.

Status

Should not be used yet!!!11!
Currently (somewhat) implemented:

  • File upload with access token validation against (mock) Synapse database, stored
    • at <remote> in-memory cache
    • at <local> filesystem
  • File download from
    • <remote> in-memory cache
    • <synapse> database
    • remote servers directly
  • <remote> has basic cache limitations (number of entries)
  • Thumbnailing

TODO

  • improve things (tm)
  • <remote> disk storage?
  • url previews
  • smarter cache sizing

Components

Local Server

same machine as Synapse, validates access tokens, manages permanent file storage
Media Upload
For the proxy to be simply removable later, Synapse needs to have all the files available too.
For mxc://localserver.example.com/AABBcccccccc this involves:

  • Placing the file in media_store/local_content/AA/BB/cccccccc
  • Updating the local_media_repository database table with a reference to the file

Remote Server

on fast networked machine, serves files and provides fast-caching from memory and disk

These servers communicate with eachother over http, which should be provided over a secure channel (WireGuard recommended).

Operation notes

Due to possible memory leakish issues in sharp you might want to run your <remote> component with jemalloc