docs: update example.env with all configuration variables
- Add HOST, PORT, LOG_LEVEL, and OAuth2 settings to example.env - Update README to reference example.env for complete configuration - Ensure users have all required variables for production deployment
This commit is contained in:
parent
8db1029517
commit
280e9ca357
2 changed files with 19 additions and 3 deletions
|
|
@ -82,10 +82,10 @@ mockapi/
|
|||
4. **Configure environment variables**:
|
||||
```bash
|
||||
cp example.env .env
|
||||
# Edit .env with your settings
|
||||
# Edit .env with your settings (see example.env for all available variables)
|
||||
```
|
||||
|
||||
Example `.env`:
|
||||
Minimal `.env` example:
|
||||
```ini
|
||||
DATABASE_URL=sqlite+aiosqlite:///./mockapi.db
|
||||
ADMIN_USERNAME=admin
|
||||
|
|
@ -94,6 +94,8 @@ mockapi/
|
|||
DEBUG=True # Set to False in production
|
||||
```
|
||||
|
||||
The `example.env` file includes additional configuration options for OAuth2, logging, and server settings.
|
||||
|
||||
5. **Initialize the database** (tables are created automatically on first run).
|
||||
|
||||
**For production deployment**, consider using the automated `install.sh` script which handles virtual environment creation, dependency installation, secure credential generation, and systemd service setup. See [Production Deployment with install.sh](#production-deployment-with-installsh) for details.
|
||||
|
|
|
|||
16
example.env
16
example.env
|
|
@ -2,4 +2,18 @@ DATABASE_URL=sqlite+aiosqlite:///./mockapi.db
|
|||
ADMIN_USERNAME=admin
|
||||
ADMIN_PASSWORD=admin123 # Change this in production
|
||||
SECRET_KEY=your-secret-key-here-change-me
|
||||
DEBUG=True
|
||||
|
||||
# Application Settings
|
||||
DEBUG=False
|
||||
LOG_LEVEL=INFO
|
||||
HOST=0.0.0.0
|
||||
PORT=8000
|
||||
|
||||
# OAuth2 Settings
|
||||
OAUTH2_ISSUER=http://localhost:8000
|
||||
OAUTH2_ACCESS_TOKEN_EXPIRE_MINUTES=30
|
||||
OAUTH2_REFRESH_TOKEN_EXPIRE_DAYS=7
|
||||
OAUTH2_AUTHORIZATION_CODE_EXPIRE_MINUTES=10
|
||||
OAUTH2_SUPPORTED_GRANT_TYPES=["authorization_code", "client_credentials", "refresh_token"]
|
||||
OAUTH2_SUPPORTED_SCOPES=["openid", "profile", "email", "api:read", "api:write"]
|
||||
OAUTH2_PKCE_REQUIRED=false
|
||||
|
|
|
|||
Loading…
Reference in a new issue