always bypass cors s3
This commit is contained in:
parent
a6b73bde6a
commit
e3bd41a05a
@ -21,10 +21,15 @@ export interface S3Config {
|
|||||||
s3AccessKeyID: string;
|
s3AccessKeyID: string;
|
||||||
s3SecretAccessKey: string;
|
s3SecretAccessKey: string;
|
||||||
s3BucketName: string;
|
s3BucketName: string;
|
||||||
bypassCorsLocally?: boolean;
|
|
||||||
partsConcurrency?: number;
|
partsConcurrency?: number;
|
||||||
forcePathStyle?: boolean;
|
forcePathStyle?: boolean;
|
||||||
remotePrefix?: string;
|
remotePrefix?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
bypassCorsLocally?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DropboxConfig {
|
export interface DropboxConfig {
|
||||||
@ -180,6 +185,7 @@ export interface FileOrFolderMixedState {
|
|||||||
export const API_VER_STAT_FOLDER = "0.13.27";
|
export const API_VER_STAT_FOLDER = "0.13.27";
|
||||||
export const API_VER_REQURL = "0.13.26"; // desktop ver 0.13.26, iOS ver 1.1.1
|
export const API_VER_REQURL = "0.13.26"; // desktop ver 0.13.26, iOS ver 1.1.1
|
||||||
export const API_VER_REQURL_ANDROID = "0.14.6"; // Android ver 1.2.1
|
export const API_VER_REQURL_ANDROID = "0.14.6"; // Android ver 1.2.1
|
||||||
|
export const API_VER_ENSURE_REQURL_OK = "1.0.0"; // always bypass CORS here
|
||||||
|
|
||||||
export const VALID_REQURL =
|
export const VALID_REQURL =
|
||||||
(!Platform.isAndroidApp && requireApiVersion(API_VER_REQURL)) ||
|
(!Platform.isAndroidApp && requireApiVersion(API_VER_REQURL)) ||
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
TFile,
|
TFile,
|
||||||
TFolder,
|
TFolder,
|
||||||
requestUrl,
|
requestUrl,
|
||||||
|
requireApiVersion,
|
||||||
} from "obsidian";
|
} from "obsidian";
|
||||||
import cloneDeep from "lodash/cloneDeep";
|
import cloneDeep from "lodash/cloneDeep";
|
||||||
import { createElement, RotateCcw, RefreshCcw, FileText } from "lucide";
|
import { createElement, RotateCcw, RefreshCcw, FileText } from "lucide";
|
||||||
@ -24,6 +25,7 @@ import {
|
|||||||
COMMAND_CALLBACK_DROPBOX,
|
COMMAND_CALLBACK_DROPBOX,
|
||||||
COMMAND_URI,
|
COMMAND_URI,
|
||||||
REMOTELY_SAVE_VERSION_2024PREPARE,
|
REMOTELY_SAVE_VERSION_2024PREPARE,
|
||||||
|
API_VER_ENSURE_REQURL_OK,
|
||||||
} from "./baseTypes";
|
} from "./baseTypes";
|
||||||
import { importQrCodeUri } from "./importExport";
|
import { importQrCodeUri } from "./importExport";
|
||||||
import {
|
import {
|
||||||
@ -878,6 +880,10 @@ export default class RemotelySavePlugin extends Plugin {
|
|||||||
this.settings.deleteToWhere = "system";
|
this.settings.deleteToWhere = "system";
|
||||||
}
|
}
|
||||||
this.settings.logToDB = false; // deprecated as of 20240113
|
this.settings.logToDB = false; // deprecated as of 20240113
|
||||||
|
|
||||||
|
if (requireApiVersion(API_VER_ENSURE_REQURL_OK)) {
|
||||||
|
this.settings.s3.bypassCorsLocally = true; // deprecated as of 20240113
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkIfPresetRulesFollowed() {
|
async checkIfPresetRulesFollowed() {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import {
|
|||||||
import type { TextComponent } from "obsidian";
|
import type { TextComponent } from "obsidian";
|
||||||
import { createElement, Eye, EyeOff } from "lucide";
|
import { createElement, Eye, EyeOff } from "lucide";
|
||||||
import {
|
import {
|
||||||
|
API_VER_ENSURE_REQURL_OK,
|
||||||
API_VER_REQURL,
|
API_VER_REQURL,
|
||||||
DEFAULT_DEBUG_FOLDER,
|
DEFAULT_DEBUG_FOLDER,
|
||||||
SUPPORTED_SERVICES_TYPE,
|
SUPPORTED_SERVICES_TYPE,
|
||||||
@ -962,7 +963,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (VALID_REQURL) {
|
if (VALID_REQURL && !requireApiVersion(API_VER_ENSURE_REQURL_OK)) {
|
||||||
new Setting(s3Div)
|
new Setting(s3Div)
|
||||||
.setName(t("settings_s3_bypasscorslocally"))
|
.setName(t("settings_s3_bypasscorslocally"))
|
||||||
.setDesc(t("settings_s3_bypasscorslocally_desc"))
|
.setDesc(t("settings_s3_bypasscorslocally_desc"))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user