Skip to content

v0.4.1

Latest

Choose a tag to compare

@MaSuCcHI MaSuCcHI released this 28 Nov 04:38
· 8 commits to main since this release
01f5771

日本語

PostgreSQL 19 への対応と、Branch 単位の PostgreSQL メジャー更新を加えたリリースです。認証の強化と、自前の実装を標準的なライブラリへ置き換える整理も含みます。

更新の前に読んでください(互換性に影響する変更)

  • Raft Protocol が 30 から 32 に上がります: ノードを 1 台ずつ、フォロワーから先に、リーダーを最後に更新してください。コンソールの Settings → Updates、db-branch update apply 0.4.1、または各ノードで sudo apt update && sudo apt upgrade のどれでも構いません。全ノードが 0.4.1 になるまで、Branch の PostgreSQL メジャー更新と新しいパスワードハッシュは使われません。プロトコル 32 に上がったあとは、ノードを古い版に戻さないでください(ログイン時に作り直したパスワードハッシュを 0.4.0 は確かめられません)。
  • コンソールのパスワードハッシュが Argon2id(PHC 形式)になります: 今のハッシュはそのまま使え、各ユーザーが次にログインしたときに作り直されます。作業は要りません。
  • POST /v1/auth/login は Content-Type: application/json だけを受け付けます: それ以外は 415 unsupported_media_type になります。コンソール・CLI・MCP は元から JSON を送っています。フォーム形式で送っているスクリプトは直してください。
  • 別のオリジンからのブラウザの要求を断ります: Cookie で認証した要求のうち、ブラウザが別サイトからと示すものは 403 csrf_failed になります(従来の X-CSRF-Token の確認に加えて)。Authorization: Bearer の要求は影響を受けません。コンソールを別のオリジンに埋め込んでいる場合は、同じオリジンから配信してください。

新機能

  • PostgreSQL 19: postgres@19.0 ランタイム(Ubuntu 24.04 / 26.04、amd64 / arm64)。PostgreSQL 18 と 17 は postgres@18.7 と postgres@17.12 に上げました。
  • Branch の PostgreSQL メジャー更新: branch upgrade で 17 → 19、18 → 19 のようなメジャー更新ができるようになりました。pg_upgrade --swap(PostgreSQL 18 以降。それより前は --link)でデータを複製せずに移すので、時間はデータ量にほぼよりません。エンコーディング・ロケール・データチェックサムの設定は元のまま引き継ぎます。事前確認では、拡張(anon を含む)が新しい版にあるか、論理レプリケーション、オブジェクト数やデータ量による時間の目安、pg_upgrade --check の結果を返します。失敗したら ZFS の Checkpoint で自動的に元に戻します。更新が終わると Branch はすぐ ready になり、統計の取り直し(vacuumdb --analyze-in-stages --missing-stats-only)は後ろで進みます(stats_updating)。
  • モジュール向けに、リーダーへ転送して原子的に読み書きする ext.AtomicStore を追加しました(SSO モジュールが使います)。

セキュリティ

  • コンソールのパスワードを Argon2id(PHC 形式、m=19456,t=2,p=1)に統一し、古いハッシュはログイン時に作り直します。
  • Cookie 認証の経路に net/http.CrossOriginProtection を X-CSRF-Token と併せて入れました。
  • POST /v1/auth/login は JSON だけを受け付けます(ログイン CSRF の防止)。
  • クラスターの PKI で、鍵・シリアル・証明書の生成エラーを無視していた所を直しました。

修正

  • PGDG のカタログ生成で、版を Debian の規則で比べるようにしました(18~rc1 のようなプレリリースは 18.0 より前)。
  • DB クライアント用の接続ファイル(DataGrip・MySQL Workbench・Navicat・DBeaver)を XML のエンコーダーで組み立て、UUID を標準の RFC 4122 UUIDv5 にしました。名前に制御文字があってもファイルが壊れません。
  • SQL の実行画面で、MySQL の条件付きコメント(/*! ... */)と -- コメントを正しく扱うようにしました。
  • アーティファクトとライセンスサービスへの HTTP 通信にタイムアウトを付けました。
  • apt リポジトリの公開で、Release / Release.gpg をパッケージ一覧の後にアップロードするようにしました。
  • コンソールのライブ更新が切れたとき、間隔を空けながら再接続するようにしました。

