Commit Graph
50 Commits
Author SHA1 Message Date
naibaandnaiba/CloudCode 8b47ff141f feat(agentcompat): add shared runtime contracts
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-07-20 04:25:03 +00:00
naibaandcloudcode e8dabf5bc6 feat(auth): add PAT auth, scoped REST/MCP access, CSRF, and tenant isolation
Introduce Personal Access Tokens (nzp_*) as a stateless auth path alongside
JWT, gated per-endpoint by a scope middleware (nezha:{resource}:{verb}) with
fail-closed empty-scope defaults and a server-id whitelist. Self-management
endpoints (profile, api-tokens, oauth2 bind, refresh-token) explicitly reject
PATs to block privilege-escalation chains. A revoke registry tears down active
long-lived connections (terminal, fm, ws, transfer, mcp) the moment a PAT is
deleted, with a tombstone closing the revoke->register race.

Add an MCP endpoint that proxies tool calls (exec, fs read/write/delete,
transfer) to agents over gRPC, guarded by origin/DNS-rebinding checks, a
per-token rate limiter, audit logging, and a kill switch. Serialize all
sends through the IOStream wrapper to honour grpc-go's concurrency contract.

Add CSRF double-submit protection on unsafe cookie-authenticated methods,
exempting authenticated PAT requests by context identity (not a forgeable
Authorization header). Apply visibility/whitelist filtering consistently
across list, get-by-id, and mutate paths to enforce tenant isolation.

Migrate legacy mcp:* scopes: rewrite read/exec to nezha:* equivalents and
drop dangerous write/delete/wildcard grants.

Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
2026-05-30 15:56:44 +00:00
naiba 6b88cdb012 feat: server transfer rotation 2026-05-25 10:17:34 +00:00
UUBulb 227a6a0cb3 fix search by id (#1047)
* fix search by id

* make SearchByID Public
2025-03-27 19:17:00 +08:00
UUBulb f34b263b69 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 043d6c4097 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 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 b75a49c3c6 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 2a6206f1a9 ddns: allow overriding domains per configuration (#979) 2025-01-30 12:19:40 +08:00
UUBulb fa30df0320 feat: support id query for "list" apis (#908)
* feat: support id query for "list" apis

* gosec
2024-12-24 23:23:01 +08:00
naiba 4861b3e013 feat: refactor grpc keepalive 2024-12-05 00:11:34 +08:00
naiba a7e4fe0909 rename repo 2024-11-28 19:38:54 +08:00
UUBulb ee725bd337 fix: server api schema (#23) 2024-11-28 17:06:54 +08:00
UUBulb 4fed62db46 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 13810bb38b 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
UUBulb 5c1599c88c fix struct tags (#7) 2024-11-16 20:57:03 +08:00
naiba 80740ddf39 refactor agent auth & server api 2024-10-20 23:23:04 +08:00
naiba 17a04757a0 model redesign 2024-10-20 00:32:55 +08:00
UUBulbandnap0o bf9c6d669a 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 db51b4111b 增加透传给前端的自定义字段方便前端扩展功能 2024-09-28 00:16:54 +08:00
naiba e0599e7a38 fix: 流量统计异常 2024-08-12 10:06:55 +08:00
naiba 4546524df0 improve: 优化可能造成流量统计异常的情况 2024-08-11 10:35:19 +08:00
UUBulb eb60a1afc8 ws: ignore all DDNS fields (#406) 2024-08-09 21:47:29 +08:00
UUBulb 3e51bce224 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 c1db52dc4a 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
Darc Z f9c0bb2240 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
naiba 41e8fe1a02 🚀 dashboard v0.14.4 hide the server from guests 2022-09-30 22:40:56 +08:00
naiba a90c0400d9 ️ 使用 json-iterator 替换 encoding/json 进行一些序列化/反序列化操作 2022-03-18 23:13:22 +08:00
naiba b6dde7d324 gosec 2021-09-04 12:42:51 +08:00
naiba c4257ad105 🐛 修复修改服务器导致 Agent 离线 2021-07-25 23:50:08 +08:00
naiba f7e9ea72dd 任意时间区间(月流量)统计,无视重启~ 2021-07-14 23:53:37 +08:00
naiba 6dd7cd00af 🐛 fixed #105 2021-02-28 23:58:04 +08:00
naiba 3c76bb4651 ♻️ v4: 去掉添加 Agent ID 要求 需要更新面板 close #83 2021-01-30 17:10:51 +08:00
naiba 42b65ff79e 💄 UI: 前端优化调整 2021-01-30 11:22:59 +08:00
naiba 56e61f2fc1 feat: 后台服务器备注 close #72 2021-01-20 19:24:59 +08:00
naiba 6f155e4c51 🐛 quickfix: nil point 2021-01-18 13:45:06 +08:00
naiba 3f4b72676b ️ refactor: 小幅提升性能 2021-01-17 22:05:59 +08:00
naiba 8cc5d1c32b 💥 v2.0 必须更新面板,新增服务监控 2021-01-16 00:45:49 +08:00
我若为王 5be775a430 添加标签功能 2021-01-12 14:09:25 +08:00
naiba 1d2c81ead2 feat: 展示排序 close #29 2021-01-08 21:04:50 +08:00
naiba 62fdf18fb7 up(notification): 添加修改删除通知、报警规则 2020-12-19 23:11:16 +08:00
naiba 82adcf8fd3 feat(notification): 添加通知方式 2020-12-19 22:14:36 +08:00
naiba 5bb5e32758 🐛 fix #9 2020-12-09 10:27:00 +08:00
naiba f012505ca8 🔒 hide secret in ws messages 2020-12-07 20:47:13 +08:00
naiba a4611beaec 🚚 from p14yground to naiba 2020-11-11 10:07:45 +08:00
naiba f2c304e396 🎨 improve offline server detect 2020-10-24 21:29:05 +08:00
奶爸 ce3c5139f7 修复内存数据更新 2019-12-13 17:56:14 +08:00
奶爸 920737ff0c Websocket 实时拉取 2019-12-10 17:57:57 +08:00
奶爸 db364099fb 展示服务器列表 2019-12-09 18:14:31 +08:00
奶爸 1311480d41 添加服务器 & 展示服务器 2019-12-08 23:18:29 +08:00