-
Notifications
You must be signed in to change notification settings - Fork 661
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
インストール完了画面で有効化するプラグインを選択する #5074
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.1 #5074 +/- ##
============================================
- Coverage 75.96% 75.65% -0.31%
- Complexity 5946 6032 +86
============================================
Files 449 456 +7
Lines 20922 21165 +243
============================================
+ Hits 15893 16012 +119
- Misses 5029 5153 +124
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
4.1-beta2 ブランチが削除されたため閉じられてしまいました。 |
|
- install/complete の段階では EntityManager::getRepository() が使用で きないため - 有効化エンドポイントは APP_ENV=install と別のセッションとなるため CSRF トークンが使用できない.他の実装を検討する必要がある
有効化エンドポイントは APP_ENV=install と別のセッションとなるためCSRF トークンが使用できない。他の実装を検討する必要がある |
ファイルで CSRF トークンをチェックするように変更して、 WIP はずしました |
動作確認項目のメモ
テスト用
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
return $this->json(['success' => true]); | ||
return $this->redirectToRoute('admin_homepage'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
無駄なリダイレクトが発生するのでログイン画面の方が良いと思います。
return $this->redirectToRoute('admin_homepage'); | |
return $this->redirectToRoute('admin_login'); |
@@ -499,12 +501,15 @@ public function complete(Request $request) | |||
$this->removeSessionData($this->session); | |||
|
|||
// 有効化URLのトランザクションチェックファイルを生成する | |||
file_put_contents($this->getParameter('kernel.project_dir').self::TRANSACTION_CHECK_FILE, time() + (60 * 10)); | |||
$token = StringUtil::random(32); | |||
file_put_contents($this->getParameter('kernel.project_dir').self::TRANSACTION_CHECK_FILE, time() + (60 * 10).':'.$token.':'.$databaseUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なぜ databaseUrl を保存しているんでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要な項目でしたので削除しました
$.get({ url: '{{ url('install_plugins') }}' }, | ||
function (data) { | ||
$('#plugins').children().remove(); | ||
data.forEach(function (plugin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugin が0個の場合はプラグイン有効化のcolumnごと非表示で良いと思います。(git clone でインストール時など)
@nanasess
|
@okazy ありがとうございます。 databaseUrl はデバッグ時の削除漏れでした😥 |
初期インストールプラグインがない場合にプラグイン有効化の文言を非表示 / インストール完了後のリダイレクト先をログイン画面に修正
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます!
動作確認して問題ありませんでした。
テストが通ればマージします。
ありがとうございます!マージしました。 |
概要(Overview・Refs Issue)
インストール完了画面で有効化するプラグインを選択する
有効化するプラグインは、予めインストール状態としておく必要がある
TODO
方針(Policy)
実装に関する補足(Appendix)
APP_ENV=install
とAPP_ENV=prod
では、セッションが共有できないため、 CSRF トークンはvar
以下のファイルに保存しているテスト(Test)
4.1-beta2 に本PRを適用し、 API プラグインが有効化されるのを確認
相談(Discussion)
インストーラの bootstrap が古いので、ボタンの見た目がよくない。管理画面と同様に bootstrap5 を使いたい
マイナーバージョン互換性保持のための制限事項チェックリスト
レビュワー確認項目