From bdfff6db1d68b4d6dd6a5629036399eb576e02b1 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Mon, 30 Dec 2024 17:42:31 +0900 Subject: [PATCH] =?UTF-8?q?Root=E3=82=A2=E3=82=AB=E3=82=A6=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=A7nowLocalUsers=20,=20maxLocalUsers=20=E3=81=AE?= =?UTF-8?q?=E5=80=A4=E3=82=92=E3=81=A8=E3=82=8C=E3=81=AA=E3=81=84=E3=83=90?= =?UTF-8?q?=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/src/server/api/endpoints/admin/meta.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index ddf7c7dcfea6..cd047114b741 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -794,8 +794,14 @@ export default class extends Endpoint { urlPreviewRequireContentLength: instance.urlPreviewRequireContentLength, urlPreviewUserAgent: instance.urlPreviewUserAgent, urlPreviewSummaryProxyUrl: instance.urlPreviewSummaryProxyUrl, - maxLocalUsers: 0, - nowLocalUsers: 0, + ...(envOption.managed ? { + nowLocalUsers: await this.usersRepository.count({ where: { host: IsNull(), username: Not(In(['instance.actor', 'relay.actor', this.config.adminUserName, this.config.rootUserName])) } }), + maxLocalUsers: this.config.maxLocalUsers, + + } : { + nowLocalUsers: 0, + maxLocalUsers: 0, + }), }; if (!envOption.managed || this.config.rootUserName === me.username) { @@ -816,8 +822,6 @@ export default class extends Endpoint { objectStorageUseProxy: false, objectStorageSetPublicRead: false, objectStorageS3ForcePathStyle: false, - maxLocalUsers: this.config.maxLocalUsers, - nowLocalUsers: await this.usersRepository.count({ where: { host: IsNull(), username: Not(In(['instance.actor', 'relay.actor', this.config.adminUserName, this.config.rootUserName])) } }), summalyProxy: 'Masked', deeplAuthKey: 'Masked', isManaged: true,