feat(storage): add insecure_skip_tls_verify option for S3

Adds an opt-in toggle to skip TLS certificate verification when connecting
to the S3 endpoint, for self-hosted S3-compatible backends (e.g. rustfs,
MinIO) that use self-signed certificates. Exposed in both the store/API
protos and the storage settings UI, mirroring the existing use_path_style
toggle. When enabled, the AWS client uses an HTTP transport with
InsecureSkipVerify; default behavior is unchanged.

This governs backend-initiated S3 calls (uploads, deletes, thumbnails, and
image/document streaming). Video/audio playback redirects the browser to a
presigned URL, so that path still requires the browser to trust the cert.

Closes #6039
This commit is contained in:
boojack
2026-06-23 00:04:54 +08:00
parent 1e3ec38fa1
commit 20c19ef82d
10 changed files with 98 additions and 23 deletions
@@ -146,6 +146,7 @@ const StorageSection = () => {
region: existing?.region ?? "",
bucket: existing?.bucket ?? "",
usePathStyle: existing?.usePathStyle ?? false,
insecureSkipTlsVerify: existing?.insecureSkipTlsVerify ?? false,
[field]: value,
}),
}),
@@ -332,6 +333,16 @@ const StorageSection = () => {
onCheckedChange={(checked) => handleS3FieldChange("usePathStyle", checked)}
/>
</SettingRow>
<SettingRow
label={t("setting.storage.insecure-skip-tls-verify")}
description={t("setting.storage.insecure-skip-tls-verify-description")}
>
<Switch
checked={instanceStorageSetting.s3Config?.insecureSkipTlsVerify ?? false}
onCheckedChange={(checked) => handleS3FieldChange("insecureSkipTlsVerify", checked)}
/>
</SettingRow>
</SettingGroup>
)}
+2
View File
@@ -680,6 +680,8 @@
"endpoint-description": "Service endpoint, such as an AWS S3, Cloudflare R2, MinIO, or other compatible URL.",
"filepath-template": "Filepath template",
"filepath-template-description": "Used by local and S3 storage. Supports {timestamp}, {uuid}, and {filename}. Default: assets/{timestamp}_{uuid}_{filename}.",
"insecure-skip-tls-verify": "Skip TLS verification",
"insecure-skip-tls-verify-description": "Disable TLS certificate verification for the S3 endpoint. Enable only for trusted endpoints using a self-signed certificate; this removes protection against man-in-the-middle attacks.",
"label": "Storage",
"local-description": "Store new attachments on the server file system. This is the default for new instances.",
"local-note-backup": "Persist and back up the attachment directory, especially in Docker or container deployments.",
File diff suppressed because one or more lines are too long