Railway template doesn't validate/generate DATABASE_ENCRYPTION_KEY in correct format, causing cryptic failure only surfaced when password-protecting a video
まだ誰も着手していません。
評価
調査の方向性
Railway のワンクリックテンプレートとサーバーの起動設定から始め、DATABASE_ENCRYPTION_KEY がどのように生成、記述され、必要な 32 バイト形式に対して検証されるかを確認します。無効な値が明確なメッセージとともに早い段階で失敗し、テンプレートが指定された openssl コマンドを使った有効な 64 文字の 16 進数値を提供または記述していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
Deploying Cap via the official Railway one-click template can leave DATABASE_ENCRYPTION_KEY set to an invalid length/format with no validation or clear error at deploy time or server startup. The failure only surfaces later, when a user tries to password-protect a video, producing a cryptic server error:
Error verifying video password: Error: Encryption failed: Invalid encryption key format: Encryption key must be 32 bytes (64 hex characters)
This is the same underlying issue as #1357, which was closed after the reporter regenerated their key with openssl rand -hex 32. That fixed their case, but the root gap remains: nothing catches or explains an invalid key until a user happens to exercise the one feature (video passwords) that touches it.
Suggested improvements
- Validate
DATABASE_ENCRYPTION_KEYformat at server startup and fail fast with a clear error, rather than only failing when a specific feature is used. -
- If the Railway template auto-generates this variable, confirm the generator produces a 64-character hex string (32 bytes) — a mismatched generator (e.g., a generic 32-character secret generator) would explain why this keeps recurring.
-
- Surface the exact fix command (
openssl rand -hex 32) directly in the Railway template's deploy-time variable description, not just in the general self-hosting docs.
Environment
Deployment: Self-hosted via Railway one-click template (ghcr.io/capsoftware/cap-web:latest)
- Surface the exact fix command (
Related issues
Related to #1357
- 主要言語
- Rust
- スター
- 22.5k
- フォーク
- 1.9k
- 平均マージ
- 6時間 33分
- マージ済み PR(30日)
- 77
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CapSoftware/Cap のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
CapSoftware/Cap#2305 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CapSoftware/Cap#1714 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
CapSoftware/Cap#2329 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
CapSoftware/Cap#2328 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
CapSoftware/Cap#2324 · コメント 1 件 ·
CapSoftware/Cap の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
state:needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
zed-industries/zed#64680 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
RustPython/RustPython#8802 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
TheLarkInn/aipm#2390 ·