Commit graph

891 commits

Author SHA1 Message Date
Jangrui
512fc1be00
Merge pull request #1 from LHB6540/fix/pr445-followup-for-author
fix(helm): 接续完善 #445 的依赖、GitOps 与 Ingress 配置
2026-07-21 00:19:04 +08:00
lhb6540
f3dbb57a80 fix(helm): 修正 CI 渲染与 PostgreSQL 管理员密码引用
同步 Helm CI matrix 与当前 values schema 和确定性凭据策略。

- 所有 CI 渲染加载测试凭据并迁移 Ingress TLS 数组配置
- PostgreSQL 使用 postgres 用户时引用管理员密码 key
- 增加内置 Secret 和 existingSecret 的管理员用户契约测试

Signed-off-by: lhb6540 <lhb6540@gmail.com>
2026-07-20 11:36:04 +08:00
lhb6540
9978d82cb1 fix(helm): 修正 Server PVC 权限与 RWO 升级策略
本地 PVC 会覆盖 Server 镜像内预先设置的目录所有者,导致非 root app 用户无法写入技能文件。

- 为 Server Pod 增加可覆盖的 fsGroup,默认匹配 v0.2.13 镜像的 app 组 101
- 本地 ReadWriteOnce 存储自动使用 Recreate,避免滚动升级时新旧 Pod 抢占卷
- ReadWriteMany 与 S3 部署继续使用 RollingUpdate
- 补充 values schema、配置契约测试和运维文档

Signed-off-by: lhb6540 <lhb6540@gmail.com>
2026-07-16 20:04:35 +08:00
lhb6540
5d379dcaaf fix(helm): 修正组件启停与依赖配置并增加 values 校验
在配置进入 Kubernetes 前完成父 Chart 校验,并补齐剩余的依赖配置契约。

- 让 Service、HPA 和 PDB 正确遵循组件启用状态
- 校验 Ingress、自动扩缩容、外部依赖和共享存储的组合配置
- 增加 values.schema.json 和 Helm 配置契约测试并接入 CI
- 统一 PostgreSQL Primary 与 Read Replica 的 max_connections 配置
- 修正 Redis Sentinel 节点、依赖等待和独立密码配置
- 允许覆盖依赖等待容器镜像,支持完整私有镜像仓库部署
- 兼容现代与旧式 IngressClass,并支持多域名 TLS 和证书 SAN
- 增加 GitOps 稳定 Secret 模式,阻止离线渲染产生随机凭据漂移
- 引用用户可控的 ConfigMap 字符串,并推导 TLS 安全 Cookie 和设备认证默认值
- 补充 Sentinel、RWX 存储、TLS Cookie、PVC 保留、私有镜像和 GitOps 文档
- 增加 Redis 数据密码与 Sentinel 密码分离的应用配置测试

已通过 Helm 严格 lint、渲染场景、配置契约测试、kubeconform、后端测试套件和 Sentinel 专项配置测试。

Signed-off-by: lhb6540 <lhb6540@gmail.com>
2026-07-15 17:19:24 +08:00
lhb6540
3b3905be63 fix(helm): 修正 Bitnami 依赖连线并同步应用配置
基于当前 SkillHub 运行时契约和 Bitnami 依赖命名,更新原贡献者提交的 Helm Chart 配置。

- 将 Server 正确连接到实际的 PostgreSQL 和 Redis Service 与 Secret
- 支持依赖组件的 existingSecret 名称和自定义密码 key,避免安装时 lookup
- 同步 S3、匿名下载、Scanner LLM、公开地址、设备认证和直接认证配置
- 将应用版本和 Chart 版本对齐当前发布版本
- 收紧 Chart 发布触发条件和手动版本选择逻辑
- 增加依赖 Service、Secret 和密码 key 的 CI 语义断言

已通过 Helm lint、九组渲染场景、kubeconform、工作流安全检查和后端应用测试套件。

Signed-off-by: lhb6540 <lhb6540@gmail.com>
2026-07-15 17:19:15 +08:00
jangrui
2b1be5ccf8 fix(ci): kubeconform 加载 CRD schema 修复 cert-manager 校验失败
ingress-tls-certmanager 场景渲染出 cert-manager 的 Certificate CRD,
kubeconform 默认仅内置原生 k8s schema,遇到 CRD 报 "could not find schema"。

