Startup safety checks run only in Production, and two unsafe defaults ship switched on

Abierto
#3,298 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp

Línea de trabajo

Start with DependencyInjection/ProductionStartupChecks.cs, PublicOriginCheck.cs, and UnencryptedKeyRingCheck.cs, then read docs/host-configuration.md and the named OpenAPI cache policy and .env.example entries. Check the existing tests around the environment gate and cache policy. Done means checks run outside Development, both opt-ins are off by default, and OpenAPI caching is shared across Host values with a relative server URL when no origin is configured.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:host area:operations security type:bug

Problem

  1. Startup safety checks run only in Production. DependencyInjection/ProductionStartupChecks.cs:19 returns unless IsProduction(); PublicOriginCheck.cs:11 and UnencryptedKeyRingCheck.cs:11 gate again. docs/host-configuration.md:195 documents it. A Staging or custom-named environment starts with no PublicOrigin, a generated signing key and an unencrypted key ring, and builds reset links from a forged Host (Api/Account/ForgotPasswordModel.cs:23).
  2. .env.example ships two unsafe opt-ins switched on. src/FluentCMS.Host/.env.example:20-21 set FLUENTCMS_ALLOW_GENERATED_SIGNING_KEY=true and FLUENTCMS_ALLOW_UNENCRYPTED_KEY_RING=true; compose defaults both to false.
  3. The OpenAPI document is cached per Host value. Api/OpenApi/OpenApiDocumentCachePolicy.cs:27-35 varies by host for one day when no public origin is set. Forged hosts each cost a document build and evict other entries of the shared output cache.

Paths are under src/FluentCMS.Core/ unless they start with src/ or docs/.

Proposal

  • Enforce the checks in every environment except Development; update docs/host-configuration.md.
  • Ship the two opt-ins commented out, with the line that explains them.
  • Do not vary the OpenAPI cache by host; emit a relative server URL when no origin is set.

Done together with #3286 and #3275, which touch the same host startup and probe code.

Acceptance

  • A host in Staging without the settings refuses to start and names what is missing
  • Development still starts without them
  • A copy of .env.example has neither opt-in on
  • Requests with different Host values share one cached OpenAPI document
  • Tests for the environment gate and the cache policy

Found in the code review of 17 Nov 2026.

Lenguaje dominante
C#
Estrellas
569
Forks
107
Merge medio
2 h 49 min
PR fusionados (30 d)
397

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fluentcms/FluentCMS

Todos los issues de fluentcms/FluentCMS

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.