-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into docs/ru-translate
- Loading branch information
Showing
27 changed files
with
1,154 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
node: | ||
packageManager: 'pnpm' | ||
pnpm: | ||
version: 9.11.0 | ||
version: 9.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
docs/src/content/docs/es/guides/hosting-integrations/netlify.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
# SPDX-FileCopyrightText: 2024 KindSpells Labs S.L. | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
title: Netlify | ||
description: Cómo configurar Astro-Shield para que funcione en Netlify | ||
--- | ||
|
||
import { Aside, Code } from '@astrojs/starlight/components'; | ||
|
||
## `Content-Security-Policy` para contenido estático | ||
|
||
Asegurar que Netlify sirve vuestro contenido estático con las cabeceras | ||
`Content-Security-Policy` requiere algo de configuración adicional. | ||
Concretamente, hay que asignar el valor `"netlify"` para la entrada | ||
`securityHeaders.enableOnStaticPages.provider` de nuestra configuración. | ||
|
||
Aquí tenéis un ejemplo más completo: | ||
|
||
```js | ||
import { resolve } from 'node:path' | ||
|
||
import { defineConfig } from 'astro/config' | ||
import { shield } from '@kindspells/astro-shield' | ||
|
||
const rootDir = new URL('.', import.meta.url).pathname | ||
const modulePath = resolve(rootDir, 'src', 'generated', 'sriHashes.mjs') | ||
|
||
export default defineConfig({ | ||
integrations: [ | ||
shield({ | ||
// - Si se establece, controla cómo se generarán las cabeceras de | ||
// seguridad. | ||
// - Si no se establece, no se generarán cabeceras de seguridad. | ||
securityHeaders: { | ||
// Esta opción es necesaria para configurar las cabeceras CSP para tu | ||
// contenido estático en Netlify. | ||
enableOnStaticPages: { provider: "netlify" }, | ||
|
||
// - Si se establece, controla cómo se generará la cabecera CSP | ||
// (Content Security Policy). | ||
// - Si no se establece, no se configurará ninguna cabecera CSP | ||
// para tu contenido estático (no es necesario especificar sus | ||
// opciones internas). | ||
contentSecurityPolicy: { | ||
// - Si se establece, controla las directivas CSP "por | ||
// defecto" (pueden ser sobreescritas en tiempo de ejecución). | ||
// - Si no se establece, Astro-Shield usará un conjunto mínimo | ||
// de directivas por defecto. | ||
cspDirectives: { | ||
'default-src': "'none'", | ||
} | ||
} | ||
} | ||
}) | ||
] | ||
}) | ||
``` | ||
<Aside type='caution'> | ||
Por ahora, el soporte para la generación de cabeceras en páginas estáticas | ||
se limita al archivo `_headers` que Netlify lee del directorio de despliegue | ||
(típicamente `dist/`). | ||
Todavía no hay soporte para otros métodos como el archivo `netlify.toml`. | ||
</Aside> | ||
<Aside type='tip'> | ||
Para ver cómo configurar las cabeceras CSP para vuestro contenido dinámico, | ||
consultad la página | ||
[Content-Security-Policy (CSP)](/es/guides/security-headers/content-security-policy/#activando-csp-para-contenido-ssr). | ||
</Aside> | ||
<Aside type='tip'> | ||
Para aprender más sobre cómo configurar cabeceras para contenido estático en | ||
Netlify, consultad su documentación oficial: | ||
- [Netlify: Headers](https://docs.netlify.com/routing/headers) | ||
- [Netlify: File Based Configuration (Headers)](https://docs.netlify.com/configure-builds/file-based-configuration/#headers) | ||
</Aside> |
77 changes: 77 additions & 0 deletions
77
docs/src/content/docs/es/guides/hosting-integrations/vercel.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
# SPDX-FileCopyrightText: 2024 KindSpells Labs S.L. | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
title: Vercel | ||
description: Cómo configurar Astro-Shield para que funcione en Vercel | ||
--- | ||
|
||
import { Aside, Code } from '@astrojs/starlight/components'; | ||
|
||
## `Content-Security-Policy` para contenido estático | ||
|
||
Asegurar que Vercel sirve vuestro contenido estático con las cabeceras | ||
`Content-Security-Policy` correctas requiere algo de configuración adicional. | ||
Concretamente: | ||
1. Asignad el valor `"vercel"` a la entrada | ||
`securityHeaders.enableOnStaticPages.provider` de vuestra configuración. | ||
2. Asignad el adaptador `@astrojs/vercel/static` (instalad el paquete | ||
`@astrojs/vercel`, podéis consultar | ||
[su documentación](https://docs.astro.build/es/guides/deploy/vercel/). | ||
|
||
Aquí tenéis un ejemplo más completo: | ||
|
||
```js | ||
import { resolve } from 'node:path' | ||
|
||
import vercel from '@astrojs/vercel/static'; | ||
import { shield } from '@kindspells/astro-shield' | ||
import { defineConfig } from 'astro/config' | ||
|
||
const rootDir = new URL('.', import.meta.url).pathname | ||
const modulePath = resolve(rootDir, 'src', 'generated', 'sriHashes.mjs') | ||
|
||
export default defineConfig({ | ||
adapter: vercel(), | ||
integrations: [ | ||
shield({ | ||
// - Si se establece, controla cómo se generarán las cabeceras de | ||
// seguridad. | ||
// - Si no se establece, no se generarán cabeceras de seguridad. | ||
securityHeaders: { | ||
// Esta opción es necesaria para configurar las cabeceras CSP para tu | ||
// contenido estático en Vercel. | ||
enableOnStaticPages: { provider: "vercel" }, | ||
|
||
// - Si se establece, controla cómo se generará la cabecera CSP | ||
// (Content Security Policy). | ||
// - Si no se establece, no se configurará ninguna cabecera CSP | ||
// para tu contenido estático (no es necesario especificar sus | ||
// opciones internas). | ||
contentSecurityPolicy: { | ||
// - Si se establece, controla las directivas CSP "por | ||
// defecto" (pueden ser sobreescritas en tiempo de ejecución). | ||
// - Si no se establece, Astro-Shield usará un conjunto mínimo | ||
// de directivas por defecto. | ||
cspDirectives: { | ||
'default-src': "'none'", | ||
} | ||
} | ||
} | ||
}) | ||
] | ||
}) | ||
``` | ||
<Aside type='tip'> | ||
Para ver cómo configurar las cabeceras CSP para vuestro contenido dinámico, | ||
consultad la página | ||
[Content-Security-Policy (CSP)](/es/guides/security-headers/content-security-policy/#activando-csp-para-contenido-ssr). | ||
</Aside> | ||
<Aside type='tip'> | ||
Para aprender más sobre cómo configurar cabeceras para contenido estático en | ||
Vercel, consultad su documentación oficial: | ||
- [Vercel: Headers](https://vercel.com/docs/projects/project-configuration#headers) | ||
</Aside> |
Oops, something went wrong.