Commit graph

37 commits

Author SHA1 Message Date
f4959eebf8
feat(groups): allow renaming a group id
Add PUT /admin/api/groups/:id/rename (owner role) which re-points the group's routes, migrates the per-group webhook secret (tenant:{id}) and pending invites, and records an audit entry. The group editor's id field is now editable and the console renames first, then persists remaining edits under the new id.
2026-08-13 09:58:02 +08:00
39bb639883
feat(install): post-install setup flow with group bind choice
The GitHub App Setup URL now lands on /auth/github/install, which renders a choice page: bind the installation to a new inst-{id} group or to an existing group the signed-in user owns (owner role re-checked on POST /auth/github/install/bind). Adds an App-JWT helper (getInstallationAccount) to name the auto-created group, audit entries, a console toast, and keeps the installation.created webhook fallback.
2026-08-13 09:39:02 +08:00
b600f02027
feat: per-group webhook ingress, custom webhooks, GitHub App tenant isolation
Add POST /webhook/{groupId} with per-group secrets (KV tenant:{groupId}), a custom provider (X-WebHooker-Signature HMAC, arbitrary JSON -> custom events through the route pipeline), and GitHub App installation isolation (Group.installationId) with automatic provisioning on installation.created (inst-{id} groups or binding matching owners groups). Includes WebhookPanel admin UI, custom route template, docs and 157 passing tests.
2026-08-13 09:24:50 +08:00
0b078d938b
feat(groups): per-group webhook log channel (logTarget)
Add an optional Discord channel/thread or Telegram chat/topic (Group.logTarget) that receives a summary message per webhook the group's routes dispatched: event/action, repo, delivery id and per route×target OK/FAIL lines with green/red embed color. Validated by the admin API and editable in the group editor; docs and example config updated.
2026-08-13 08:36:46 +08:00
13ba1e019e
merge: resolve docs conflict with origin/main (auto-fix)
Merged the remote lint/formatting fix; kept the group-level lang row in the zh group schema table.
2026-08-12 00:50:28 +08:00
7e45b0a09c
feat(groups): configure message language per group instead of per route
Route.lang is removed; Group.lang now drives the message language for
every route in the group (default en, custom via KV i18n:<lang>).
dispatch.ts loads translations per group and falls back to en for
groups without a lang. Admin UI: GroupEditor gains the language field,
RouteEditor/RouteCard drop theirs; docs and config example updated.
2026-08-12 00:43:47 +08:00
github-actions[bot]
89b43b8b28 chore: auto-fix lint & formatting [skip ci] 2026-08-11 16:06:06 +00:00
c73b642504
feat(admin): deep-linkable console URLs, stop collapsing unknown paths to /admin
The root catch-all page ([...slug].vue) redirected every unknown URL to
/admin, and the worker fell back to the SPA for any path — so no matter
what page was opened, the URL ended up at baseurl/admin.

- Extract the console into ConsolePage.vue; the active tab now mirrors
  the URL path: /admin (groups), /admin/groups, /admin/logs, /admin/audit
  (tab switches use router.replace; unknown slugs render 404)
- admin.vue and admin/[slug].vue become thin wrappers
- Delete the root [...slug].vue catch-all redirect
- server.ts: notFound serves ASSETS (SPA + _nuxt chunks) only for
  /admin-prefixed paths; every other unknown URL returns a JSON 404
2026-08-12 00:05:20 +08:00
a0e15975df
fix(invites): list invites via per-group KV index instead of kv.list
Cloudflare KV's list operation is eventually consistent and can lag
behind a fresh write, so pending invites were invisible right after
creation (GET /admin/api/groups/:id/invites returned {invites: []}).
Keep a per-group token index (invite:group:{id}) updated on create,
revoke, accept and expiry; the members panel also inserts the freshly
created invite into the list immediately and copies the absolute link.
2026-08-11 23:53:58 +08:00
11b74aa82a
feat(admin-ui): members panel, invite links, audit tab and role-aware console
- New MembersPanel: role switching, add/remove members, invite-link
  generation with copy/revoke, pending invite list
- New Audit tab (AuditLog.vue) with group filter
- Role-aware UI: viewer hides route/group edit actions (RouteCard readonly),
  owner-only controls, role badge + member count on group cards
