Commit Graph
51 Commits
Author SHA1 Message Date
9ec6164f58 fix(security): harden server and service deletion lifecycle (#1220)
* test: TDD regression tests for GHSA-jx78-55p5-rwv5 stream quota enforcement

* Apply remaining changes

* fix: update action SHA allowlist and test assertions to match dependabot bump

* fix: close GHSA-jx78-55p5-rwv5 incomplete fix of GHSA-qjpp-gffx-2wm9

Finding 1 (Moderate): nil-guard reporterServer in delayCheck and notifyCheck.
ServerShared has its own lock independent of serviceResponseDataStoreLock, so
m := ServerShared.GetList() taken inside the worker can return a nil entry for
the reporter if the server was concurrently deleted. Previously this caused an
unrecovered SIGSEGV in the worker goroutine (and in the gRPC layer with no
recovery interceptor), taking down the whole instance.

Finding 2 (Low): nil-guard ss.services[id] in ServiceSentinel.Delete().
A caller-supplied id that is absent from the registry caused
ss.services[id].CronJobID to panic, aborting the Delete loop and leaving every
subsequent valid id as a zombie service (DB row deleted, in-memory entry kept,
cron probe still running).

Regression tests added for both findings following the existing
servicesentinel_lifecycle_test.go patterns.

* Apply remaining changes

* chore: replace commit hashes with version tags in test.yml

* fix(server): serialize authoritative lifecycle changes

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix(service): bind reports to reporter lifecycle

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix(rpc): reject results from stale task streams

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix(agentcompat): allow version-tagged actions

* fix(agentcompat): allow literal checkout refs

* refactor(agentcompat): remove SHA resolver policy

* test(agentcompat): remove resolver SHA fixtures

* test(agentcompat): remove mutable ref fixtures

* test(agentcompat): use tagged actions in secure fixtures

* test(agentcompat): update credential fixtures for tags

* test(agentcompat): update reusable action fixtures

* test(agentcompat): update artifact redaction fixtures

* test(agentcompat): finish artifact fixture tag migration

* test(agentcompat): update workflow validation fixtures

* test(agentcompat): update dependency workflow fixture

* ci(agentcompat): stop pinning cross-repository revisions

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: naiba <hi@nai.ba>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-01 15:45:20 +08:00
naibaandnaiba/CloudCode c893aa5786 fix(service): serialize reports with service lifecycle
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-07-21 13:11:05 +00:00
hamster1963 7a61da098b fix(service): filter service stats based on user permissions 2026-06-20 00:45:53 +08:00
naiba c3c361ad66 fix(service): flip CopyStats public filter to HideForGuest
Completes the EnableShowInService->HideForGuest rename; the public stats
filter was missed in the previous commit, leaving service/singleton
referencing the removed field and breaking the build.
2026-06-02 03:32:10 +00:00
naiba 6b88cdb012 feat: server transfer rotation 2026-05-25 10:17:34 +00:00
naibaandnaiba/CloudCode 8d21062c3b fix(rpc): authorize agent task results
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-21 02:02:02 +00:00
naibaandnaiba/CloudCode e38a0ef469 fix(cron): restrict task delivery by owner
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
3d0c9b963c 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 5c27259439 chore: cleanup some code (#1069)
* chore

* modernize loop

* ddns: simpify Provider struct
2025-04-26 18:28:21 +08:00
naiba e74706fd31 refactor: clean code 2025-03-31 19:52:23 +08:00
UUBulb a26337acb2 fix service (#1015) 2025-03-02 16:36:57 +08:00
naiba c3a0689c5d fix: reset ping value correctly after reaching average count in ServiceSentinel 2025-03-02 16:10:33 +08:00
naiba 589191a0bb fix: reset ping value after reaching average count in ServiceSentinel 2025-03-02 15:42:12 +08:00
UUBulb af55fae652 improve check for offline rules (#1013)
* improve check for offline rules

* bug fixes

* update dependencies

* fix error wrap

* fix offline check

* improve readability
2025-03-02 15:37:21 +08:00
UUBulb 54ca4ca0b6 fix: ConfigCache not copied affer server updates (#1008)
* fix: ConfigCache not copied affer server updates

* fix: server list not updated when dispatching tasks

* improve

* reuse logic
2025-02-26 20:48:54 +08:00
UUBulb ea068d4db1 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 ff4fd31ec4 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
UUBulb dc0132c9aa 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
UUBulb 3e3994d3c9 chore: use cmp (#568) 2024-12-08 20:21:35 +08:00
UUBulb 4ddad9ea00 fix service api (#556)
* fix service api

* update ServiceResponseItem

* fix: ddns lock
2024-12-05 21:00:02 +08:00
naiba a7e4fe0909 rename repo 2024-11-28 19:38:54 +08:00
uubulb 96bec45855 add zh_TW locale, rename ssl to tls 2024-11-01 14:32:55 +08:00
uubulb d56224a118 feat: add i18n support 2024-11-01 05:07:04 +08:00
UUBulbandnaiba 029457831d 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 70b914d535 add setting api (#461) 2024-10-27 13:10:07 +08:00
naiba 868c242eb3 refactor: rename monitor -> service 2024-10-25 00:13:45 +08:00
naiba 69799c28d4 🚀 monitor api 2024-10-23 23:06:11 +08:00
UUBulb 28b606ef7b 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 542f06551e refactor: remove pages, combine grpc http port 2024-10-20 11:47:45 +08:00
naiba 8849cb51e6 init jwt 2024-10-20 00:09:16 +08:00
UUBulb c9d33db20b chore: fix a typo (#355) 2024-05-05 20:12:54 +08:00
lvyaoting 5295c4ab56 chore: fix some comments (#345) 2024-04-08 22:30:39 +08:00
Ko no dioandLvGJ 7ab36d4e11 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
Akkia 09a7d77bea 不忽略首次请求就出错的情况 2023-06-19 05:13:05 +08:00
Akkia e6d46f11fe 始终发送ip变更通知+优化ssl与延迟通知静音缓存规则 2023-06-19 05:02:20 +08:00
Akkia 91edca2202 服务状态变更时清除静音缓存 2023-06-18 04:02:41 +08:00
Akkia a0d1175c56 服务监控支持触发任务执行 2023-04-15 19:04:38 +08:00
naiba e730f725da 🐛 fix panic when update the time zone 2022-12-29 00:41:11 +08:00
naiba 946ce73096 🚀 dashboard v0.14.6 with installer v0.11.0 2022-10-31 21:54:37 +08:00
naiba 360d30681e 🐛 fix service stats 2022-10-12 23:06:25 +08:00
naiba 0bcbf34403 服务延迟报警 [no ci] 2022-09-17 10:30:32 +08:00
naiba 4224ee99b2 🔖 dashboard v0.13.9 ignore monitor unmarshal error 2022-05-02 13:36:49 +08:00
naiba 2b4b60dbf2 ♻️ refactor lock of service data 2022-05-02 10:33:21 +08:00
naiba 2dd93cfce6 fix: service total uptime rate close #191 2022-05-02 00:45:03 +08:00
naiba 43d99981af 💬 update notification text [skip ci] 2022-04-30 19:23:19 +08:00
Akkia f64c7b6301 fix: 修复修改通知方式所在组后 不会移除其原有map映射关系的问题 2022-04-15 23:23:51 +08:00
Akkia a048663c67 fix: 前向兼容性 | for range pointer issue 2022-04-15 20:34:25 +08:00
Akkia a7261b1510 WIP: 补全各模块的通知分组设置 2022-04-15 03:13:53 +08:00
Akkia b648550595 optimize: 移除两处冗余的代码 (初始化后未使用|重复初始化) 2022-04-12 00:01:38 +08:00
Akkia 9776cf6182 添加代码注释+修正一个typo 2022-04-11 22:51:02 +08:00