Merge branch 'master' of https://github.com/Victrid/remotely-save into Victrid-master
This commit is contained in:
@@ -15,6 +15,7 @@ export interface S3Config {
|
||||
s3BucketName: string;
|
||||
bypassCorsLocally?: boolean;
|
||||
partsConcurrency?: number;
|
||||
forcePathStyle?: boolean;
|
||||
}
|
||||
|
||||
export interface DropboxConfig {
|
||||
|
||||
+1
-1
Submodule src/langs updated: 4b69d60d89...28730585f8
@@ -658,6 +658,9 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
if (this.settings.s3.partsConcurrency === undefined) {
|
||||
this.settings.s3.partsConcurrency = 20;
|
||||
}
|
||||
if (this.settings.s3.forcePathStyle === undefined) {
|
||||
this.settings.s3.forcePathStyle = false;
|
||||
}
|
||||
}
|
||||
|
||||
async saveSettings() {
|
||||
|
||||
@@ -155,6 +155,7 @@ export const DEFAULT_S3_CONFIG = {
|
||||
s3BucketName: "",
|
||||
bypassCorsLocally: true,
|
||||
partsConcurrency: 20,
|
||||
forcePathStyle: false,
|
||||
};
|
||||
|
||||
export type S3ObjectType = _Object;
|
||||
@@ -192,6 +193,7 @@ export const getS3Client = (s3Config: S3Config) => {
|
||||
const s3Client = new S3Client({
|
||||
region: s3Config.s3Region,
|
||||
endpoint: endpoint,
|
||||
forcePathStyle: s3Config.forcePathStyle,
|
||||
credentials: {
|
||||
accessKeyId: s3Config.s3AccessKeyID,
|
||||
secretAccessKey: s3Config.s3SecretAccessKey,
|
||||
@@ -203,6 +205,7 @@ export const getS3Client = (s3Config: S3Config) => {
|
||||
const s3Client = new S3Client({
|
||||
region: s3Config.s3Region,
|
||||
endpoint: endpoint,
|
||||
forcePathStyle: s3Config.forcePathStyle,
|
||||
credentials: {
|
||||
accessKeyId: s3Config.s3AccessKeyID,
|
||||
secretAccessKey: s3Config.s3SecretAccessKey,
|
||||
|
||||
@@ -745,6 +745,27 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
|
||||
})
|
||||
);
|
||||
|
||||
new Setting(s3Div)
|
||||
.setName(t("settings_s3_urlstyle"))
|
||||
.setDesc(t("settings_s3_urlstyle_desc"))
|
||||
.addDropdown((dropdown) => {
|
||||
dropdown.addOption(
|
||||
"virtualHostedStyle",
|
||||
"Virtual Hosted-Style (default)"
|
||||
);
|
||||
dropdown.addOption("pathStyle", "Path-Style");
|
||||
dropdown
|
||||
.setValue(
|
||||
this.plugin.settings.s3.forcePathStyle
|
||||
? "pathStyle"
|
||||
: "virtualHostedStyle"
|
||||
)
|
||||
.onChange(async (val: string) => {
|
||||
this.plugin.settings.s3.forcePathStyle = val === "pathStyle";
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
|
||||
if (requireApiVersion(API_VER_REQURL)) {
|
||||
new Setting(s3Div)
|
||||
.setName(t("settings_s3_bypasscorslocally"))
|
||||
|
||||
Reference in New Issue
Block a user