- GroupEditor: members managed via panel, owners field super-admin only
- en/zh i18n and CSS for the new panels
2026-08-11 23:38:33 +08:00
f8cb3a4ddb
fix(admin): pass group filter to send-log API on refresh/filter 2026-08-11 22:22:37 +08:00
aec0d1a257 feat: add gitea/forgejo support 2026-08-11 22:01:04 +08:00
52d136c468 fix(push): link commit hash and render message as plain text 2026-08-11 17:50:20 +08:00
e1b1daac98 chore: remove dead code and unused dependencies
Cleans up stale implementation artifacts:
- Delete legacy `src/webhook.ts` (dead code per AGENTS.md)
- Delete admin composables `useMe.ts` and `useRoutes.ts`
- Remove unused dependencies `jose` and `yaml`
- Remove stale `Me` interface, `FILTER_LABELS`, `invalidateConfigCache`, and formatter re-exports
2026-08-11 16:31:13 +08:00
76ba2c0a89 feat: add Discord role mention support to routes 2026-08-11 15:48:44 +08:00
github-actions[bot]
869d84d78c chore: auto-fix lint & formatting [skip ci] 2026-08-08 16:53:44 +00:00
589558a20d feat: add group filter to send logs view
- Add groupId query param to GET /api/logs endpoint
- Add group filter dropdown in SendLogs component
- Pass groups list and filter state from admin.vue
- Update useLogs.ts to accept optional groupId parameter
- Add groupId to SendRecord type
- Add i18n keys and CSS for filter UI
2026-08-08 23:09:06 +08:00
ab98c84896 feat(admin): add stop toggle and badge to route editor UI 2026-08-08 00:54:13 +08:00
55eafaeecc
feat: link commit in check suite messages
Add clickable commit links in check_suite formatter output with fallback
URL when html_url is unavailable. Remove check_run from checks template
since formatter only handles check_suite events.
2026-08-03 09:19:00 +08:00
7ee1e5899f
feat(admin): add route reordering with up/down buttons 2026-08-03 08:40:59 +08:00
bec48233fa
refactor(admin): narrow workflows template filter to workflow_run 2026-08-03 08:24:31 +08:00
a001efea5f
feat(admin): add route templates to editor 2026-08-03 08:16:34 +08:00
be50d23319
refactor(admin): use target-row grid for target inputs 2026-08-03 07:30:07 +08:00
github-actions[bot]
568e206643 chore: auto-fix lint & formatting [skip ci] 2026-08-02 21:19:33 +00:00
bd7a8f2632
feat: add Telegram push support with multi-target routes
Add a platform-aware route target system so a single route can forward
to several destinations at once (e.g. a Discord channel and a Telegram
group). Route.target becomes Route.targets[] with per-entry platform,
channelId/threadId for Discord and chatId/topicId for Telegram; the
legacy single-target format is normalized on load and accepted by the
admin API.

Implement the Telegram driver with HTML rendering and Bot API
sendMessage (chat_id + message_thread_id for topics, retry on 429/5xx),
plus /gh commands served over POST /telegram/webhook: login, logout,
comment, merge and close. The comment/merge/close commands resolve the
issue or PR from the replied-to notification message. OAuth binding now
stores a D1 telegram_links mapping and replies with a confirmation.

Sync the Telegram webhook from the scheduled trigger via setWebhook.
2026-08-03 05:19:05 +08:00
dcbe93be91
feat(admin): add detailed send log viewer with extended fields 2026-08-03 05:19:02 +08:00
809f89400b
feat: add per-group emoji toggle and standardized embed titles 2026-08-03 01:25:03 +08:00
github-actions[bot]
2e4cb24c1d chore: auto-fix lint & formatting [skip ci] 2026-08-02 16:44:42 +00:00
8c8cfbf211
fix: remove click prevent on route toggle switch 2026-08-03 00:12:50 +08:00
38daf7bc83
feat: ignore filters on fallback routes 2026-08-03 00:02:29 +08:00
d419b9c940
feat: add fallback routes and repository event enrichment 2026-08-02 23:23:07 +08:00
9e0f21c538
feat(admin): add zh/en i18n to the config console
Introduce a lightweight useI18n composable (zh default, auto-detect via
navigator.language, manual toggle persisted to localStorage) with full
zh/en dictionaries, and wire translation keys through the console UI.
2026-08-02 08:40:01 +08:00
d3c1349d00
feat(admin): group-centric console navigation and group-scoped routes API
Add GET/PUT /api/groups/:groupId/routes endpoints that filter and merge
routes by group (backend forces groupId from the path param). Rework the
console so the top level lists groups; entering a group shows and manages
only that group's routes. Drop the route-level group selector and the
now-redundant group badge on route cards.
2026-08-02 08:39:46 +08:00
62985a2f3f
feat(admin): groups management UI in the console
Add a super-admin-only Groups tab to create, edit and delete groups
(name, admin ids, owner scope). Routes now require a group via a select
in the editor, group names are shown on route cards, and the new
useMe/useGroups composables back the UI.
2026-08-02 08:16:05 +08:00
83794c251f
feat(web): auto dark mode for admin console
Add a prefers-color-scheme dark palette to the Nuxt console so it
follows the device/OS theme automatically. Tokenize the previously
hardcoded dot-grid, sticky header, switch knob and overlay scrim so
they invert correctly, and set color-scheme: dark for native controls.
2026-08-02 07:51:46 +08:00
81d21ffb08
feat(web): add public landing page and move console to /admin
Serve a public landing page at / with buttons to the docs, GitHub repo,
Terms, Privacy and the admin login. Relocate the Nuxt admin console from
/ to /admin so the root is no longer the private console.

- add home-routes.ts (bilingual landing, auto dark mode, configurable
  DOCS_URL / GITHUB_REPO_URL) mounted at /
- move console to admin/pages/admin.vue; redirect / and unknown SPA
  routes to /admin
- point admin login/logout redirects at /admin
2026-08-02 07:40:14 +08:00
407514f3c9
feat(admin): GitHub OAuth login, admin whitelist and Nuxt WebUI
Add an admin WebUI (Nuxt static SPA in admin/, served via the ASSETS
binding) for managing routes and viewing send logs. Access is gated by
GitHub OAuth plus an ADMIN_USER_IDS whitelist with cookie sessions
(admin-session.ts). Expose routes/logs CRUD API (admin-routes.ts), add a
discord-link mapping in token-store.ts, and mount admin routes with an
SPA assets fallback in the server.
2026-08-02 06:50:41 +08:00