Read in your language
हिन्दीবাংলাEspañolFrançaisDeutschMore languages
Opens Google Translate, which sends this page's text to Google. The English is the reference. The Haq app itself has Hindi, Bengali, Spanish, French and German built in, offline.
Build and deploy
How Haq is tested, built, signed and deployed to haq.abhisek-goswami.com, and how to set it up.
In one line: change → pull request → tests → owner approval → merge → build with fingerprinted packs → Cloudflare deploy → every app updates itself.
What runs where#
| When | What | Where |
|---|---|---|
| Every push and pull request | Pack validation, Python and JavaScript tests, a test build | GitHub Actions (tests.yml) |
| Every Monday, 11:00 IST | Check official sources for changes; open an issue if any changed. The last fingerprints are kept in the Actions cache | GitHub Actions (watch-sources.yml) |
Merge to main |
Build dist/ and deploy to haq.abhisek-goswami.com |
Cloudflare Workers Builds |
Docs change on main |
Rebuild abhisek-goswami.com so its Haq docs pages update | GitHub Actions (docs-hook.yml) |
The build#
npm run build (or node scripts/build.mjs):
- Validates every rule pack and stops on any problem.
- Copies the app, packs and examples into
dist/. - Writes
dist/manifest.json, listing every pack with its version, review and SHA-256 fingerprint. The app refuses any pack whose fingerprint does not match. - Signs the manifest with Ed25519 if the
HAQ_SIGNING_KEYsecret is set (optional, below).
One-time setup#
1. GitHub repository settings
- Settings → Rules → Rulesets. Haq uses two rulesets on
main:main-1blocks force pushes and deleting the branch.main-2requires a pull request with 1 approval from the code owner (stale approvals are dismissed) and theteststatus check. Only the Repository admin role may bypass it, so outside changes always need the owner's approval.
.github/CODEOWNERSnames the owner for every file (*).- Settings → General: release immutability on, sign-off on web-based commits on, auto-merge off.
- Settings → Actions → General → Workflow permissions: Read and write, so the weekly watcher can open issues.
2. Cloudflare
- Workers & Pages → Create → Import a repository → choose
haq. - Build command
npm run build, deploy commandnpx wrangler deploy. - After the first deploy: haq → Settings → Domains & Routes → Add → Custom domain →
haq.abhisek-goswami.com.
3. Docs on abhisek-goswami.com
- In Cloudflare, open the portfolio Worker → Settings → Builds → Deploy hooks → create one and copy its URL.
- In the
haqGitHub repo: Settings → Secrets and variables → Actions → New secret, namedPORTFOLIO_DEPLOY_HOOK, with that URL.
4. Manifest signing (optional)
On your own computer, run node scripts/keygen.mjs. Save the private key only as a Cloudflare build secret named HAQ_SIGNING_KEY (haq Worker → Settings → Variables and secrets, type Secret). Save the public key as app/public-key.txt and commit it. The app then shows manifest signature verified in its footer.
Updating the privacy notice#
Edit PRIVACY.md, then run:
python3 scripts/privacy_page.py
This rebuilds app/privacy.html and re-runs Haq's own GDPR and DPDP checks, printing the result at the bottom of the page. The tests also check PRIVACY.md on every push, so a notice that loses a required item fails the build.
Search and AI assistants#
The site helps search engines and AI assistants describe Haq correctly. None of this changes the security headers.
| File | What it does |
|---|---|
app/robots.txt |
Lets every crawler in and points to the sitemap. |
app/sitemap.xml |
Lists the public pages. Update lastmod when a page changes. |
app/llms.txt |
A short plain-text summary of Haq, its modules and key facts, for AI assistants. |
| Structured data | The home page has WebSite, WebApplication and FAQPage data (JSON-LD), and each module page has a breadcrumb. JSON-LD is data, not a script, so the strict Content Security Policy is unchanged. |
| Share tags | Every page has Open Graph tags and share.jpg (1200×630), so links show a picture card. |
The home page's Questions people ask section and the FAQPage data hold the same text: change both together.
Running the source watcher from India (optional, free)#
GitHub's own servers are in the US, and many Indian government sites block them, so about half the sources show as "could not check". To check them from India, run the watcher on your own computer:
- On GitHub: Settings → Actions → Runners → New self-hosted runner, pick your computer's system, and follow the commands it shows. When it asks for extra labels, type
india. - Start the runner (
./run.sh, orrun.cmdon Windows), or install it as a service so it starts with the computer:./svc.sh installthen./svc.sh starton a Mac (nosudo),sudo ./svc.sh installandsudo ./svc.sh starton Linux, or answer Yes to "run as service" on Windows. On a Mac, choose ARM64 for Apple chips (M1 and later) and x64 for Intel. The runner only works while the computer is awake. - On GitHub: Settings → Secrets and variables → Actions → Variables → New repository variable, name
WATCH_RUNNER, valueindia. - Actions → watch official sources → Run workflow to test it.
If the computer is off at run time, the job waits and runs when it comes back (up to a day). To go back to GitHub's servers, delete the WATCH_RUNNER variable.
Safety: the repository is public, so keep Settings → Actions → General → Fork pull request workflows on "Require approval for all external contributors", and never approve a run you haven't read. Only the watcher uses the india runner.
Haq is free to use. © Abhisek Goswami, all rights reserved. Suggestions, translations, legal reviews and feedback are welcome.