Commit Graph

47 Commits

Author SHA1 Message Date
naiba 9acffc11f6 chore: bump Go to 1.26, update dependencies and frontend templates
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-03-20 11:23:03 +00:00
奶爸 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
naiba 540c1cb1e7 feat: binding ip with session
🛡️staying safe even your frontend was hacked
2025-10-09 21:36:59 +08:00
UUBulb 655d034f79 ci: use go1.24 (#1012) 2025-02-28 22:19:57 +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 828588eef1 improve: 404 status code 2024-12-31 23:58:44 +08:00
naiba b78c92b2df fix: swago 2024-11-29 21:55:29 +08:00
naiba 6ae78b13a2 Revert "ci: comment out costly things (#4)"
This reverts commit 3168055948.
2024-11-28 19:43:50 +08:00
UUBulb 3168055948 ci: comment out costly things (#4) 2024-11-10 07:09:38 +08:00
naiba 0b6d0977ac feat: update admin-dist 2024-10-24 22:35:26 +08:00
naiba 7e6864fa8c fix ci 2024-10-21 23:14:31 +08:00
naiba ae4fd35a01 fix ci 2024-10-21 23:04:38 +08:00
naiba 9c08ebe956 feat: server group api 2024-10-21 23:00:51 +08:00
naiba aa20c97312 refactor agent auth & server api 2024-10-20 23:23:04 +08:00
naiba d3f907b5c3 fix ci 2024-10-20 14:09:29 +08:00
naiba 6cd243ea40 fix ci 2024-10-19 23:17:14 +08:00
naiba 9e6bbd3386 🎉 init swaggo 2024-10-19 23:14:53 +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
naiba 2b40040ec5 chore: ignore gosec errors 2024-10-02 10:10:06 +08:00
UUBulb 23751440c6 [ci][docker]: use matrix to reduce build time & change base image to busybox (#417)
* ci: use matrix to reduce build time

* docker: change base image to busybox

* reuse workflows

* only download ipinfo db on tag pushes

* goreleaser
2024-09-02 22:13:13 +08:00
naiba ada344cd6b chore: go 1.21.x 2024-07-13 13:11:40 +08:00
naiba 9d6682fd58 fix: build 2024-07-13 13:00:48 +08:00
UUBulb a9da084711 ci: using time/tzdata package to provide zoneinfo (#365) 2024-06-14 10:24:58 +08:00
naiba d9a7002906 Update Go version to 1.20.x in GitHub workflows 2024-04-06 14:25:29 +08:00
naiba eb3e2883e2 update ci 2024-04-06 11:51:08 +08:00
naiba c3d1eec6bf Update GitHub Actions workflow to include specific paths 2023-11-30 09:52:24 +08:00
naiba a823da1f29 📦 static link 2023-11-29 15:45:32 +08:00
naiba 0e91a00076 Update release and test workflows 2023-11-28 23:18:29 +08:00
naiba b8eeb225a1 sync to jihulab 2023-10-26 23:29:20 +08:00
naiba a2e34bfc49 fix gosec (3 2023-10-21 22:21:21 +08:00
naiba bf7056fd15 update workflows 2023-10-21 18:27:25 +08:00
naiba 49878d0ce9 clean: remove agent 💩 2023-05-11 00:13:11 +08:00
naiba 65afad89eb [agent] splitting the agent into separate repositories 2023-05-11 00:08:54 +08:00
naiba 90f872c8ae update contributors avatar size 2023-05-08 12:48:50 +08:00
naiba 8ae885874b 🔒️ more secure token generation 2022-12-16 23:34:14 +08:00
naiba 7977846acd ⬆️ Upgrade dependencies 2022-08-13 11:40:10 +08:00
naiba 2ed1e08707 fix code scan alerts 2022-04-18 20:45:07 +08:00
naiba 888f2efa60 💩 优化 CountryCode 获取 2022-03-31 22:59:07 +08:00
naiba 379da07551 ⬆️ Upgrade to Go v1.18.0 2022-03-22 18:46:18 +08:00
naiba 4b36223b4b 💚 fix gosec 2021-11-04 13:02:07 +08:00
naiba bcc42dea79 💚 更新 Go 版本 2021-11-04 12:55:12 +08:00
naiba e80f12e210 👷 goreleaser config update 2021-11-03 21:40:22 +08:00
naiba bb55c3354a update ci 2021-09-04 12:51:02 +08:00
naiba e40026f6cc gosec 2021-09-04 12:42:51 +08:00
naiba e822af297f 👷 2021-09-04 12:19:59 +08:00
naiba 3f76e700d2 👷 [skip ci] gosec code scanner 2021-09-04 12:18:12 +08:00