Commit Graph
197 Commits
Author SHA1 Message Date
RhenCloud a899e16604 fix(ci): scope auto-fix commits and ignore artifacts 2026-10-02 21:31:53 +08:00
github-actions[bot] 0e2e30ae1a chore: auto-fix lint & formatting [skip ci] 2026-10-02 21:18:20 +08:00
RhenCloud 3567c6d321 fix(formatter): link branch and tag titles 2026-10-01 18:40:02 +08:00
RhenCloud b7fd31a665 fix(push): handle unresolved bot authors 2026-10-01 18:33:17 +08:00
RhenCloud 1057a60de7 fix(push): show differing commit author 2026-09-30 18:52:07 +08:00
wyf9 5fd1709f0f chore: signed actions commit 2026-09-30 18:44:10 +08:00
RhenCloud 2db56d63c7 feat(brand): add fishhook logo and wire up favicon 2026-09-26 17:00:51 +08:00
RhenCloud 968ad3d2f3 fix(admin): avoid duplicate platform key in route target normalization
Merging the blank target and stored target before normalizing the
platform keeps the bundler from inlining blankTarget() into the same
object literal, which emitted a duplicate-object-key warning.
2026-09-26 16:23:00 +08:00
github-actions[bot] 05ede2aa03 chore: auto-fix lint & formatting [skip ci] 2026-09-26 08:03:37 +00:00
RhenCloud 2891e1f33c fix(github): send User-Agent header on GitHub API requests
GitHub rejects API requests without a User-Agent (403), and Workers'
fetch does not set one by default, so workflow job enrichment and
check-suite build-log lookups silently failed in production.
2026-09-26 16:02:27 +08:00
RhenCloud 027ca2bcca fix(dispatch): hoist workflow jobs memoization above route loop
The workflow_jobsPromise declaration sat after the route dispatch loop,
so processRoute hit a temporal dead zone ReferenceError for
workflow_run events; Promise.allSettled swallowed it and no message was
sent. Move the memoized enrichment above the loop and add a regression
test that dispatches a workflow_run event with jobs enrichment.
2026-09-26 15:52:32 +08:00
github-actions[bot] e8d7455a2b chore: auto-fix lint & formatting [skip ci] 2026-09-26 07:33:49 +00:00
RhenCloud 04352c3a19 feat(github): fetch workflow_run jobs via jobs_url enrichment
The workflow_run webhook payload carries no jobs array, only jobs_url,
so the Jobs field never populated for real GitHub events. Fetch the job
list from the GitHub API once per delivery (lazy, memoized across
routes) and inject it into the payload before formatting.

- app-token.ts: shared getInstallationToken (App JWT -> installation
  token) + GITHUB_API_VERSION; check-run.ts now reuses it
- workflow-jobs.ts: getWorkflowRunJobs, App token when configured else
  unauthenticated (public repos), per_page=100, best-effort
- docs: GitHub App needs Actions: read; note API enrichment in the
  message-format and supported-events guides (en + zh)
2026-09-26 15:33:06 +08:00
github-actions[bot] ae36c22fda chore: auto-fix lint & formatting [skip ci] 2026-09-26 06:58:56 +00:00
RhenCloud e607d41432 feat(workflow): render workflow_run jobs as colored diff block
List each job on its own line with a status emoji and, for completed
jobs, the duration. Discord colors the diff fence: '+' green for
success, '-' red for other finished conclusions, plain for
running/queued/pending. Telegram/Feishu collapse it to inline code.

Sync AGENTS.md, README(s), docs guide and supported-events tables.
2026-09-26 14:58:00 +08:00
github-actions[bot] 4e81d3d4da chore: auto-fix lint & formatting [skip ci] 2026-09-13 05:13:36 +00:00
RhenCloud 2e89c79e9c fix(telegram): render rich header title as plain text 2026-09-13 13:13:09 +08:00
github-actions[bot] 1348873847 chore: auto-fix lint & formatting [skip ci] 2026-09-10 14:36:24 +00:00
RhenCloud 1a0500b812 fix: prevent data loss in routes, fragments, and group operations
Found and fixed multiple critical bugs with similar patterns:

1. routeStatements() used DELETE FROM d1_routes before re-inserting
   - Could cause data loss if interrupted or if logic changes
   - Now uses DELETE with WHERE clause + INSERT...ON CONFLICT (upsert)

