Configuration
ArchSmith uses Spring Boot's profile-based configuration system with a custom arch-smith properties prefix.
Profile System
| Profile | File | Database | Redis | Flyway | Captcha |
|---|---|---|---|---|---|
| dev (default) | application-dev.yaml | Testcontainers PostgreSQL | Testcontainers Redis | Disabled | Disabled |
| test | application-test.yaml | PostgreSQL | Real Redis | Enabled | Enabled |
| prod | application-prod.yaml | PostgreSQL (master/slave) | Real Redis | Enabled | Enabled |
Switch profiles via environment variable or JVM argument:
# Environment variable
SPRING_PROFILES_ACTIVE=prod ./gradlew server-admin:bootRun
# JVM argument
java -Dspring.profiles.active=prod -jar server-admin.jarConfiguration Files
server-admin/src/main/resources/
├── application.yaml # Shared base config (all profiles)
├── application-dev.yaml # Dev overrides
├── application-test.yaml.example # Template for test (copy and edit)
├── application-prod.yaml.example # Template for prod (copy and edit)
└── log4j2-spring.xml # Logging with <SpringProfile> sectionsWARNING
application-test.yaml and application-prod.yaml are gitignored. Always copy from the .example files and fill in real values.
ArchSmith Properties (arch-smith.*)
Core Settings
arch-smith:
name: ArchSmith # Application name
version: 1.0.0 # Version string
copyright-year: 2025 # Footer copyright year
captcha-type: math # Captcha type: "math" or "text"
rsa-private-key: "MIICeAIB..." # RSA key for frontend encryptionJWT Configuration
arch-smith:
jwt:
secret: "your-base64-secret-key" # HMAC-SHA512 signing key
expire-seconds: 604800 # Token TTL (default: 7 days)DANGER
Always change jwt.secret in production! The default key is for development only.
Token Configuration
arch-smith:
token:
header: Authorization # HTTP header name
auto-refresh-time: 20 # Auto-refresh threshold (minutes)Captcha Configuration
arch-smith:
captcha:
enabled: true # Enable/disable login captchaServer Monitor
arch-smith:
monitor:
enabled: true # Enable Oshi system monitoringEmbedded Services (Dev Only)
arch-smith:
embedded:
redis: true # Start Redis via Testcontainers
postgresql: true # Start PostgreSQL via Testcontainers
rustfs: true # Start RustFS (S3) via TestcontainersData Sensitivity
arch-smith:
sensitive:
enabled: true # Enable sensitive data masking in responsesDatasource Configuration
ArchSmith uses dynamic-datasource-spring-boot4-starter for multi-datasource support with master/slave routing.
Dev Profile (Testcontainers PostgreSQL)
spring:
datasource:
dynamic:
primary: user_master
strict: false
datasource:
user_master:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://${TESTCONTAINERS_PG_HOST}:${TESTCONTAINERS_PG_PORT}/archsmith
username: archsmith
password: archsmith
user_slave:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://${TESTCONTAINERS_PG_HOST}:${TESTCONTAINERS_PG_PORT}/archsmith
username: archsmith
password: archsmithTIP
In dev mode, Testcontainers automatically starts PostgreSQL and injects the connection properties. You do not need to configure these values manually.
Production Profile (PostgreSQL)
spring:
datasource:
dynamic:
primary: user_master
strict: false
datasource:
user_master:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://master-host:5432/archsmith
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
user_slave:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://slave-host:5432/archsmith
username: ${DB_USERNAME}
password: ${DB_PASSWORD}Use @DS("group_name") annotation for explicit datasource routing in service methods.
Flyway Configuration
arch-smith:
flyway:
enabled: true # Enable Flyway migrations (test/prod only)
spring:
jpa:
hibernate:
ddl-auto: validate # Flyway manages DDL; Hibernate only validatesSee Database Migration for the full Flyway guide.
File Storage Configuration
ArchSmith supports file upload/download with two backend options: local filesystem and S3-compatible storage (e.g., RustFS).
Local Storage
arch-smith:
file-storage:
type: local
local:
base-path: /data/archsmith/uploads # Directory for stored filesS3 / RustFS Storage
arch-smith:
file-storage:
type: s3
s3:
endpoint: http://localhost:9000 # RustFS or S3 endpoint
access-key: ${MINIO_ACCESS_KEY}
secret-key: ${MINIO_SECRET_KEY}
bucket: archsmith # Default bucket name
region: us-east-1 # AWS region (or leave default for RustFS)TIP
In dev mode, RustFS is auto-started via Testcontainers. The S3 endpoint and credentials are injected automatically — no manual configuration needed.
Logging
Logging is configured in log4j2-spring.xml using <SpringProfile> for profile-specific behavior:
- dev: Console output with colored formatting
- non-dev: File-only output with rotation
OpenTelemetry
management:
tracing:
sampling:
probability: 1.0 # dev: 100%, prod: 0.1 (10%)
otlp:
tracing:
endpoint: http://localhost:4318/v1/traces
metrics:
endpoint: http://localhost:4318/v1/metricsOverride the OTLP endpoint in production via OTEL_EXPORTER_OTLP_ENDPOINT environment variable.
Actuator Endpoints
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus| Endpoint | URL |
|---|---|
| Health | http://localhost:8080/actuator/health |
| Metrics | http://localhost:8080/actuator/metrics |
| Prometheus | http://localhost:8080/actuator/prometheus |
Related Pages
- Local Development Setup — dev environment details
- Database Migration — Flyway configuration
- Production Guide — production config checklist
---