`flagsmith login` fails on a self-hosted instance that isn't served at `http://localhost:8000`
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- docker-compose, go
- 领域
- cli, documentation
调研方向
从 internal/cmd/login.go(返回 issuer 不匹配错误的位置)和 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 小时
- 30 天内合并 PR
- 4
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天内回复
-
难度 2/5 1-3 小时 新手友好度 25/100
Flagsmith/flagsmith-cli#90 ·
维护者通常 2 天内回复
查看 Flagsmith/flagsmith-cli 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 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 天内回复