Commit Graph

128 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
naiba b69eac4310 refactor: clean code 2025-03-31 19:52:23 +08:00
UUBulb 67c129635e update ddns on server update (#1050) 2025-03-31 19:41:04 +08:00
UUBulb ec44dbbd9b fix search by id (#1047)
* fix search by id

* make SearchByID Public
2025-03-27 19:17:00 +08:00
UUBulb fa36a36beb improve transfer record logic (#1033)
* improve transfer record logic

* refactor

* modernize loops

* remove unused type conversions

* update dependencies

* script: keep .gitkeep files

* fix

* remove clear
2025-03-19 22:21:21 +08:00
UUBulb f1e3613daf fix: config fields not generated on first startup (#1016)
* fix: config fields not generated on first startup

* cleanup

* fix reference

* replace yaml module

* remove duplicated fields

* remove yaml.v3 as a direct dependency

* update dependency

* chore
2025-03-03 19:02:25 +08:00
UUBulb 91bef2882a refactor: simplify server & service manipulation (#993)
* refactor: simplify server & service manipulation

* update

* fix

* update for nat, ddns & notification

* chore

* update cron

* update dependencies

* use of function iterators

* update default dns servers
2025-02-21 23:08:12 +08:00
UUBulb 4b1af369e3 small improvements (#958)
* small improvements

* fix: return empty iterator if no json present

* use time.Tick

* changes
2025-01-19 21:22:00 +08:00
naiba 18020939da feat: 绑定 oauth2 2024-12-28 23:50:59 +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 f212144310 feat: add online user count 2024-12-21 10:59:05 +08:00
Moraxyc 8f8a30c02c Refactor: Load UserTemplates from embedded yaml file (#575)
* Refactor: Load UserTemplates from embedded yaml file

* feat: add version field to UserTemplates

* refactor: use shell script to fetch frontends

* chore: add *-dist to .gitignore

* refactor: rename to FrontendTemplates

BREAKING CHANGE: This commit changes the `user_templates` filed
in the communication json between backend and the admin-frontend.

Keep user config.yml `user_template` filed.
2024-12-10 21:57:20 +08:00
naiba 5b5e006b97 feat: 优化 GeoIP 更新逻辑 2024-12-07 11:06:42 +08:00
UUBulb 64dde0215a UserTemplate GitHub -> Repository (#564) 2024-12-06 23:38:20 +08:00
naiba 9b0697491d feat: multi user template 2024-12-06 23:19:28 +08:00
naiba 3cce7ebf01 rename repo 2024-11-28 19:38:54 +08:00
naiba 17b02640a9 feat: waf 🤡 2024-11-22 23:57:25 +08:00
uubulb 5114fc2854 feat: add i18n support 2024-11-01 05:07:04 +08:00
naiba 1e3c6b4a66 fix: migration 2024-10-28 14:42:36 +08:00
naiba eae12d8df2 refactor: rename monitor -> service 2024-10-25 00:13:45 +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
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 b1d77a1d27 improve: 优化可能造成流量统计异常的情况 2024-08-11 10:35:19 +08:00
naiba 67b788a969 内置HTTP内网穿透 2024-07-14 19:41:50 +08:00
UUBulb 0501e120f6 fix: timestamp conversion (#383) 2024-07-04 14:32:19 +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
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
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
naiba dc94259a56 v0.15.13 generate release 2023-11-28 23:01:37 +08:00
naiba 7a774319dd 🚸 Add location flag to server status page 2023-11-26 22:29:55 +08:00
naiba 1c9bec6ef3 💄 improve server-status home table
responsiveness
2023-11-22 12:45:54 +08:00
naiba 56c66402a2 🚸 [v0.15.11] improve translation and serverstats theme 2023-11-21 09:59:14 +08:00
naiba 64a660ddd2 💄 improve server-status theme 2023-11-09 17:31:26 +08:00
naiba ce2e5439f7 💄 优化 server status 主题 2023-11-08 13:17:42 +08:00
naiba b6c2410b41 💄 优化 server-status 主题服务页流量统计 2023-11-07 22:56:59 +08:00
naiba 1c00cc8e3b 💄 优化 server-status 主题 2023-11-07 22:15:13 +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 641b79bd4c fix theme-angel-kanade byte format 2023-10-22 20:12:38 +08:00
naiba ce530705e7 fix theme angel kanade 2023-10-21 18:05:56 +08:00
dependabot[bot] af3bc66c0c Bump golang.org/x/net from 0.14.0 to 0.17.0 (#293)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-12 09:51:31 +08:00
naiba 93bcf833fd v0.15.2 消息模板新增 #DATETIME# 占位符 2023-09-02 00:06:40 +08:00
naiba 45e26f4082 v0.15.1 批量删除服务器 bulk delete the servers 2023-06-14 00:23:47 +08:00
naiba fdb112b971 dash v0.15.0 服务监控触发任务执行
Co-authored-by: AkkiaS7 <68485070+AkkiaS7@users.noreply.github.com>
Co-authored-by: cantoblanco <116849421+cantoblanco@users.noreply.github.com>
2023-04-17 00:09:04 +08:00
naiba a4fd818f02 dash v0.14.13 fix home.html 2023-04-09 11:18:44 +08:00
naiba 61a14d204b dash: v0.14.12 new theme AngelKanade 2023-04-09 00:28:21 +08:00
naiba 2a5827f3ee 🔖 dashboard v0.14.11 2023-02-03 17:38:14 +08:00
naiba 094580cf20 ️ 支持未 root 的 Android 设备 close #270 2023-01-25 16:14:08 +08:00
naiba 49e38148a7 🐛 fix panic when update the time zone 2022-12-29 00:41:11 +08:00
naiba 8ae885874b 🔒️ more secure token generation 2022-12-16 23:34:14 +08:00