From ee0a44559040e83ce7d184bef57372f9c3602a75 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 13 Aug 2020 20:05:01 +0900 Subject: [PATCH] Option objectStorageSetPublicRead (#6645) --- locales/ja-JP.yml | 1 + .../1597230137744-objectStorageSetPublicRead.ts | 14 ++++++++++++++ src/client/pages/instance/settings.vue | 4 ++++ src/models/entities/meta.ts | 5 +++++ src/server/api/endpoints/admin/update-meta.ts | 8 ++++++++ src/server/api/endpoints/meta.ts | 1 + src/services/drive/add-file.ts | 1 + 7 files changed, 34 insertions(+) create mode 100644 migration/1597230137744-objectStorageSetPublicRead.ts diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 073a497620..96398db6ac 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -468,6 +468,7 @@ objectStorageUseSSL: "SSLを使用する" objectStorageUseSSLDesc: "API接続にhttpsを使用しない場合はオフにしてください" objectStorageUseProxy: "Proxyを利用する" objectStorageUseProxyDesc: "API接続にproxyを利用しない場合はオフにしてください" +objectStorageSetPublicRead: "アップロード時に'public-read'を設定する" serverLogs: "サーバーログ" deleteAll: "全て削除" showFixedPostForm: "タイムライン上部に投稿フォームを表示する" diff --git a/migration/1597230137744-objectStorageSetPublicRead.ts b/migration/1597230137744-objectStorageSetPublicRead.ts new file mode 100644 index 0000000000..f040f2afdd --- /dev/null +++ b/migration/1597230137744-objectStorageSetPublicRead.ts @@ -0,0 +1,14 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class objectStorageSetPublicRead1597230137744 implements MigrationInterface { + name = 'objectStorageSetPublicRead1597230137744' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageSetPublicRead" boolean NOT NULL DEFAULT false`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageSetPublicRead"`); + } + +} diff --git a/src/client/pages/instance/settings.vue b/src/client/pages/instance/settings.vue index 8318807d43..0c0e506ab8 100644 --- a/src/client/pages/instance/settings.vue +++ b/src/client/pages/instance/settings.vue @@ -161,6 +161,7 @@ {{ $t('objectStorageUseSSL') }} {{ $t('objectStorageUseProxy') }} + {{ $t('objectStorageSetPublicRead') }}