変更

  • 自前の実装を標準的なライブラリに置き換えました: golang.org/x/term(パスワード入力)、github.com/danieljoos/wincred(Windows の資格情報)、golang.org/x/mod/semver(カタログの版の比較)、github.com/cenkalti/backoff/v5(再試行)、github.com/google/uuid。どれも cgo を使わない Go のライブラリで、MIT か BSD のライセンスです。
  • 認証情報の読み込みをキャッシュし、保存先が変わったらすぐ読み直すようにしました。

English

PostgreSQL 19 support and PostgreSQL major version upgrades for branches, plus authentication hardening and dependency cleanups.

Upgrade notes (read before upgrading)

  • Raft Protocol 30 → 32: upgrade nodes one at a time, followers first and the leader last (Settings → Updates in the console, db-branch update apply 0.4.1, or apt update && apt upgrade on each node). Until every node runs 0.4.1, PostgreSQL major upgrades of branches and the new password hash format are not used. Do not downgrade a node after the cluster has moved to protocol 32: passwords re-hashed on login can no longer be verified by 0.4.0.
  • Console password hashes move to Argon2id in PHC format: existing hashes keep working and are re-hashed the next time each user logs in. No action is needed.
  • POST /v1/auth/login requires Content-Type: application/json and answers 415 unsupported_media_type otherwise. The console, CLI and MCP already send JSON; update scripts that post a form.
  • Cross-origin browser requests are refused: cookie-authenticated requests that a browser marks as cross-site now answer 403 csrf_failed (in addition to the existing X-CSRF-Token check). Requests with Authorization: Bearer are not affected. If you embed the console behind another origin, serve it from the same origin.

Added

  • PostgreSQL 19: postgres@19.0 runtime for Ubuntu 24.04 / 26.04 on amd64 / arm64. PostgreSQL 18 and 17 move to postgres@18.7 and postgres@17.12.
  • PostgreSQL major version upgrades of a branch: branch upgrade now supports PostgreSQL major version upgrades (including jumping majors such as 17 -> 19 and 18 -> 19) via pg_upgrade --swap (PostgreSQL 18+, --link on older versions), preserving encoding, locale, and data checksum settings (pg_controldata), checking target extensions (including anon), logical replication slots/subscriptions, object-count/database-size warnings, and pg_upgrade --check compatibility, scaling operation timeouts from object counts, reporting pg_upgrade progress stages, rolling back automatically via ZFS checkpoints on failure, and running vacuumdb --analyze-in-stages --missing-stats-only in the background while keeping the branch ready (stats_updating, stats_warning, Raft Protocol 31).
  • ext.AtomicStore (Get / PutIfAbsent / Take) for modules that need atomic, leader-forwarded state (used by the SSO module).

Security

  • Console passwords use Argon2id in PHC format (m=19456,t=2,p=1), with transparent re-hashing of legacy hashes on login (Raft Protocol 32).
  • net/http.CrossOriginProtection is added on cookie-authenticated routes as defense in depth next to X-CSRF-Token.
  • POST /v1/auth/login only accepts JSON (prevents login CSRF).
  • Key, serial and certificate generation errors in the cluster PKI are no longer ignored.

Fixed

  • PGDG catalog generation compares versions with Debian rules (pre-releases such as 18~rc1 sort before 18.0).
  • Client connection files (DataGrip, MySQL Workbench, Navicat, DBeaver) are built with an XML encoder and use standard RFC 4122 UUIDv5 values, so control characters in names no longer break the files.
  • The SQL runner handles MySQL conditional comments (/*! ... */) and -- comments correctly.
  • HTTP clients for artifacts and the license service have timeouts.
  • publish-apt.py uploads Release / Release.gpg after the package indexes.
  • The console's live updates reconnect with exponential backoff instead of retrying in a tight loop.

Changed

  • Dependencies replace hand-written code: golang.org/x/term (password prompts), github.com/danieljoos/wincred (Windows credential store), golang.org/x/mod/semver (catalog version comparison), github.com/cenkalti/backoff/v5 (retries), github.com/google/uuid. All are pure Go (no cgo) under MIT or BSD licenses.
  • Authentication state reads are cached and invalidated immediately when the store changes.