Commit Graph

263 Commits

Author SHA1 Message Date
naiba
58cc8aa5df Merge branch 'dev' of github.com:naiba/nezha-v1 into dev 2024-11-22 23:57:48 +08:00
naiba
17b02640a9 feat: waf 🤡 2024-11-22 23:57:25 +08:00
UUBulb
fc98c0919f
report geoip separately, fix server creation & deletion bugs (#14)
* new geoip method

* report geoip separately, fix server creation & deletion bugs

* fix struct tag

* fix write name

* remove deleteion list

* remove rpc realip header

* Revert "remove rpc realip header"

This reverts commit 8a5f86cf2d7df87f28cfa2a3b3430f449dd6ed73.
2024-11-22 22:40:43 +08:00
naiba
d699d0ee87 feat: grpc / web get real ip 2024-11-22 00:19:36 +08:00
UUBulb
9905390ba6
add force update server api (#13) 2024-11-20 21:36:21 +08:00
UUBulb
f6ecd26607
fix alert rule api (#12) 2024-11-20 13:44:15 +08:00
UUBulb
a1bac6e525
remove id field in every form struct, fix cron & ddns db (#11) 2024-11-19 23:34:56 +08:00
UUBulb
3efbf9cce1
disable soft deletion in group api (#10)
* disable soft deletion in group api

* remove DeleteAt

* remove DeleteAt service
2024-11-19 21:41:21 +08:00
UUBulb
8eec79d54f fix service tags (#8) 2024-11-17 00:40:40 +08:00
UUBulb
288e1b75e9
fix struct tags (#7) 2024-11-16 20:57:03 +08:00
UUBulb
8640cbbf42
fix: add json tag for service response (#6) 2024-11-16 09:08:18 +08:00
uubulb
d7012e36bf set c.Language to zh_CN if not specified 2024-11-01 14:36:14 +08:00
uubulb
ca997cc994 add zh_TW locale, rename ssl to tls 2024-11-01 14:32:55 +08:00
uubulb
5114fc2854 feat: add i18n support 2024-11-01 05:07:04 +08:00
naiba
45fcbd029f format: json marshal 2024-10-29 10:21:25 +08:00
naiba
1e3c6b4a66 fix: migration 2024-10-28 14:42:36 +08:00
UUBulb
ff0ff9a9ee
add "network page" api (#460)
* add network api

* a minor change

* only show service name if unauthorized

* update

* 除了 load/初始化 避免在 singleton 进行查询等操作

---------

Co-authored-by: naiba <hi@nai.ba>
2024-10-27 14:43:37 +08:00
UUBulb
b4edb4cc95
add setting api (#461) 2024-10-27 13:10:07 +08:00
UUBulb
68d7e16773
add cron, nat api & refactor alert rule (#459)
* add cron api & refactor alert rule

* add nat api

* fix swagger

* remove unnecessary steps
2024-10-26 23:57:47 +08:00
UUBulb
ebc4fad9bc
add alert api (#458) 2024-10-26 08:16:57 +08:00
UUBulb
d086e98711
add fm api (#456) 2024-10-25 09:09:08 +08:00
naiba
eae12d8df2 refactor: rename monitor -> service 2024-10-25 00:13:45 +08:00
UUBulb
31520debb2
update grpc-go & protobuf definition (#455) 2024-10-24 20:41:47 +08:00
naiba
6b650169df 🚀 monitor api 2024-10-23 23:06:11 +08:00
UUBulb
61e755d2b9
implement notification group (#450)
* implement notification group

* some fixes

* fix sql

* add listNotification

* retrieve notification from map

* create notification_group_notification if non-exist

* NotificationIDToGroup -> NotificationIDToGroups

* clean
2024-10-23 21:55:12 +08:00
naiba
c4011934f7 fix agent connect 2024-10-22 23:44:50 +08:00
naiba
f99edfd7bd feat: terminal api 2024-10-22 22:01:01 +08:00
naiba
387da11f1b feat: create user, read users, batch delete users 2024-10-22 21:19:30 +08:00
UUBulb
15585ef12e
ddns: add listProviders api (#446)
* ddns: add listProviders api

* fix swagger
2024-10-22 00:04:17 +08:00
naiba
9c08ebe956 feat: server group api 2024-10-21 23:00:51 +08:00
UUBulb
aa0d570b2b
dev: add ddns create, edit and batch delete api (#444) 2024-10-21 14:30:50 +08:00
naiba
aa20c97312 refactor agent auth & server api 2024-10-20 23:23:04 +08:00
naiba
53f1abb7c8 refactor: login & refresh token 2024-10-20 14:05:43 +08:00
naiba
606e10ca0a refactor: remove pages, combine grpc http port 2024-10-20 11:47:45 +08:00
naiba
4fc0aad7a0 model redesign 2024-10-20 00:32:55 +08:00
naiba
843ecdaa33 init jwt 2024-10-20 00:09:16 +08:00
naiba
9e6bbd3386 🎉 init swaggo 2024-10-19 23:14:53 +08:00
UUBulb
aa81fc02ab
fix: add custom theme key (#440) 2024-10-19 11:59:31 +08:00
UUBulb
f6531a52bd
ddns: remove ipv6 nameservers, support custom nameservers (#439) 2024-10-18 22:06:01 +08:00
UUBulb
be7b6e9c5e
fix(ddns): add missing field WebhookRequestType (#436)
* fix(ddns): add missing field WebhookRequestType

* add missing placeholders
2024-10-17 23:35:28 +08:00
UUBulb
a503f0cf40
ddns: store configuation in database (#435)
* ddns: store configuation in database

Co-authored-by: nap0o <144927971+nap0o@users.noreply.github.com>

* feat: split domain with soa lookup

* switch to libdns interface

* ddns: add unit test

* ddns: skip TestSplitDomainSOA on ci

network is not steady

* fix error handling

* fix error handling

---------

Co-authored-by: nap0o <144927971+nap0o@users.noreply.github.com>
2024-10-17 21:03:03 +08:00
UUBulb
55f5c89c1c
feat: description file for custom theme; use gjson (#433)
* feat: description file for custom theme; use gjson

* fix gosec

* remove outdated stuff
2024-10-10 00:08:16 +08:00
naiba
106d58575b 增加透传给前端的自定义字段方便前端扩展功能 2024-09-28 00:16:54 +08:00
UUBulb
eb6dd2855e
refactor: ddns (#414)
* refactor ddns

* update webhook
2024-08-24 11:11:06 +08:00
UUBulb
47f8447a22
feat: framed fm for webshell (#411)
* feat: framed fm for webshell

* 1MB buffer
2024-08-20 22:25:29 +08:00
naiba
daab64d232 feat: 管理后台自定义代码 2024-08-14 00:24:17 +08:00
hiDandelion
711d162a46
Add replacing fields to notification content in notification.go (#408) 2024-08-13 13:51:19 +08:00
naiba
6abc0fce51 fix: 流量统计异常 2024-08-12 10:06:55 +08:00
naiba
b1d77a1d27 improve: 优化可能造成流量统计异常的情况 2024-08-11 10:35:19 +08:00
UUBulb
6b05a21641
ws: ignore all DDNS fields (#406) 2024-08-09 21:47:29 +08:00
naiba
6a70e67ef9 feat: 在面板重启时通知agent更新信息 2024-08-02 19:41:39 +08:00
UUBulb
f95191c8af
fix: concurrent write to single WebSocket connection (#392) 2024-07-17 10:06:23 +08:00
naiba
67b788a969 内置HTTP内网穿透 2024-07-14 19:41:50 +08:00
naiba
1c91fcffac feat: 去除 webTerminal 的 websocket 依赖 2024-07-14 12:47:36 +08:00
Tao Chen
e1513203b4
添加OIDC支持 (#387)
* add general OIDC

* use "github.com/coreos/go-oidc/v3/oidc" to simplify oidc config

* fix: check if https by X-Forwarded-Proto

* recovery config.yaml
2024-07-13 12:51:59 +08:00
UUBulb
0501e120f6
fix: timestamp conversion (#383) 2024-07-04 14:32:19 +08:00
UUBulb
cfa425bb33
feat: notifications support for GPU & Temperature (#381) 2024-07-03 12:34:45 +08:00
UUBulb
cf9bbb5ff4
feat: Add GPU inspection support (#373) 2024-06-23 10:27:33 +08:00
UUBulb
2aabe1bd61
chore: fix some typos (#370) 2024-06-16 18:04:27 +08:00
Leon
e0e2b8c3c2
Add support for sensor temperature in host state (#359)
* feat: Add support for sensor temperature in host state

* chore: Update file permissions for saving config data
2024-06-01 19:11:48 +08:00
Akkia
25e7f8a912
支持cloudflare access OIDC认证 (#354) 2024-05-03 08:47:53 +08:00
UUBulb
5c7652f047
Add DDNS Profiles, use publicsuffixlist domain parser (#350)
* Add DDNS Profiles, use publicsuffixlist domain parser

* Add Tencent Cloud DNS Provider

* Restore validate DDNS provider function

* chore: fmt & upgrade dependencies
2024-04-27 13:36:36 +08:00
UUBulb
f647a5f8e6
ddns: Add ability to update IPv4 or IPv6 only (#342)
* ddns: Add ability to resolve IPv4 or IPv6 only

* Fix bugs

* cdn cache
2024-03-30 11:00:55 +08:00
naiba
7d85c4c4a5 Update dependencies and fix test assertions 2024-03-23 13:00:47 +08:00
naiba
da6a3463ed 后台关闭切换主题功能 2024-02-27 21:05:39 +08:00
naiba
99ac12c9fd 前端切换模板 2024-02-24 22:28:07 +08:00
Darc Z
3b5ee464a7
Add DDNS support (#324)
* feat: add ddns updater framework

Note: no functionality implemented yet

* feat: add webhook ddns provider

* feat: update dashboard template

* fix: check nil and cron task string

* fix: webhook string formated with unexcepted param

* fix: webhook header split error

* feat: cloudflare ddns provider

* refract: move ddns update trigger into ReportSystemInfo

* lang: update other languages text

* fix: clear codes and logics

* fix: move update ddns to goroutine to avoid blocking

* fix: clear unused codes

* fix: update timestamp to prevent cache
2024-02-24 21:10:27 +08:00
xykt
dbfea9a00b
对历史延迟图表进行了相关修复/美化工作 (#321)
* Update network.html

修复以下问题:
- 延迟默认最高300ms,超过后默认抹平
- 曲线上有很多ping值为0的无效散点,导致毛刺很多,干扰效果
- 图标的y轴比例失调,上方大片留白,大大降低了有效显示区域
- 默认只显示最近不到半小时左右的延迟表现,想看全天需要拖动,影响效果
- 曲线不显示极大极小值,不够直观

* Update config.go

修复了以下问题:
- 延迟默认最高300ms,超过后默认抹平
- 曲线上有很多ping值为0的无效散点,导致毛刺很多,干扰效果
- 图标的y轴比例失调,上方大片留白,大大降低了有效显示区域
- 默认只显示最近不到半小时左右的延迟表现,想看全天需要拖动,影响效果
- 曲线不显示极大极小值,不够直观
2024-02-19 13:52:43 +08:00
Ko no dio
7d38634933
feat: add index on monitor history (#320) 2024-02-18 20:00:36 +08:00
Ko no dio
626613441d
fix: add toggle to service (#317)
* fix: short nework word

* fix: add toggle on service

* fix: delete console log update main.js version

---------

Co-authored-by: LvGJ <lvgj1998@gmail.com>
2024-02-13 23:09:40 +08:00
Ko no dio
e8b8e59bd7
feat: add network monitor hitory (#316) · 三网ping
* feat: add network monitor hitory

* fix: revert proto change and add indexStore

* fix: update monitor delete unuse monitor history

* fix: delete unuse monitor type

---------

Co-authored-by: LvGJ <lvgj1998@gmail.com>
2024-02-12 14:16:04 +08:00
Mmx
927bf13ce4
fix: field name "VerifySSL" to "SkipVerifySSL" in Transport config (#305) 2023-12-06 09:35:38 +08:00
Mmx
1dcd899591
Fix Coroutine Leaks and Proxy Handling in http.Client (#304)
* fix: builtin variable conflict

* feat: add pkg/utils/http HttpClientSkipTlsVerify HttpClient

* fix: realtime create http Transport

* fix: http keepalive connection may not reusable

* feat: allow http request use proxy from environment
2023-12-05 23:22:25 +08:00
unclezs
470fa69ad9
feat: add server-status theme (#295)
*  feat: add server-status theme

* add `ServerStatus` theme to README

---------

Co-authored-by: naiba <hi@nai.ba>
2023-11-07 13:46:28 +08:00
naiba
a2e34bfc49 fix gosec (3 2023-10-21 22:21:21 +08:00
naiba
68f10e4fc7 fix gosec 2023-10-21 22:11:55 +08:00
naiba
014abbc41e fix gosec 2023-10-21 18:13:38 +08:00
naiba
93bcf833fd v0.15.2 消息模板新增 #DATETIME# 占位符 2023-09-02 00:06:40 +08:00
Akkia
e5704157e3
服务监控支持触发任务执行 2023-04-15 19:04:38 +08:00
naiba
61a14d204b dash: v0.14.12 new theme AngelKanade 2023-04-09 00:28:21 +08:00
naiba
ff8bf16171 fix gosec G307 2023-02-12 21:10:34 +08:00
rootmelo92118
aff4b093f6
Update config.go 2023-02-03 13:12:14 +08:00
naiba
8ae885874b 🔒️ more secure token generation 2022-12-16 23:34:14 +08:00
naiba
51655a09a1 gorm: CreatedAt index 2022-10-24 04:12:51 +00:00
owen
011fc2340a fix: 更新导致创建日期归零 2022-10-23 23:53:24 +08:00
naiba
1bb99494e3 🐛 fix service stats 2022-10-12 23:06:25 +08:00
ysicing
b4a5dd550e feat(oauth2): add gitea oauth2 support
add gitea oauth2 support

Signed-off-by: ysicing <i@ysicing.me>
2022-10-12 19:34:15 +08:00
naiba
d1f3c47cee 🚀 dashboard v0.14.4 hide the server from guests 2022-09-30 22:40:56 +08:00
naiba
c60ebd1bae 服务延迟报警 [no ci] 2022-09-17 10:30:32 +08:00
naiba
1561ccb2fb ⬆️ upgrade dependencies 2022-09-14 22:26:14 +08:00
naiba
a5ddafbd8b rename CronCoverSelf to CronCoverAlertTrigger 2022-09-14 22:14:47 +08:00
Akkia
13abf2af13
为新增字段提供默认值 2022-09-14 12:16:24 +08:00
Akkia
13d1be59b6
feat: 报警规则支持绑定触发任务 2022-09-14 11:14:23 +08:00
Akkia
7228f334a5
添加触发任务类型 2022-09-13 06:14:47 +08:00
Akkia
32d15e116e
feat: 触发报警后的通知支持仅发送一次 2022-09-13 04:01:08 +08:00
naiba
2ab7a5fdd8 custon dashboard template [no ci] 2022-06-03 09:45:11 +08:00
naiba
e5c507f4e8 dashboard v0.13.20 Login with Gitlab、Jihulab 2022-05-26 20:00:20 +08:00
naiba
ddb05a5aa0 🚀 dashboard v0.13.16 自定义外部主题 2022-05-19 09:46:11 +08:00
Akkia
914d7cbbae
add: API Token相关的前端页面 2022-05-18 20:52:18 +08:00
Akkia
990394bf46
feat: Token生成|存储|验证 2022-05-18 10:10:35 +08:00