Skip to content

Yikai CMS v2.2.0

Choose a tag to compare

@bluesailor bluesailor released this 06 Nov 07:05
· 56 commits to main since this release

YikaiCMS v2.2.0

简体中文

升级须知

  • 含数据库升级(新增外部 AI 接入的令牌与提案表)。在线升级后请在后台「数据库升级」中执行;升级前照常备份文件与数据库。最低 PHP 仍为 8.2。
  • 增量包覆盖 2.0.6 至 2.1.3,更早的版本使用完整包。
  • 密钥不再以明文保存:服务器缺少有效的 ENCRYPT_KEY 或 OpenSSL 不支持 AES-256-GCM 时,AI 接口密钥、SMTP 密码、百度推送令牌等新填或修改的密钥会保存失败,原来的设置保持不变;以前存的未加密密钥照常可用。站点健康会给出原因。处理步骤:
    1. 先把数据库和 config/config.php 一起备份,两者配套保存——加密后的密钥只能用当时的 ENCRYPT_KEY 解开;
    2. 没有密钥时在 config/config.php 加上 define('ENCRYPT_KEY', '32 位以上的随机字符');。已有密钥的站点不要修改或删除它,否则已加密的密钥全部失效;OpenSSL 不支持时请主机商启用或升级 OpenSSL 扩展;
    3. 到 AI 设置、邮件设置、SEO 助手里重新填写密钥并保存;
    4. 站点健康显示「密钥加密存储」正常即完成。之后迁移或恢复站点时,数据库要和这份 config.php 一起带走。出问题时还原第 1 步的那一对备份即可。
  • 外部 AI 接入默认关闭,新装和老站都需在后台按需启用。
  • SEO 助手 1.3.3(插件市场)需单独更新:配合上面的密钥规则,令牌保存失败时整次不保存并提示原因。要求 CMS 1.20.1 以上。

新功能

  • 外部 AI 接入(MCP):给 Codex、Claude Code 等 AI 客户端签发令牌,按能力分别授权读取文章与普通单页、提交文章草稿或单页内容提案。令牌不能发布任何内容;提案由有权限的后台人员审核,可先私密预览,应用后只成为草稿,草稿没被再改过时可撤销。普通单页目前只能修改标题文字、正文和图片替代文字。
  • 后台草稿预览、案例快捷入口、产品规格添加更顺手。
  • 网页构建器:工具栏与语言切换调整;页面标题区可选样式、实时预览,细节可折叠。

修复

  • 整站模板导出再导入后,锁定版本的组件(含嵌套组件、变体)会变成最新版。
  • (安全) 密钥在加密不可用时被静默存为明文;通用设置表单可以绕过专用写入改动密钥与 AI 配置。
  • (安全) 图片编辑的保存与还原可用 GET 请求触发;模板导入被拒绝时会删掉已准备好的文件;站内搜索与查询参数缺少类型校验。
  • 服务器未启用 Fileinfo 时,经内容验证的受支持图片也无法上传;PHP 8.5 上传时出现弃用警告。
  • 14 个可下载语言包补齐新增后台文案,繁体中文同步更新。

English

Before you upgrade

  • This release includes a database upgrade (new tables for external AI access tokens and proposals). After the online upgrade, run it under Database upgrade in the admin. Back up files and the database first, as always. The minimum PHP version is still 8.2.
  • Delta packages cover 2.0.6 to 2.1.3; older versions use the full package.
  • Secrets are never stored as plain text any more. If the server has no valid ENCRYPT_KEY, or OpenSSL lacks AES-256-GCM, saving a new or changed AI API key, SMTP password or Baidu push token now fails and the previous setting stays unchanged. Secrets saved earlier without encryption keep working. Site Health shows the reason. To fix it:
    1. Back up the database and config/config.php together and keep them as a pair: encrypted secrets can only be read with the ENCRYPT_KEY they were saved with.
    2. If there is no key, add define('ENCRYPT_KEY', 'a random string of 32+ characters'); to config/config.php. If the site already has a key, never change or remove it, or every encrypted secret becomes unreadable. If OpenSSL is the problem, ask your host to enable or update the OpenSSL extension.
    3. Enter and save the secrets again in AI settings, Email settings and SEO Assistant.
    4. You are done when Site Health shows Encrypted secret storage as good. From then on, move or restore the database together with this config.php. If anything goes wrong, restore the pair from step 1.
  • External AI access is off by default on new and existing sites; enable it in the admin when you need it.
  • SEO Assistant 1.3.3 (plugin market) is updated separately. It follows the secret rule above: if the token cannot be saved, nothing on the page is saved and the reason is shown. Requires CMS 1.20.1 or later.

New

  • External AI access (MCP): issue tokens to AI clients such as Codex and Claude Code, granting each capability separately: reading articles and ordinary pages, and proposing article drafts or page content changes. Tokens cannot publish anything. Authorized admins review each proposal, can preview it privately, and applying it only creates a draft, which can be undone as long as nobody has edited it since. For ordinary pages, only heading text, body text and image alt text can be changed for now.
  • Easier draft previews, case shortcuts and product specifications in the admin.
  • Page builder: reworked toolbar and language switching; the page title area gets style choices, live preview and collapsible details.

Fixes

  • After exporting and re-importing a whole-site template, components pinned to a version (including nested components and variants) switched to the latest version.
  • (Security) Secrets were silently stored as plain text when encryption was unavailable; generic settings forms could bypass the dedicated writers and change secrets and AI settings.
  • (Security) Image edit save and restore could be triggered with a GET request; a refused template import deleted files it had already prepared; site search and query parameters lacked type checks.
  • Supported images that pass content validation could not be uploaded on servers without Fileinfo; uploads printed deprecation warnings on PHP 8.5.
  • The 14 downloadable language packs now include all new admin strings; Traditional Chinese is updated too.

日本語

アップグレード前の注意

  • データベースのアップグレードを含みます(外部 AI 接続のトークンと提案用のテーブルを追加)。オンラインアップグレード後、管理画面の「データベースアップグレード」で実行してください。事前にファイルとデータベースをバックアップしてください。PHP の最低要件は引き続き 8.2 です。
  • 差分パッケージは 2.0.6〜2.1.3 に対応します。それより前のバージョンは完全パッケージを使ってください。
  • シークレットを平文で保存しなくなりました。 サーバーに有効な ENCRYPT_KEY がない、または OpenSSL が AES-256-GCM に対応していない場合、AI API キー・SMTP パスワード・Baidu 送信トークンなどを新しく入力または変更しても保存されず、以前の設定はそのまま残ります。以前に暗号化せずに保存したシークレットは引き続き使えます。理由はサイトヘルスに表示されます。対処手順:
    1. データベースと config/config.php を一緒にバックアップし、組にして保管してください。暗号化されたシークレットは保存時の ENCRYPT_KEY でしか復号できません。
    2. キーがない場合は config/config.php に define('ENCRYPT_KEY', '32 文字以上のランダムな文字列'); を追加します。既にキーがあるサイトでは変更・削除しないでください。 暗号化済みのシークレットがすべて読めなくなります。OpenSSL が原因の場合は、ホスティング会社に OpenSSL 拡張の有効化または更新を依頼してください。
    3. AI 設定・メール設定・SEO アシスタントでシークレットを入力し直して保存します。
    4. サイトヘルスで「シークレットの暗号化保存」が正常になれば完了です。以後、サイトを移行・復元するときはデータベースとこの config.php を一緒に移してください。問題が起きた場合は手順 1 のバックアップを組で復元してください。
  • 外部 AI 接続は既定で無効です。 新規・既存サイトとも、必要に応じて管理画面で有効にしてください。
  • SEO アシスタント 1.3.3(プラグインマーケット)は別途更新してください。 上記のルールに合わせ、トークンを保存できない場合はページ全体を保存せず理由を表示します。CMS 1.20.1 以上が必要です。

新機能

  • 外部 AI 接続(MCP):Codex や Claude Code などの AI クライアントにトークンを発行し、記事・通常ページの読み取り、記事下書きやページ内容の提案を機能ごとに許可できます。トークンでは何も公開できません。提案は権限のある管理者が確認し、非公開でプレビューでき、適用しても下書きになるだけです。その後誰も編集していなければ取り消せます。通常ページで変更できるのは、現在のところ見出しテキスト・本文・画像の代替テキストのみです。
  • 管理画面の下書きプレビュー、事例へのショートカット、製品仕様の追加を使いやすくしました。
  • ページビルダー:ツールバーと言語切り替えを調整。ページタイトル領域でスタイルの選択、ライブプレビュー、詳細の折りたたみが可能になりました。

修正

  • サイト全体テンプレートをエクスポートして再インポートすると、バージョン固定したコンポーネント(入れ子のコンポーネントやバリアントを含む)が最新版に変わっていました。
  • (セキュリティ) 暗号化が使えないときにシークレットが黙って平文で保存されていました。汎用の設定フォームから専用の保存処理を迂回してシークレットや AI 設定を変更できました。
  • (セキュリティ) 画像編集の保存・復元が GET リクエストで実行できました。拒否されたテンプレートインポートが、準備済みのファイルを削除していました。サイト内検索とクエリのパラメータに型チェックがありませんでした。
  • Fileinfo が無効なサーバーで、内容検証を通過した対応画像もアップロードできませんでした。PHP 8.5 でアップロード時に非推奨警告が出ていました。
  • ダウンロード可能な 14 言語パックに新しい管理画面の文言を追加し、繁体字中国語も更新しました。

Build commit: 60d7e9e
CI checks: https://github.com/bluesailor/yikaicms/commit/60d7e9eb05860e6a04e28c60070612b3134d6362/checks
CI run: https://github.com/bluesailor/yikaicms/actions/runs/42152146200