Web Server Auth and Security
This page focuses on authentication behavior and minimum security baseline for manyoyo serve.
Listen Address and Startup
serve supports:
<port>, e.g.3000<host:port>, e.g.127.0.0.1:3000,0.0.0.0:3000
Default listen address is 127.0.0.1:3000.
bash
# Local access only (default)
manyoyo serve
# Custom port
manyoyo serve 3000
# LAN access (requires strong password + firewall)
manyoyo serve 0.0.0.0:3000 -u admin -P 'StrongPassword'Auth Parameter Priority
Web auth parameters are serverUser and serverPass. They can come from CLI, config files, and env vars.
Priority:
command-line arguments > runs.<name> > global configuration > environment variables > defaults
Environment variables:
MANYOYO_SERVER_USERMANYOYO_SERVER_PASS
Defaults:
serverUser:adminserverPass: auto-generated random password on startup when not explicitly set
Auth Gateway Behavior
serve mode uses a global auth gateway. All pages and APIs require authentication except login-related allowlist routes.
Current anonymous allowlist:
/auth/login/auth/logout/auth/frontend/login.css/auth/frontend/login.js
Login and API Access Example
bash
# 1) Login and store cookie
curl --noproxy '*' -c /tmp/manyoyo.cookie \
-X POST http://127.0.0.1:3000/auth/login \
-H 'Content-Type: application/json' \
-d '{"username":"admin","password":"StrongPassword"}'
# 2) Access API with cookie
curl --noproxy '*' -b /tmp/manyoyo.cookie \
http://127.0.0.1:3000/api/sessions
# 3) Logout
curl --noproxy '*' -b /tmp/manyoyo.cookie \
-X POST http://127.0.0.1:3000/auth/logoutMinimum Security Baseline
- Prefer
127.0.0.1for local-only access - If using
0.0.0.0, set a strong password and restrict source IP via firewall - Avoid plain-text passwords in shared scripts; prefer protected config or env vars
- Rotate
serverPassregularly; use isolated credentials in shared environments
Common Issue
401 Unauthorized
Check in this order:
- Ensure
/auth/loginsucceeded and cookie is attached - Ensure
-u/-Pmatches effective config - Run
manyoyo config showand verify final source ofserverUser/serverPass