mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-31 01:42:27 +00:00
Add R2 public URL to storage tests
This commit is contained in:
1 parent
a923ce57c8
commit
e096a8b136
1 file changed
+16
@@ -9294,12 +9294,26 @@ export class ProfileModalController {
|
||||
const secretAccessKey = this.storageSecretKeyInput?.value?.trim() || "";
|
||||
const bucket = this.storageBucketInput?.value?.trim() || "";
|
||||
const forcePathStyle = provider === PROVIDERS.GENERIC;
|
||||
const publicBaseUrl = this.storagePrefixInput?.value?.trim() || "";
|
||||
|
||||
if (!accessKeyId || !secretAccessKey || !endpointOrAccount) {
|
||||
this.setStorageFormStatus("Missing credentials for test.", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
provider === "cloudflare_r2" &&
|
||||
(publicBaseUrl.includes(".r2.cloudflarestorage.com") ||
|
||||
publicBaseUrl.includes(".s3.") ||
|
||||
publicBaseUrl.includes(".amazonaws.com"))
|
||||
) {
|
||||
this.setStorageFormStatus(
|
||||
"Invalid Public URL. Please use your R2.dev or custom domain.",
|
||||
"error",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.setStorageFormStatus("Testing connection...", "info");
|
||||
|
||||
const config = {
|
||||
@@ -9312,6 +9326,8 @@ export class ProfileModalController {
|
||||
|
||||
if (provider === "cloudflare_r2") {
|
||||
config.accountId = endpointOrAccount;
|
||||
config.publicBaseUrl = publicBaseUrl;
|
||||
config.baseDomain = publicBaseUrl;
|
||||
} else {
|
||||
config.endpoint = endpointOrAccount;
|
||||
config.forcePathStyle = forcePathStyle;
|
||||
|
||||
Reference in new issue
Block a user