2. saveFragments() used DELETE FROM d1_fragments before re-inserting
   - Same pattern as routes, fixed with targeted deletes + upsert
   - Added loadFragments() call to determine what to delete

3. adminGroupRename() didn't update fragment groupId
   - When renaming a group, fragments were left pointing to old groupId
   - Now updates fragments alongside routes, secrets, and invites

All changes follow the same safe pattern:
- Load existing data to identify what needs deletion
- Delete only removed items with WHERE clauses
- Use INSERT...ON CONFLICT DO UPDATE for upserts
- Never use bare DELETE FROM table

Testing: All 339 tests pass.
2026-09-10 22:35:43 +08:00
github-actions[bot] 6c6c67fd73 chore: auto-fix lint & formatting [skip ci] 2026-09-10 14:30:55 +00:00
RhenCloud b313cdc2fe fix: prevent cascade deletion of routes when updating groups
Previously, saveGroups() used DELETE FROM d1_groups followed by re-insertion,
which triggered ON DELETE CASCADE and wiped all routes whenever any group was updated.

Changes:
- Use INSERT...ON CONFLICT DO UPDATE (upsert) instead of delete-then-insert
- Only delete groups that are actually being removed
- Delete routes first, then delete groups (proper cascade order)
- Load existing group IDs before saving to detect deletions

This fixes the critical bug where updating one group's metadata would
delete all routes across all groups.

Data recovery: Used D1 Time Travel to restore from bookmark
000018f9-00000002-000050de-f23b7bfe5ccdc00e9c9dec3a4de8bc81 (before
the problematic group update), recovering 18 routes.
2026-09-10 22:29:47 +08:00
RhenCloud fd6ccda411 fix(check): key check_run in-place edits on check name + head_sha
Providers that emit a fresh check run id per phase (e.g. Cloudflare Pages)
no longer post a new message for each status change; same name + commit
SHA now edits the existing message. Falls back to the run id when name or
head_sha is absent. Docs updated in sync.
2026-08-31 01:17:13 +08:00
RhenCloud cc8bb4182f fix(push): render created tags/branches as create events instead of 0 commits 2026-08-29 16:47:00 +08:00
github-actions[bot] 5c31b573d3 chore: auto-fix lint & formatting [skip ci] 2026-08-27 14:00:26 +00:00
RhenCloud 449739ee97 feat(check): resolve build log url for failed check suites via GitHub API
check_suite payloads carry no details_url; the build log lives on the
underlying check_run. For failed suites, fetch the suite's check runs with
an installation token and inject the first run's details_url (preferring
the Cloudflare run) as a Build Log field.
2026-08-27 21:59:48 +08:00
RhenCloud b2db616865 fix(check): show build log link for failed check suites too
The Build Log field was only added to check_run messages; failed
check_suite messages now also link check_suite.details_url.
2026-08-27 21:43:32 +08:00
RhenCloud 8681723f2a feat(check): add build log link for failed Cloudflare checks
Failed check_run messages now include a Build Log field linking to
check_run.details_url (the Cloudflare build log page).
2026-08-27 21:43:26 +08:00
github-actions[bot] 1375db9a20 chore: auto-fix lint & formatting [skip ci] 2026-08-26 16:39:02 +00:00
RhenCloud c75567cf15 feat: migrate to Tailwind CSS v4
Replace @nuxtjs/tailwindcss with @tailwindcss/vite, move theme
tokens into @theme inline in main.css, drop tailwind.config.ts.
2026-08-27 00:26:17 +08:00
RhenCloud 32a8c2ce4e fix: revert tailwindcss to v3 to keep @nuxtjs/tailwindcss config working
The v4 bump moved the PostCSS plugin to @tailwindcss/postcss, breaking
the production build while the project still uses a v3-style
tailwind.config.ts and @apply components.
2026-08-27 00:18:00 +08:00
RhenCloud a9c411387e chore: regenerate bun.lock to match package.json 2026-08-27 00:14:06 +08:00
RhenCloud 4b99f6d33d feat(feishu): add Feishu inbound webhook, /gh commands and card actions
- add feishu_links D1 table and link store helpers
- implement X-Lark-Signature verification, url_verification, /gh login|logout|comment|merge|close and card.action.trigger Merge/Close
- render interactive cards with clickable title link, inline links and callback buttons (no whole-card card_link)
- bind Feishu account in OAuth callback
- document event subscription and required scopes
2026-08-27 00:07:05 +08:00
RhenCloud 3437ac5513 chore: update LICENSE
Signed-off-by: RhenCloud <i@rhen.cloud>
2026-08-25 20:19:00 +08:00
dependabot[bot] 11d8eca96b chore(deps-dev): bump tailwindcss from 3.4.19 to 4.3.3
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) from 3.4.19 to 4.3.3.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.3.3/packages/tailwindcss)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-version: 4.3.3
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-24 23:00:31 +08:00
dependabot[bot] eca4ebb4a1 chore(deps-dev): bump eslint from 9.39.5 to 10.9.0
Bumps [eslint](https://github.com/eslint/eslint) from 9.39.5 to 10.9.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v9.39.5...v10.9.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 10.8.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-24 23:00:09 +08:00
dependabot[bot] 20b71889a7 chore(deps): bump github/codeql-action from 3 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-24 22:59:44 +08:00
github-actions[bot] df16dc94f7 chore: auto-fix lint & formatting [skip ci] 2026-08-24 14:52:59 +00:00
RhenCloud a77ac8ad91 fix: allow editing filters on fallback routes 2026-08-24 22:51:36 +08:00
RhenCloud 9899cd01bf fix(telegram): render HTML with markdown-it and strip HTML from Discord bodies 2026-08-24 22:51:26 +08:00
RhenCloud ea049e28c9 docs: add CONTRIBUTING.md 2026-08-24 22:51:24 +08:00
RhenCloud 2807c97c5f feat(filters): fragment presets and code-block send log detail 2026-08-24 22:51:22 +08:00
RhenCloud c090281cb2 feat(filters): JSONPath field filters, operators, AST groups, fragments, and test-match
Add a field filter type reading any payload value by JSONPath with array expansion, 12 comparison operators (eq/ne/contains/startsWith/endsWith/regex/gt/gte/lt/lte/in/exists), a visual AST builder (all/any/not) in the route editor, chip-based multi-value input, a stateless POST /admin/api/test-match dry-run, and named filter fragments stored in D1 (d1_fragments, migration 0010) inlined into route ASTs on insert.
2026-08-24 22:51:20 +08:00
RhenCloud c955db03c3 feat(logs): populate send log detail and fix dedup re-claim condition
- dispatch: attach per-send detail (title/url/description/match/provider)
  so the admin log view shows message context, not just a bare ok flag
- idempotency: compare dedup expiry against claimed_at instead of the new
  expires_at so non-expired duplicates are rejected and expired keys re-claim
2026-08-24 22:51:11 +08:00
RhenCloud c6198e855f chore: add MIT LICENSE file
Signed-off-by: RhenCloud <i@rhen.cloud>
2026-08-18 13:56:34 +08:00
github-actions[bot] 7c37f5d8b6 chore: auto-fix lint & formatting [skip ci] 2026-08-17 07:51:36 +00:00
RhenCloud 9eeafb8c15 chore(config): make R2 payload binding optional
Comment out the PAYLOAD bucket binding so deploys do not require R2;
the worker already falls back to KV queue:payload:* when env.PAYLOAD is unset.
2026-08-17 15:09:24 +08:00
RhenCloud 25ebae4ae5 feat(storage): migrate config, dedup and delivery state to D1
- Move oversized queue payloads from KV to R2 (PAYLOAD binding, webhooks/YYYY/MM/DD/*.json, KV queue:payload:* fallback)
- Persist routes/groups to D1 (d1_routes/d1_groups) with memory -> KV -> D1 three-tier cache, seeded from legacy KV config keys
- Move webhook dedup (dedup_keys), delivery state (delivery_state) and message tracking (message_tracking) to D1 via canUseD1 probe with automatic KV fallback
- Batch send_logs inserts (recordSendBatch) and add group_id/ts index
- Add storage-prune scheduled task for expired dedup/state/tracking rows
- Add TTL to invite:group:{id} index and audit all ephemeral KV keys
- Add D1 indexes for the new tables
- Sync AGENTS.md, README.md/zh and docs/ (en/zh) with the new storage layout
2026-08-17 15:01:20 +08:00
RhenCloud 2e1b0f022e fix(ci): run tests sequentially to avoid global state pollution 2026-08-17 10:59:32 +08:00
github-actions[bot] b7a100a4a8 chore: auto-fix lint & formatting [skip ci] 2026-08-16 16:02:49 +00:00
RhenCloud 2975087262 fix(push): link branch ref in title as inline code 2026-08-17 00:01:32 +08:00