90 lines
1.8 KiB
TOML
Raw Normal View History

2026-01-31 16:36:09 +08:00
[default]
app.name = "{{ cookiecutter.project_name }}"
2026-01-31 19:26:28 +08:00
app.version = "{{ cookiecutter.project_name }}"
2026-02-02 13:36:57 +08:00
app.description = "基于 FastAPI 和 Tortoise-ORM 的 {{ cookiecutter.project_name }} 打包脚手架"
2026-01-31 16:36:09 +08:00
app.debug = false
env = "production"
[database]
2026-01-31 19:26:28 +08:00
type = "sqlite"
2026-01-31 16:36:09 +08:00
generate_schemas = true # 生产环境使用迁移工具
2026-01-31 19:26:28 +08:00
[database.sqlite]
engine = "tortoise.backends.sqlite"
file_path = "db.sqlite3"
journal_mode = "WAL"
busy_timeout = 10000
maxsize = 10
minsize = 1
cache_size = -2000
synchronous = "NORMAL"
temp_store = "MEMORY"
mmap_size = 1073741824
foreign_keys = true
auto_vacuum = "INCREMENTAL"
max_cached_statements = 100
readonly = false
2026-01-31 16:36:09 +08:00
[security]
secret_key = "your-secret-key-change-in-production"
algorithm = "HS256"
access_token_expire_minutes = 30
2026-02-02 13:36:57 +08:00
refresh_token_expire_days = 7
[jwt_cache]
enabled = true
db_path = "./cache"
cleanup_interval_hours = 24
max_sessions_per_user = 5
2026-01-31 16:36:09 +08:00
[development]
env = "development"
debug = true
[development.server]
host = "127.0.0.1"
port = 8000
reload = true
# workers = 4
[development.logging]
level = "DEBUG"
file = "logs/dev.log"
[development.cors]
allow_origins = ["*"]
allow_credentials = true
allow_methods = ["*"]
allow_headers = ["*"]
[production]
env = "production"
debug = false
[production.server]
host = "0.0.0.0"
port = 8000
reload = false
workers = 1
[production.logging]
level = "INFO"
file = "logs/prod.log"
[production.cors]
2026-01-31 19:26:28 +08:00
allow_origins = ["https://yourdomain.com", "http://localhos:8000", "http://127.0.0.1:8000"]
2026-01-31 16:36:09 +08:00
allow_credentials = true
allow_methods = ["GET", "POST", "PUT", "DELETE"]
allow_headers = ["Authorization", "Content-Type"]
[production.module_system]
type = "module-bank"
path = ["resources/app.mbank", "resources/plugins.mbank"]
[production.file_system]
type = "svfs"
path = "resources/application.vfs"
[cache]
2026-01-31 19:26:28 +08:00
default_ttl = 300