Skip to content

Commit

Permalink
Merge branch 'main' into docs/ru-translate
Browse files Browse the repository at this point in the history
  • Loading branch information
castarco authored Oct 6, 2024
2 parents d1409a7 + 40c2034 commit ae61acd
Show file tree
Hide file tree
Showing 27 changed files with 1,154 additions and 543 deletions.
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,27 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
groups:
prod-deps-security:
applies-to: "security-updates"
dependency-type: "production"
dev-deps-security:
applies-to: "security-updates"
dependency-type: "development"
prod-deps:
applies-to: "version-updates"
dependency-type: "production"
dev-deps:
applies-to: "version-updates"
dependency-type: "development"
ignore:
- dependency-name: "@types/node"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
- "version-update:semver-patch"
- dependency-name: "typescript"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
- "version-update:semver-patch"
6 changes: 3 additions & 3 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
build:
strategy:
matrix:
node-version: [20]
os: [ubuntu-22.04]
node-version: [22]
os: [ubuntu-24.04]

runs-on: ${{ matrix.os }}

Expand All @@ -25,7 +25,7 @@ jobs:
- name: Install PNPM # v3.0.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: '9.11.0'
version: '9.12.0'
- name: Use Node.js ${{ matrix.node-version }} # v4.0.2
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
node-version: [ 18, 20, 22 ]
os: [ubuntu-22.04]
os: [ubuntu-24.04]

runs-on: ${{ matrix.os }}

Expand All @@ -33,7 +33,7 @@ jobs:
- name: Install PNPM # v3.0.0
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: '9.11.0'
version: '9.12.0'
- name: Use Node.js ${{ matrix.node-version }} # v4.0.2
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
Expand Down
2 changes: 1 addition & 1 deletion .moon/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
node:
packageManager: 'pnpm'
pnpm:
version: 9.11.0
version: 9.12.0
6 changes: 3 additions & 3 deletions @kindspells/astro-shield/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
},
"devDependencies": {
"@types/node": "^22.7.4",
"astro": "^4.15.9",
"astro": "^4.15.11",
"get-tsconfig": "^4.8.1",
"rollup": "^4.22.5",
"rollup": "^4.24.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"typescript": "^5.6.2",
"vite": "^5.4.8",
"vitest": "^2.1.1"
"vitest": "^2.1.2"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "MIT",
"dependencies": {
"@astrojs/node": "^8.3.4",
"astro": "^4.15.9"
"astro": "^4.15.11"
},
"devDependencies": {
"@kindspells/astro-shield": "workspace:*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"dependencies": {
"@astrojs/node": "^8.3.4",
"astro": "^4.15.9"
"astro": "^4.15.11"
},
"devDependencies": {
"@kindspells/astro-shield": "workspace:*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"dependencies": {
"@astrojs/node": "^8.3.4",
"astro": "^4.15.9"
"astro": "^4.15.11"
},
"devDependencies": {
"@kindspells/astro-shield": "workspace:*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"dependencies": {
"@astrojs/node": "^8.3.4",
"astro": "^4.15.9"
"astro": "^4.15.11"
},
"devDependencies": {
"@kindspells/astro-shield": "workspace:*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "MIT",
"dependencies": {
"astro": "^4.15.9"
"astro": "^4.15.11"
},
"devDependencies": {
"@kindspells/astro-shield": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
"organizeImports": { "enabled": true },
"files": {
"include": ["*.json", "*.js", "*.mjs", "*.mts", "*.d.ts"],
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"dependencies": {
"astro-sst": "^2.43.5",
"sharp": "0.33.5",
"sst": "^3.1.49"
"sst": "^3.1.67"
},
"devDependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/check": "^0.9.4",
"@astrojs/starlight": "^0.28.2",
"@astrojs/ts-plugin": "^1.10.2",
"@kindspells/astro-shield": "workspace:^",
"astro": "^4.15.9",
"astro": "^4.15.11",
"typescript": "^5.6.2"
}
}
2 changes: 1 addition & 1 deletion docs/src/content/docs/ca/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hero:
file: ../../../assets/astro-shield.webp
actions:
- text: Començar
link: /getting-started/
link: /ca/getting-started/
icon: right-arrow
variant: primary
- text: Aprèn sobre les integracions d'Astro
Expand Down
80 changes: 80 additions & 0 deletions docs/src/content/docs/es/guides/hosting-integrations/netlify.mdx
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 docs/src/content/docs/es/guides/hosting-integrations/vercel.mdx
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>
Loading

0 comments on commit ae61acd

Please sign in to comment.