Sentry 企業(yè)級(jí)數(shù)據(jù)安全解決方案 - Relay 項(xiàng)目配置
項(xiàng)目配置
在 static 或 proxy 模式下運(yùn)行 Relay 時(shí),您可以在文件系統(tǒng)上配置項(xiàng)目設(shè)置。 Static 項(xiàng)目配置位于 Relay 配置目錄的 projects 子目錄下,默認(rèn)位于 .relay/projects。
- 托管(managed) 模式下的 Relay 僅適用于商業(yè)和企業(yè)計(jì)劃。https://sentry.io/pricing/
要配置項(xiàng)目,請(qǐng)?jiān)谠撐恢锰砑用麨?
- .relay/
- └── projects/
- ├── 17.json
- ├── 21.json
- └── 42.json
項(xiàng)目配置是一種可擴(kuò)展格式,主要由可選字段組成。最低配置 必須 包含以下字段:
- {
- "slug": "my-project",
- "publicKeys": [
- {
- "publicKey": "<DSN_KEY>",
- "isEnabled": true
- }
- ],
- "config": {
- "allowedDomains": ["*"]
- }
- }
公鑰 (
基本選項(xiàng)
slug
- 項(xiàng)目的簡(jiǎn)稱,顯示在 Sentry 中。Relay 當(dāng)前需要此值才能接受事件。
- {
- "slug": "my-project"
- }
disabled
- 項(xiàng)目是否被禁用。如果設(shè)置為 true,則 Relay 將丟棄發(fā)送到此項(xiàng)目的所有事件。
- {
- "disabled": false
- }
publicKeys
- 已知公鑰(DSN 中的公鑰)的列表以及是否應(yīng)接受使用該密鑰的事件。
- {
- "publicKeys": [
- {
- "publicKey": "12345abcdb1e4c123490ecec89c1f199",
- "isEnabled": true
- }
- ]
- }
- 您可以通過進(jìn)入 Sentry > Project Settings > Client Keys (DSN) 來獲取密鑰。公鑰可以從 DSN 中提取。在這個(gè) DSN 中,例如 https://12345abcdb1e4c123490ecec89c1f199@o1.ingest.sentry.io/2244,key 是12345abcdb1e4c123490ecec89c1f199。
- 一個(gè)項(xiàng)目可能包含多個(gè)公鑰,但只會(huì)處理使用已啟用項(xiàng)目密鑰的消息。同樣,可以使用 isEnabled flag 禁用 key。
config.allowedDomains
- 配置 Sentry 應(yīng)接受事件的 Origin 或 Referer URL。這對(duì)應(yīng)于 Sentry UI 中的 Allowed Domains 設(shè)置。
- 空列表拒絕所有來源。使用默認(rèn)的 ["*"] 以允許所有來源。
- {
- "config": {
- "allowedDomains": ["mycompany.com"]
- }
- }