Merge branch 'develop' into enh-tweak-signin-dialog
This commit is contained in:
commit
46c94518e7
|
@ -13,7 +13,7 @@
|
||||||
# The provider of the service who sets up Misskey on behalf of the customer should
|
# The provider of the service who sets up Misskey on behalf of the customer should
|
||||||
# set this value to something unique when generating the Misskey config file,
|
# set this value to something unique when generating the Misskey config file,
|
||||||
# and provide it to the customer.
|
# and provide it to the customer.
|
||||||
initialPassword: example_password_please_change_this_or_you_will_get_hacked
|
setupPassword: example_password_please_change_this_or_you_will_get_hacked
|
||||||
|
|
||||||
# ┌─────┐
|
# ┌─────┐
|
||||||
#───┘ URL └─────────────────────────────────────────────────────
|
#───┘ URL └─────────────────────────────────────────────────────
|
||||||
|
|
|
@ -70,7 +70,8 @@
|
||||||
# The provider of the service who sets up Misskey on behalf of the customer should
|
# The provider of the service who sets up Misskey on behalf of the customer should
|
||||||
# set this value to something unique when generating the Misskey config file,
|
# set this value to something unique when generating the Misskey config file,
|
||||||
# and provide it to the customer.
|
# and provide it to the customer.
|
||||||
initialPassword: example_password_please_change_this_or_you_will_get_hacked
|
#
|
||||||
|
# setupPassword: example_password_please_change_this_or_you_will_get_hacked
|
||||||
|
|
||||||
# ┌─────┐
|
# ┌─────┐
|
||||||
#───┘ URL └─────────────────────────────────────────────────────
|
#───┘ URL └─────────────────────────────────────────────────────
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
url: 'http://misskey.local'
|
url: 'http://misskey.local'
|
||||||
|
|
||||||
|
setupPassword: example_password_please_change_this_or_you_will_get_hacked
|
||||||
|
|
||||||
# ローカルでテストするときにポートを被らないようにするためデフォルトのものとは変える(以下同じ)
|
# ローカルでテストするときにポートを被らないようにするためデフォルトのものとは変える(以下同じ)
|
||||||
port: 61812
|
port: 61812
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
## 2024.10.0
|
## 2024.10.0
|
||||||
|
|
||||||
### Note
|
### Note
|
||||||
- サーバー初期設定時に使用する初期パスワードを設定できるようになりました。今後Misskeyサーバーを新たに設置する際には、初回の起動前にコンフィグファイルの`initialPassword`を必ず変更してください。(すでに初期設定を完了しているサーバーについては、この変更に伴い対応する必要はありません)
|
- サーバー初期設定時に使用する初期パスワードを設定できるようになりました。今後Misskeyサーバーを新たに設置する際には、初回の起動前にコンフィグファイルの`setupPassword`をコメントアウトし、初期パスワードを設定することをおすすめします。(すでに初期設定を完了しているサーバーについては、この変更に伴い対応する必要はありません)
|
||||||
ホスティングサービスを運営している場合は、コンフィグファイルを構築する際に`initialPassword`をランダムな値に設定し、ユーザーに通知するようにしてください。
|
- ホスティングサービスを運営している場合は、コンフィグファイルを構築する際に`setupPassword`をランダムな値に設定し、ユーザーに通知するようにシステムを更新することをおすすめします。
|
||||||
|
- なお、初期パスワードが設定されていない場合でも初期設定を行うことが可能です(UI上で初期パスワードの入力欄を空欄にすると続行できます)。
|
||||||
|
|
||||||
### General
|
### General
|
||||||
- Feat: サーバー初期設定時に初期パスワードを設定できるように
|
- Feat: サーバー初期設定時に初期パスワードを設定できるように
|
||||||
|
|
|
@ -48,6 +48,7 @@ Cypress.Commands.add('registerUser', (username, password, isAdmin = false) => {
|
||||||
cy.request('POST', route, {
|
cy.request('POST', route, {
|
||||||
username: username,
|
username: username,
|
||||||
password: password,
|
password: password,
|
||||||
|
...(isAdmin ? { setupPassword: 'example_password_please_change_this_or_you_will_get_hacked' } : {}),
|
||||||
}).its('body').as(username);
|
}).its('body').as(username);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "2024.10.0-alpha.0",
|
"version": "2024.10.0-beta.2",
|
||||||
"codename": "nasubi",
|
"codename": "nasubi",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -63,7 +63,7 @@ type Source = {
|
||||||
|
|
||||||
publishTarballInsteadOfProvideRepositoryUrl?: boolean;
|
publishTarballInsteadOfProvideRepositoryUrl?: boolean;
|
||||||
|
|
||||||
initialPassword?: string;
|
setupPassword?: string;
|
||||||
|
|
||||||
proxy?: string;
|
proxy?: string;
|
||||||
proxySmtp?: string;
|
proxySmtp?: string;
|
||||||
|
@ -154,7 +154,7 @@ export type Config = {
|
||||||
|
|
||||||
version: string;
|
version: string;
|
||||||
publishTarballInsteadOfProvideRepositoryUrl: boolean;
|
publishTarballInsteadOfProvideRepositoryUrl: boolean;
|
||||||
initialPassword: string | undefined;
|
setupPassword: string | undefined;
|
||||||
host: string;
|
host: string;
|
||||||
hostname: string;
|
hostname: string;
|
||||||
scheme: string;
|
scheme: string;
|
||||||
|
@ -235,7 +235,7 @@ export function loadConfig(): Config {
|
||||||
return {
|
return {
|
||||||
version,
|
version,
|
||||||
publishTarballInsteadOfProvideRepositoryUrl: !!config.publishTarballInsteadOfProvideRepositoryUrl,
|
publishTarballInsteadOfProvideRepositoryUrl: !!config.publishTarballInsteadOfProvideRepositoryUrl,
|
||||||
initialPassword: config.initialPassword,
|
setupPassword: config.setupPassword,
|
||||||
url: url.origin,
|
url: url.origin,
|
||||||
port: config.port ?? parseInt(process.env.PORT ?? '', 10),
|
port: config.port ?? parseInt(process.env.PORT ?? '', 10),
|
||||||
socket: config.socket,
|
socket: config.socket,
|
||||||
|
|
|
@ -51,7 +51,7 @@ export const paramDef = {
|
||||||
properties: {
|
properties: {
|
||||||
username: localUsernameSchema,
|
username: localUsernameSchema,
|
||||||
password: passwordSchema,
|
password: passwordSchema,
|
||||||
initialPassword: { type: 'string', nullable: true },
|
setupPassword: { type: 'string', nullable: true },
|
||||||
},
|
},
|
||||||
required: ['username', 'password'],
|
required: ['username', 'password'],
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -75,13 +75,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
if (!realUsers && me == null && token == null) {
|
if (!realUsers && me == null && token == null) {
|
||||||
// 初回セットアップの場合
|
// 初回セットアップの場合
|
||||||
if (this.config.initialPassword != null) {
|
if (this.config.setupPassword != null) {
|
||||||
// 初期パスワードが設定されている場合
|
// 初期パスワードが設定されている場合
|
||||||
if (ps.initialPassword !== this.config.initialPassword) {
|
if (ps.setupPassword !== this.config.setupPassword) {
|
||||||
// 初期パスワードが違う場合
|
// 初期パスワードが違う場合
|
||||||
throw new ApiError(meta.errors.wrongInitialPassword);
|
throw new ApiError(meta.errors.wrongInitialPassword);
|
||||||
}
|
}
|
||||||
} else if (ps.initialPassword != null && ps.initialPassword.trim() !== '') {
|
} else if (ps.setupPassword != null && ps.setupPassword.trim() !== '') {
|
||||||
// 初期パスワードが設定されていないのに初期パスワードが入力された場合
|
// 初期パスワードが設定されていないのに初期パスワードが入力された場合
|
||||||
throw new ApiError(meta.errors.wrongInitialPassword);
|
throw new ApiError(meta.errors.wrongInitialPassword);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
<div class="_gaps_m" style="padding: 32px;">
|
<div class="_gaps_m" style="padding: 32px;">
|
||||||
<div>{{ i18n.ts.intro }}</div>
|
<div>{{ i18n.ts.intro }}</div>
|
||||||
<MkInput v-model="initialPassword" type="password" data-cy-admin-initial-password>
|
<MkInput v-model="setupPassword" type="password" data-cy-admin-initial-password>
|
||||||
<template #label>{{ i18n.ts.initialPasswordForSetup }} <div v-tooltip:dialog="i18n.ts.initialPasswordForSetupDescription" class="_button _help"><i class="ti ti-help-circle"></i></div></template>
|
<template #label>{{ i18n.ts.initialPasswordForSetup }} <div v-tooltip:dialog="i18n.ts.initialPasswordForSetupDescription" class="_button _help"><i class="ti ti-help-circle"></i></div></template>
|
||||||
<template #prefix><i class="ti ti-lock"></i></template>
|
<template #prefix><i class="ti ti-lock"></i></template>
|
||||||
</MkInput>
|
</MkInput>
|
||||||
|
@ -40,9 +40,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { host, version } from '@@/js/config.js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import { host, version } from '@@/js/config.js';
|
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { login } from '@/account.js';
|
import { login } from '@/account.js';
|
||||||
|
@ -51,7 +51,7 @@ import MkAnimBg from '@/components/MkAnimBg.vue';
|
||||||
|
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const initialPassword = ref('');
|
const setupPassword = ref('');
|
||||||
const submitting = ref(false);
|
const submitting = ref(false);
|
||||||
|
|
||||||
function submit() {
|
function submit() {
|
||||||
|
@ -61,7 +61,7 @@ function submit() {
|
||||||
misskeyApi('admin/accounts/create', {
|
misskeyApi('admin/accounts/create', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
initialPassword: initialPassword.value === '' ? null : initialPassword.value,
|
setupPassword: setupPassword.value === '' ? null : setupPassword.value,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
return login(res.token);
|
return login(res.token);
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"name": "misskey-js",
|
"name": "misskey-js",
|
||||||
"version": "2024.10.0-alpha.0",
|
"version": "2024.10.0-beta.2",
|
||||||
"description": "Misskey SDK for JavaScript",
|
"description": "Misskey SDK for JavaScript",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./built/index.js",
|
"main": "./built/index.js",
|
||||||
|
|
|
@ -5614,7 +5614,7 @@ export type operations = {
|
||||||
'application/json': {
|
'application/json': {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
initialPassword?: string | null;
|
setupPassword?: string | null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue