npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ework-mirror

v0.1.17

Published

One-way mirror from ework to Gitea (webhook-driven, Gitea-compat auth as awork user)

Downloads

2,511

Readme

ework-mirror

One-way webhook mirror: ework → Gitea.

Receives ework-web issue/comment events on POST /ingest/ework and creates corresponding issues/comments in a target Gitea instance using a token that authenticates as user awork.

Why

During the transition period off Gitea, ework-web remains the source of truth but Gitea stays in sync as a hot backup. Real-user actions mirror to Gitea so:

  • Awork daemon (still pointed at Gitea) keeps working unchanged.
  • Gitea is a verification / rollback target.
  • Downstream Gitea consumers (webhooks, OAuth clients) work without modification.

Loop suppression

The mirror authenticates to Gitea as user awork. Because awork daemon's isBotUser() check (awork/src/trackers/gitea-tracker.ts:178) ignores any comment authored by its own bot username, every mirrored POST to Gitea emits a Gitea webhook carrying sender.login = "awork" — which awork silently drops. No code change to awork required.

The receiver also skips events where sender.login == "awork" (echoes from Gitea-side awork actions would otherwise bounce back).

Install

./scripts/install.sh \
  --gitea-url http://gitea.local:3000 \
  --gitea-token <awork-user-token> \
  # optional: --port 1197 --host 127.0.0.1

Idempotent. Generates ~/.local/share/ework-mirror/.env with a random EWORK_WEBHOOK_SECRET. Installs a --user systemd unit by default.

Wire ework-web to deliver events

In ework-web UI (/<owner>/<repo>/webhooks), add a webhook:

| Field | Value | |-------|-------| | URL | http://127.0.0.1:1197/ingest/ework | | Secret | (the EWORK_WEBHOOK_SECRET from .env) | | Events | issues, issue_comment | | Active | ✓ |

Operate

./scripts/install.sh status         # service status
./scripts/install.sh logs           # tail logs
./scripts/install.sh uninstall      # stop + remove unit (data preserved)

Event log is queryable in ~/.local/share/ework-mirror/mirror.db:

SELECT received_at, event, action, ework_project, ework_issue, gitea_target, outcome
FROM event_log ORDER BY id DESC LIMIT 20;

Scope (v0.1)

  • ✅ Mirror issues (opened/closed/reopened) — first-seen creates Gitea issue, subsequent events patch state
  • ✅ Mirror issue_comment (created) — creates Gitea comment; idempotent on ework_comment_id
  • ✅ HMAC-SHA256 signature verification (Gitea / Gogs / GitHub-compat headers)
  • ✅ Duplicate suppression via SQLite issue_map + comment_map
  • ✅ Retroactive mirror (if comment arrives before issue create, issue is auto-created)
  • ⏸️ Edits / deletes not mirrored (rare; out of scope)
  • ⏸️ Attachments not mirrored (separate concern)
  • ⏸️ Gitea → ework mirror (not implemented; single-direction by design)

Config keys

| Env | Required | Default | Purpose | |-----|----------|---------|---------| | PORT | no | 1197 | Listen port | | HOST | no | 127.0.0.1 | Bind address | | EWORK_WEBHOOK_SECRET | yes (auto-gen) | — | HMAC secret shared with ework-web | | GITEA_URL | yes | — | Target Gitea base URL | | GITEA_TOKEN | yes | — | Token for user awork (scopes: write:issue, write:repository) | | GITEA_ACT_AS | no | awork | Identity for POSTs — must be awork for loop suppression | | DB_PATH | no | ~/.local/share/ework-mirror/mirror.db | SQLite path | | VERBOSE | no | false | Log every event at info level |