From b68c7b18a5f8a62b8f2a33bf97ff8a2ba003b479 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 6 Feb 2021 11:48:57 +0900 Subject: [PATCH] s3ForcePathStyle (#7122) Co-authored-by: ybw2016v --- .../1611547387175-objectStorageS3ForcePathStyle.ts | 14 ++++++++++++++ src/client/pages/instance/settings.vue | 4 ++++ src/models/entities/meta.ts | 5 +++++ src/server/api/endpoints/admin/update-meta.ts | 10 +++++++++- src/server/api/endpoints/meta.ts | 1 + src/services/drive/s3.ts | 4 +++- 6 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 migration/1611547387175-objectStorageS3ForcePathStyle.ts diff --git a/migration/1611547387175-objectStorageS3ForcePathStyle.ts b/migration/1611547387175-objectStorageS3ForcePathStyle.ts new file mode 100644 index 000000000..1506a2900 --- /dev/null +++ b/migration/1611547387175-objectStorageS3ForcePathStyle.ts @@ -0,0 +1,14 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class objectStorageS3ForcePathStyle1611547387175 implements MigrationInterface { + name = 'objectStorageS3ForcePathStyle1611547387175' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageS3ForcePathStyle" boolean NOT NULL DEFAULT true`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageS3ForcePathStyle"`); + } + +} diff --git a/src/client/pages/instance/settings.vue b/src/client/pages/instance/settings.vue index 761044b01..cea621ba2 100644 --- a/src/client/pages/instance/settings.vue +++ b/src/client/pages/instance/settings.vue @@ -175,6 +175,7 @@ {{ $ts.objectStorageUseSSL }} {{ $ts.objectStorageUseProxy }} {{ $ts.objectStorageSetPublicRead }} + s3ForcePathStyle