Commit Graph
56 Commits
Author SHA1 Message Date
e961fdb131 ci(e2e): make backend stubs embeddable and keep vitest scoped
The dashboard embed pattern ignores hidden-only dist directories, so the CI backend stub must create visible index.html files. Keep the README in sync and exclude Playwright specs from Vitest so npm run test remains a unit-test command.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>

Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
2026-05-26 05:27:46 +00:00
naibaandcloudcode baec84bdc2 docs(e2e): describe how to run Playwright suite locally and read CI artifacts
Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
2026-05-26 04:36:03 +00:00
naibaandcloudcode 52f67d22ba ci: run Playwright e2e against a real Go backend in GitHub Actions
Boot a fresh dashboard from nezhahq/nezha master inside the runner:

- Checkout admin-frontend and the backend repo into two paths.
- Generate the two embed stubs and swag docs so cmd/dashboard builds.
- Inject NZ_JWTSECRETKEY (env-first config story) and start the
  backend on 127.0.0.1:8008 with a tmp SQLite db.
- Wait on /api/v1/setting before letting Playwright launch.
- Playwright config brings up Vite dev which proxies /api to 8008.
- Upload playwright-report and dashboard.log on failure for triage.

Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
2026-05-26 04:34:43 +00:00
naibaandcloudcode dc0cfd0ecb test(e2e): add Playwright suite for auth + CSRF + visibility fixes
Covers the security fixes that landed across both repos:

- auth.spec.ts: login persists nz-jwt cookie and getProfile succeeds;
  password change bumps TokenVersion + revokes the old cookie so the
  pre-change JWT can no longer auth (regression guard for the
  keyId+session backend rewrite).
- cron-csrf.spec.ts: POST /api/v1/cron/:id/manual succeeds while GET
  is no longer routable (regression guard for the cron CSRF fix).
- fm-csrf.spec.ts: POST /api/v1/file is reachable while GET is no
  longer routable (regression guard for the FM CSRF fix).
- visibility.spec.ts: an anonymous caller cannot see a server-group
  that contains zero guest-visible servers (regression guard for the
  server-group leak fix).

Fixtures wrap the noisy login + cleanup boilerplate. tsconfig is
scoped to tests/e2e so the suite stays out of the production tsc
project graph.

Playwright config starts the Vite dev server (npm run dev) and
expects a backend reachable at the URL Vite proxies to. CI workflow
follow-up commit wires the backend up.

Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
2026-05-26 04:34:43 +00:00
naibaandcloudcode c80899a753 fix(fm): switch createFM to POST to match backend CSRF fix
Backend moves /api/v1/file from GET to POST so SameSite=Lax cookies
can no longer expose this state-changing endpoint to cross-site
CSRF. Update createFM() accordingly.

Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
2026-05-26 04:07:52 +00:00
naibaandcloudcode f2fea38e10 fix(cron): switch manual trigger to POST to match backend CSRF fix
Backend GHSA-8qhj-4f8c-j8qg moves /api/v1/cron/:id/manual from GET to
POST so SameSite=Lax cookies no longer expose this state-changing
endpoint to cross-site CSRF. Update runCron() accordingly.

Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
2026-05-26 04:00:15 +00:00
naiba b23a6c0be1 feat: server transfer rotation 2026-05-25 10:15:24 +00:00
naibaandnaiba/CloudCode 142fc19469 fix: hide admin settings tabs for members
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-16 00:46:15 +08:00
naibaandnaiba/CloudCode b77ac7af93 fix: use Combobox for notification group selection in settings page
Settings page used a plain number input for ip_change_notification_group_id,
requiring users to manually enter a group ID. Replace it with a searchable
Combobox component (consistent with alert-rule/service/cron pages) and wrap
the settings route with NotificationProvider to load notification group data.

