mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
docs: note admin account wizard requirement in source-compile install
Method 3 (source compile) instructs users to pre-create config.yaml, but does not mention that doing so disables the setup wizard — the only code path that creates the initial admin account. Users following the README end up with a running server and an empty users table, and login fails with "invalid email or password". The default.admin_email / default.admin_password fields in config.yaml are loaded into the config struct but never read by any code path (setup.SetupConfig.Admin is tagged yaml:"-"), so they cannot serve as an alternative way to seed the admin. Add a "Creating the Admin Account" subsection to Method 3 in all three language READMEs (EN/CN/JA), explaining the wizard dependency and two workarounds: let the wizard generate config.yaml, or temporarily move config.yaml aside to trigger the wizard on first run. Related: #521 (docker variant of the same symptom), #2617, #2350. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
5f022663ac
commit
98feeccbe1
@@ -540,6 +540,25 @@ URL バリデーションまたはレスポンスヘッダーフィルタリン
|
||||
- TLS のみのアウトバウンドトラフィックを強制
|
||||
- プロキシで機密性の高い上流レスポンスヘッダーを除去
|
||||
|
||||
#### ⚠️ 重要:管理者アカウントの作成
|
||||
|
||||
初期管理者アカウントは**セットアップウィザード経由でのみ作成**されます(初回起動時に `http://<host>:8080` にアクセス)。`config.yaml` の `default.admin_email` / `default.admin_password` フィールドは**管理者作成には使われません**。テンプレートに残っているのは歴史的経緯によるものです。
|
||||
|
||||
上記ステップ 5 で事前に `config.yaml` を作成しているため、**初回起動時にセットアップウィザードはスキップされます**。サーバーは既存の config を検出して通常モードで直接起動し、この時点では `users` テーブルが空のため、初回ログインは `invalid email or password` を返します。
|
||||
|
||||
**管理者アカウントを作成する 2 つの方法:**
|
||||
|
||||
1. **推奨 — ウィザードに `config.yaml` を自動生成させる:** 上記ステップ 5 をスキップします(`cp` を実行しない)。`./sub2api` を直接起動し、`http://localhost:8080` にアクセスすると、セットアップウィザードがデータベース・Redis・管理者アカウントの設定を案内し、`config.yaml` を自動生成します。
|
||||
|
||||
2. **すでに `config.yaml` を作成してしまった場合:** 初回起動前に一時的に退避してウィザードを発生させ、完了後に戻します:
|
||||
```bash
|
||||
mv config.yaml config.yaml.bak
|
||||
./sub2api # ウィザードが http://localhost:8080 で起動し、新しい config.yaml を生成します
|
||||
# ウィザード完了後、Ctrl+C でサーバーを停止し、設定を復元します:
|
||||
mv config.yaml.bak config.yaml
|
||||
./sub2api # 通常モードで再起動し、作成した管理者でログインします
|
||||
```
|
||||
|
||||
```bash
|
||||
# 6. アプリケーションを実行
|
||||
./sub2api
|
||||
|
||||
Reference in New Issue
Block a user