mirror of
https://github.com/afoim/fuwari.git
synced 2026-01-31 00:53:19 +08:00
fix: 更新脚本和CSP中的域名从acofork.com到2x.nz
This commit is contained in:
@@ -78,7 +78,7 @@ export const navBarConfig: NavBarConfig = {
|
||||
},
|
||||
{
|
||||
name: "统计",
|
||||
url: "https://umami.acofork.com/share/CdkXbGgZr6ECKOyK", // Internal links should not include the base path, as it is automatically added
|
||||
url: "https://umami.2x.nz/share/CdkXbGgZr6ECKOyK", // Internal links should not include the base path, as it is automatically added
|
||||
external: true, // Show an external link icon and will open in a new tab
|
||||
},
|
||||
{
|
||||
@@ -121,7 +121,7 @@ export const imageFallbackConfig: ImageFallbackConfig = {
|
||||
|
||||
export const umamiConfig: UmamiConfig = {
|
||||
enable: true,
|
||||
baseUrl: "https://umami.acofork.com",
|
||||
baseUrl: "https://umami.2x.nz",
|
||||
shareId: "CdkXbGgZr6ECKOyK",
|
||||
timezone: "Asia/Shanghai",
|
||||
};
|
||||
|
||||
@@ -32,8 +32,8 @@ lang: ""
|
||||
我们只看Umami请求:
|
||||
- https://cloud.umami.is/script.js :Umami官方的全局JS,注入在所有页面中,用于后续将访客行为告知给Umami
|
||||
- http://localhost:4321/js/umami-share.js :之前写的中间件,用于避免多次请求Umami拿全局Token
|
||||
- https://umami.acofork.com/analytics/us/api/websites/5d710dbd-3a2e-43e3-a553-97b415090c63/stats?startAt=0&endAt=1763429011353&unit=hour&timezone=Asia%2FShanghai&compare=false :获取全站统计信息。为什么在文章页也会获取全站统计?因为全站统计被安放在用户配置块,而用户配置块全局可见
|
||||
- https://umami.acofork.com/analytics/us/api/websites/5d710dbd-3a2e-43e3-a553-97b415090c63/stats?startAt=0&endAt=1763429243350&unit=hour&timezone=Asia%2FShanghai&path=eq.%2Fposts%2Fswup-js%2F&compare=false :获取本页统计信息
|
||||
- https://umami.2x.nz/analytics/us/api/websites/5d710dbd-3a2e-43e3-a553-97b415090c63/stats?startAt=0&endAt=1763429011353&unit=hour&timezone=Asia%2FShanghai&compare=false :获取全站统计信息。为什么在文章页也会获取全站统计?因为全站统计被安放在用户配置块,而用户配置块全局可见
|
||||
- https://umami.2x.nz/analytics/us/api/websites/5d710dbd-3a2e-43e3-a553-97b415090c63/stats?startAt=0&endAt=1763429243350&unit=hour&timezone=Asia%2FShanghai&path=eq.%2Fposts%2Fswup-js%2F&compare=false :获取本页统计信息
|
||||
- 两个预检:由于CORS,请求源和被请求源不一致,这是浏览器自带的安全策略,实际顺序为 先预检(我不属于你?我能不能访问你?) - 再fetch(我允许你,访问吧) 。题外话:为什么需要预检?因为浏览器要确保该请求是对方明确允许的,而不是恶意网站强行访问的,否则会触发 **CSRF** 攻击,也就是对端源安全策略过于宽松,导致谁都能拿到信息,这些信息可能是敏感的(如登录Token,用户名与密码等)
|
||||
- https://api-gateway.umami.dev/api/send :Umami的官方JS,用于将本次访问的行为汇报给Umami
|
||||
|
||||
|
||||
@@ -115,12 +115,12 @@ const bannerOffset =
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<script src="/js/umami-share.js" defer></script>
|
||||
<script data-swup-ignore-script is:inline src="https://pic.acofork.com/random.js"></script>
|
||||
<script data-swup-ignore-script is:inline src="https://pic.2x.nz/random.js"></script>
|
||||
|
||||
|
||||
|
||||
{/* <!-- Content Security Policy -->
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://giscus.app https://hpic.072103.xyz https://umami.acofork.com https://hm.baidu.com https://www.googletagmanager.com https://www.google-analytics.com https://pagead2.googlesyndication.com https://googleads.g.doubleclick.net https://static.cloudflareinsights.com https://*.adtrafficquality.google; style-src 'self' 'unsafe-inline' https://giscus.app https://fonts.googleapis.com https://api.iconify.design; font-src 'self' https://fonts.gstatic.com https://api.iconify.design; img-src 'self' data: https: http:; connect-src 'self' https://umami.acofork.com https://hm.baidu.com https://www.google-analytics.com https://analytics.google.com https://api.iconify.design https://static.cloudflareinsights.com https://pic.2x.nz https://q2.qlogo.cn https://ep1.adtrafficquality.google https://googleads.g.doubleclick.net; frame-src 'self' https://giscus.app *.bilibili.com https://www.google.com https://googleads.g.doubleclick.net https://support.nodeget.com https://*.adtrafficquality.google; object-src 'none'; base-uri 'self'; form-action 'self';"> */}
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://giscus.app https://hpic.072103.xyz https://umami.2x.nz https://hm.baidu.com https://www.googletagmanager.com https://www.google-analytics.com https://pagead2.googlesyndication.com https://googleads.g.doubleclick.net https://static.cloudflareinsights.com https://*.adtrafficquality.google; style-src 'self' 'unsafe-inline' https://giscus.app https://fonts.googleapis.com https://api.iconify.design; font-src 'self' https://fonts.gstatic.com https://api.iconify.design; img-src 'self' data: https: http:; connect-src 'self' https://umami.2x.nz https://hm.baidu.com https://www.google-analytics.com https://analytics.google.com https://api.iconify.design https://static.cloudflareinsights.com https://pic.2x.nz https://q2.qlogo.cn https://ep1.adtrafficquality.google https://googleads.g.doubleclick.net; frame-src 'self' https://giscus.app *.bilibili.com https://www.google.com https://googleads.g.doubleclick.net https://support.nodeget.com https://*.adtrafficquality.google; object-src 'none'; base-uri 'self'; form-action 'self';"> */}
|
||||
{favicons.map(favicon => (
|
||||
<link rel="icon"
|
||||
href={favicon.src.startsWith('/') ? url(favicon.src) : favicon.src}
|
||||
@@ -243,7 +243,7 @@ const bannerOffset =
|
||||
|
||||
<link rel="alternate" type="application/rss+xml" title={profileConfig.name} href={`${Astro.site}rss.xml`}/>
|
||||
<!-- Umami分析(自建) -->
|
||||
<script defer src="https://umami.acofork.com/script.js" data-website-id="5d710dbd-3a2e-43e3-a553-97b415090c63" data-swup-ignore-script></script>
|
||||
<script defer src="https://umami.2x.nz/script.js" data-website-id="5d710dbd-3a2e-43e3-a553-97b415090c63" data-swup-ignore-script></script>
|
||||
{/* - Umami分析(云-备用)
|
||||
<script defer src="https://cloud.umami.is/script.js" data-website-id="5d710dbd-3a2e-43e3-a553-97b415090c63" data-swup-ignore-script></script> */}
|
||||
<!-- 超级吊的Umami eop -->
|
||||
|
||||
Reference in New Issue
Block a user