No description
https://txlog.rda.run
- JavaScript 98.3%
- Makefile 1.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| docs | ||
| functions | ||
| .gitignore | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
txlog.rda.run
This repository contains Cloudflare Workers functions to dynamically fetch and display the latest version badges for the Txlog Agent and Server components on the txlog.rda.run website.
Setup Instructions
0. Install dependencies
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 24
npm add -D vitepress@next
1. Create GitHub Personal Access Token
- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a descriptive name like "txlog-version-badge"
- Select expiration (recommend 1 year)
- No scopes needed - leave all checkboxes unchecked (we only need public repo access)
- Click "Generate token"
- Copy the token immediately (it won't be shown again)
2. Configure Environment Variable for Cloudflare Pages/Workers
# Set environment variable in Cloudflare dashboard
GITHUB_TOKEN=ghp_your_token_here
3. Optional: KV Cache Setup
For even better performance, you can set up a KV store:
- Create a KV namespace called "txlog-cache"
- Bind it to the
CACHEenvironment variable in your Pages settings
Fallback Behavior
Even without the token, the functions now have improved fallback behavior:
- Returns hardcoded versions when API fails (v1.6.3 for agent, v1.12.1 for server)
- Implements client-side caching with Cache-Control headers
- Graceful degradation instead of error messages
Current Hardcoded Fallback Versions
- Agent:
v1.6.3 - Server:
v1.12.1
Update these in the functions if newer versions are released and the API is still failing.
Run dev server locally
npx vitepress dev docs