Commit Graph

114 Commits

Author SHA1 Message Date
奶爸 e61772e858 feat(v2.0.0): tsdb (#1162)
* feat: tsdb

* fix(ci): remove --parseGoList=false from swag init to fix dependency resolution

* fix(ci): fix swag init directory and temporary remove s390x support due to cgo issues

* fix(ci): fix swag init output directory to cmd/dashboard/docs

* fix(ci): set GOTOOLCHAIN=auto for gosec

* feat: add system storage maintenance for SQLite and TSDB

* shit

* feat: add s390x support and improve service monitoring

* ci: upgrade goreleaser-cross image to v1.25

* ci: add libzstd-dev:s390x for cross-compilation

* ci: build libzstd for s390x from source

* ci: add libzstd_linux_s390x.go for gozstd linking

* ci: use vendor mode for s390x gozstd build

* ci: clone zstd source for s390x build

* refactor(tsdb): rename MaxDiskUsageGB to MinFreeDiskSpaceGB and optimize queries

- Rename config to accurately reflect VictoriaMetrics behavior: minimum free disk space threshold
- Add QueryServiceHistoryByServerID for batch query optimization
- Fix hasStatus to avoid false status counting when only delay data exists
- Fix service aggregation boundary: use successCount*2 >= count
- Fix serviceID parsing with strconv.ParseUint error handling
- Add TagFiltersCacheSize for better query performance

* feat(api): add server metrics endpoint and simplify service history response

- Add /server/:id/metrics API for querying TSDB server metrics
- Simplify getServiceHistory by removing redundant data conversion
- Change AvgDelay type from float32 to float64
- Remove generated swagger docs (to be regenerated)
- Update TSDB query, writer and tests

* chore: 临时禁用不支持前端

* ci: cache zstd build for s390x to speed up CI

* fix(tsdb): fix race conditions, data correctness and optimize performance

- Fix TOCTOU race between IsClosed() and write/query by holding RLock
- Fix delay=0 excluded from stats by using hasDelay flag instead of value > 0
- Fix fmt.Sscanf -> strconv.ParseUint for server_id parsing with error logging
- Fix buffer unbounded growth by flushing inside lock when over maxSize
- Split makeMetricRow into makeServerMetricRow/makeServiceMetricRow
- Extract InitGlobalSettings() from Open() for VictoriaMetrics globals
- Remove redundant instance/GetInstance/SetInstance singleton
- Add error logging for silently skipped block decode errors
- Optimize WriteBatch* to build all rows in single write call
- Optimize downsample to use linear scan instead of map for sorted data
- Optimize query slice reuse across block iterations

* 服务添加DisplayIndex (#1166)

* 服务添加DisplayIndex

* 根据ai建议修改

---------

Co-authored-by: huYang <306061454@qq.com>

* fix(tsdb): restore SQLite fallback and monthly status reload on restart

- Restore ServiceHistory model and SQLite write fallback when TSDB is disabled
- Reload monthlyStatus (30-day) and serviceStatusToday from TSDB/SQLite on startup
- Add SQLite fallback query for /service/:id/history and /server/:id/service
- Remove breaking GET /service/:id endpoint, keep /service/:id/history only
- Add QueryServiceDailyStats to TSDB for per-day aggregation
- Add tests for monthly status and today stats loading from both TSDB and SQLite
- Migrate ServiceHistory table only when TSDB is disabled

* ci: exclude false-positive gosec rules G117, G703, G704

* feat(api): expose tsdb_enabled in setting response

* ci: restore G115 exclusion accidentally dropped in previous commit

* fix: update version numbers for OfficialAdmin and Official templates

* chore: upgrade frontend

* chore: upgrade frontend

---------

Co-authored-by: 胡说丷刂 <34758853+laosan-xx@users.noreply.github.com>
Co-authored-by: huYang <306061454@qq.com>
2026-02-15 13:13:33 +08:00
UUBulb b6fed87d61 fix: member-created services shouldn't be applied to admin resources (#1113) 2025-08-28 22:37:44 +08:00
naiba bce7fdd547 feat: 批量转移服务器给其他用户 2025-06-16 23:46:36 +08:00
UUBulb 1d2f8d24f6 feat: update to go1.24 & support listening https (#1002)
* feat: support listening https

* refactor

* modernize

* support snake case in config

* more precise control of config fields

* update goreleaser config

* remove kubeyaml

* fix: expose agent_secret

* chore
2025-02-28 22:02:54 +08:00
UUBulb a41f623dd2 feat: batch set server config (#983)
* feat: batch set server config

* run in parallel

* fix route

* fix

* return some information

* fix order
2025-02-04 11:25:49 +08:00
UUBulb 7e8985a599 feat: edit server config online (#980)
* feat: edit server config online

* clean

* refactor

* generate template

* fix deadlocks

* fix
2025-01-31 13:33:53 +08:00
UUBulb a5b7db10e1 feat: option to force authorization for vistor routes (#971) 2025-01-29 19:27:57 +08:00
naiba f6683adb70 feat: implement client-side status code handling 2025-01-05 23:53:04 +08:00
naiba 7cb04d79ee feat: v1.5.2 2025-01-01 01:02:02 +08:00
UUBulb 3c72d6ce64 fix windows ci (#934)
* fix windows ci

* perm

* use custom writer

* remove patches

* fuck codeql
2025-01-01 00:58:57 +08:00
naiba 126773974c Merge branch 'master' of github.com:nezhahq/nezha 2024-12-31 23:58:49 +08:00
naiba 828588eef1 improve: 404 status code 2024-12-31 23:58:44 +08:00
UUBulb 3216ad43fa fix: struct tag (#932)
* fix: struct tag

* fix: struct tag

* fix: strings conversion

* do not write anything after redirection

* fix table

* fix select
2024-12-31 23:09:58 +08:00
UUBulb 553f8e58d4 fix: oauth2 redirect url not consistent (#930)
* fix: oauth2 redirect url not consistent

* only use one redirect uri

* feat: allow to disable password authentication

* generate translation template

* update error

* redirect

* query
2024-12-31 22:29:29 +08:00
naiba 953fa153cc fix: home page 404 2024-12-30 21:25:22 +08:00
quanljh cea4031da3 fix: return 404 when page not found (#927) 2024-12-30 20:43:37 +08:00
naiba 18020939da feat: 绑定 oauth2 2024-12-28 23:50:59 +08:00
UUBulb d50605d668 feat: support id query for "list" apis (#908)
* feat: support id query for "list" apis

* gosec
2024-12-24 23:23:01 +08:00
仓鼠 3c6dc2c87e fix: batch-block online-user request method (#903) 2024-12-22 23:18:08 +08:00
naiba 4af7e83004 feat: list & block online users 2024-12-22 01:08:07 +08:00
UUBulb 653d0cf2e9 feat: user roles (#852)
* [WIP] feat: user roles

* update

* update

* admin handler

* update

* feat: user-specific connection secret

* simplify some logics

* cleanup

* update waf

* update user api error handling

* update waf api

* fix codeql

* update waf table

* fix several problems

* add pagination for waf api

* update permission checks

* switch to runtime check

* 1

* cover?

* some changes
2024-12-22 00:05:41 +08:00
naiba 06738d5d16 feat: enhance template configuration and update README for translation status 2024-12-10 22:27:06 +08:00
naiba 251bc10af9 feat: v1.1 2024-12-07 01:18:34 +08:00
naiba 9b0697491d feat: multi user template 2024-12-06 23:19:28 +08:00
UUBulb 040c8df02e fix service api (#556)
* fix service api

* update ServiceResponseItem

* fix: ddns lock
2024-12-05 21:00:02 +08:00
naiba a0878876b2 fix: windows path issue 2024-11-30 00:02:45 +08:00
naiba d62d0aa11c fix: home page 500 2024-11-29 22:49:17 +08:00
naiba 970c0d0430 feat: embed dist 2024-11-29 21:31:39 +08:00
naiba ab4d896efc Revert "Fix code scanning alert no. 23: Uncontrolled data used in path expression (#486)"
This reverts commit c2b3d19a51.
2024-11-28 20:38:02 +08:00
naiba c2b3d19a51 Fix code scanning alert no. 23: Uncontrolled data used in path expression (#486)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-11-28 20:26:51 +08:00
naiba 3cce7ebf01 rename repo 2024-11-28 19:38:54 +08:00
UUBulb e90941f52b send country code in ws, update profile api (#22)
* send country code in ws

* make ddns_profiles optional field

* update profile api
2024-11-26 21:30:56 +08:00
UUBulb 885330e948 update profile api (#16)
* update profile api

* rename

* fix realip assertion

* add waf api
2024-11-23 16:22:22 +08:00
naiba 17b02640a9 feat: waf 🤡 2024-11-22 23:57:25 +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
naiba e15dddae73 fix: update refresh token endpoint to use hyphen 2024-11-08 23:57:15 +08:00
naiba 6322c22b49 feat: profile api 2024-11-03 23:28:10 +08:00
uubulb 5114fc2854 feat: add i18n support 2024-11-01 05:07:04 +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 380973a200 prevent writing response to websocket connections (#457) 2024-10-25 21:45:05 +08:00
UUBulb d086e98711 add fm api (#456) 2024-10-25 09:09:08 +08:00
naiba fa9d02396b fix: swagger doc 2024-10-25 00:19:44 +08:00
naiba eae12d8df2 refactor: rename monitor -> service 2024-10-25 00:13:45 +08:00
naiba 5cf8b8024c feat: dev docker 2024-10-24 21:33:36 +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