Skip to content

Commit

Permalink
Fix: q13 and reverse proxy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cantoblanco committed Dec 14, 2024
1 parent f8f6593 commit cd2846e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docs/en_US/guide/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ If you plan to use a CDN, prepare two domain names:
- One configured with a CDN for public access. The CDN must support the WebSocket protocol.
- Another domain without CDN for communication between the Agent and Dashboard.

Although V1 no longer differentiates between access and communication ports, preparing two domains is recommended to avoid potential issues caused by specific CDN configurations (not mandatory).

This guide uses "dashboard.example.com" and "data.example.com" as examples.
:::

Expand Down
2 changes: 1 addition & 1 deletion docs/en_US/guide/q3.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ dashboard.example.com {
header_up nz-realip {http.CF-Connecting-IP} # Replace with your CDN's private header
# Uncomment the next line and comment the above if Caddy is the outermost layer
# header_up nz-realip {remote_host};
header_up Upgrade {http.upgrade}
header_up Upgrade {http.upgrade} # Comment this line if Agent TLS communication is enabled
header_up Connection "upgrade"
transport http {
read_buffer 16384
Expand Down
4 changes: 3 additions & 1 deletion docs/guide/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ outline: deep
::: tip
如果你想使用 CDN,请准备两个域名:
- 一个配置好 CDN,用作公开访问,CDN 需支持 WebSocket 协议;
- 另一个域名不使用 CDN,用作 Agent 与 Dashboard 的通信。
- 另一个域名不使用 CDN,用作 Agent 与 Dashboard 的通信。

尽管 V1 版本不再区分访问端口和通信端口,但由于不同厂商的 CDN 配置可能导致通信异常,仅建议按上述方式准备域名(非强制要求)。

本文档以 "dashboard.example.com" 和 "data.example.com" 为例。
:::
Expand Down
21 changes: 0 additions & 21 deletions docs/guide/q13.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@ outline: deep

# 初始化用户密码

由于本地数据库存储的用户密码是通过 `bcrypt` 加密后的,所以当遗忘后没办法找回明文。不过你可以借助初始化功能来创建一个原始用户后再修改密码为你喜爱的。


1. 找到数据库的路径
例如 `/opt/nezha/dashboard/data/sqlite.db`
2. 查询、删除现有用户
```shell
sqlite3 sqlite.db "select * from users"
sqlite3 sqlite.db "delete from users"
```
3. 重启面板服务
面板初始化过程中会判断,如果用户表为空,则尝试插入默认用户。
4. 尝试登录
不出意外,用户表里面已经插入了默认用户,用户名和密码 `admin`

---
outline: deep
---

# 初始化用户密码

当遗忘本地数据库中存储的用户密码时,无法直接找回明文密码,因为它已通过 `bcrypt` 加密。不过,可以通过重置功能创建一个原始用户,之后再修改密码为所需的密码。

---
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/q3.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ dashboard.example.com {
header_up Origin https://{host}
header_up nz-realip {http.CF-Connecting-IP} # 替换为你的 CDN 提供的私有 header,此处为 CloudFlare 默认
# header_up nz-realip {remote_host} # 如果你使用caddy作为最外层,就把上面一行注释掉,启用此行
header_up Upgrade {http.upgrade}
header_up Upgrade {http.upgrade} # Agent 开启 tls 通信时注释掉此行
header_up Connection "upgrade"
transport http {
read_buffer 16384
Expand Down

0 comments on commit cd2846e

Please sign in to comment.