| lib | ||
| local | ||
| remote | ||
| .eslintrc.js | ||
| .gitignore | ||
| fix-media.js | ||
| index.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| shell.nix | ||
| test_upload.sh | ||
| yarn.lock | ||
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
- at
- 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_repositorydatabase 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