System Settings
Database-backed configuration for authentication, SMTP, file storage, rate limiting, and more — manageable via Admin UI or API.
System Settings
FastCMS includes a comprehensive settings system for storing application configuration values in the database. Settings can be managed via the Admin UI or API.
Files
Manage uploaded files and media
hero-banner.png
142 KB
product-shot.jpg
88 KB
report-q1.pdf
2.1 MB
thumbnail.webp
34 KB
data-export.csv
512 KB
logo-dark.svg
8 KB
bg-pattern.png
67 KB
user-avatar.jpg
22 KB
readme.txt
4 KB
video-thumb.jpg
56 KB
schema.json
18 KB
banner-mobile.png
95 KB
Admin UI
Navigate to Admin > Settings to access the settings interface with four tabs:
Authentication Tab
Configure how users authenticate:
- Authentication methods (password, OAuth, OTP, MFA)
- OAuth behavior (auto-create users, link by email, require verification)
- Password requirements (minimum length, complexity)
- Token settings (access and refresh token expiry)
OAuth Providers Tab
Manage OAuth providers for social login:
- View configured providers with status
- Add new providers (29 supported)
- Edit provider credentials
- Enable/disable and reorder providers
Mail Tab
Configure SMTP for sending emails:
- SMTP host, port, username, password
- From email address and display name
Storage Tab
Configure file storage:
- Storage type (Local, S3, or Azure Blob Storage)
- Maximum file size
- S3 and Azure credentials
Setting Categories
| Category | Description |
|---|---|
app | General application settings |
auth | Authentication and security |
mail | Email/SMTP configuration |
storage | File storage configuration |
backup | Backup settings |
logs | Request logging settings |
Default Settings Reference
App
| Key | Default | Description |
|---|---|---|
app_name | "FastCMS" | Application name |
app_url | "http://localhost:8000" | Application URL |
rate_limit_per_minute | 100 | Rate limit per minute |
rate_limit_per_hour | 1000 | Rate limit per hour |
Auth
| Key | Default | Description |
|---|---|---|
password_auth_enabled | true | Enable password authentication |
oauth_enabled | true | Enable OAuth2 |
oauth_auto_create_user | true | Auto-create on OAuth login |
password_min_length | 8 | Minimum password length |
password_require_upper | false | Require uppercase letter |
password_require_number | false | Require number |
password_require_special | false | Require special character |
token_expiry_hours | 24 | Access token expiry |
refresh_token_expiry_days | 7 | Refresh token expiry |
verification_required | false | Require email verification |
| Key | Default | Description |
|---|---|---|
smtp_host | "" | SMTP server host |
smtp_port | 587 | SMTP server port |
smtp_user | "" | SMTP username |
smtp_password | "" | SMTP password |
from_email | "noreply@fastcms.dev" | From email address |
from_name | "FastCMS" | From display name |
Storage
| Key | Default | Description |
|---|---|---|
type | "local" | Storage type (local/s3/azure) |
max_file_size | 10485760 | Max file size (10 MB) |
s3_bucket | "" | S3 bucket name |
s3_region | "" | S3 region (e.g., us-east-1) |
azure_container | "" | Azure container name |
azure_connection_string | "" | Azure connection string |
Backup
| Key | Default | Description |
|---|---|---|
enabled | true | Enable automated backups |
cron_schedule | "0 2 * * *" | Cron schedule (2 AM daily) |
retention_days | 30 | Keep backups for N days |
s3_enabled | false | Upload to S3 |
Settings API
Get All Settings
GET /api/v1/settings
Authorization: Bearer ADMIN_TOKENGet Settings by Category
curl "http://localhost:8000/api/v1/settings/auth" \
-H "Authorization: Bearer ADMIN_TOKEN"{
"password_auth_enabled": {
"value": true,
"description": "Enable password authentication"
},
"password_min_length": {
"value": 8,
"description": "Minimum password length"
}
}Update a Setting
POST /api/v1/settings
Authorization: Bearer ADMIN_TOKEN
Content-Type: application/json
{
"key": "password_min_length",
"value": 12,
"category": "auth",
"description": "Minimum password length"
}Delete a Setting
DELETE /api/v1/settings/{key}
Authorization: Bearer ADMIN_TOKENProgrammatic Access
from app.services.settings_service import SettingsService
async def example(db):
settings = SettingsService(db)
# Get a setting with default
min_length = await settings.get("password_min_length", default=8)
# Set a setting
await settings.set(
key="maintenance_mode",
value=True,
category="app",
description="Enable maintenance mode"
)
# Get all settings in a category
auth_settings = await settings.get_category("auth")Common Recipes
Enable Strict Password Policy
curl -X POST "http://localhost:8000/api/v1/settings" \
-H "Authorization: Bearer ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "password_min_length", "value": 12, "category": "auth"}'
curl -X POST "http://localhost:8000/api/v1/settings" \
-H "Authorization: Bearer ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "password_require_upper", "value": true, "category": "auth"}'Enable Maintenance Mode
{
"key": "maintenance_mode",
"value": true,
"category": "app",
"description": "Site is under maintenance"
}Configure Rate Limiting
{
"key": "rate_limit_per_minute",
"value": 60,
"category": "app"
}Best Practices
- Use Categories — Organize related settings together
- Add Descriptions — Always include helpful descriptions for future reference
- Set Defaults — Define sensible defaults in code, override via settings
- Use Admin UI — Prefer the Admin UI for interactive configuration
- Backup Settings — Settings are included in database backups automatically