37 lines
711 B
Markdown
37 lines
711 B
Markdown
# Ubuntu User Management API (FastAPI, V1)
|
|
|
|
## Run
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
```
|
|
|
|
## Required Env
|
|
|
|
- `TOKEN`
|
|
- `HOME_BASE_DIR` (default `/home`)
|
|
- `USE_LIBUSER` (default `false`)
|
|
- `LOG_LEVEL` (default `INFO`)
|
|
- `LOG_PATH` (default `./logs/user_manage_api.log`)
|
|
- `SUDO_PATH` (default `/usr/bin/sudo`)
|
|
|
|
## Notes
|
|
|
|
- API process should run as non-root.
|
|
- System account commands are executed through sudo allowlist.
|
|
- Password input is pre-hashed only (no plaintext transformation in service).
|
|
- Deleting user keeps home directory by default.
|
|
|
|
## Test
|
|
|
|
```bash
|
|
pytest -q
|
|
```
|
|
|
|
## Generate Python SDK
|
|
|
|
```bash
|
|
python scripts/generate_python_sdk.py
|
|
```
|