This is a Cloudflare Worker implementation of the ablesci automatic check-in script.
- Cloudflare Account: You need a Cloudflare account.
- Node.js: Installed on your machine.
-
Install dependencies: This project uses a standalone worker script, but you need
wranglerCLI to deploy.npm install -g wrangler
-
Login to Cloudflare:
wrangler login
-
Set the Cookie Secret (CLI Method): The script requires your authentication cookie. Do not commit this to GitHub. Set it securely using wrangler secrets:
wrangler secret put COOKIE
When prompted, paste your
_identity-frontendcookie value.
If you are deploying by connecting your GitHub repository directly in the Cloudflare Dashboard:
- Connect Repo: Select this repository in the Cloudflare Workers dashboard.
- Build Settings:
- Build Command: Leave empty.
- Deploy Command:
npx wrangler deploy(default).
- Environment Variables (CRITICAL):
- Do NOT set the cookie in the "Build" step.
- After the project is created, go to Settings -> Variables and Secrets.
- Add a variable named
COOKIEwith your cookie value. - Click "Encrypt" or "Secret" to keep it secure.
- Redeploy: You must go to "Deployments" and trigger a new deployment for the variable to take effect.
- Important Note on Preview:
The "Quick Edit" preview pane in Cloudflare often does not load secrets. To test, click the actual deployed URL (e.g.,
https://ablesci.yourname.workers.dev).
To deploy the worker to your Cloudflare account:
wrangler deploy- Schedule: The worker is configured to run daily at 00:00 UTC (which is 08:00 Beijing Time) in
wrangler.toml.You can adjust this cron expression if needed.[triggers] crons = ["0 0 * * *"]
You can trigger the worker manually via the command line or the Cloudflare dashboard to test if it works:
wrangler tail # locally watch logsOr simply visit the deployed worker URL provided after wrangler deploy.