Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Hosts cannot start a quiz in local Docker: ws-server has no JWT_SECRET

未关闭 适合新手
#186 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker-compose, typescript

调研方向

先阅读 docker-compose.yml 和 setup.md,然后检查 apps/ws-server/.env.example 以及 http-server 加载其 .env 的方式,以找出 JWT_SECRET 的共享来源。将匹配的值传递给 ws-server,并记录其环境文件以及 secret 必须匹配的要求;考虑是否应在启动时因使用回退值而失败。完成标准是:按照指南,在新克隆的项目中运行 docker-compose up 后能够启动一个问答游戏。

由索引模型根据 Issue 内容生成。

描述

Backend first issue bug good first issue help wanted

Since #156 was fixed, ws-server verifies the host's login token before letting a socket run a quiz. It reads the same JWT_SECRET that http-server uses to sign that token.

docker-compose.yml never passes it:

  ws-server:
    environment:
      - DATABASE_URL=postgresql://postgres:postgres@db:5432/Qtrive
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - REDIS_PASSWORD=thisistheredisPassword
      # no JWT_SECRET

Both services fall back to the literal string "secret" when the variable is missing. http-server reads its own .env, which setup.md tells you to fill in with a real value — so in a default Docker setup the two services end up with different secrets.

Why it matters

Every host join is rejected with ORGANIZER_AUTH_FAILED. The quiz lobby loads, the join code shows, participants can join — but Start Game does nothing, and the only clue is a message in the browser console.

A new contributor follows setup.md exactly and hits a quiz they cannot start, with no obvious cause. This is the first thing someone will trip over.

What a fix looks like
  • Pass JWT_SECRET through to ws-server in docker-compose.yml, from the same source http-server uses, so the two cannot drift.
  • setup.md documents a .env for packages/db, apps/http-server and apps/genAI, but never one for apps/ws-server. Add it, pointing at apps/ws-server/.env.example, and say plainly that the value must match http-server.
  • Worth considering whether the || "secret" fallback should stay at all. Failing loudly at startup when the variable is missing would have made this obvious instead of silent.
Definition of done
  • docker-compose up gives a working host flow with no manual env editing
  • setup.md lists every .env a fresh clone needs
  • Starting a quiz works locally straight after following the setup guide

Good first issue: a few lines of YAML and a docs edit, but it unblocks everyone who clones the repo.

主要语言
TypeScript
星标
21
派生
7
平均合并
3 小时 39 分钟
30 天内合并 PR
16

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TheCodeHeist-Coder/Rexial 的其他 Issue

查看 TheCodeHeist-Coder/Rexial 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。