Skip to content

Conversation

@dreamhunter2333
Copy link
Owner

@dreamhunter2333 dreamhunter2333 commented Aug 22, 2025

User description

#642


PR Type

Documentation


Description

  • Updated Cloudflare UI instructions to reflect recent changes.

  • Adjusted terminology for consistency with new Cloudflare labels.

  • Enhanced clarity with updated screenshots and links.

  • Improved guidance for database, worker, and KV setup processes.


Changes walkthrough 📝

Relevant files
Documentation
d1.md
Updated database setup instructions and added schema link

vitepress-docs/docs/zh/guide/ui/d1.md

  • Updated navigation paths for creating and initializing databases.
  • Added a link to the db/schema.sql file for clarity.
  • Removed redundant warning block for database initialization.
  • +3/-5     
    pages.md
    Revised application creation steps for new UI                       

    vitepress-docs/docs/zh/guide/ui/pages.md

  • Updated navigation paths for creating applications.
  • Adjusted terminology for direct upload instructions.
  • +2/-2     
    worker.md
    Updated worker and KV setup instructions with new UI         

    vitepress-docs/docs/zh/guide/ui/worker.md

  • Updated worker creation and configuration steps for new UI.
  • Adjusted terminology for settings and bindings.
  • Added new screenshots for worker setup and bindings.
  • Enhanced KV and Telegram Bot setup instructions.
  • +27/-10 

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis 🔶

    642 - Partially compliant

    Compliant requirements:

    • Update documentation to reflect changes in the Cloudflare UI.
    • Ensure instructions are clear and align with the new UI structure.
    • Provide updated screenshots to match the new UI.
    • Adjust terminology to match the new Cloudflare labels.
    • Improve guidance for database, worker, and KV setup processes.

    Non-compliant requirements:

    []

    Requires further human verification:

    []

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Clarity of Instructions

    Ensure that the updated instructions for creating and initializing the database are clear and unambiguous, especially for users unfamiliar with the new Cloudflare UI.

    打开 cloudflare 控制台,选择 `Storage & Databases` -> `D1 SQL Database` -> `Create Database`,点击创建数据库
    
    ![d1](/ui_install/d1.png)
    
    创建完成后,我们在 cloudflare 的控制台可以看到 D1 数据库
    
    ## 初始化数据库
    
    ::: warning 注意
    你也可以跳过初始化数据库,在部署完成后,在 admin 页面的 `快速设置` -> `数据库` 中,点击 `初始化数据库` 按钮来初始化数据库
    :::
    
    打开 `Console` 标签页,输入仓库中 [db/schema.sql](https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/db/schema.sql) 文件的内容,点击 `Execute` 执行
    Completeness of Worker Setup

    Verify that the steps for setting up Workers, including compatibility flags and bindings, are comprehensive and accurate for the new UI.

    1. 点击 `Compute (Workers)` -> `Workers & Pages` -> `Create`
    
        ![create worker](/ui_install/worker_home.png)
    
    2. 选择 `Worker`,点击 `Create Worker`, 修改名称然后点击 `Deploy`
    
        ![worker1](/ui_install/worker-1.png)
        ![worker2](/ui_install/worker-2.png)
    
    3. 回到 `Workers & Pages`,找到刚刚创建的 worker,点击 `Settings` -> `Runtime`, 修改 `Compatibility flags`, 手动输入增加 `nodejs_compat`, 兼容日期也需要大于图片中的日期。
    
        ![worker-runtime](/ui_install/worker-runtime.png)
    
    4. 下载 [worker.js](https://github.com/dreamhunter2333/cloudflare_temp_email/releases/latest/download/worker.js)
    
    5. 回到 `Overview`,找到刚刚创建的 worker,点击 `Edit Code`, 删除原来的文件,上传 `worker.js`, 点击 `Deploy`
    
        > [!NOTE]
        > 上传需要先点击左侧菜单的 Explorer,
        > 在文件列表的窗口里点击鼠标右键,在右键菜单里找到 `Upload`,
        > 请参考下面的截图
        >
        > 参考: [issues156](https://github.com/dreamhunter2333/cloudflare_temp_email/issues/156#issuecomment-2079453822)
    
        ![worker3](/ui_install/worker-3.png)
    
        ![worker-upload](/ui_install/worker-upload.png)
    
    6. 点击 `Settings` -> `Variables and Secrets`, 如图所示添加变量
    
        ![worker-var](/ui_install/worker-var.png)
    
        > [!NOTE] 注意
        > 更多变量的配置请查看 [worker变量说明](/zh/guide/worker-vars)
        >
        > 注意字符串格式的变量的最外层的引号是不需要的
        >
        > 对于 `USER_ROLES` 请配置为此格式 `[{"domains":["awsl.uk","dreamhunter2333.xyz"],"role":"vip","prefix":"vip"},{"domains":["awsl.uk","dreamhunter2333.xyz"],"role":"admin","prefix":""}]`
    
        建议配置的变量列表
    
        | 变量名                     | 类型        | 说明                                       | 示例                                 |
        | -------------------------- | ----------- | ------------------------------------------ | ------------------------------------ |
        | `PREFIX`                   | 文本        | 新建邮箱名称默认前缀,不需要前缀可不配置   | `tmp`                                |
        | `DOMAINS`                  | JSON        | 用于临时邮箱的所有域名, 支持多个域名       | `["awsl.uk", "dreamhunter2333.xyz"]` |
        | `JWT_SECRET`               | 文本/Secret | 用于生成 jwt 的密钥, jwt 用于登录以及鉴权  | `xxx`                                |
        | `ADMIN_PASSWORDS`          | JSON        | admin 控制台密码, 不配置则不允许访问控制台 | `["123", "456"]`                     |
        | `ENABLE_USER_CREATE_EMAIL` | 文本/JSON   | 是否允许用户创建邮箱, 不配置则不允许       | `true`                               |
        | `ENABLE_USER_DELETE_EMAIL` | 文本/JSON   | 是否允许用户删除邮件, 不配置则不允许       | `true`                               |
    
    7. 点击 `Settings` -> `Bindings`, 点击 `Add Binding`, 名称如图,选择刚刚创建的 D1 数据库,点击 `Add Binding`
    
        > [!NOTE] 重要
        > 注意此处 `D1 Database` 的绑定名称必须为 `DB`
    
        ![worker-bindings](/ui_install/worker-bindings.png)
    
        ![worker-d1-1](/ui_install/worker-d1-1.png)
    
        ![worker-d1-2](/ui_install/worker-d1-2.png)
    
    KV Cache Setup Accuracy

    Confirm that the instructions for creating and binding the KV cache are correct and align with the updated Cloudflare UI.

    9. 如果你要启用注册用户功能,并需要发送邮件验证,则需要创建 `KV` 缓存, 不需要可跳过此步骤
    
        > [!NOTE] 重要
        > 如果你要启用注册用户功能,并需要发送邮件验证,则需要创建 `KV` 缓存, 不需要可跳过此步骤
        >
        > 注意此处 `KV` 的绑定名称必须为 `KV`
    
        点击 `Storage & Databases` -> `KV` -> `Create Namespace`, 如图,点击 `Create Namespace`
    
        ![worker-kv](/ui_install/worker-kv.png)
    
        ![worker-kv-0](/ui_install/worker-kv-0.png)
    
        然后点击 `Settings` -> `Bindings`, 点击 `Add Binding`, 名称如图,选择刚刚创建的 KV,点击 `Add Binding`
    
        ![worker-bindings](/ui_install/worker-bindings.png)
    
        ![worker-kv-1](/ui_install/worker-kv-1.png)
    

    @github-actions
    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Clarify flag addition instructions

    Clarify the exact format or syntax for manually adding the nodejs_compat flag to
    avoid user errors. This will ensure users can correctly configure the compatibility
    flags.

    vitepress-docs/docs/zh/guide/ui/worker.md [15]

    -3. 回到 `Workers & Pages`,找到刚刚创建的 worker,点击 `Settings` -> `Runtime`, 修改 `Compatibility flags`, 手动输入增加 `nodejs_compat`, 兼容日期也需要大于图片中的日期。
    +3. 回到 `Workers & Pages`,找到刚刚创建的 worker,点击 `Settings` -> `Runtime`, 修改 `Compatibility flags`, 手动输入增加 `nodejs_compat`(格式为: `flag_name`),兼容日期也需要大于图片中的日期。
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion improves clarity by specifying the format for adding the nodejs_compat flag, reducing potential user errors. However, it is not a critical issue, so the score reflects its moderate importance.

    Medium

    @dreamhunter2333 dreamhunter2333 merged commit 89d8944 into main Aug 22, 2025
    1 check passed
    @dreamhunter2333 dreamhunter2333 deleted the feature/docs branch August 22, 2025 17:14
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants