Files
go-omni/cmd/go-omni/scaffold/templates/modules-config.yaml.tmpl

31 lines
1.3 KiB
Cheetah

# Only fields listed here override Default(). Environment names are explicit.
server:
# Optional cross-origin access: server.cors (disabled by default). See framework cors/README.md.
address: "${GO_OMNI_HTTP_ADDR:-127.0.0.1:8080}"
transport: "${GO_OMNI_TRANSPORT:-nethttp}"
{{if ne .Storage "none"}}storage:
{{if not .API}} filesToken: "${GO_OMNI_FILES_TOKEN}"
{{end}}{{if eq .Storage "local"}} root: "${GO_OMNI_STORAGE_ROOT:-var/files}"
publicUrl: "${GO_OMNI_STORAGE_PUBLIC_URL:-http://127.0.0.1:8080/storage/object}"
signingKey: "${GO_OMNI_STORAGE_SIGNING_KEY}"
{{else}} bucket: "${GO_OMNI_STORAGE_BUCKET}"
accessKey: "${GO_OMNI_STORAGE_ACCESS_KEY}"
secretKey: "${GO_OMNI_STORAGE_SECRET_KEY}"
sessionToken: "${GO_OMNI_STORAGE_SESSION_TOKEN:-}"
{{if eq .Storage "r2"}} accountId: "${GO_OMNI_STORAGE_ACCOUNT_ID}"
{{else if eq .Storage "s3"}} endpoint: "${GO_OMNI_STORAGE_ENDPOINT}"
region: "${GO_OMNI_STORAGE_REGION:-us-east-1}"
{{else}} region: "${GO_OMNI_STORAGE_REGION:-cn-hangzhou}"
{{end}}{{end}}{{end}}
{{if and .API (eq .Database "mysql")}}database:
host: "${GO_OMNI_DB_HOST:-127.0.0.1}"
port: "${GO_OMNI_DB_PORT:-3306}"
database: "${GO_OMNI_DB_DATABASE}"
user: "${GO_OMNI_DB_USER}"
password: "${GO_OMNI_DB_PASSWORD}"
{{end}}
{{if and (not .API) (eq .Database "mysql")}}database:
driver: mysql
dsn: "${GO_OMNI_DB_DSN}"
{{end}}