4903 Commits

Author SHA1 Message Date
zijiren 5d0ecb4698 fix(account): allow patching user annotations (#7275) 2026-08-28 18:44:58 +08:00
jingyang 2586ffd27a fix(client-sdk): target direct parent frame (#7276)
* fix(client-sdk): target direct parent frame

* build(client-sdk): bump package version to 0.1.21

* build(client-sdk): bump package version to 0.1.23
2026-08-28 16:46:35 +08:00
jingyang 70ac4e999b fix(frontend): guard unknown workspace quota types (#7260)
* fix(frontend): guard unknown workspace quota types

Ignore quota resources that an older frontend bundle does not recognize and make quota formatting resilient to new SDK fields. Add a regression test for pod and unknown quota types.

* build(client-sdk): bump package version to 0.1.22
2026-08-28 16:09:03 +08:00
Phil Su 553ef241a9 feat(desktop): suppress the dock while Brain is the topmost window (#7267)
While Brain (system-brain) is the topmost non-minimized window, AppDock
(collapse pill included, zIndex 1000) no longer renders, so nothing
overlays the Brain iframe. The dock returns as soon as Brain loses the
top layer, is minimized, or is closed. Other apps and the floating-button
shape are unaffected.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 15:44:19 +08:00
zijiren d859f43238 fix(account): enforce suspended namespace webhook (#7266)
* fix(account): enforce suspended namespace webhook

* style(account): format webhook tests
2026-08-28 10:44:37 +08:00
zijiren b3dcab4119 perf(account): reduce controller cache memory usage (#7255)
* perf(account): reduce controller cache memory usage

* test(account): satisfy cache test lint checks

* perf(account): limit pod informer cache

* perf(account): cache projected pod fields

* style(account): format pod cache test
2026-08-27 16:51:09 +08:00
zijiren 91c24c7463 perf(resources): reduce controller cache memory (#7257)
* perf(resources): reduce controller cache memory

* fix(resources): wait for projected cache sync
2026-08-27 16:27:40 +08:00
zijiren 813b027777 perf(license): reduce controller cache memory (#7263) 2026-08-27 16:25:10 +08:00
zijiren a2a338dbcf perf(user): reduce controller cache memory usage (#7256)
* perf(user): reduce controller cache memory

* fix(user): resolve GVK for direct-read finalizers

* perf(user): cache projected user fields

* perf(user): project cached metadata fields

* style(user): satisfy cache lint checks
2026-08-27 16:22:19 +08:00
cuisongliu 8526c3a030 fix(clusterrole): expand permissions for kube-system namespace (#7264)
Signed-off-by: cuisongliu <cuisongliu@qq.com>
2026-08-26 22:14:59 +08:00
cuisongliu 7afc77ef3d fix(clusterrole): expand permissions for kube-system namespace (#7261)
Signed-off-by: cuisongliu <cuisongliu@qq.com>
2026-08-26 19:51:16 +08:00
Yun Pan beea1e56cb feat(account): expose admin account read APIs (#7220)
* feat(account): expose admin account read APIs

* fix(account): satisfy golangci-lint

* fix(account): satisfy golines formatting

* fix(account): apply golangci-lint formatting

* fix(account): address review feedback

* feat(account): isolate admin jwt authentication

* test(account): cover property reload admin auth

* fix(account): satisfy context-aware request lint

* fix(account): address admin auth review feedback
2026-08-21 15:05:38 +08:00
jingyang b53b60d7bb feat(desktop): route GitHub repo deep-links to Brain /deploy like templates (#7244)
The official template one-click deploy lands in Brain via the OAuth page's
openBrainTemplateDeploy branch: `/oauth?login=github&openapp=system-brain&
templateName=...&templateForm=...` becomes an autolaunch for the Brain
`/deploy` route. GitHub one-click deploy (Brain #283) needs the same entry
point, but githubRepo/autoDeploy were silently ignored.

Add the symmetric openBrainGithubDeploy branch: when openapp is system-brain
and githubRepo is present, autolaunch Brain `/deploy?githubRepo=...&
autoDeploy=1` so the Brain GitHub deployer opens with the repo pre-filled and
auto-deploys once when autoDeploy=1. Works for both the token-login and
already-logged-in paths; anything malformed falls through to normal openapp
handling.
2026-08-21 14:54:33 +08:00
Yun Pan c82addbaa2 fix(user): avoid full User objects in webhook validation (#7240)
* fix(user): avoid full user lists in webhook validation

* fix(user): satisfy golangci-lint

* fix(user): use informer-backed user count

* style(user): satisfy formatter checks

* fix(user): wait for informer event sync
2026-08-21 11:18:19 +08:00
nightwhite 228e59250c feat(frontend): add Rybbit analytics integration with event forwarding (#7231)
* feat(frontend): add Rybbit analytics integration with event forwarding

Integrate self-hosted Rybbit analytics as an additional sink alongside
the existing GTM pipeline, which remains fully unchanged:

- Add RybbitScript component to @sealos/gtm, driven by the
  NEXT_PUBLIC_RYBBIT_HOST / NEXT_PUBLIC_RYBBIT_SITE_ID env vars;
  loads nothing when unset
- Forward all track() events to window.rybbit.event() in addition to
  dataLayer; object props are JSON-serialized and truncated at 512
  chars per value (Rybbit caps properties at 2KB, primitives only)
- Mount RybbitScript in desktop / applaunchpad / dbprovider / template;
  dbprovider and template get an analytics script for the first time
  (their track() events previously had no consumer)
- Document the env vars in desktop/.env.template

Verified: @sealos/gtm, desktop, dbprovider and template production
builds pass. The applaunchpad build failure is a pre-existing echarts
SSR issue on main, confirmed unrelated via a stash control test.

* refactor(frontend): drive Rybbit config from runtime backend config

Address review feedback: replace build-time NEXT_PUBLIC_* env vars with
runtime configuration delivered by each app's existing config channel,
symmetric with how gtmId flows today. Config changes no longer require
a rebuild and can be toggled per environment at deploy time.

- RybbitScript is now props-driven (host / siteId); empty host or
  siteId disables it. No process.env reads remain
- desktop: add layoutConfig.rybbitHost / rybbitSiteId (type, client
  defaults, Helm values + configmap), passed through at the mount point
- applaunchpad: add analytics.rybbit.{host,siteId} to the config
  schemas (server + client), example yaml and chart configmap; read in
  getInitialProps alongside the existing gtm fields
- dbprovider / template: add optional analytics.rybbit section to the
  config schemas, example yamls, chart configmaps and values; read in
  getInitialProps and pass to the mount point
- New analytics sections are optional in the zod schemas so existing
  deployments keep working when only the image is upgraded
- Drop the NEXT_PUBLIC_RYBBIT_* entries from desktop/.env.template;
  document rybbitHost/rybbitSiteId in the Helm values guides

Verified: @sealos/gtm builds; desktop production build passes;
dbprovider / template / applaunchpad compile successfully
(applaunchpad still stops at the pre-existing echarts SSR issue on
/app/detail/monitor, unchanged from main).

* chore(desktop): restore .env.template to drop unrelated diff

* fix(frontend): buffer early Rybbit events and allowlist host in provider CSP

Review follow-up for the Rybbit integration:

- Queue events fired before the Rybbit script finishes loading and
  flush them from RybbitScript onLoad, mirroring the dataLayer buffer
  the GTM path already has
- Append the configured rybbitHost to script-src in both CSP
  annotations (nginx snippet + higress) of the dbprovider/template/
  applaunchpad ingresses, so /api/script.js is not blocked when the
  integration is enabled; unset values render the CSP unchanged
- Wire applaunchpad rybbitHost/rybbitSiteId through values instead of
  hardcoded empty strings in the configmap, matching dbprovider and
  template (the config channel was previously broken)
2026-08-20 17:54:57 +08:00
jingyang c1ce22d06f fix(desktop): expose pod workspace quota (#7209)
* fix(desktop): expose pod workspace quota

* fix(providers): support pod quota in provider quota boxes

Adapt dbprovider, template and applaunchpad QuotaBoxes to render the
new pod workspace quota item: add sourceMap color / icon entries and
missing i18n keys, aligning zh label with the shared quota-dialog.
2026-08-20 11:37:26 +08:00
jingyang 03425c6a7c fix(costcenter): embed Alipay cashier page via iframe (#7237)
* fix(costcenter): embed Alipay cashier page via iframe

The Alipay payment URL from TradePagePay is a signed gateway URL over
900 characters long, which cannot be scanned as a QR code. Switch to
qr_pay_mode=4 (order code mode) so Alipay renders the official cashier
page, return its auto-submitting form HTML as the payment code, and
embed it in the frontend via an iframe. QR code rendering remains for
legacy data.

* refactor(pay): restore original alipay comments

* refactor(costcenter): load Alipay cashier page via iframe src
2026-08-19 17:56:09 +08:00
Carson Yang 3cffcaacd3 fix(desktop): preserve marketing attribution through Cloud auth (#7217)
* feat(marketing): propagate attribution through desktop auth

* fix(desktop): complete attribution handoff

* fix(desktop): support persisted attribution sessions

* fix(desktop): close attribution lifecycle gaps

* fix(analytics): remove duplicate login success events
2026-08-19 10:19:31 +08:00
Yun Pan 95c67c41eb fix(account): wait for all deletion workers (#7232) 2026-08-18 15:21:49 +08:00
Yun Pan a706e3297a fix(account): prevent stale debt deletion after recharge (#7230)
* fix(account): prevent stale debt deletion after recharge

* style(account): satisfy golangci-lint formatting

* fix(account): improve debt deletion diagnostics
2026-08-18 11:26:51 +08:00
Phil Su a04e0eb544 feat(desktop): route Stripe returns to declared app (#7208)
* feat(billing): route Stripe returns to declared app

Signed-off-by: aimeritething <aimeritething@gmail.com>

* fix(billing): persist Stripe callback app

Signed-off-by: aimeritething <aimeritething@gmail.com>

* fix(billing): address review feedback for Stripe payApp routing

- Fix golangci-lint issues: use NewRequestWithContext and
  http.MethodPost in tests, drop a trailing blank line
- Normalize array-valued app query params in the desktop
  Stripe callback resolver and cover it with a test
- Simplify pendingTransactionPromotionCode with strings.SplitN
- Rename the parser test to reflect it only verifies JSON binding
- Refresh the stale callback URL example comment in buildURLs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: aimeritething <aimeritething@gmail.com>

* docs(pay): use placeholder values in callback URL example

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: aimeritething <aimeritething@gmail.com>

---------

Signed-off-by: aimeritething <aimeritething@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 16:39:09 +08:00
Yun Pan cc8ebb8743 fix(user): make kube API client rate limit configurable (#7203)
* fix(user): make kube API client rate limit configurable

* fix(user): add cloudDomain and cloudApiServerPort fallbacks

Signed-off-by: Yun Pan <dinoallo@netc.it>

* fix(user): increase the default kubeAPI.qps and kubeAPI.burst

Signed-off-by: Yun Pan <dinoallo@netc.it>

---------

Signed-off-by: Yun Pan <dinoallo@netc.it>
2026-08-11 19:07:40 +08:00
Yun Pan 82a30ff42d feat(user): issue kubeconfigs with token requests (#7196)
* feat(user): issue kubeconfigs with token requests

Use the ServiceAccount TokenRequest subresource instead of manually managed service-account-token Secrets, and request long-lived tokens as a transition for existing kubeconfig consumers.

* fix(user): bind token requests to a secret

* fix(user): restore random token secret names

* fix(user): satisfy golangci-lint

* fix(user): satisfy golines

* fix(user): clean up legacy service account token secrets

* fix(user): satisfy golines

* fix(user): clean up stale bound token secrets

* fix(user): satisfy golines

* fix(user): satisfy golines for token secret cleanup
2026-08-11 18:58:32 +08:00
xzy 54e6c1da3d refactor(minio): remove minio service from monorepo (#7198) 2026-08-11 14:20:14 +08:00
jingyang ec6ad8da2f fix(terminal): prevent initial tab readiness race (#7162) 2026-08-10 11:47:33 +08:00
xzy 13d3350e5b refactor(objectstorage): remove objectstorage project from monorepo (#7158)
* refactor: remove objectstorage project from monorepo

* ci(frontends): avoid shell interpolation in matrix step
2026-08-06 17:50:45 +08:00
cuisongliu cf6f27d8aa fix(monitor): update Docker image references in monitor values.yaml (#7167)
Signed-off-by: cuisongliu <cuisongliu@qq.com>
2026-08-06 10:03:16 +08:00
zijiren c2dd5ccc40 fix(account): expose billing catch-up setting in user values (#7156) 2026-08-04 15:44:11 +08:00
jingyang a0fb462148 fix(costcenter): improve payment QR scanning (#7151) 2026-08-04 10:45:59 +08:00
zijiren 6c28b33cd8 fix(account): make hourly billing reconciliation resumable and idempotent (#7126)
* fix(account): make hourly billing reconciliation resumable and idempotent

- schedule every ready billing hour from a persisted Mongo checkpoint
- retry failed owner reconciliation and preserve checkpoint progress
- use stable billing IDs with Mongo upsert semantics
- recover stable unsettled billings independently from monitor data
- make Cockroach balance and credits deductions idempotent
- reconstruct historical debt and subscription state using transaction UpdatedAt
- scope subscription history queries to active workspaces in the target hour
- add focused unit and Testcontainers runtime coverage

* perf

* fix(account): restore hourly billing deduction semantics

* feat(account): bound billing checkpoint catch-up window

- add BILLING_MAX_CATCHUP_DURATION with a default of 24h
- limit historical billing replay to the configured duration
- preserve first-start behavior to process only the latest ready hour
- log skipped hours when the persisted checkpoint exceeds the replay window
- expose durable checkpoint lag and windowed pending checkpoint metrics
- wire the setting into the account controller Helm chart
- add bounded catch-up, first-start, validation, and metric tests

* fix: ci

* perf(account): optimize indexed historical billing queries

- replace full DebtStatusRecord loading with per-user LATERAL lookup
- use half-open billing time boundaries for historical debt state
- add composite indexes for debt, subscription, and credits queries
- add Testcontainers runtime and execution-plan coverage for billing paths
- verify Mongo billing indexes and repeated initialization behavior
2026-08-03 16:52:51 +08:00
jingyang 78bf640d30 feat(desktop): honor shared app ordering (#7150) 2026-08-03 15:03:49 +08:00
yy 46682b1023 fix(stargz): build image and disable leader election (#7146)
* fix(ci): build stargz webhook image

* fix(stargz): disable leader election by default
2026-07-31 17:20:46 +08:00
yy 15ad047b7a fix(stargz): annotate injected runtime pods (#84) (#7144)
* fix(stargz): annotate injected runtime pods (#84)

* fix(stargz): annotate injected runtime pods


---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* fix(stargz): satisfy lint in injector test (#85)

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-07-31 16:21:43 +08:00
jingyang f841fedada fix(applaunchpad): use browser timezone for date ranges (#7132)
* fix(applaunchpad): use Shanghai time for date ranges

* fix(costcenter): correct GTM currency field

* fix(applaunchpad): use browser timezone for date ranges

* fix(applaunchpad): reject nonexistent DST times
2026-07-29 16:48:55 +08:00
yy 9fedc50c05 feat(webhooks): add stargz runtime injector webhook (#7042)
* feat(webhooks): add stargz runtime injector webhook

Introduce a mutating admission webhook that injects runtimeClassName stargz
for Pods using configured internal registries, with devbox pod skip, deploy
scripts, and kustomize manifests for cluster rollout.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(webhooks): resolve stargz golangci-lint issues

Apply gci, gofumpt, and golines formatting and remove unused nolint directives.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: ci lint

* fix(webhooks): resolve remaining stargz golangci-lint issues

Co-authored-by: Cursor <cursoragent@cursor.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-29 14:37:33 +08:00
Yun Pan 3aa8b3ebfa ci(semgrep): baseline push scans and bump semgrep (#7133) 2026-07-28 15:57:45 +08:00
Yun Pan da3b7b6c03 ci(lifecycle): keep lint incremental on push (#7130)
* ci: keep lifecycle lint incremental on push

* ci(lifecycle): document incremental lint base
2026-07-28 14:36:56 +08:00
Nixieboluo b11bbf2af5 fix(costcenter): wrong exp time display (#7118)
Signed-off-by: Nixieboluo <me@sagirii.me>
2026-07-27 19:25:41 +08:00
Yun Pan 17eb3112f2 ci(lifecycle): lint test-only changes without e2e (#7119)
* fix(lifecycle): add missing license headers

* ci: skip lifecycle checks for test-only changes

* ci: pin checkout in k3s e2e workflow

* ci: skip core e2e for lifecycle test-only changes

* ci(lifecycle): lint test-only changes

* ci(lifecycle): use current golangci-lint version
2026-07-27 17:55:28 +08:00
jingyang 48270c146d fix(frontend): correct launchpad UTC ranges and guest startup (#7121)
* fix(desktop): prevent guest startup loop

* fix(applaunchpad): use UTC for log time ranges

* test(desktop): retain unit startup coverage

* fix(desktop): prevent workspace retry loop
2026-07-27 17:29:09 +08:00
Yun Pan d19bd067c7 fix(lint): resolve controller and service issues (#7095)
* fix(lint): resolve controller and service issues

* fix(lifecycle): add missing test licenses

* fix(account): format debt sync code

* fix(lifecycle): resolve staging lint issues

* ci: update golangci-lint to v2.12.2

* ci: update golangci-lint config

* ci: adjust golangci-lint config

* fix(webhook): resolve admission lint issues

* fix(lint): resolve remaining module issues

* fix(scan): resolve semgrep findings

* fix(ci): remove deleted pay service from matrix
2026-07-27 14:45:50 +08:00
cuisongliu 41b39b524b chore(frontend): remove switch-region provider (#7101) 2026-07-27 13:58:31 +08:00
Jiahui e6ad22e041 chore(service): remove pay service (#7112)
remove pay service

# Conflicts:
#	service/go.work.sum
2026-07-27 13:26:10 +08:00
Jiahui cc4a72c142 fix(ci): ci build error (#7114)
fix ci
2026-07-27 12:07:14 +08:00
cuisongliu 5ca668dce6 chore(frontend): remove kubepanel provider (#7105) 2026-07-27 11:00:12 +08:00
cuisongliu ac3023057b chore(service): remove hubble and exceptionmonitor (#7108)
* chore(service): remove hubble and exceptionmonitor

* fix(service/account): restore compile with gin logger

* Revert "fix(service/account): restore compile with gin logger"

This reverts commit c57c974f3c.
2026-07-27 10:32:18 +08:00
Yun Pan 52ed8943dc ci(lifecycle): lint changed modules in PRs (#7096)
* ci(lifecycle): lint changed modules in PRs

* ci(lifecycle): restrict changed module diff scope
2026-07-24 17:59:37 +08:00
zijiren 95131f1208 refactor(devbox): Devbox and related gateway services (#7098)
remove(devbox): Devbox and related gateway services
2026-07-24 17:56:28 +08:00
Che f550632d91 feat(desktop): open Brain by default from root (#7093)
* feat(desktop): open Brain by default from root

* fix(desktop): prefer tab-local restore target

* fix(desktop): harden restore and guide exit behavior
2026-07-24 14:58:07 +08:00
Yun Pan b38d2ae17d fix(account): harden PAYG debt recovery (#7089)
* fix(account): recover debt status after balance normalization

* fix(account): retry debt refresh when user lock is busy

* fix(account): verify workspace subscriptions during debt recovery
2026-07-24 11:35:58 +08:00