惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Palo Alto Networks Blog
AWS News Blog
AWS News Blog
Latest news
Latest news
Microsoft Security Blog
Microsoft Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Vulnerabilities – Threatpost
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
C
CERT Recently Published Vulnerability Notes
T
Tenable Blog
雷峰网
雷峰网
K
Kaspersky official blog
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
A
Arctic Wolf
Project Zero
Project Zero
F
Fortinet All Blogs
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
SegmentFault 最新的问题
P
Privacy & Cybersecurity Law Blog
D
DataBreaches.Net
量子位
Cisco Talos Blog
Cisco Talos Blog
博客园 - 【当耐特】
V
Visual Studio Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 叶小钗
I
Intezer
G
GRAHAM CLULEY
Google Online Security Blog
Google Online Security Blog
T
The Blog of Author Tim Ferriss
T
Troy Hunt's Blog
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Hacker News: Ask HN
Hacker News: Ask HN
M
MIT News - Artificial intelligence
N
News | PayPal Newsroom
Cyberwarzone
Cyberwarzone
V
V2EX
腾讯CDC
Webroot Blog
Webroot Blog
MongoDB | Blog
MongoDB | Blog

繁星点点

最新轻量级龙虾部署教程 通过netboot.xyz重装系统 giffgaff卡保号教程 Llinux系统中全新透明代理方案(可代理所有出站流量) tailscale开启子网路由常见的坑 OpenWrt固件编译 解决UFW和Docker的问题 使用PGP的非对称算法加密文件 NSSM工具把任意exe程序注册为Windows后台服务 轻量级简约端口转发rinetd 安卓IDE的安装和使用 IP信息查询网站汇总 热点共享代理教程 SSH使用密钥认证登录详细解释 Debian系统公网IP出口切换指南,适用多IP服务器 Windows系统安装Scoop包管理器 安卓Flutter开发学习笔记 使用手机搭建节点服务端 关于github提交记录泄露真实邮箱的处理办法 anytls协议部署教程 caddy给域名用上ECH加密 通过gitlab流水线自动备份仓库 通过CF-Workers代理访问网站 低配机器使用alpine系统跑docker 端口敲门教程 3x-ui面板通过api管理示例 nmap端口扫描 数据库常用命令 snap和winget包管理器 Git推送GitHub常用命令 😩😩😩学不完,根本学不完😩😩😩 使用CDN后获取访客真实IP 一些用于网络测试的下载测速文件 纯v6网络访问v4站点最简单的方法 服务器配置SSH密钥登录 windows重装系统教程 Github-Actions默认用户变量GITHUB_TOKEN的提权语法 给站点套CFT的一些坑 解决CF反代Docker失效的问题 使用py3快速启动一个文件上传和下载的接口 ios系统最新免拔卡使用tiktok方法 clash手搓配置最全协议示例详解 为IP地址申请免费证书并开启HTTPS 实用网站收藏 纯CSS实现剧透效果 在CloudflareWAF中屏蔽国内浏览器 网络安全之百度URL欺骗漏洞分析和复现 超级强大的ansible批量管理主机运维工具使用教程 收集整理的最新的常用VPS脚本工具 无法注册TG账号和国内号码接收不到验证码详细解决方案 国内环境安装xui面板 免费接码网站合集 完整的网络状态码列表 关于xui面板报错无法监听127.0.0.1:62789的问题 Xboard面板常见问题 项目编译构建文档 ios最新美区ID注册方法 V2board前后端分离 Markdown语法教程 Github加速 Docker镜像加速和离线安装 Liunx配置wrap 代理工具和SSH工具推荐 常用代码记录
Docker部署哪吒监控
2024-11-30 · via 繁星点点

Docker部署哪吒监控

v1版本

docker-compose.yaml配置

services:
  dashboard:
    image: ghcr.io/nezhahq/nezha
    restart: always
    ports:
      - "8008:8008"
    volumes:
      - ./data:/dashboard/data

caddy反代配置

