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
@@ -542,6 +542,25 @@ If you disable URL validation or response header filtering, harden your network
|
||||
- Enforce TLS-only outbound traffic
|
||||
- Strip sensitive upstream response headers at the proxy
|
||||
|
||||
#### ⚠️ Important: Creating the Admin Account
|
||||
|
||||
The initial admin account is **only created via the setup wizard** (served at `http://<host>:8080` on first run). The `default.admin_email` / `default.admin_password` fields in `config.yaml` are **not used** to create it — they exist in the template for historical reasons.
|
||||
|
||||
Because step 5 above pre-creates `config.yaml`, the setup wizard will be **skipped on first run**: the server detects an existing config and boots straight into normal mode with an empty `users` table, so the first login attempt fails with `invalid email or password`.
|
||||
|
||||
**Two ways to create the admin account:**
|
||||
|
||||
1. **Recommended — let the wizard generate `config.yaml`:** Skip step 5 (do not run the `cp`). Start `./sub2api` directly; the setup wizard at `http://localhost:8080` walks you through database, Redis, and admin account setup, then writes `config.yaml` for you.
|
||||
|
||||
2. **If you already created `config.yaml`:** Temporarily move it aside so the wizard can trigger on first run, then restore it afterwards:
|
||||
```bash
|
||||
mv config.yaml config.yaml.bak
|
||||
./sub2api # wizard runs at http://localhost:8080 and writes a fresh config.yaml
|
||||
# stop the server (Ctrl+C) once the wizard completes, then restore your config:
|
||||
mv config.yaml.bak config.yaml
|
||||
./sub2api # restart in normal mode and log in with the admin you just created
|
||||
```
|
||||
|
||||
```bash
|
||||
# 6. Run the application
|
||||
./sub2api
|
||||
|
||||
Reference in New Issue
Block a user