追加 -schema-location 从 datreeio/CRDs-catalog 远程加载 CRD schema,
覆盖整个 catalog 收录的 CRD 资源,9 场景矩阵无需差异化处理。

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-09 17:17:06 +08:00
jangrui
0605357316 fix(chart): 修复 PR review 反馈项
- 删除 subchart image block,使用 Bitnami 默认版本
- 移除 Ingress cert-manager annotation,消除双重签发
- 清空默认明文密码,改为空字符串
- 排除 tgz 进 git,CI 添加 helm dependency build
- checksum 改为模板级渲染,修复文件末尾换行
- sentinel default 3,列表生成改用 append+join
- 添加 externalRedis.sentinel.password 字段
- README 补充 existingSecret key 清单
- CI 添加 kubeconform -strict 校验
- RedissonConfig 添加注释,补充空密码测试用例

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-04 06:35:28 +08:00
jangrui
07c97cf7cd feat(server): 支持 Redis Sentinel 模式密码配置
- RedissonConfig 根据 spring.profiles.active 切换普通/Sentinel密码
- 新增 application-redis-sentinel.yml 专属 Spring profile
- 新增 RedissonConfigTest 覆盖普通和 Sentinel 两种模式用例

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
906c7f9884 feat(chart): 集成 Bitnami 组件并重构高可用配置
- 使用 Bitnami PostgreSQL/Redis subchart 替代内置 StatefulSet
- 新增 sentinel 模式密码分离(redis-sentinel-password)
- 修复证书 secretName 与 Ingress 动态一致性
- 清理 ConfigMap 未引用字段,Service 模板去重
- CI 矩阵修复 sentinel 参数并扩展至 9 场景
- 命名空间硬编码替换为动态 $.Release.Namespace

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
5909bc1a1a 修复 Helm:解决 CI 流水线故障与模板边界场景
- 修复 S3 存储模式下卷挂载条件渲染
- CI 多行参数不再被 YAML 尾随换行符截断
- 移除未使用的 database.architecture 字段
- 简化 Helm Chart 发布工作流

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
6ed5fb34dc commit -m "fix(ci): 修复 helm lint 缺少路径参数和 grep -c 在 bash -e 下的退出码问题"
Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
396ae4a55f feat(chart): 添加组件级镜像标签配置以支持个性化镜像版本
Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
0ddb392086 feat(chart): 添加 Helm Chart 发布工作流
Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
58bb062993 feat(chart): 镜像 tag 与 Chart.yaml appVersion 联动
values.yaml 中 images.tag 留空时自动取 Chart.yaml 的 appVersion,
格式为 v{appVersion}(如 0.2.8 → v0.2.8)。
用户仍可通过 --set images.tag=xxx 显式覆盖。

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
8a37801862 fix(chart): 修复安全、兼容及可维护性问题
- secret.yaml: lookup 检查现有 Secret 避免 upgrade 重新生成密码
- secret.yaml: Redis/S3 凭据通过 Secret 引用,移除明文环境变量
- backend/frontend/scanner: 新增 checksum 注解,配置变更自动触发滚动更新
- backend/frontend/scanner: 镜像地址支持 global.imageRegistry 覆盖
- postgres: internal 模式仅支持单副本,移除伪集群配置
- postgres: 探针用户名改用 POSTGRES_USER 环境变量
- values.yaml: accessMode 默认 ReadWriteMany,tag 指定 v0.2.8

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
jangrui
dd1e87f1f3 feat(chart): 添加 SkillHub Helm Chart 部署方案
新增 Helm Chart 支持完整的 SkillHub 私有化部署,包括:

- PostgreSQL/Redis 内置 StatefulSet 及外部模式切换
- 零依赖设计,无需 Bitnami 子 Chart
- 支持 standalone/cluster 数据库架构
- NodePort/LoadBalancer/ClusterIP 多种服务类型
- HPA、PDB、ServiceMonitor 完整运维支持
- cert-manager 证书自动签发
- initContainer 等待数据库和 Redis 就绪
- PVC 卸载保护 (helm.sh/resource-policy: keep)
- GitHub Actions: PR 校验 + 发布到 GHCR OCI

