Skip to content

Commit

Permalink
RootアカウントでnowLocalUsers , maxLocalUsers の値をとれないバグを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyatea committed Dec 30, 2024
1 parent c8ca1c7 commit bdfff6d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/backend/src/server/api/endpoints/admin/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
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) {
Expand All @@ -816,8 +822,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
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,
Expand Down

0 comments on commit bdfff6d

Please sign in to comment.