Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 7a2f93c

Browse files
committed
fix
1 parent 982f916 commit 7a2f93c

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

packages/backend/src/config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ type Source = {
7272
rootUserName?: string;
7373
rootPassword?: string;
7474
publishTarballInsteadOfProvideRepositoryUrl?: boolean;
75-
7675
objectStorage?: {
7776
useObjectStorage: boolean;
7877
objectStorageBaseUrl: string;
@@ -205,7 +204,6 @@ export type Config = {
205204

206205
version: string;
207206
publishTarballInsteadOfProvideRepositoryUrl: boolean;
208-
setupPassword: string | undefined;
209207
host: string;
210208
hostname: string;
211209
scheme: string;
@@ -310,7 +308,6 @@ export function loadConfig(): Config {
310308
version,
311309
publishTarballInsteadOfProvideRepositoryUrl:
312310
!!config.publishTarballInsteadOfProvideRepositoryUrl,
313-
setupPassword: config.setupPassword,
314311
url: url.origin,
315312
port: config.port ?? parseInt(process.env.PORT ?? '', 10),
316313
socket: config.socket,

packages/backend/src/server/api/endpoints/admin/accounts/create.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const paramDef = {
5151
properties: {
5252
username: localUsernameSchema,
5353
password: passwordSchema,
54-
setupPassword: { type: 'string', nullable: true },
5554
},
5655
required: ['username', 'password'],
5756
} as const;
@@ -73,19 +72,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
7372
const me = _me ? await this.usersRepository.findOneByOrFail({ id: _me.id }) : null;
7473
const realUsers = await this.instanceActorService.realLocalUsersPresent();
7574

76-
if (!realUsers && me == null && token == null) {
77-
// 初回セットアップの場合
78-
if (this.config.setupPassword != null) {
79-
// 初期パスワードが設定されている場合
80-
if (ps.setupPassword !== this.config.setupPassword) {
81-
// 初期パスワードが違う場合
82-
throw new ApiError(meta.errors.wrongInitialPassword);
83-
}
84-
} else if (ps.setupPassword != null && ps.setupPassword.trim() !== '') {
85-
// 初期パスワードが設定されていないのに初期パスワードが入力された場合
86-
throw new ApiError(meta.errors.wrongInitialPassword);
87-
}
88-
} else if ((realUsers && !me?.isRoot) || token !== null) {
75+
if ((realUsers && !me?.isRoot) || token !== null) {
8976
// 初回セットアップではなく、管理者でない場合 or 外部トークンを使用している場合
9077
throw new ApiError(meta.errors.accessDenied);
9178
}

packages/frontend/src/pages/welcome.setup.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ SPDX-License-Identifier: AGPL-3.0-only
1414
</div>
1515
<div class="_gaps_m" style="padding: 32px;">
1616
<div>{{ i18n.ts.intro }}</div>
17-
<MkInput v-model="setupPassword" type="password" data-cy-admin-initial-password>
18-
<template #label>{{ i18n.ts.initialPasswordForSetup }} <div v-tooltip:dialog="i18n.ts.initialPasswordForSetupDescription" class="_button _help"><i class="ti ti-help-circle"></i></div></template>
19-
<template #prefix><i class="ti ti-lock"></i></template>
20-
</MkInput>
2117
<MkInput v-model="username" pattern="^[a-zA-Z0-9_]{1,20}$" :spellcheck="false" required data-cy-admin-username>
2218
<template #label>{{ i18n.ts.username }}</template>
2319
<template #prefix>@</template>
@@ -51,7 +47,6 @@ import MkAnimBg from '@/components/MkAnimBg.vue';
5147
5248
const username = ref('');
5349
const password = ref('');
54-
const setupPassword = ref('');
5550
const submitting = ref(false);
5651
5752
function submit() {
@@ -61,7 +56,6 @@ function submit() {
6156
misskeyApi('admin/accounts/create', {
6257
username: username.value,
6358
password: password.value,
64-
setupPassword: setupPassword.value === '' ? null : setupPassword.value,
6559
}).then(res => {
6660
return login(res.token);
6761
}).catch((err) => {

0 commit comments

Comments
 (0)