顯示具有 CloudFlare 標籤的文章。 顯示所有文章
顯示具有 CloudFlare 標籤的文章。 顯示所有文章

2025/03/14

透過CloudFlare GraphQL 取得SubDomain國家來源數據

權限要給Zone/Logs & Analytics
curl -X POST "https://api.cloudflare.com/client/v4/graphql" ^
  -H "Authorization: Bearer YourToken" ^
  -H "Content-Type: application/json" ^
  --data "{ \"query\": \"query { viewer { zones(filter: { zoneTag: \\\"YourZoneID\\\" }) { httpRequestsAdaptiveGroups( limit: 1000, filter: { clientRequestHTTPHost: \\\"YourSubDomain\\\", datetime_geq: \\\"2025-03-13T00:00:00Z\\\", datetime_lt: \\\"2025-03-14T00:00:00Z\\\" }, orderBy: [count_DESC] ) { dimensions { clientCountryName } count sum { edgeResponseBytes } } } } }\" }"

2023/09/25

CloudFlare CDN 導致Vue網頁不會更新問題

最近在公司遇到很無奈的問題

用npm run build出來的檔案會Cache在某個版本
用npm run serve則不會

2023/05/12

Ubuntu 22.04 LTS Certbot 使用 CloudFlare 申請全域的 Let's Encrypt憑證

先輸入以下命令安裝套件
# Install CertBot
sudo apt update -y
sudo apt install snapd -y
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo apt install python-is-python3 python3-certbot-dns-cloudflare -y
進到CloudFlare所要取得SSL的Domain頁面,點擊Get your API token 編輯cf.ini
點擊Create Token

點擊Get started,啟用下列Pemission和選取要設定的Domain,點擊Continue to summary就會得到Token