feat(files): read-only SQL file store over Community Server DB (#36)
Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go 1.25) (pull_request) Successful in 1m56s
Tests / Test (Go stable) (pull_request) Successful in 1m57s

This commit is contained in:
2026-09-16 17:24:22 +00:00
parent 72c7cd5173
commit bf3ef025aa
8 changed files with 1006 additions and 2 deletions
+8 -1
View File
@@ -157,6 +157,13 @@ func (c *Client) downloadFileEntry(ctx context.Context, f *FileEntry, dst io.Wri
// downloadFromMinio streams objectKey from the configured MinIO bucket.
func (c *Client) downloadFromMinio(ctx context.Context, objectKey string, dst io.Writer) (int64, error) {
return downloadMinioObject(ctx, c.client, objectKey, dst)
}
// downloadMinioObject streams objectKey from the configured MinIO bucket using
// hc. It is the shared implementation behind (*Client).downloadFromMinio and
// the read-only SQL store (file_pg.go), which has no *Client.
func downloadMinioObject(ctx context.Context, hc *http.Client, objectKey string, dst io.Writer) (int64, error) {
if objectKey == "" {
return 0, fmt.Errorf("onlyoffice: minio fallback: empty object key")
}
@@ -177,7 +184,7 @@ func (c *Client) downloadFromMinio(ctx context.Context, objectKey string, dst io
if err := signMinioRequest(ctx, cfg, req); err != nil {
return 0, err
}
resp, err := c.client.Do(req)
resp, err := hc.Do(req)
if err != nil {
return 0, fmt.Errorf("onlyoffice: minio fallback: %w", err)
}