♻️(yhub) replace minio client by S3 sdk

We have some signature errors when using the minio client to list all
the versions of an existing document. To avoid this error we have
decided to use the S3 sdk and allow to configure the signature versino
the user wants. Also, the check on the document size has been removed,
there is no limitation on the document size.
This commit is contained in:
Manuel Raynaud
2026-09-22 16:00:57 +02:00
parent 505885259c
commit 70b0694ac6
7 changed files with 577 additions and 147 deletions
+5 -6
View File
@@ -16,7 +16,6 @@ import {
jwtVerify,
SignJWT,
} from 'jose';
import { Client as S3Client } from 'minio';
import { secret } from './env.js';
// legacy Django/S3 document store — see migration.js and README.md
@@ -237,11 +236,11 @@ const backendFetch = async (path, { cookie, origin }) => {
// Seeding never decides whether the caller may read the document — that is the
// backend's answer alone. There are two ways this ends other than a seed:
//
// the legacy object cannot be migrated (it does not decode, or it is bigger
// than we will load) — retrying will not change that, so the room opens as
// a new document. Refusing instead would lock a document nobody can repair
// from the outside. Logged per access, because the caller is now editing
// alongside legacy content that stayed behind in S3.
// the legacy object cannot be migrated (it does not decode) — retrying will
// not change that, so the room opens as a new document. Refusing instead
// would lock a document nobody can repair from the outside. Logged per
// access, because the caller is now editing alongside legacy content that
// stayed behind in S3.
// the legacy store could not be reached (timeout, network, backpressure) —
// the same request later may well succeed, so it answers 503 rather than
// silently starting an empty document on top of content that exists.