mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-12 05:59:20 +00:00
🔒 Add optional SRI support for Umami Analytics
This commit is contained in:
11 files changed
+33
No files matched your search
@@ -342,6 +342,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
||||
| `umamiAnalytics.dataDomains` | _Not set_ | If you want the tracker to only run on specific domains, provide it for your tracker script. This is a comma delimited list of domain names. Such as "yoursite.com,yoursite2.com". |
|
||||
| `umamiAnalytics.scriptName` | script.js | The name of the `script.js` used for anti-ad-blocking is configured by the environment variable `TRACKER_SCRIPT_NAME` |
|
||||
| `umamiAnalytics.enableTrackEvent` | true | When set to `true` track event will add automatically. If you do not want to add track event, set it to `false`. |
|
||||
| `umamiAnalytics.integrity` | _Not set_ | Optional SRI hash for the Umami tracking script. When configured, the script uses `crossorigin="anonymous"`. The script host must support CORS, and the hash must be updated whenever the script changes. |
|
||||
|
||||
### Seline Analytics
|
||||
|
||||
|
||||
@@ -342,6 +342,7 @@ Blowfish は、テーマの機能を制御する多数の設定パラメータ
|
||||
| `umamiAnalytics.dataDomains` | _未設定_ | トラッカーを特定のドメインでのみ実行したい場合は、トラッカースクリプトに指定します。これは、ドメイン名のカンマ区切りリストです。例えば "yoursite.com,yoursite2.com" のようになります。 |
|
||||
| `umamiAnalytics.scriptName` | script.js | アンチ広告ブロックに使用される `script.js` の名前は、環境変数 `TRACKER_SCRIPT_NAME` で設定されます。 |
|
||||
| `umamiAnalytics.enableTrackEvent` | `true` | `true` に設定すると、トラックイベントが自動的に追加されます。トラックイベントを追加したくない場合は、`false` に設定してください。 |
|
||||
| `umamiAnalytics.integrity` | _未設定_ | Umami トラッキングスクリプトのオプションの SRI ハッシュ。設定すると `crossorigin="anonymous"` が追加されます。スクリプトの配信元は CORS に対応している必要があり、スクリプトが変更された場合はハッシュの更新が必要です。 |
|
||||
|
||||
### Seline Analytics
|
||||
|
||||
|
||||
@@ -404,6 +404,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
||||
| `umamiAnalytics.dataDomains` | _Not set_ | If you want the tracker to only run on specific domains, provide it for your tracker script. This is a comma delimited list of domain names. Such as "yoursite.com,yoursite2.com". |
|
||||
| `umamiAnalytics.scriptName` | script.js | The name of the `script.js` used for anti-ad-blocking is configured by the environment variable `TRACKER_SCRIPT_NAME` |
|
||||
| `umamiAnalytics.enableTrackEvent` | true | When set to `true` track event will add automatically. If you do not want to add track event, set it to `false`. |
|
||||
| `umamiAnalytics.integrity` | _Not set_ | Optional SRI hash for the Umami tracking script. When configured, the script uses `crossorigin="anonymous"`. The script host must support CORS, and the hash must be updated whenever the script changes. |
|
||||
|
||||
### Seline Analytics
|
||||
|
||||
|
||||
@@ -346,6 +346,7 @@ Blowfish 提供了大量控制主题功能的配置参数,下面的表格中
|
||||
| `umamiAnalytics.dataDomains` | 无 | 如果你只想在特别的数个域名中使用 tracker 功能,那么你需要设置它。这个参数的值是逗号分隔的域名列表,如:yoursite.com,yoursite2.com。 |
|
||||
| `umamiAnalytics.scriptName` | script.js | 用于反广告屏蔽的 script.js 名称,由环境变量 `TRACKER_SCRIPT_NAME` 配置。 |
|
||||
| `umamiAnalytics.enableTrackEvent` | true | 默认会自动添加 Umami Track Event。如果你不想添加 Event,那学需要设置为 `false`。 |
|
||||
| `umamiAnalytics.integrity` | 无 | Umami 跟踪脚本的可选 SRI 哈希值。配置后会自动添加 `crossorigin="anonymous"`。脚本服务器必须支持 CORS,且脚本内容发生变化时需要更新哈希值。 |
|
||||
|
||||
### Seline Analytics
|
||||
|
||||
|
||||
@@ -47,8 +47,12 @@ To enable Umami Analytics support, simply provide your [Umami tracking code](htt
|
||||
If you also use the custom domain feature of Umami and would like to serve their script from your domain, you can also additionally provide the `domain` configuration value. If you don't provide a `domain` value, the script will load directly from Umami DNS (analytics.umami.is).
|
||||
If you want the tracker to only run on specific domains, you can provide the `dataDomains` configuration value. If you don't provide a `dataDomains` value, the script will run on any website where the `domain` and`websiteid` match. If the environment variable `TRACKER_SCRIPT_NAME` is configured, you can specify a custom script name `scriptName`. If it is not configured, either comment it out or use the default `script.js`.
|
||||
|
||||
To enable optional Subresource Integrity (SRI), set the `integrity` parameter to a valid SHA-256, SHA-384, or SHA-512 hash. Blowfish automatically adds `crossorigin="anonymous"` when an integrity hash is provided.
|
||||
|
||||
{{< alert >}}
|
||||
**Note:** If you enable Umami Analytics, Blowfish will support [Umami Track Event](https://umami.is/docs/track-events) automatically. If you do not want to support Track Event, the param `enableTrackEvent` must set to `false`.
|
||||
|
||||
**SRI:** The script host must support CORS. If the upstream script changes, the integrity hash must be updated; otherwise, browsers will block the script and analytics tracking will stop.
|
||||
{{< /alert >}}
|
||||
|
||||
```toml
|
||||
@@ -60,6 +64,7 @@ If you want the tracker to only run on specific domains, you can provide the `da
|
||||
dataDomains = "yoursite.com,yoursite2.com"
|
||||
scriptName = "TRACKER_SCRIPT_NAME"
|
||||
enableTrackEvent = true
|
||||
# integrity = "sha384-YOUR_HASH"
|
||||
```
|
||||
|
||||
### Seline Analytics
|
||||
|
||||
@@ -47,8 +47,12 @@ Umami Analytics のサポートを有効にするには、`config/_default/param
|
||||
Umami のカスタムドメイン機能を使用していて、ドメインからスクリプトを配信したい場合は、追加で `domain` 設定値を指定することもできます。`domain` 値を指定しない場合、スクリプトは Umami DNS (analytics.umami.is) から直接ロードされます。
|
||||
トラッカーを特定のドメインでのみ実行したい場合は、`dataDomains` 設定値を指定できます。`dataDomains` 値を指定しない場合、スクリプトは `domain` と `websiteid` が一致する任意のウェブサイトで実行されます。環境変数 `TRACKER_SCRIPT_NAME` が設定されている場合は、カスタムスクリプト名 `scriptName` を指定できます。設定されていない場合は、コメントアウトするか、デフォルトの `script.js` を使用してください。
|
||||
|
||||
Subresource Integrity (SRI) を有効にするには、オプションの `integrity` パラメータに SHA-256、SHA-384、または SHA-512 ハッシュを指定します。Blowfish は自動的に `crossorigin="anonymous"` を追加します。
|
||||
|
||||
{{< alert >}}
|
||||
**注:** Umami Analytics を有効にすると、Blowfish は [Umami トラックイベント](https://umami.is/docs/track-events)を自動的にサポートします。トラックイベントをサポートしたくない場合は、パラメータ `enableTrackEvent` を `false` に設定する必要があります。
|
||||
|
||||
**SRI:** スクリプトの配信元は CORS に対応している必要があります。スクリプトが更新された場合は、整合性ハッシュも更新する必要があります。更新しないと、ブラウザがスクリプトをブロックし、アクセス解析が停止します。
|
||||
{{< /alert >}}
|
||||
|
||||
```toml
|
||||
@@ -60,6 +64,7 @@ Umami のカスタムドメイン機能を使用していて、ドメインか
|
||||
dataDomains = "yoursite.com,yoursite2.com"
|
||||
scriptName = "TRACKER_SCRIPT_NAME"
|
||||
enableTrackEvent = true
|
||||
# integrity = "sha384-YOUR_HASH"
|
||||
```
|
||||
|
||||
### Seline Analytics
|
||||
|
||||
@@ -49,8 +49,12 @@ If you want the tracker to only run on specific domains, you can provide the `da
|
||||
|
||||
If you want to honor the Do Not Track setting of the users browser, you have to set `doNotTrack` to `true`. Blowfish does not honor the Do Not Track setting per default.
|
||||
|
||||
To enable Subresource Integrity (SRI) for the Umami tracking script, set the optional `integrity` parameter to a valid SHA-256, SHA-384, or SHA-512 hash. Blowfish will automatically add `crossorigin="anonymous"` when this parameter is configured.
|
||||
|
||||
{{< alert >}}
|
||||
**Note:** If you enable Umami Analytics, Blowfish will support [Umami Track Event](https://umami.is/docs/track-events) automatically. If you do not want to support Track Event, the param `enableTrackEvent` must set to `false`.
|
||||
|
||||
**SRI:** The script host must support CORS. If the upstream script changes, the integrity hash must be updated; otherwise, browsers will block the script and analytics tracking will stop.
|
||||
{{< /alert >}}
|
||||
|
||||
```toml
|
||||
@@ -63,6 +67,7 @@ If you want to honor the Do Not Track setting of the users browser, you have to
|
||||
scriptName = "TRACKER_SCRIPT_NAME"
|
||||
enableTrackEvent = true
|
||||
doNotTrack = false
|
||||
# integrity = "sha384-YOUR_HASH"
|
||||
```
|
||||
|
||||
### Seline Analytics
|
||||
|
||||
@@ -48,9 +48,12 @@ googleAnalytics = "G-MEASUREMENT_ID"
|
||||
如果你想使用自定义域名来获取跟踪脚本, 那么需要提供 `domain` 参数,否则会从 Umami 云服务版的地址 (analytics.umami.is) 获取脚本。
|
||||
如果你只想在特别的数个域名中使用 tracker 功能,那么需要提供 `dataDomains` 参数。否则任何一个匹配了 `websiteid` 和 `domain` 参数值的网站,Umami 脚本都会执行。如果环境变量配置了 `TRACKER_SCRIPT_NAME` 可以填写自定义的脚本名称 `scriptName`,如果没有配置就注释掉或者填写默认的 `script.js` 。
|
||||
|
||||
要启用子资源完整性(SRI),可以通过可选的 `integrity` 参数设置 SHA-256、SHA-384 或 SHA-512 哈希值。Blowfish 会自动添加 `crossorigin="anonymous"` 属性。
|
||||
|
||||
{{< alert >}}
|
||||
**Note:** 开启 Umami 网站分析后, Blowfish 会自动支持 [Umami 事件追踪](https://umami.is/docs/track-events)。如果你不想支持此功能,需要把参数 `enableTrackEvent` 设置为 `false`。
|
||||
|
||||
**SRI:** 脚本服务器必须支持 CORS。如果上游脚本发生变化,必须更新完整性哈希值,否则浏览器将阻止加载该脚本,导致网站分析功能停止工作。
|
||||
{{< /alert >}}
|
||||
|
||||
```toml
|
||||
@@ -62,6 +65,7 @@ googleAnalytics = "G-MEASUREMENT_ID"
|
||||
dataDomains = "yoursite.com,yoursite2.com"
|
||||
scriptName = "TRACKER_SCRIPT_NAME"
|
||||
enableTrackEvent = true
|
||||
# integrity = "sha384-YOUR_HASH"
|
||||
```
|
||||
|
||||
### Seline
|
||||
|
||||
Reference in new issue
Block a user