example.com {
    reverse_proxy /proto.NezhaService/* h2c://127.0.0.1:8008
    
    reverse_proxy /* 127.0.0.1:8008
}

⚠️必须修改面板后台Agent对接地址,填example.com:443,并选中使用 TLS 连接

如果套了cf,则网络配置需要开启grpc选项

国内被控机替换脚本地址:https://gitee.com/naibahq/scripts/raw/main/agent/install.sh

后台路径 /dashboard
默认用户名密码 admin admin

重置密码

数据库路径/opt/nezha/dashboard/data/sqlite.db

安装数据库

apt update && apt install sqlite3 -y

先备份数据库

cp /opt/nezha/dashboard/data/sqlite.db /opt/nezha/dashboard/data/sqlite.db.bak

重置用户表

sqlite3 /opt/nezha/dashboard/data/sqlite.db "DELETE FROM users;"

然后重启面板,此时密码会重置为初始密码

配置多oauth2登录

oauth2:
  Gitee:
    clientid: "your id"
    clientsecret: "your secret"
    endpoint:
      authurl: "https://gitee.com/oauth/authorize"
      tokenurl: "https://gitee.com/oauth/token"
    scopes:
      - user_info
    userinfourl: "https://gitee.com/api/v5/user"
    useridpath: "id"
  GitHub:
    clientid: "your id"
    clientsecret: "your secret"
    endpoint:
      authurl: "https://github.com/login/oauth/authorize"
      tokenurl: "https://github.com/login/oauth/access_token"
    userinfourl: "https://api.github.com/user"
    useridpath: "id"
  Cloudflare:
    clientid: "your id"
    clientsecret: "your secret"
    endpoint:
      authurl: "https://XXXX.cloudflareaccess.com/cdn-cgi/access/sso/oidc/XXX/authorization"
      tokenurl: "https://XXX.cloudflareaccess.com/cdn-cgi/access/sso/oidc/XXX/token"
    scopes:
      - openid
      - profile
    userinfourl: "https://XXX.cloudflareaccess.com/cdn-cgi/access/sso/oidc/XXX/userinfo"
    useridpath: "sub"

v0版本

创建相关文件:

cd /home && mkdir -p template data

docker-compose.yml配置

services:
  nezha:
    image: ghcr.io/naiba/nezha-dashboard:v0.20.13
    container_name: nezha
    restart: always
    ports:
      - "8080:80"
      - "5555:5555"
    volumes:
      - ./data:/dashboard/data
      - ./template:/dashboard/resource/template

data目录添加config.yaml配置

debug: false
language: zh-CN
site:
    brand: 服务器监控
    cookiename: nezha-dashboard
    theme: server-status
    dashboardtheme: default
    customcode: ""
    customcodedashboard: ""
    viewpassword: ""
oauth2:
    type: github
    admin: github用户名
    admingroups: ""
    clientid: 验证ID
    clientsecret: 验证密钥
    endpoint: ""
    oidcdisplayname: OIDC
    oidcissuer: ""
    oidclogouturl: ""
    oidcregisterurl: ""
    oidcloginclaim: sub
    oidcgroupclaim: groups
    oidcscopes: openid,profile,email
    oidcautocreate: false
    oidcautologin: false
httpport: 80
grpcport: 5555
grpchost: grpc.example.com # 被控端连接域名(前端不开CDN可去掉这个这里的域名)
proxygrpcport: 0 # 被控端连接域名套CF需改成443
tls: false # 被控端连接域名套CF需改成true
enableplainipinnotification: false
disableswitchtemplateinfrontend: false
enableipchangenotification: false
ipchangenotificationtag: default
cover: 0
ignoredipnotification: ""
location: Asia/Shanghai
ignoredipnotificationserverids: {}
maxtcppingvalue: 1000
avgpingcount: 2
dnsservers: ""

oauth2回调URL示例:

https://example.com/oauth2/callback

caddy配置示例

# 前端域名
example.com {
    encode zstd gzip
    reverse_proxy localhost:8080
}

# 被控端连接域名(前端不开CDN可去掉这个配置)
grpc.example.com {
    reverse_proxy {
        to localhost:5555
        transport http {
            versions h2c 2
        }
    }
}

将面板中复制所得的指令中的sh的raw文件url替换成

https://cdn.jsdelivr.net/gh/sky22333/shell@main/nezha/install.sh

其他参数不变,然后去被控机安装即可。

国内服务器:

bash <(curl -sSL https://blog.52013120.xyz/assets/agent.sh)

官方项目地址