diff --git a/README.md b/README.md index c0255865..45ecbea6 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,25 @@ > | KV | No | 25 MiB (Cloudflare limit) | 1 GB | +## FAQ + +- **After forking the repository, why can't I see my repository when connecting GitHub to Cloudflare, or why do I get a 404 after selecting it?** + This is usually related to how the GitHub fork is identified or how Cloudflare handles repository authorization and synchronization. If the fork keeps a repository name, description, or other information that is very similar to the upstream project, it may be more likely to trigger related restrictions or issues. It is recommended to rename the repository to something different from the upstream project when creating the fork, and change the repository description as well. For example, you can rename it to `2233warden`. If you have already created the fork, you can rename the repository and update its description in the GitHub repository settings, then try connecting it to Cloudflare again. + +- **I deleted my deployment and redeployed it. Why does registration require an invite code again?** + Deleting the Worker or redeploying it does not automatically delete the persistent data that was already created. The users, invite codes, and related configuration stored in the D1 database and KV namespace are still there, so the newly deployed Worker continues to read the existing data and enforce the invite-code requirement. + If you want to start completely from scratch, you need to delete the corresponding **D1 database and KV namespace** as well. + +- **I configured `JWT_SECRET`, but the page still says it is missing. Why?** + Make sure `JWT_SECRET` is configured under **Workers → Settings → Variables and Secrets**, specifically as a **Runtime variable or Secret**, rather than under **Build variables**. + Build-time variables are only available during the build process. They are not available to the Worker at runtime, so the build may succeed while the application still reports that `JWT_SECRET` is missing. + +- **Why does `JWT_SECRET` seem to disappear after an upgrade or redeployment?** + It is recommended to store `JWT_SECRET` as a **Secret** rather than as a plain-text variable. `JWT_SECRET` is a sensitive runtime credential and should not be committed to the repository. + If your deployment process recreates or overwrites the Worker variable configuration, ordinary variables may be affected. Secrets are more appropriate for sensitive configuration that needs to remain available across multiple deployments. If the application still reports that `JWT_SECRET` is missing after a redeployment, check **Variables and Secrets** for the current Worker and make sure the Secret is still configured. + +--- + ## How to update - Manual: open your fork on GitHub; when the sync banner appears, click **Sync fork** → **Update branch** diff --git a/README_ZH.md b/README_ZH.md index 56fb1309..58a59ef7 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -91,6 +91,24 @@ > | KV | 不需要 | 25 MiB(Cloudflare限制) | 1 GB | +## 常见问题: +- **Fork 完仓库后,在 Cloudflare 连接 GitHub 账户时看不到自己的仓库,或者选择仓库后返回 404?** + 这通常与 GitHub Fork 仓库的识别或 Cloudflare 对仓库的授权/同步有关。如果 Fork 后仓库名称、描述等信息与上游项目高度一致,可能更容易触发相关限制或异常。建议在 Fork 时就将仓库名称修改为与上游不同的名称,并同时修改仓库描述,例如改为 `2233warden`。如果已经完成 Fork,也可以直接在 GitHub 仓库设置中修改名称和描述,然后重新尝试在 Cloudflare 中连接。 + +- **我删掉部署后重新部署,为什么注册又开始要求邀请码了?** + 因为删除 Worker 或重新部署并不会自动删除已经创建的持久化数据。D1 数据库和 KV 命名空间中的用户、邀请码及相关配置仍然存在,因此重新部署后仍会读取原来的数据,并继续要求邀请码。 + 如果希望完全重新开始,需要同时删除对应的 **D1 数据库和 KV 命名空间**。 + +- **我配置了 `JWT_SECRET`,为什么页面仍然提示缺少?** + 请将 `JWT_SECRET` 配置在 Cloudflare Workers 的 **Settings → Variables and Secrets** 中,并确保它属于 **Runtime variables and secrets**,而不是 **Build variables**。 + Build 阶段的变量只在项目构建过程中可用,Worker 实际运行时无法通过运行时环境读取,因此即使构建能够正常完成,页面仍可能提示 `JWT_SECRET` 缺失。 + +- **为什么升级或重新部署后,`JWT_SECRET` 好像消失了?** + 建议将 `JWT_SECRET` 配置为 **Secret**,而不是普通的明文变量。`JWT_SECRET` 属于敏感的运行时凭据,也不应该出现在代码仓库中。 + 如果部署流程会重新生成或覆盖 Worker 的变量配置,普通变量可能受到影响;使用 Secret 更适合保存这类需要在多次部署之间持续存在的敏感配置。重新部署后如果仍提示缺失,请检查当前 Worker 的 **Variables and Secrets** 中是否仍存在该 Secret。 + +--- + ## 更新方法: - 手动:打开你 Fork 的 GitHub 仓库,看到顶部同步提示后,点击 `Sync fork` ➜ `Update branch`