Signed-off-by: jangrui <admin@jangrui.com>
2026-06-01 20:59:58 +08:00
dongmucat
098616dcb6
Merge pull request #436 from iflytek/cli-bump-0.1.6
chore(cli): bump version to 0.1.6
2026-05-14 17:45:01 +08:00
dongmucat
a9bc076f81 chore(cli): bump version to 0.1.6 2026-05-14 17:18:46 +08:00
dongmucat
356e507cf9
Merge pull request #434 from iflytek/worktree-fix-promotion-download
fix(promotion): copy bundleReady and downloadReady when promoting skill to global
2026-05-14 15:50:06 +08:00
dongmucat
afa6b6c834
Merge pull request #417 from iflytek/fix/admin-skill-scan-bypass
fix(security): trigger security scan for admin-published skills
2026-05-14 14:50:53 +08:00
dongmucat
9dfbed2ef1
Merge pull request #422 from iflytek/feat/cli-auto-build
feat(cli): add automated build and publish workflow
2026-05-14 14:50:27 +08:00
dongmucat
2af0bf184b fix(promotion): copy bundleReady and downloadReady when promoting skill to global
When approving a promotion, the new SkillVersion was created without copying
bundleReady and downloadReady from the source version, causing the download
button to be permanently disabled for promoted skills.
2026-05-14 14:32:36 +08:00
Cheney
f59a10e36f chore(ci): remove temporary publish-script test workflow 2026-05-13 09:28:28 +08:00
Cheney
48174c9ad2 fix(cli): match 'push' anywhere in git args, not just $1
The script calls `git -C /path push ...` so the first arg is `-C`,
not `push`. Use glob match on full args instead.
2026-05-13 09:27:44 +08:00
dongmucat
5ccb7f9cf7
Merge pull request #423 from iflytek/feat/landing-cli-tab
feat(web): add CLI install tab on landing quick start
2026-05-13 09:27:39 +08:00
Cheney
dad06b465d fix(cli): fix exit code capture in tests using git wrappers
The `status="$(env ... printf | bash ... && echo 0 || echo $?)"` pattern
doesn't correctly capture the script's exit code because the command
substitution and pipe interact poorly. Use direct assignment with
`|| status=$?` instead.
2026-05-13 09:26:33 +08:00
Cheney
935054cc9e fix(cli): use git wrapper for push-failure test
The old approach (breaking origin URL) caused `git pull` to fail
before reaching the push step. Use a git wrapper that only fails
on `push` so the rest of the script runs normally.
2026-05-13 09:18:19 +08:00
Cheney
c520f38135 fix(cli): remove unreliable race-condition test, renumber tests
Remove test 7 (remote tag race condition) — the scenario is nearly
impossible with the new baseline sync logic and too complex to
reliably simulate. Fix variable naming inconsistencies from the
renumbering.
2026-05-13 09:16:19 +08:00
Cheney
1c29cfac57 test(cli): add debug logging to race-condition test wrapper 2026-05-12 18:05:02 +08:00
Cheney
85a758bbdd fix(cli): rewrite test 7 to cover real remote tag race condition
Old test 7 used `--no-tags` config to prevent fetch from pulling the
remote tag, but that doesn't reflect any real-world scenario. With the
new baseline sync logic, a pre-existing remote tag would be synced
into the local version, eliminating the conflict path the test claimed
to cover.

Replace with a git wrapper that injects the conflicting tag into origin
right before the script's `ls-remote` check, which simulates a real
race between two developers attempting to release the same version.
2026-05-12 18:02:02 +08:00
Cheney
c1c12c56eb fix(cli): gitignore test scaffolding files in publish-cli tests
Tests write stdout.log/stderr.log into the test repo root, which made
`git status --porcelain` non-empty and broke test 3 (non-main branch
abort) by tripping the dirty-tree check first.

Add a .gitignore to the test fixture repo to filter out these files.
2026-05-12 17:57:32 +08:00
Cheney
1420ffac56 test(ci): add temporary workflow to test publish-cli script
This workflow runs scripts/tests/publish-cli-test.sh in CI to verify
the publish script changes. Will be removed after verification.
2026-05-12 17:53:12 +08:00
Cheney
eeb2540a3e fix(cli): align checkout ref across all workflow jobs
publish-npm and create-release now checkout the same ref as
build-and-test (the input tag or push ref), preventing source
mismatch between npm package and GitHub Release artifacts.
2026-05-12 17:29:58 +08:00
Cheney
70b962a4c8 fix(cli): harden release pipeline per PR #422 review
1. npm version check: three-state logic (exists/missing/error) to prevent
   silent skip on network failures, registry 5xx, or auth issues.

2. workflow_dispatch: checkout the specified tag and validate SHA matches,
   preventing builds from wrong ref.

3. Atomic push: use `git push --atomic` and detect unpushed tags via
   `git ls-remote` instead of `--no-merged` (catches branch-pushed-but-
   tag-failed state).
