From 69dd52920e946de994e14b20a00a1444eec459cc Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 12 Apr 2020 20:32:34 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=82=AD=E3=82=B7=E3=81=AE?= =?UTF-8?q?=E9=99=A4=E5=A4=96=E3=83=9B=E3=82=B9=E3=83=88=20(#6244)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * プロキシの除外ホスト * オブジェクトストレージとの通信にProxyを使うかを選択できるように * fix lint * コメント Co-authored-by: rinsuki <428rinsuki+git@gmail.com> --- .config/example.yml | 5 ++ locales/ja-JP.yml | 2 + .../1586624197029-AddObjectStorageUseProxy.ts | 14 ++++++ src/client/pages/instance/settings.vue | 4 ++ src/config/types.ts | 1 + src/misc/download-url.ts | 4 +- src/misc/fetch.ts | 49 +++++++++++++++---- src/models/entities/meta.ts | 5 ++ src/remote/activitypub/request.ts | 4 +- src/server/api/endpoints/admin/update-meta.ts | 8 +++ src/server/api/endpoints/meta.ts | 1 + src/services/drive/s3.ts | 8 ++- 12 files changed, 89 insertions(+), 16 deletions(-) create mode 100644 migration/1586624197029-AddObjectStorageUseProxy.ts diff --git a/.config/example.yml b/.config/example.yml index 201082cce..1794dc9a8 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -142,6 +142,11 @@ id: 'aid' # Proxy for HTTP/HTTPS #proxy: http://127.0.0.1:3128 +#proxyBypassHosts: [ +# 'example.com', +# '192.0.2.8' +#] + # Proxy for SMTP/SMTPS #proxySmtp: http://127.0.0.1:3128 # use HTTP/1.1 CONNECT #proxySmtp: socks4://127.0.0.1:1080 # use SOCKS4 diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 29a4c2d3d..082709153 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -454,6 +454,8 @@ objectStorageRegion: "Region" objectStorageRegionDesc: "'xx-east-1'のようなregionを指定してください。使用サービスにregionの概念がない場合は、空または'us-east-1'にしてください。" objectStorageUseSSL: "SSLを使用する" objectStorageUseSSLDesc: "API接続にhttpsを使用しない場合はオフにしてください" +objectStorageUseProxy: "Proxyを利用する" +objectStorageUseProxyDesc: "API接続にproxyを利用しない場合はオフにしてください" serverLogs: "サーバーログ" deleteAll: "全て削除" showFixedPostForm: "タイムライン上部に投稿フォームを表示する" diff --git a/migration/1586624197029-AddObjectStorageUseProxy.ts b/migration/1586624197029-AddObjectStorageUseProxy.ts new file mode 100644 index 000000000..deadf9483 --- /dev/null +++ b/migration/1586624197029-AddObjectStorageUseProxy.ts @@ -0,0 +1,14 @@ +import {MigrationInterface, QueryRunner} from 'typeorm'; + +export class AddObjectStorageUseProxy1586624197029 implements MigrationInterface { + name = 'AddObjectStorageUseProxy1586624197029' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageUseProxy" boolean NOT NULL DEFAULT true`, undefined); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageUseProxy"`, undefined); + } + +} diff --git a/src/client/pages/instance/settings.vue b/src/client/pages/instance/settings.vue index f0a123f27..f7db4aa10 100644 --- a/src/client/pages/instance/settings.vue +++ b/src/client/pages/instance/settings.vue @@ -116,6 +116,7 @@ Secret key {{ $t('objectStorageUseSSL') }} + {{ $t('objectStorageUseProxy') }}