Gitea Actions runs notify_site_traffic.py at 09:00 CST using Cloudflare GraphQL and a Feishu webhook (secrets from keyzoo). Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.2 KiB
PowerShell
39 lines
1.2 KiB
PowerShell
# Local / scheduled runner: inject both keyzoo secrets then post Feishu digest.
|
|
#
|
|
# Requires Keyzoo desktop daemon (MCP asset_exec). From an agent:
|
|
# run this script is not enough alone — use notify_site_traffic.py via
|
|
# dual asset_exec, or set env manually:
|
|
#
|
|
# $env:CLOUDFLARE_EMAIL = "..."
|
|
# $env:CLOUDFLARE_API_KEY = "..."
|
|
# $env:FEISHU_WEBHOOK_URL = "..."
|
|
# python notify_site_traffic.py
|
|
#
|
|
# Windows Task Scheduler example (after env is available in the task):
|
|
# Program: python
|
|
# Arguments: notify_site_traffic.py
|
|
# Start in: <repo>
|
|
# Trigger: Daily 09:00
|
|
|
|
param(
|
|
[string]$Day = "",
|
|
[switch]$DryRun
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
Set-Location $Root
|
|
|
|
$argsList = @()
|
|
if ($Day) { $argsList += @("--day", $Day) }
|
|
if ($DryRun) { $argsList += "--dry-run" }
|
|
|
|
if (-not $env:CLOUDFLARE_API_KEY -and -not $env:KEYZOO_ASSET_SECRET_GLOBAL_API_KEY) {
|
|
Write-Error "Missing Cloudflare API key in env (set CLOUDFLARE_* or run via keyzoo)."
|
|
}
|
|
if (-not $env:FEISHU_WEBHOOK_URL -and -not $env:KEYZOO_ASSET_SECRET_FEISHU_WEBHOOK_URL) {
|
|
Write-Error "Missing Feishu webhook in env (set FEISHU_WEBHOOK_URL or run via keyzoo)."
|
|
}
|
|
|
|
python notify_site_traffic.py @argsList
|