Closes nezhahq/nezha#1174

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-03-01 01:11:37 +00:00
奶爸andnaiba 6ddcd0eaea fix: public_note validation rejects non-object JSON values, preventing second edit (#154)
Co-authored-by: naiba <naiba@users.noreply.github.com>
2026-02-19 14:30:10 +08:00
naiba 1b9c82ca5a fix: server edit dialog submit button unresponsive after first save (#1132)
Upgrade react-hook-form 7.63→7.71 to fix form.reset() race condition
that silently broke zod validation on subsequent submissions.

Reset form and public-note state (publicNoteObj/Raw/Mode/Errors)
from latest data when the edit dialog opens, preventing stale state
from a previous edit session.
2026-02-14 12:11:47 +08:00
naiba 13c78a8302 fix: immutable release 2026-01-01 11:58:11 +08:00
naiba 8ae5bee0c0 chore: fix import 2025-10-09 09:48:07 +08:00
naiba 4806ff35fe 💩 f*ck react 2025-10-02 17:15:20 +08:00
naiba 61186143bd fix: Cannot read properties of undefined (reading 'displayName') 2025-10-02 15:26:31 +08:00
naiba 10a04a2daf chore: add locales 2025-08-23 21:09:54 +08:00
naiba 01ed6eae54 feat: 批量转移服务器给其他用户 2025-06-16 23:44:30 +08:00
naiba adac229ab4 chore(i18n): add locale config options 2025-03-29 13:21:14 +08:00
naiba 223cb9c1ae feat(i18n): add locales 2025-03-27 19:11:56 +08:00
naiba 66945cdb15 chore: update locale 2025-03-22 22:37:01 +08:00
naiba f6ce25d466 feat: disable nat 2025-01-21 22:21:52 +08:00
naiba aa00431f8b chore: add type 2024-12-30 21:15:17 +08:00
naiba 718bff0abb feat: oauth2 登录 2024-12-28 23:50:24 +08:00
naiba 8130e336a9 fix: block button 2024-12-23 19:47:57 +08:00
naiba 86115547a5 fix: member role menu 2024-12-23 19:24:46 +08:00
naiba 76f868d242 fix: typo & render error 2024-12-17 22:19:22 +08:00
naiba a1ca16b297 feat: implement InjectContext for dynamic resource injection 2024-12-17 22:03:21 +08:00
naiba 9204e0ae37 chore: refactor 2024-12-15 20:26:35 +08:00
naiba 1a2c5a5a44 chore: change key 2024-12-15 15:27:23 +08:00
naiba 71e2f1a699 feat: 后台自定义代码 & 后端语言优先 2024-12-15 15:08:57 +08:00
naiba 5bd0e1c073 fix: animate man position 2024-12-15 10:57:47 +08:00
naiba 97d49de6be refactor: enum i18n 2024-12-14 10:39:07 +08:00
naiba dc2f28979f feat: api update 2024-12-10 22:19:31 +08:00
naiba e2027a0ef0 fix: local debug 2024-12-09 23:11:17 +08:00
naiba 2e814e6f5e fix: websocket 2024-12-02 23:51:24 +08:00
naiba 4cdb11059a fix: websocket 2024-12-02 22:10:07 +08:00
naiba 7f3f6e8af1 chore: i18n 2024-12-01 21:50:59 +08:00
naiba c49bbb54e1 fix: waf page 2024-11-30 21:31:55 +08:00
naiba ef70277ff4 feat: 优化复制安装命令提示 2024-11-30 20:14:49 +08:00
naiba a3c9fcec73 fix: copy to clipboard 2024-11-30 17:08:47 +08:00
naiba c98632bc17 feat: 修改用户名,简化代码 2024-11-30 15:02:42 +08:00
naiba 3e9a75125a feat: 调整安装脚本复制位置 2024-11-30 12:58:53 +08:00
naiba 48cdd6f4d5 Merge pull request #1 from uubulb/dev 2024-11-25 13:37:19 +08:00
naiba f17bdbf760 fix: logout & login page home button 2024-11-23 10:25:54 +08:00
naiba 135cdf1111 rename 2024-11-23 01:18:01 +08:00
naiba be2f5a519f chore: fetch depth 0 2024-11-20 22:32:02 +08:00
naiba 48ea9ca76a fix: build ignore error 2024-11-20 22:29:08 +08:00
naiba 4c93d1643b release 2024-11-20 22:04:08 +08:00
naiba 0c38d52025 Merge pull request #2 from uubulb/dev
init service page
2024-11-15 23:06:26 +08:00
naiba f842d5aeec feat: auto generate api types 2024-11-09 00:07:21 +08:00
naiba 680dc219d3 feat: server table 1/10 2024-11-06 00:09:03 +08:00
naiba bfdae2838f feat: refresh token 2024-11-05 00:02:43 +08:00
naiba b1a0b607da feat: login & check user 2024-11-03 23:29:32 +08:00
naiba 772d66334e 🚧 server/service 2024-11-02 22:58:56 +08:00
naiba 017e6cfdcf login page 2024-11-02 22:34:43 +08:00
naiba d945ca97c1 🎉 init vite & shadcn-ui 2024-11-01 22:47:49 +08:00