Skip to content

Commit 11ad9e7

Browse files
committed
🚀 Add: Configuración de producción con seguridad y performance optimizadas
## Características del perfil production: ### 🔒 **Seguridad reforzada** - CORS restrictivo con origins específicos - Cookies seguras y HTTP-only - Rate limiting estricto - Actuator endpoints limitados - Error messages ocultos ### ⚡ **Performance optimizada** - Connection pools ajustados - Cache habilitado con mayor duración - Límites conservadores en requests - JVM optimizations - Graceful shutdown ### 📊 **Monitoring preparado** - Métricas de JVM, proceso y sistema - Prometheus export habilitado - Info endpoints con metadatos - Logging estructurado ### 🛡️ **Configuración segura** - Variables de entorno para secrets - Sin información sensible en logs - Validación estricta de datos - Headers de seguridad habilitados
1 parent 98e0c8a commit 11ad9e7

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# ===============================================
2+
# SismoView Backend - Production Profile
3+
# ===============================================
4+
5+
# ========================
6+
# PRODUCTION SERVER SETTINGS
7+
# ========================
8+
server.port=8080
9+
server.shutdown=graceful
10+
spring.lifecycle.timeout-per-shutdown-phase=20s
11+
12+
# Security headers
13+
server.servlet.session.cookie.http-only=true
14+
server.servlet.session.cookie.secure=true
15+
16+
# ========================
17+
# PRODUCTION LOGGING
18+
# ========================
19+
logging.level.com.sismoview=INFO
20+
logging.level.org.springframework=WARN
21+
logging.level.org.hibernate=WARN
22+
logging.level.org.apache=WARN
23+
24+
# Structured logging for production
25+
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
26+
27+
# ========================
28+
# SECURITY & CORS
29+
# ========================
30+
sismoview.cors.allowed-origins=${ALLOWED_ORIGINS:https://sismoview.vercel.app,https://sismoview.com}
31+
sismoview.cors.allowed-methods=GET,POST,OPTIONS
32+
sismoview.cors.allowed-headers=Content-Type,Authorization,X-Requested-With
33+
sismoview.cors.allow-credentials=false
34+
35+
# ========================
36+
# RATE LIMITING - STRICT
37+
# ========================
38+
sismoview.rate-limit.enabled=true
39+
sismoview.rate-limit.requests-per-minute=30
40+
sismoview.rate-limit.burst-capacity=5
41+
42+
# ========================
43+
# PERFORMANCE OPTIMIZATIONS
44+
# ========================
45+
sismoview.seismic.cache-results=true
46+
sismoview.seismic.cache-duration-minutes=60
47+
sismoview.seismic.max-cities-per-request=25
48+
49+
# Connection pool optimizations
50+
server.tomcat.max-connections=2000
51+
server.tomcat.threads.max=100
52+
server.tomcat.threads.min-spare=25
53+
54+
# ========================
55+
# ACTUATOR - RESTRICTED
56+
# ========================
57+
management.endpoints.web.exposure.include=health,info,metrics
58+
management.endpoint.health.show-details=never
59+
management.endpoint.health.show-components=never
60+
management.security.enabled=true
61+
62+
# ========================
63+
# JVM OPTIMIZATIONS
64+
# ========================
65+
spring.jpa.hibernate.ddl-auto=validate
66+
spring.jpa.show-sql=false
67+
spring.jpa.properties.hibernate.format_sql=false
68+
69+
# ========================
70+
# ERROR HANDLING - SECURE
71+
# ========================
72+
server.error.include-stacktrace=never
73+
server.error.include-exception=false
74+
server.error.include-binding-errors=never
75+
server.error.include-message=never
76+
77+
# ========================
78+
# MONITORING & OBSERVABILITY
79+
# ========================
80+
management.metrics.enable.jvm=true
81+
management.metrics.enable.process=true
82+
management.metrics.enable.system=true
83+
management.metrics.export.prometheus.enabled=true
84+
85+
# Application info for monitoring
86+
info.app.name=@project.name@
87+
info.app.version=@project.version@
88+
info.app.encoding=@project.build.sourceEncoding@
89+
info.java.version=@java.version@

0 commit comments

Comments
 (0)