优化更新中英文文档-安装Dashboard
This commit is contained in:
parent
8688538e0e
commit
3b15ae51c2
178
docs/en_US/guide/dashboard.md
Normal file → Executable file
178
docs/en_US/guide/dashboard.md
Normal file → Executable file
@ -1,72 +1,89 @@
|
||||
## Preparations
|
||||
To setup a Nezha monitorning Dashboard, you need these things:
|
||||
1. A VPS that can connect to the Internet, firewall and security policies need to open ports 8008 and 5555, otherwise it will be inaccessible and unable to receive data. A 1 core 512MB RAM server is sufficient for most usage scenarios
|
||||
2. A domain name that has been set up with an A record that resolves to the Dashboard server IP
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
## Preparation
|
||||
|
||||
To set up Nezha Monitoring, you need:
|
||||
1. A server with public internet access, with firewall and security policies allowing traffic on ports 8008 and 5555. These ports are necessary for accessing and receiving data. A server with a single core and 512MB of RAM is sufficient for most use cases.
|
||||
2. A domain with an A record set to point to your Dashboard server IP.
|
||||
::: tip
|
||||
If you want to use CDN, please prepare two domains, one connect to CDN for public access, CDN needs to support WebSocket protocol; the other domain should not connect to CDN, use it as Agent to send data to Dashboard.
|
||||
This document uses "cdn.example.com" and "data.example.com" domains to demonstrate respectively
|
||||
If you want to use a CDN, prepare two domains: one configured with CDN for public access (CDN must support WebSocket protocol), and another domain not using CDN for communication between the Agent and Dashboard.
|
||||
|
||||
This document uses "dashboard.example.com" and "data.example.com" as example domains.
|
||||
:::
|
||||
3. A Github or Gitlab account
|
||||
3. A Github account (or Gitlab, Gitee).
|
||||
|
||||
**This document will use the aaPanel as an example, with future versions of the changes, some of the features may change, this document is for reference only**
|
||||
:::warning
|
||||
This project does not rely on aaPanel, you can choose to use any server panel you like, and if you are capable enough, you can manually install NginX or Caddy to configure SSL and reverse proxy.
|
||||
If you don't think it's necessary to use port 80 or 443 to access Dashboard, you don't even need to install NginX and you can just use the install script.
|
||||
**This document uses the aaPanel for reverse proxying the Dashboard as an example. As future versions change, some features may change their entry points. This document is for reference only.**
|
||||
::: warning
|
||||
This project does not depend on the aaPanel; you can choose any server panel you prefer or manually install Nginx or Caddy to configure SSL and reverse proxy.
|
||||
If you do not need to use ports 80 and 443 to access the Dashboard, you can directly use the installation script to install and run Nezha Monitoring without installing Nginx.
|
||||
:::
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
## Get the Client ID and Client Secret on Github/Gitlab
|
||||
Nezha Monitor uses a Github account as the login account for the admin panel
|
||||
+ First we need to create a new authentication application, after logging into Github, open https://github.com/settings/developers and select "OAuth Apps" - "New OAuth App "
|
||||
`Application name` - Fill in as you like
|
||||
`Homepage URL` - Fill in the panel's access domain name, such as: "http://cdn.example.com"
|
||||
`Authorization callback URL` - Fill in the callback address, e.g., "http://cdn.example.com/oauth2/callback"
|
||||
+ Click on "Registration Application"
|
||||
+ Remember the Client ID in the page, then click "Generate a new client secret" to create a new Client Secret, the new secret will be displayed only once, please save it properly
|
||||
<br/>
|
||||
<br/>
|
||||
+ If you're using Gitlab, you'll need to go to https://gitlab.com/-/profile/applications to create a new application
|
||||
+ Fill in `Redirect URL` with the callback address
|
||||
+ In `Scopes`, select `read_user` and `read_api`
|
||||
+ Once created, save the Application ID and Secret
|
||||
## Installing Dashboard on the server
|
||||
* In the panel server, run the installation script:
|
||||
## Obtaining Github Client ID and Secret
|
||||
|
||||
Nezha Monitoring uses Github, Gitlab, or Gitee as admin accounts.
|
||||
1. First, create an OAuth application. For Github, log in to Github, open [Github OAuth Apps](https://github.com/settings/developers), and select "OAuth Apps" -> "New OAuth App".
|
||||
`Application name` - Fill in as you like.
|
||||
`Homepage URL` - Fill in with the domain for accessing the dashboard, such as "http://dashboard.example.com" (your domain).
|
||||
`Authorization callback URL` - Fill in with the callback address, such as "http://dashboard.example.com/oauth2/callback" (don't forget `/oauth2/callback`).
|
||||
1. Click “Register application”.
|
||||
2. Save the Client ID on the page, then click “Generate a new client secret” to create a new Client Secret, which will be displayed only once, **please keep it safe**.
|
||||
|
||||
## Using Cloudflare Access as OAuth2 Provider
|
||||
|
||||
If you encounter issues using Github, Gitlab, or Gitee as admin login, consider switching to [using Cloudflare Access as the OAuth2 provider](/en_US/guide/q8.html).
|
||||
|
||||
### Creating a SaaS-OIDC Application
|
||||
|
||||
1. Go to [Zero Trust Dashboard](https://one.dash.cloudflare.com) and log in with your Cloudflare account.
|
||||
2. `My Team` -> `Users` -> `<specific user>` -> Get `User ID` and save it.
|
||||
3. `Access` -> `Application` -> `Add an Application`.
|
||||
4. Choose `SaaS`, enter a custom application name in `Application` (e.g., nezha), select `OIDC`, and click `Add application`.
|
||||
5. Select `Scopes`: `openid`, `email`, `profile`, `groups`.
|
||||
6. Fill in your callback address in `Redirect URLs`, such as `https://dashboard.example.com/oauth2/callback`.
|
||||
7. Save the `Client ID`, `Client Secret`, and `Issuer` address (protocol and domain part), e.g., `https://xxxxx.cloudflareaccess.com`.
|
||||
|
||||
**If using this method, after installing the Dashboard, modify the configuration file `/opt/nezha/dashboard/data/config.yaml`, and change the `Endpoint` configuration to the `Issuer` address saved earlier, e.g., `https://xxxxx.cloudflareaccess.com`, and restart the Dashboard.**
|
||||
|
||||
## Installing the Dashboard on the Server
|
||||
|
||||
Run the installation script on the dashboard server:
|
||||
```bash
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
```
|
||||
|
||||
* After waiting for the Docker installation to complete, input the following settings:
|
||||
`OAuth2 provider` - Github or Gitlab
|
||||
`Client ID` - Previously saved Client ID
|
||||
`Client Secret` - Previously saved secret
|
||||
`GitHub/Gitee login name` - Github o Gitlab username
|
||||
`Site title` - Custom site title
|
||||
`Site access port` - Public access port, customizable, default 8008
|
||||
`RPC port` - The communication port between Agent and Dashboard, default 5555
|
||||
After Docker installation completes, enter the following values:
|
||||
- `OAuth provider` - choose one from github, cloudflare, gitlab, gitee.
|
||||
- `Client ID` - the previously saved Client ID.
|
||||
- `Client Secret` - the previously saved Client Secret.
|
||||
- `Username` - the username/User ID from the OAuth provider.
|
||||
- `Site title` - custom site title.
|
||||
- `Access port` - public access port, customizable, default is 8008.
|
||||
- `Agent communication port` - port for Agent and Dashboard communication, default is 5555.
|
||||
|
||||
* After the input is complete, wait to pull the mirror
|
||||
After the installation, if everything is fine, you can visit the domain + port number, such as "http://cdn.example.com:8008" to view the Dashboard
|
||||
After inputting the values, wait for the image to be pulled.
|
||||
When the installation completes, you can access the dashboard by visiting your domain and port number, such as “http://dashboard.example.com:8008”.
|
||||
|
||||
* In the future, if you need to run the script again, you can run:
|
||||
In the future, if you need to run the script again, run:
|
||||
```bash
|
||||
./nezha.sh
|
||||
```
|
||||
to open the management script
|
||||
<br/>
|
||||
<br/>
|
||||
## Configure reverse proxy
|
||||
* Create a new site in the aaPanel, fill in the public access domain name, such as "http://cdn.example.com", then click "Settings" to enter the site settings option, select " Reverse proxy" - "New reverse proxy"
|
||||
to open the management script.
|
||||
|
||||
* Customize a proxy name, fill in `http://127.0.0.1` in the "Target URL" and click "Save"
|
||||
## Configuring Reverse Proxy
|
||||
|
||||
* Open the " configuration" to the right of the new reverse proxy you just created and replace the configuration file with the following:
|
||||
````nginx
|
||||
Create a new site in the aaPanel, with the domain filled in as the public access domain, such as “http://dashboard.example.com”. Then click “Settings” to enter the site settings options, select “Reverse Proxy” - “New Reverse Proxy”.
|
||||
|
||||
Customize a proxy name and fill in `http://127.0.0.1` in the "Target URL" below, then click “Save”.
|
||||
|
||||
Open the “Configuration File” on the right side of the newly created reverse proxy and replace the configuration file with the following content:
|
||||
```nginx
|
||||
#PROXY-START/
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8008;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
}
|
||||
location ~ ^/(ws|terminal/.+)$ {
|
||||
proxy_pass http://127.0.0.1:8008;
|
||||
@ -76,52 +93,31 @@ location ~ ^/(ws|terminal/.+)$ {
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
#PROXY-END/
|
||||
````
|
||||
* Click "Save"
|
||||
Now, you should be able to access the panel directly using a domain name such as: "http://cdn.example.com"
|
||||
<br/>
|
||||
#### Other:
|
||||
```
|
||||
Click “Save”.
|
||||
Now you should be able to access the dashboard directly using the domain, such as “http://dashboard.example.com”.
|
||||
|
||||
### Additional Content:
|
||||
|
||||
* CaddyServer v1(v2 no special configuration required)
|
||||
CaddyServer v1 (v2 does not require special configuration):
|
||||
|
||||
```
|
||||
proxy /ws http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
proxy /terminal/* http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
```
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
```caddy
|
||||
proxy /ws http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
proxy /terminal/* http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
```
|
||||
|
||||
## Configuring SSL in the aaPanel
|
||||
First, temporarily disable the reverse proxy
|
||||
As with other websites, you can choose to automatically apply for a Let´s Encrypt certificate or manually configure an existing certificate by going to "SSL" in the site settings
|
||||
After you finish setting up SSL, you need to go back to https://github.com/settings/developers and edit the authentication application you created before, change all the domain names in the "Homepage URL" and "Authorization callback URL" you filled in before from `http` to `https`, such as: "https://cdn.example.com" and "https://cdn.example.com/oauth2/callback", **If you don't change these links, you may not be able to log into the admin panel**
|
||||
|
||||
## FAQ
|
||||
### What should I do if /terminal or /ws cannot be connected after HTTPS is enabled?
|
||||
It is often caused by incomplete certificates. Please add -d to the agent running parameters. If there is x509: certificate signed by unknown authority in the log, replacing the complete certificate can solve the problem 100%.
|
||||
First, temporarily disable the reverse proxy.
|
||||
Like configuring SSL certificates for other websites, enter the “SSL” in the site settings, and you can choose to automatically apply for a Let’s Encrypt certificate or manually configure an existing certificate.
|
||||
After completing the SSL settings, go back to [Github OAuth Apps](https://github.com/settings/developers) and edit the previously created OAuth application. Change all the domain parts in "Homepage URL" and "Authorization callback URL" from `http` to `https`, such as "https://dashboard.example.com" and "https://dashboard.example.com/oauth2/callback". **Failing to change this may result in being unable to log in to the admin panel.**
|
||||
|
||||
### I am not satisfied with the data modification or addition function provided by the Dashboard, what if I want to modify or add data myself?
|
||||
Commonly used in requirements such as batch installation of Agents, where you can modify the database directly.
|
||||
Please note that not everything can be modified in the database, wrong modification will lead to data confusion and failure to start Dashboard, **please do not modify the database at will!**
|
||||
::: danger
|
||||
Again, **please do not modify the database at will!**
|
||||
:::
|
||||
If you need to modify the data in the database, please **stop** the Dashboard container before modifying it.
|
||||
The database type is sqlite3, located in `/opt/nezha/dashboard/data/sqlite.db`, please backup before modifying the data
|
||||
## Updating the Dashboard
|
||||
|
||||
### What are each table or column in the database?
|
||||
The documentation does not provide an explanation of the database. If you have the ability to modify the database, you should be able to read it with a little thinking.
|
||||
|
||||
### Does Dashboard update automatically?
|
||||
The Agent normally updates automatically, but the Dashboard does not and needs to be updated manually.
|
||||
|
||||
### How do I update the Dashboard?
|
||||
Run the script `. /nezha.sh` and select restart Dashboard and update
|
||||
Run the script `./nezha.sh`, and select to restart and update the dashboard.
|
@ -73,4 +73,22 @@ The entered DDNS `AccessID` or `AccessSecret` is incorrect.
|
||||
## Network Monitoring Page Shows: server monitor history not found
|
||||
|
||||
This error indicates that no TCP-Ping or ICMP-Ping type monitoring has been set in the services page or monitoring data has not yet been generated.
|
||||
If it has been set up, wait for some time and then check again.
|
||||
If it has been set up, wait for some time and then check again.
|
||||
|
||||
### What to do if /terminal or /ws can't connect properly after enabling HTTPS?
|
||||
|
||||
This is often due to an incomplete certificate. Add the -d parameter to the agent run command. If the log contains `x509:certificate signed by unknown authority`, replacing with a complete certificate will solve the problem.
|
||||
|
||||
### What if I'm not satisfied with the data modification/addition functionality provided by the dashboard and want to modify/add data myself?
|
||||
|
||||
Common in scenarios like batch adding Agents, you can directly modify the database.
|
||||
Note that not everything in the database can be modified; incorrect modifications can lead to data corruption and inability to start the Dashboard. **Do not modify the database casually!**
|
||||
::: danger
|
||||
Again, **do not modify the database casually!**
|
||||
:::
|
||||
If you need to modify data in the database, **stop** the dashboard container first.
|
||||
The database type is sqlite3, located at `/opt/nezha/dashboard/data/sqlite.db`. Backup before modifying.
|
||||
|
||||
### Will the Dashboard automatically update?
|
||||
|
||||
Agents typically update automatically, but the Dashboard does not and requires manual updates.
|
@ -5,87 +5,84 @@ outline: deep
|
||||
## 准备工作
|
||||
|
||||
搭建一个哪吒监控,你需要:
|
||||
1. 一台可以连接公网的 VPS,防火墙和安全策略需要放行 8008 和 5555 端口,否则会无法访问和无法接收数据。单核 512MB 内存的服务器配置就足以满足大多数使用场景
|
||||
2. 一个已经设置好 A 记录,指向 Dashboard 服务器 ip 的域名
|
||||
1. 一台可以连接公网的服务器,防火墙和安全策略需要放行 8008 和 5555 端口,否则会无法访问和无法接收数据。单核 512MB 内存的服务器配置就足以满足大多数使用场景。
|
||||
2. 一个已经设置好 A 记录,指向 Dashboard 服务器 IP 的域名。
|
||||
::: tip
|
||||
如果你想使用 CDN,请准备两个域名,一个配置好 CDN 用作公开访问,CDN 需要支持 WebSocket 协议;另一个域名不要使用 CDN,用作 Agent 端与 Dashboard 的通信
|
||||
本文档分别以 "dashboard.example.com" 和 "data.example.com" 两个域名来演示
|
||||
:::
|
||||
3. 一个 Github 账号(或:Gitlab、Gitee)
|
||||
如果你想使用 CDN,请准备两个域名,一个配置好 CDN 用作公开访问,CDN 需要支持 WebSocket 协议;另一个域名不要使用 CDN,用作 Agent 端与 Dashboard 的通信。
|
||||
|
||||
**本文档将以宝塔面板反代面板的过程作为范例,随着未来版本的变化,部分功能的入口可能会发生改变,本文档仅供参考**
|
||||
本文档分别以 "dashboard.example.com" 和 "data.example.com" 两个域名来演示。
|
||||
:::
|
||||
3. 一个 Github 账号(或:Gitlab、Gitee)。
|
||||
|
||||
**本文档将以宝塔面板反代 Dashboard 的过程作为示范,随着未来版本的变化,部分功能的入口可能会发生改变,本文档仅供参考。**
|
||||
:::warning
|
||||
本项目并不依赖宝塔,你可以选择使用你喜欢的任何服务器面板,或手动安装 NginX 或 Caddy 来配置 SSL 和反代。
|
||||
如果你认为没有必要使用 80、443 端口来访问 Dashboard,你甚至不需要安装 NginX 就可以直接使用安装脚本安装并运行哪吒监控。
|
||||
本项目并不依赖宝塔,你可以选择使用你喜欢的任何服务器面板,或手动安装 Nginx 或 Caddy 来配置 SSL 和反代。
|
||||
如果你认为没有必要使用 80、443 端口来访问 Dashboard,你甚至不需要安装 Nginx 就可以直接使用安装脚本安装并运行哪吒监控。
|
||||
:::
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
## 获取 Github 的 Client ID 和密钥
|
||||
|
||||
哪吒监控接入 Github、Gitlab、Gitee 作为后台管理员账号
|
||||
1. 首先我们需要新建一个验证应用,以 Github 为例,登录 Github 后,打开 https://github.com/settings/developers ,依次选择“OAuth Apps” - “New OAuth App”
|
||||
`Application name` - 随意填写
|
||||
`Homepage URL` - 填写面板的访问域名,如:"http://dashboard.example.com" (你的域名)
|
||||
`Authorization callback URL` - 填写回调地址,如:"http://dashboard.example.com/oauth2/callback" (不要忘记`/oauth2/callback`)
|
||||
2. 点击 “Register application”
|
||||
3. 保存页面中的 Client ID,然后点击 “Generate a new client secret“,创建一个新的 Client Secret,新建的密钥仅会显示一次,**请妥善保存**
|
||||
哪吒监控接入 Github、Gitlab、Gitee 作为后台管理员账号。
|
||||
1. 首先我们需要新建一个验证应用,以 Github 为例,登录 Github 后,打开 https://github.com/settings/developers,依次选择“OAuth Apps” - “New OAuth App”。
|
||||
`Application name` - 随意填写。
|
||||
`Homepage URL` - 填写面板的访问域名,如:"http://dashboard.example.com"(你的域名)。
|
||||
`Authorization callback URL` - 填写回调地址,如:"http://dashboard.example.com/oauth2/callback"(不要忘记`/oauth2/callback`)。
|
||||
2. 点击 “Register application”。
|
||||
3. 保存页面中的 Client ID,然后点击 “Generate a new client secret“,创建一个新的 Client Secret,新建的密钥仅会显示一次,**请妥善保存**。
|
||||
|
||||
## 获取 Cloudflare Access 作为 OAuth2 提供方
|
||||
位于中国大陆的用户可能无法直接连接 Github,如您在使用 Github、Gitlab、Gitee 作为管理员账户登录时遇到问题,您可以优先考虑切换 [使用 Cloudflare Access 作为 OAuth2 提供方](/guide/q8.html)作为登录方式
|
||||
## 使用 Cloudflare Access 作为 OAuth2 提供方
|
||||
|
||||
**新建 SaaS-OIDC 应用流程**
|
||||
位于中国大陆的用户可能无法直接连接 Github,如您在使用 Github、Gitlab、Gitee 作为管理员账户登录时遇到问题,可以优先考虑切换 [使用 Cloudflare Access 作为 OAuth2 提供方](/guide/q8.html) 作为登录方式。
|
||||
|
||||
1. 前往 [Zero Trust Dashboard](https://one.dash.cloudflare.com),使用 Cloudflare 账号登录;
|
||||
2. `My Team` -> `Users` -> `<具体用户>` -> 获取 `User ID` 并保存;
|
||||
3. `Access` -> `Application` -> `Add an Application`;
|
||||
4. 选择 `SaaS`,在 `Application` 中输入自定义的应用名称(例如 nezha),选择 `OIDC` 后点击 `Add application`;
|
||||
5. `Scopes` 选择 `openid`, `email`, `profile`, `groups`;
|
||||
6. `Redirect URLs` 填写你的 callback 地址,例如 `https://dashboard.example.com/oauth2/callback`;
|
||||
7. 保存 `Client ID`、`Client Secret`、`Issuer` 地址中协议与域名的部分,例如 `https://xxxxx.cloudflareaccess.com`
|
||||
### 新建 SaaS-OIDC 应用流程
|
||||
|
||||
**如使用此方式,安装 Dashboard 完成后,需要修改配置文件 `/opt/nezha/dashboard/data/config.yaml`,将 `Endpoint` 配置修改为之前保存的`Issuer`地址,例如 `https://xxxxx.cloudflareaccess.com`,保存后需重启 Dashboard**
|
||||
<br/>
|
||||
1. 前往 [Zero Trust Dashboard](https://one.dash.cloudflare.com),使用 Cloudflare 账号登录。
|
||||
2. `My Team` -> `Users` -> `<具体用户>` -> 获取 `User ID` 并保存。
|
||||
3. `Access` -> `Application` -> `Add an Application`。
|
||||
4. 选择 `SaaS`,在 `Application` 中输入自定义的应用名称(例如 nezha),选择 `OIDC` 后点击 `Add application`。
|
||||
5. `Scopes` 选择 `openid`, `email`, `profile`, `groups`。
|
||||
6. `Redirect URLs` 填写你的 callback 地址,例如 `https://dashboard.example.com/oauth2/callback`。
|
||||
7. 保存 `Client ID`、`Client Secret`、`Issuer` 地址中协议与域名的部分,例如 `https://xxxxx.cloudflareaccess.com`。
|
||||
|
||||
**如使用此方式,安装 Dashboard 完成后,需要修改配置文件 `/opt/nezha/dashboard/data/config.yaml`,将 `Endpoint` 配置修改为之前保存的 `Issuer` 地址,例如 `https://xxxxx.cloudflareaccess.com`,保存后需重启 Dashboard。**
|
||||
|
||||
## 在服务器中安装 Dashboard
|
||||
|
||||
* 在面板服务器中,运行安装脚本:
|
||||
在面板服务器中,运行安装脚本:
|
||||
```bash
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
```
|
||||
如果你的面板服务器位于中国大陆,可以使用镜像:
|
||||
````bash
|
||||
如果你的面板服务器位于中国大陆,可以使用镜像:
|
||||
```bash
|
||||
curl -L https://gitee.com/naibahq/nezha/raw/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo CN=true ./nezha.sh
|
||||
````
|
||||
```
|
||||
|
||||
* 等待 Docker 安装完毕后,分别输入以下值:
|
||||
`OAuth提供商` - github,cloudflare,gitlab,gitee 中选择一个
|
||||
`Client ID` - 之前保存的 Client ID
|
||||
`Client Secret` - 之前保存的 Client Secret
|
||||
`用户名` - OAuth 提供商中的用户名/User ID
|
||||
`站点标题` - 自定义站点标题
|
||||
`访问端口` - 公开访问端口,可自定义,默认 8008
|
||||
`Agent的通信端口` - Agent 与 Dashboard 的通信端口,默认 5555
|
||||
等待 Docker 安装完毕后,分别输入以下值:
|
||||
- `OAuth提供商` - github、cloudflare、gitlab、gitee 中选择一个。
|
||||
- `Client ID` - 之前保存的 Client ID。
|
||||
- `Client Secret` - 之前保存的 Client Secret。
|
||||
- `用户名` - OAuth 提供商中的用户名/User ID。
|
||||
- `站点标题` - 自定义站点标题。
|
||||
- `访问端口` - 公开访问端口,可自定义,默认 8008。
|
||||
- `Agent的通信端口` - Agent 与 Dashboard 的通信端口,默认 5555。
|
||||
|
||||
* 输入完成后,等待拉取镜像
|
||||
安装结束后,如果一切正常,此时你可以访问域名+端口号,如 “http://dashboard.example.com:8008” 来查看面板
|
||||
输入完成后,等待拉取镜像。
|
||||
安装结束后,如果一切正常,此时你可以访问域名+端口号,如 “http://dashboard.example.com:8008” 来查看面板。
|
||||
|
||||
* 将来如果需要再次运行脚本,可以运行:
|
||||
将来如果需要再次运行脚本,可以运行:
|
||||
```bash
|
||||
./nezha.sh
|
||||
```
|
||||
来打开管理脚本
|
||||
<br/>
|
||||
<br/>
|
||||
来打开管理脚本。
|
||||
|
||||
## 配置反向代理
|
||||
|
||||
* 在宝塔面板中新建一个站点,域名填写公开访问域名,如 “http://dashboard.example.com“ ,然后点击“设置”进入站点设置选项,选择“反向代理” - “新建反向代理”
|
||||
在宝塔面板中新建一个站点,域名填写公开访问域名,如 “http://dashboard.example.com“ ,然后点击“设置”进入站点设置选项,选择“反向代理” - “新建反向代理”。
|
||||
|
||||
* 自定义一个代理名称,在下方“目标 URL”中填入 `http://127.0.0.1` 然后点击“保存”
|
||||
自定义一个代理名称,在下方“目标 URL”中填入 `http://127.0.0.1` 然后点击“保存”。
|
||||
|
||||
* 打开刚刚新建的反向代理右边的“配置文件”,将配置文件替换为以下内容:
|
||||
````nginx
|
||||
打开刚刚新建的反向代理右边的“配置文件”,将配置文件替换为以下内容:
|
||||
```nginx
|
||||
#PROXY-START/
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8008;
|
||||
@ -100,50 +97,31 @@ location ~ ^/(ws|terminal/.+)$ {
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
#PROXY-END/
|
||||
````
|
||||
* 点击“保存”
|
||||
现在,你应该可以直接使用域名,如:“http://dashboard.example.com“ 来访问面板了
|
||||
<br/>
|
||||
#### 扩展内容:
|
||||
```
|
||||
点击“保存”。
|
||||
现在,你应该可以直接使用域名,如:“http://dashboard.example.com“ 来访问面板了。
|
||||
|
||||
### 扩展内容:
|
||||
|
||||
* CaddyServer v1(v2 无需特别配置)
|
||||
CaddyServer v1(v2 无需特别配置):
|
||||
|
||||
```
|
||||
proxy /ws http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
proxy /terminal/* http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
```
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
```caddy
|
||||
proxy /ws http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
proxy /terminal/* http://ip:8008 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
```
|
||||
|
||||
## 在宝塔面板中配置 SSL
|
||||
|
||||
首先,先暂时关闭反向代理
|
||||
正如在其他网站中配置 SSL 证书一样,进入站点设置中的 “SSL”,你可以选择自动申请 Let´s Encrypt 证书或手动配置已有的证书
|
||||
完成 SSL 的设置后,你需要回到 https://github.com/settings/developers ,编辑之前创建的验证应用程序,将之前我们填入的 "Homepage URL" 和 "Authorization callback URL" 中的域名全部从`http`改为`https`,如:"https://dashboard.example.com" 和 "https://dashboard.example.com/oauth2/callback" ,**不更改此项可能会导致你无法登录面板后台**
|
||||
首先,先暂时关闭反向代理。
|
||||
正如在其他网站中配置 SSL 证书一样,进入站点设置中的 “SSL”,你可以选择自动申请 Let´s Encrypt 证书或手动配置已有的证书。
|
||||
完成 SSL 的设置后,你需要回到 https://github.com/settings/developers ,编辑之前创建的验证应用程序,将之前我们填入的 "Homepage URL" 和 "Authorization callback URL" 中的域名全部从 `http` 改为 `https`,如:"https://dashboard.example.com" 和 "https://dashboard.example.com/oauth2/callback" ,**不更改此项可能会导致你无法登录面板后台**。
|
||||
|
||||
## 常见问题
|
||||
### 启用 HTTPS 后 /terminal 或 /ws 不能正常连接怎么办?
|
||||
常常是由于证书不完整造成的,请在 agent 运行参数中添加 -d,若 log 中有 x509:certificate signed by unknown authority,更换完整证书则可解决该问题。
|
||||
## 更新 Dashboard
|
||||
|
||||
### 我对面板提供的数据修改/增加功能不满意,我想要自己修改/增加数据怎么办?
|
||||
常见于批量插入 Agent 等需求中,可以直接修改数据库。
|
||||
请注意,数据库中并非什么都可以修改,错误的修改会导致数据混乱无法启动 Dashboard,**请勿随意修改数据库!**
|
||||
::: danger
|
||||
再重复一遍,**请勿随意修改数据库!**
|
||||
:::
|
||||
如需要在数据库中修改数据,请先**停止**面板容器再修改。
|
||||
数据库类型是 sqlite3,位于 `/opt/nezha/dashboard/data/sqlite.db`,修改前请备份
|
||||
|
||||
### Dashboard 会自动更新吗?
|
||||
Agent通常情况下会自动更新,但Dashboard并不会,需要手动更新。
|
||||
|
||||
### 如何更新 Dashboard?
|
||||
运行脚本 `./nezha.sh` ,选择重启面板并更新
|
||||
运行脚本 `./nezha.sh` ,选择重启面板并更新。
|
@ -73,4 +73,22 @@ systemctl status docker
|
||||
## 打开网络监控页显示:server monitor history not found
|
||||
|
||||
出现此错误说明没有在服务页中设置 TCP-Ping 和 ICMP-Ping 类型的监控或者监控数据还未生成。
|
||||
如已经设置完毕,可以等待一段时间后再查看。
|
||||
如已经设置完毕,可以等待一段时间后再查看。
|
||||
|
||||
### 启用 HTTPS 后 /terminal 或 /ws 不能正常连接
|
||||
|
||||
常常是由于证书不完整造成的,请在 agent 运行参数中添加 -d,若 log 中有 `x509:certificate signed by unknown authority`,更换完整证书则可解决该问题。
|
||||
|
||||
### 对面板提供的数据修改/增加功能不满意,想要修改/增加数据
|
||||
|
||||
常见于批量新建 Agent 等需求中,可以直接修改数据库。
|
||||
请注意,数据库中并非什么都可以修改,错误的修改会导致数据混乱无法启动 Dashboard,**请勿随意修改数据库!**
|
||||
::: danger
|
||||
再重复一遍,**请勿随意修改数据库!**
|
||||
:::
|
||||
如需要在数据库中修改数据,请先**停止**面板容器再修改。
|
||||
数据库类型是 sqlite3,位于 `/opt/nezha/dashboard/data/sqlite.db`,修改前请备份。
|
||||
|
||||
### Dashboard 会自动更新吗?
|
||||
|
||||
Agent 通常情况下会自动更新,但 Dashboard 并不会,需要手动更新。
|
Loading…
x
Reference in New Issue
Block a user