笨猫博客

  • 🍟首页
  • 🍘目录
    • 🥝VPS教程
    • 🍾猫玩技术
    • 🍹干货分享
    • 🍏软件分享
    • 🍩一只猫
  • 🍋工具
    • 🌽IP路由追踪
    • 🍐域名Whois查询
    • 🥘域名被墙查询
    • 🍧IP正常检测
    • 🔥IP端口检测
    • 🍆短网址
    • 🐟VIP音乐播放
    • 🍯KMS激活
  • 🍓链接
  • 🍪联系
  • 🍱登录
    • 🥦登录
    • 🍒注册
关注互联网,生活,音乐,乐此不疲的一只笨猫
  1. 首页
  2. 猫玩技术
  3. 正文

如何利用fly.io搭建哪吒探针

2023-02-10 2196点热度 1人点赞 0条评论

1.从github拉取哪吒探针最新源码,进入源码根目录。

2.修改cmd/dashboard/main.go:

import (
"...."
"...."
"os"
"fmt"
"...."
"...."
"...."
)
....
....
func init() {
//新建conf文件
file6, err := os.Create("data/config.yaml")
if err != nil {
fmt.Println(err)
}
data := `debug: false
httpport: 80
grpcport: 7777
oauth2:
type: "github" #Oauth2 登录接入类型,gitee/github
admin: "" #管理员列表,半角逗号隔开
clientid: "" # 在 https://github.com/settings/developers 创建,无需审核 Callback 填 http(s)://域名或IP/oauth2/callback
clientsecret: ""
site:
brand: "名字"
cookiename: "nezha-dashboard" #浏览器 Cookie 字段名,可不改
theme: "default"
`
file6.WriteString(data)
file6.Close()
// 初始化 dao 包
singleton.Init()
singleton.InitConfigFromPath("data/config.yaml")
singleton.InitDBFromPath("data/sqlite.db")
singleton.InitLocalizer()
initSystem()
}
flyctl deploy #填写相关配置信息

3.编辑生成的fly.toml为:

app = "名字"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[env]
[experimental]
allowed_public_ports = []
auto_rollback = true
[mounts]
destination = "/dashboard/data"
source = "卷名,随便起,下面用的到"
[[services]]
http_checks = []
internal_port = 80
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
[[services]]
http_checks = []
internal_port = 7777
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
port = 7777
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"

4.为了数据持久化,创建一个卷存放数据:

fly volumes create 卷名 --region hkg --size 1

5.启动:

fly deploy --no-cache --remote-only

6.等待创建完毕就大功告成了!

demo:https://mynezhatz.fly.dev/

标签: 哪吒探针
最后更新:2023-02-06

笨猫

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

最新 热点 随机
最新 热点 随机
WIN10系统彻底永久关闭自动更新 WinRAR 商业版下载安装和白嫖指南 Certbot申请谷歌免费SSL证书 宝塔面板卸载全解析:命令与脚本两种方式详解 SSL证书密钥类型选择RSA还是ECC算法?对网站的影响及建议 万能 一键dd windows 脚本, 含 win10/win11/server2025官方最精简版,一键激活+VC运行库
煎饼大佬的一键DD/重装脚本DD一个轻量的Alpine+Linux+发行版+更轻+更快+更安全LibreTV - 免费在线视频搜索与观看平台万能 一键dd windows 脚本, 含 win10/win11/server2025官方最精简版,一键激活+VC运行库SSL证书密钥类型选择RSA还是ECC算法?对网站的影响及建议宝塔面板卸载全解析:命令与脚本两种方式详解
wordpress修改之友情链接页面 欢乐颂2泄漏版43-55全集分享 机卡分离的中国电信版 iPhone 4S PixPin :不止截图的截图工具 100多个Web2.0在线生成器 3G时代,选择合适自己的3G服务及运营商。
最近评论
龙笑天 发布于 3 周前(05月25日) 一直用的萌咖的路过 :smile:
C 发布于 1 个月前(05月04日) 有个更省心的路子,上传到 catbox.moe,然后用 i0.wp.com 做加速(也支持heif格...
薯条 发布于 3 个月前(03月21日) 这个博客18年了吗,好久了哎
Q 发布于 3 个月前(03月19日) 您好: 我的一个WORDPRESS站点,安装了 wp telegram插件,我在配置了Bot ...
喂 发布于 3 个月前(03月08日) 热帖ggww
标签
elliptictrue100.10.02
BLOG ChatGPT Chrome CloudFlare DirectAdmin github Godaddy google kloxo Linux OneDrive OneIndex PHP QQ shadowsocks SNS ssh Typecho VPS web2.0 whmcs Windows wordpress 一键脚本 下载 免费 博客 图文教程 图标 图片 域名 头像 奥运 宝塔面板 插件 教程 日记 有趣 浏览器 游戏 猫 生活 电影 百度 网站 视频 设计 软件 阿里云盘 音乐
好友
  • glzjin's blog glzjin's blog
  • ZAERA博客
  • 冰沫记
  • 奇它博客
  • 猫腻‘s Blog
  • 猫饭
  • 肥宅之家
  • 萌博
  • 野路子程序员

COPYRIGHT © 2022 笨猫博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang