Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/content/docs/ko/guides/deploy/cleavr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ logo: cleavr
supports: ['ssr', 'static']
i18nReady: true
---

import { Steps } from '@astrojs/starlight/components';

서버 및 앱 배포 관리 도구인 [Cleavr](https://cleavr.io/)을 사용하여 Astro 프로젝트를 자체 VPS (Virtual Private Server)에 배포할 수 있습니다.
Expand Down
44 changes: 43 additions & 1 deletion src/content/docs/ko/reference/experimental-flags/csp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default defineConfig({
</head>
```

### 하위 클래스 값 추가하기
##### 하위 클래스 값 추가하기

이 필드를 사용하여 [`script-src-attr`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src-attr), [`script-src-elem`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src-elem), [`style-src-attr`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/style-src-attr), [`style-src-elem`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/style-src-elem)에 속하는 유효한 값 (예: `unsafe-hashes` 및 `unsafe-inline`)을 추가할 수도 있습니다.

Expand Down Expand Up @@ -229,6 +229,48 @@ export default defineConfig({
</head>
```

##### 다중 리소스

리소스를 여러 번 또는 여러 소스 (예: `csp` 구성에 정의된 것과 [CSP 런타임 API](#런타임-api)를 사용하여 추가된 것)로부터 삽입할 때, Astro는 중복을 제거하고 새로운 리소스들을 병합합니다.

다음 예시에서 `img-src https://global.cdn.example.org` 및 `default-src https://global.cdn.example.org` 지시어는 `csp` 구성에 설정되어 모든 페이지에 적용됩니다.

```js title="astro.config.mjs"
export default defineConfig({
experimental: {
csp: {
directives: [
"img-src https://global.cdn.example.org",
"default-src https://global.cdn.example.org"
]
}
}
})
```

또한, 개별 페이지에서는 [Astro.csp.insertDirective](#cspinsertdirective)를 사용하여 `img-src https://vendor.cdn.example.org/` 및 `default-src https://global.cdn.example.org/ https://vendor.cdn.example.org/` 리소스가 추가됩니다.

```astro title="src/pages/index.astro"
---
Astro.csp.insertDirective("img-src https://vendor.cdn.example.org")
Astro.csp.insertDirective("default-src https://global.cdn.example.org https://vendor.cdn.example.org")
---
```

빌드 과정에서 `index.html` 페이지에 대한 `image-src` 및 `default-src` 지시어의 리소스는 병합되고 중복이 제거되어 적절한 헤더를 생성합니다.

```html
<head>
<meta
http-equiv="content-security-policy"
content="
image-src https://global.cdn.example.org https://vendor.cdn.example.org;
default-src https://global.cdn.example.org https://vendor.cdn.example.org;
"
>
</head>
```

#### `hashes`

<p>
Expand Down