Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: サーバー初期設定時に初期パスワードを要求できるように #14626

Merged

Conversation

kakkokari-gtyih
Copy link
Contributor

@kakkokari-gtyih kakkokari-gtyih commented Sep 25, 2024

What

初期設定開始時に初期パスワードを要求できるように

Why

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR packages/misskey-js packages/frontend:test labels Sep 25, 2024
Copy link
Contributor

github-actions bot commented Sep 25, 2024

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -1971,6 +1971,12 @@
                   "password": {
                     "type": "string",
                     "minLength": 1
+                  },
+                  "initialPassword": {
+                    "type": [
+                      "string",
+                      "null"
+                    ]
                   }
                 },
                 "required": [
@@ -2009,6 +2015,24 @@
                   "$ref": "#/components/schemas/Error"
                 },
                 "examples": {
+                  "ACCESS_DENIED": {
+                    "value": {
+                      "error": {
+                        "message": "Access denied.",
+                        "code": "ACCESS_DENIED",
+                        "id": "1fb7cb09-d46a-4fff-b8df-057708cce513"
+                      }
+                    }
+                  },
+                  "INCORRECT_INITIAL_PASSWORD": {
+                    "value": {
+                      "error": {
+                        "message": "Initial password is incorrect.",
+                        "code": "INCORRECT_INITIAL_PASSWORD",
+                        "id": "97147c55-1ae1-4f6f-91d6-e1c3e0e76d62"
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {

Get diff files from Workflow Page

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 42 lines in your changes missing coverage. Please review.

Project coverage is 41.39%. Comparing base (75ea964) to head (aab74bf).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/pages/welcome.setup.vue 0.00% 22 Missing ⚠️
.../src/server/api/endpoints/admin/accounts/create.ts 45.94% 20 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14626      +/-   ##
===========================================
+ Coverage    39.69%   41.39%   +1.70%     
===========================================
  Files         1545     1549       +4     
  Lines       193848   199643    +5795     
  Branches      3608     2631     -977     
===========================================
+ Hits         76952    82650    +5698     
- Misses      116299   116428     +129     
+ Partials       597      565      -32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

locales/ja-JP.yml Outdated Show resolved Hide resolved
@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Sep 25, 2024

動いてそうだけど手元で検証できないのでやっていただきたい気持ち

@kakkokari-gtyih
Copy link
Contributor Author

試しにcypressでパスワードの値を変えてみたら( 66b2b48 )変な止まり方して成功扱いになった

https:/misskey-dev/misskey/actions/runs/11024875489/job/30618786666

@kakkokari-gtyih kakkokari-gtyih marked this pull request as ready for review September 25, 2024 02:34
@zyoshoka
Copy link
Contributor

admin/accounts/create エンドポイント自体は初期設定以外でも管理者がアカウントを作る際にも使われますが、config に設定したままだと毎回 initialPassword が要求されてしまうのは微妙な気がします

@kakkokari-gtyih
Copy link
Contributor Author

なおったかも

@syuilo syuilo added this to the v2024.9.0 milestone Sep 26, 2024
@syuilo syuilo merged commit 2c1a747 into misskey-dev:develop Oct 3, 2024
35 checks passed
@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

👍🏻

@kakkokari-gtyih
Copy link
Contributor Author

.github/misskey/test.ymlに初期パスワード設定し忘れている+それでtest通ってるのでまだなにかおかしいかも(ローカルで試した?)

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

パスワード有りパターン / パスワード無しパターン 両方試した

@kakkokari-gtyih kakkokari-gtyih deleted the feat-setup-initial-password branch October 3, 2024 09:33
@kakkokari-gtyih
Copy link
Contributor Author

パスワード有りパターン / パスワード無しパターン 両方試した

じゃあなんでtestは通ったんだろう…

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

パスワード有りパターン / パスワード無しパターン 両方試した

  • パスワード無し設定でパスワード無しで登録できる
  • パスワード有り設定でパスワード無しでエラーになる
  • パスワード有り設定で間違ったパスワードでエラーになる
  • パスワード有り設定で正しいパスワードで登録できる

@kakkokari-gtyih
Copy link
Contributor Author

パスワード無し設定でパスワード有り(適当)で登録できる

↑これってどうあるべきなんだろう…?

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

どうでもよさそう

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

ホスティングサービスを運営している場合は、コンフィグファイルを構築する際にinitialPasswordをランダムな値に設定し、ユーザーに通知するようにしてください。

これ対応には時間かかるんじゃないかしら

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

しばらく初期設定は初期パスワード無効にした方が良い気がする

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

そうでないと事業者が対応できるまでMisskeyをアップデートすることができなくなる

@kakkokari-gtyih
Copy link
Contributor Author

それか、コンフィグに「コメントアウトすればスキップできます」と明記して対応が完了するまではスキップしておいてもらうか

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

コメントアウトであっても対応は対応だからなぁ

初期設定パスワードがない状態(現在)→初期設定パスワードをオプトインできる状態→初期設定パスワードをオプトアウトできる状態

として段階的に導入した方が丸そう

@syuilo
Copy link
Member

syuilo commented Oct 3, 2024

あと initialPassword じゃなくて setupPassword の方が分かりやすそう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/frontend:test packages/frontend Client side specific issue/PR packages/misskey-js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants