fix(service): don't prompt for a username (OpenCode web UI sends only a password)
- the OpenCode web app's 'Add server' dialog asks for server address + password; the username defaults to 'opencode' and is never sent by the browser - so the installer no longer asks for a username (a custom one would break the web login); --username/OPENCODE_SERVER_USERNAME remain for API clients - README explains the add-server dialog and what to enter
This commit is contained in:
parent
381c1008e9
commit
b6cbcdc080
2 changed files with 2 additions and 1 deletions
|
|
@ -256,6 +256,8 @@ The service step is a **separate program** — `install-service.sh` — so you c
|
|||
|
||||
**Auth (optional).** OpenCode's server has its own HTTP basic auth — enabled purely by setting `OPENCODE_SERVER_PASSWORD` (username defaults to `opencode`, or set `OPENCODE_SERVER_USERNAME`). The installer offers this interactively, or accept it non-interactively with `--password`. The secret is **never written into the unit**: it goes into a root-only env file (`/etc/opencode/opencode.env`, mode `600`) that the unit pulls in via `EnvironmentFile=`. Use this **or** your proxy's basic auth — they don't conflict.
|
||||
|
||||
> **The web app is a client.** On first use it shows an **"Add server"** dialog asking for the **server address** and the **password** — the username is *not* asked because it defaults to `opencode`. Enter your server URL and the password you set here. It's remembered after that. Keep the username as `opencode` (a custom one would not be sent by the browser).
|
||||
|
||||
It refuses to run non-interactively unless you pass `--yes`, and backs up any existing unit before replacing it.
|
||||
|
||||
- **Default bind is `127.0.0.1`** — the server has **no authentication of its own**, so keep it loopback-only and put a reverse proxy (Zoraxy, nginx, …) in front. Choose `0.0.0.0` only if you deliberately want it exposed on your network.
|
||||
|
|
|
|||
|
|
@ -228,7 +228,6 @@ if [ "$INTERACTIVE" = 1 ] && [ "$DRY_RUN" = 0 ]; then
|
|||
printf " Protect the server with a password? [y/N]: "; v=""; tty_read v
|
||||
case "$v" in
|
||||
[Yy]*)
|
||||
printf " Username [%s]: " "$SVC_USERNAME"; v=""; tty_read v; [ -n "$v" ] && SVC_USERNAME="$v"
|
||||
pw1=""; printf " Password: "; tty_read_secret pw1
|
||||
pw2=""; printf " Confirm password: "; tty_read_secret pw2
|
||||
if [ -z "$pw1" ]; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue