Skip to content
Open
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
6 changes: 4 additions & 2 deletions content/docs/decap-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ backend:

## Options

By default, the proxy server runs on port `8081` and allows CORS requests from any origin. You can customize these settings with these options.
By default, the proxy server runs on port `8081` and allows CORS requests only from local development origins that match `/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/`. You can customize these settings with these options.

This default was introduced in decap-server@3.8.0 as a security hardening measure. Before, the default was `*`.

#### Environment Variables

* **`PORT`** defines the port you'd like the proxy server to use. Running `PORT=8082 npm run start` starts the server on port `8082` rather than the default `8081`.

* **`BIND_HOST`** variable allows binding to 127.0.0.1 rather than all IP addresses. Running `BIND_HOST=localhost npm run start` allows connecting to `http://localhost:8081/` but connections to `http://<public_ip>:8081/` are no longer possible. <span class="version-tag">3.9</span>

* **`ORIGIN`** allows restricting CORS responses to a specific origin rather than allowing the API to be accessed from any server. Running `ORIGIN=https://example.com npm run start` changes the HTTP header in responses to `Access-Content-Allow-Origin: https://example.com`. The server can no longer be accessed by arbitrary websites. <span class="version-tag">3.9</span>
* **`ORIGIN`** allows overriding the default local-only CORS origin pattern (`/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/`) with a specific origin. Running `ORIGIN=https://example.com npm run start` changes the HTTP header in responses to `Access-Content-Allow-Origin: https://example.com`. The server can no longer be accessed by arbitrary websites. <span class="version-tag">3.9</span>

You can define them in 2 ways:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/widgets/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The markdown widget provides a full-fledged text editor, allowing users to forma
* `buttons`: an array of strings representing the formatting buttons to display (all shown by default). Buttons include: `bold`, `italic`, `strikethrough`, `code`, `link`, `heading-one`, `heading-two`, `heading-three`, `heading-four`, `heading-five`, `heading-six`, `quote`, `bulleted-list`, and `numbered-list`.
* `editor_components`: an array of strings representing the names of editor components to display (all shown by default). Decap CMS includes `image` and `code-block` editor components by default, and custom components may be [created and registered](/docs/custom-widgets/#registereditorcomponent).
* `modes`: an array of strings representing the names of allowed editor modes. Possible modes are `raw` and `rich_text`. A toggle button appears in the toolbar when more than one mode is available.
* `sanitize_preview`: accepts a boolean value, `false` by default. Sanitizes markdown preview to prevent XSS attacks - might alter the preview content.
* `sanitize_preview`: accepts a boolean value, `true` by default. Sanitizes markdown preview to prevent XSS attacks - might alter the preview content. *This default changed from `false` to `true` in decap-cms@3.13.0 as a security hardening measure.*

**Example**

Expand Down
2 changes: 1 addition & 1 deletion content/docs/widgets/richtext.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The richtext widget provides a full-fledged text editor, allowing users to forma
* `buttons`: an array of strings representing the formatting buttons to display (all shown by default). Buttons include: `bold`, `italic`, `strikethrough`, `code`, `link`, `heading-one`, `heading-two`, `heading-three`, `heading-four`, `heading-five`, `heading-six`, `quote`, `bulleted-list`, and `numbered-list`.
* `editor_components`: an array of strings representing the names of editor components to display (all shown by default). Decap CMS includes `image` and `code-block` editor components by default, and custom components may be [created and registered](/docs/custom-widgets/#registereditorcomponent).
* `modes`: an array of strings representing the names of allowed editor modes. Possible modes are `raw` and `rich_text`. A toggle button appears in the toolbar when more than one mode is available.
* `sanitize_preview`: accepts a boolean value, `false` by default. Sanitizes markdown preview to prevent XSS attacks - might alter the preview content.
* `sanitize_preview`: accepts a boolean value, `true` by default. Sanitizes markdown preview to prevent XSS attacks - might alter the preview content. *This default changed from `false` to `true` in decap-cms@3.13.0 as a security hardening measure.*

**Example**

Expand Down