Files
ERP/oa-backend/src/main/resources/application.yml
T

75 lines
2.7 KiB
YAML

server:
port: 8090
# Reconstruct the public scheme/host when running behind Nginx, Caddy or a
# tunnel so same-origin HTTPS requests are not rejected as cross-origin.
forward-headers-strategy: framework
spring:
application:
name: oa-backend
servlet:
multipart:
# Real file upload (FileController). Single file up to 50MB; whole request a bit larger.
max-file-size: 50MB
max-request-size: 60MB
# ---------------------------------------------------------------------------
# Local development defaults to SQLite. Production must activate the postgres
# profile and provide OA_DB_URL/OA_DB_USERNAME/OA_DB_PASSWORD.
# ---------------------------------------------------------------------------
datasource:
url: jdbc:sqlite:./data/oa.db
driver-class-name: org.sqlite.JDBC
username:
password:
hikari:
maximum-pool-size: 2
minimum-idle: 1
jpa:
hibernate:
ddl-auto: update
database-platform: org.hibernate.community.dialect.SQLiteDialect
open-in-view: false
show-sql: false
properties:
hibernate:
dialect: org.hibernate.community.dialect.SQLiteDialect
format_sql: false
hbm2ddl:
# 逐表读取列元数据,避免 SQLite 在表数量较多时报
# "too many terms in compound SELECT"(启动期 schema 校验崩溃)。
jdbc_metadata_extraction_strategy: individually
flyway:
# SQLite remains a zero-setup local development option only. Production
# migrations are enabled by application-postgres.yml.
enabled: false
# CORS origins allowed for /api/** are configured in WebConfig (CorsConfig).
# Allowed: http://localhost:8080, http://localhost:5173, http://127.0.0.1:*
logging:
level:
root: INFO
com.kaidi.oa: INFO
# ---------------------------------------------------------------------------
# 统一 AI 服务层 (AiService -> Anthropic Messages API)。
# api-key 留空 = 优雅降级模式:/api/oa/ai/* 不报错,返回 configured=false 的提示,活体不崩。
# 要真正产出 AI 结果:把 api-key 填上,或设置环境变量 ANTHROPIC_API_KEY。
# ---------------------------------------------------------------------------
oa:
seed:
demo: ${OA_SEED_DEMO:true}
ai:
api-key: ""
model: claude-haiku-4-5-20251001
update:
enabled: ${OA_UPDATE_ENABLED:false}
gitea-base-url: ${OA_UPDATE_GITEA_BASE_URL:https://git.awaioi.com}
repository: ${OA_UPDATE_REPOSITORY:awaioi/ERP}
channel: ${OA_UPDATE_CHANNEL:stable}
token: ${OA_UPDATE_TOKEN:}
helper-command: ${OA_UPDATE_HELPER_COMMAND:}
state-file: ${OA_UPDATE_STATE_FILE:./runtime/update-state.json}
config-file: ${ERP_CONFIG_FILE:}
allow-insecure-http: ${OA_UPDATE_ALLOW_INSECURE_HTTP:false}