`flagsmith login` fails on a self-hosted instance that isn't served at `http://localhost:8000`
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker-compose, go
- 領域
- cli, documentation
調査の方向性
issuer の不一致エラーが返される internal/cmd/login.go と、不一致が検出される internal/auth/oauth.go から始めます。CLI のヒントを拡張して、FLAGSMITH_API_URL、FLAGSMITH_FRONTEND_URL、およびホスト単位の API キー変数を明記します。次に、環境変数のドキュメントを更新し、API セクションに両方のサーバー設定を追加します。
索引モデルが issue の本文から書いたものです。
説明
Self-hosted 2.294.0 (docker.flagsmith.com/flagsmith/flagsmith:2.294.0, Docker Compose) with the API published on localhost:18101, and @flagsmith/cli 2.0.0.
$ flagsmith login --api-url http://localhost:18101 --no-browser
Error: authorization server metadata is for http://localhost:8000, not http://localhost:18101 — use the instance's canonical API URL
The instance's discovery document still describes the default URLs:
$ curl -s http://localhost:18101/.well-known/oauth-authorization-server
{"issuer": "http://localhost:8000", "authorization_endpoint": "http://localhost:8080/oauth/authorize/", "token_endpoint": "http://localhost:8000/o/token/", ...}
The server builds it from FLAGSMITH_API_URL and FLAGSMITH_FRONTEND_URL, which default to http://localhost:8000 and http://localhost:8080 (common.py L982-L985, oauth2_metadata/views.py L46-L47). The CLI is right to refuse the mismatch (oauth.go L69-L71), but the error gives no hint: browserLogin only adds one for ErrNoDiscovery (login.go L85-L90). "Canonical API URL" points at the CLI flag, when the fix is a server setting.
The docs don't help either. The environment variables page lists FLAGSMITH_API_URL only as a frontend variable (with an /api/v1/ example) and doesn't mention FLAGSMITH_FRONTEND_URL.
The default docker-compose.yml sets neither, so on port 8000 the issuer matches but authorization_endpoint points at 8080, while the dashboard is on 8000. I haven't tried login on port 8000 itself. The run locally with a coding agent guide already says to use an organisation API key, not flagsmith login.
Workaround:
export FLAGSMITH_API_URL=http://localhost:18101
export FLAGSMITH_API_KEY_localhost_18101=<organisation API key>
Suggestions:
- When the issuer doesn't match, add a hint that names the server settings (
FLAGSMITH_API_URL,FLAGSMITH_FRONTEND_URL) and the host-scoped key variable, astooOldForOAuthHintdoes for older servers (#76). - Document both settings in the API section of the environment variables page.
- 主要言語
- Go
- スター
- 14
- フォーク
- 4
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Flagsmith/flagsmith-cli のほかの issue
-
`feature create --variants` ignores each variant's `key`対応中かも @Anuragkumar-687 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Flagsmith/flagsmith-cli#126 ·
メンテナーはふだん 2 日以内に返信
-
`feature variant update` fails with a 500: the API needs `feature` and `default_percentage_allocation` in the PATCH対応中かも @Anuragkumar-687 が今日担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 45/100
Flagsmith/flagsmith-cli#125 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
Flagsmith/flagsmith-cli#107 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Flagsmith/flagsmith-cli#93 ·
メンテナーはふだん 2 日以内に返信
-
Dependency Dashboardオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
Flagsmith/flagsmith-cli#90 ·
メンテナーはふだん 2 日以内に返信
Flagsmith/flagsmith-cli の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
expr-lang/expr#1037 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
provider-key submission
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
opentofu/registry#6740 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nightgauge/nightgauge#3713 ·
メンテナーはふだん 1 日以内に返信
-
fix: restore GitHub issue templates and check their license headers対応中かも @slievrly が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信