2026-05-12 17:15:35 +08:00
Cheney
8126faa452 fix(cli): detect and guide recovery of unpushed release artifacts
Add pre-flight check in publish-cli.sh to detect unpushed commits and tags
from previous failed pushes. When detected, the script exits with clear
recovery instructions:

1. Retry push (for transient network failures)
2. Rollback and re-release (for clean restart)

This prevents the baseline sync logic from skipping failed versions when
local tags participate in version calculation after a push failure.

Addresses feedback from dongmucat in PR #422.
2026-05-12 16:14:47 +08:00
Cheney
159886b76d fix(cli): ensure create-release depends on publish-npm and rewrite publish-cli tests
1. Update release-cli.yml to make create-release depend on publish-npm with proper skip_npm handling, preventing half-released state where GitHub Release exists but npm package is unavailable.

2. Rewrite publish-cli-test.sh to cover the new publish flow: main branch check, dirty tree detection, tag baseline sync, version bumping, tag conflict detection, user cancellation, and atomic push verification.
2026-05-12 16:12:57 +08:00
dongjiang
41b1d03cfc
Add AGENTS.md and SKILL.md to support AI tools (#393)
Signed-off-by: dongjiang <dongjiang1989@126.com>
2026-05-12 15:35:17 +08:00
dongmucat
fed4eeb2b9 fix(web): make quick start tab icons exhaustive 2026-05-12 14:08:29 +08:00
dongmucat
8931f6d241 feat(web): add CLI install tab on landing quick start
Add a third peer tab 'CLI' to LandingQuickStartSection that surfaces the
official install command 'npm i -g @astron-team/skillhub'. Layout uses
grid-cols-1 md:grid-cols-3 so mobile shows tabs stacked and desktop
shows three equal-width columns.

Addresses iflytek/skillhub#419 (homepage Quick Start part only).
2026-05-12 11:05:02 +08:00
Cheney
490ddfa548 fix(cli): push branch and tag atomically in publish-cli.sh 2026-05-12 11:01:50 +08:00
Cheney
378216c6da feat(cli): add automated build and publish workflow
- Add release-cli.yml GitHub Actions workflow: build, test, npm publish,
  and GitHub Release triggered by cli-v* tags
- Rewrite scripts/publish-cli.sh: local bump + commit + tag + push,
  enforces main branch, idempotent tag checks
- Add concurrency group and release idempotency to workflow
- Add make publish-cli / publish-cli-minor / publish-cli-major targets
- Add cli/RELEASE.md documenting the full release process
2026-05-12 10:32:06 +08:00
dongmucat
15e55e8055
Merge pull request #418 from iflytek/fix/cli-update-registry
fix(cli): respect configured npm registry
2026-05-11 15:18:29 +08:00
dongmucat
836267fd45 fix(cli): respect configured npm registry 2026-05-11 14:53:20 +08:00
dongmucat
554cad5b2e
Merge pull request #416 from iflytek/fix/cli-publish-version-sync
fix(cli): sync publish version flow
2026-05-11 14:14:32 +08:00
dongmucat
cebad0bbd7 refactor(security): use explicit SCANNING check in processScanResult
Gemini review feedback: the previous != PUBLISHED condition was too broad
and could inadvertently overwrite terminal states like REJECTED or YANKED.
Now explicitly check == SCANNING before transitioning status.
2026-05-11 13:56:08 +08:00
dongmucat
299659bf93 fix(cli): avoid publish temp file leak 2026-05-11 13:43:31 +08:00
dongmucat
ec4598efec fix(security): trigger security scan for admin-published skills
Super admin auto-publish flow was skipping security scanning entirely.
Now triggerScan is called regardless of autoPublish flag, while preserving
the PUBLISHED status (scan runs as post-publish audit rather than blocking).

Closes #415
2026-05-11 11:36:08 +08:00
dongmucat
e7aecc4050 fix(cli): sync publish version flow 2026-05-11 11:00:10 +08:00
dongmucat
84914c9d94
Merge pull request #359 from iflytek/feature/skillhub-cli-v1
Some checks failed
Deploy Docs / build (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
feat(cli): add SkillHub CLI v1
2026-05-09 17:25:24 +08:00
dongmucat
d77a7d67c9 fix(cli): return correct exit code for network failures
- Handle 502/503 status codes as network errors (EXIT.network = 3)
- Previously these were treated as generic errors (EXIT.generic = 1)
- Fixes integration tests for login and search network failure scenarios
- Bump version to 0.1.4
2026-05-09 17:09:16 +08:00