mirror of
https://github.com/wekan/wekan.git
synced 2026-11-17 00:45:55 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5be568495e | ||
|
|
ebcdf327b0 | ||
|
|
e3da773d03 | ||
|
|
b35184d487 | ||
|
|
db3b12fac2 | ||
|
|
a34beaa62b | ||
|
|
138f727ebb | ||
|
|
39ee1d9512 | ||
|
|
b05972c4c8 | ||
|
|
495a6faa63 | ||
|
|
8eff8bb442 | ||
|
|
00b0431685 | ||
|
|
a364e75025 | ||
|
|
040d853c8e | ||
|
|
79676b3790 | ||
|
|
5ec3aaf85f | ||
|
|
cc302acdd1 | ||
|
|
77c22918d7 | ||
|
|
1051265fc8 | ||
|
|
7875220470 | ||
|
|
628a69c086 |
No files matched your search
+157
-449
@@ -124,6 +124,163 @@ its reason.
|
||||
|
||||
</details>
|
||||
|
||||
# v13.14 2026-11-16 WeKan ® release
|
||||
|
||||
**In short:** a **checklist folded on a minicard** stays folded, and every
|
||||
profile preference survives a reconnect. The **card shortcuts** open only their
|
||||
popup, **one shared list header row** really hides the other swimlanes'
|
||||
headers, and the editors no longer show "comment-placeholder" after the
|
||||
**i18next 27** update. **Deleting a card** keeps its attachments recoverable.
|
||||
|
||||
This release fixes the following bugs:
|
||||
|
||||
**Minicards** - folding a checklist, and the preferences it is stored with.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/b05972c4c88e108526c85ad3598867d781395e98">A checklist folded on a minicard stays folded: no publication sends the current user a partial profile</a>. Thanks to mimZD and xet7.</summary>
|
||||
|
||||
The fold was stored, and half a second later the checklist unfolded again
|
||||
([#6919](https://github.com/wekan/wekan/issues/6919)). DDP merges only
|
||||
top-level fields, and Meteor re-runs named subscriptions before the accounts
|
||||
publication of the whole profile on every login, a reconnect included.
|
||||
`userDesktopDragHandles` and ten other publications sent the current user a
|
||||
few `profile` fields; when one won, the client's profile shrank to them until a
|
||||
reload and every preference in it went back to its default -
|
||||
[#6691](https://github.com/wekan/wekan/issues/6691) had found the same for the
|
||||
board view. The drag-handle preference is now published under its own field,
|
||||
and the others leave the current user out (`server/lib/notCurrentUser.js`).
|
||||
`tests/noNarrowProfileForCurrentUser6919.test.cjs` finds every such query; the
|
||||
browser spec folds checklists in Persian after a page load and a reconnect, and
|
||||
24 of 24 reconnect runs pass where 4 of 24 unfolded before.
|
||||
|
||||
</details>
|
||||
|
||||
**Keyboard shortcuts** - what `d`, Shift+M and Shift+C open.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/138f727ebbfc30d395fbcfa18ca244e58abe91d7">Card shortcuts open only their popup, next to the minicard or the card menu</a>. Thanks to mimZD and xet7.</summary>
|
||||
|
||||
On a hovered minicard, `d`, Shift+M and Shift+C opened the card first, and
|
||||
Move / Copy went through the card's hamburger menu as well
|
||||
([#6924](https://github.com/wekan/wekan/issues/6924)). Now only the Due date,
|
||||
Move card or Copy card popup opens, next to the minicard, and the card stays
|
||||
closed; on an opened card Move / Copy no longer show the menu first.
|
||||
`client/lib/cardShortcutPopup.js` allows exactly what a click on the rendered
|
||||
control would, and `tests/cardShortcutPopup.test.cjs` ties each rule to that
|
||||
template condition; the browser specs check a non-admin and disabled shortcuts
|
||||
open nothing.
|
||||
|
||||
</details>
|
||||
|
||||
**Swimlanes** - one shared list header row.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/39ee1d9512ef0c5c5aec94fe9842c00c7b00da1d">One shared list header row hides the other swimlanes' list headers</a>. Thanks to mimZD and xet7.</summary>
|
||||
|
||||
The hiding rule was a plain `display: none`, which loses to the desktop list
|
||||
header layout's `display: block !important`, so every swimlane kept its headers
|
||||
and the setting's own browser spec failed. It is `!important` now and outranks
|
||||
those rules; `tests/sharedListRow6902.test.cjs` checks that against every
|
||||
`!important` header display rule in the client CSS.
|
||||
|
||||
</details>
|
||||
|
||||
**Translations** - what a string that is empty on purpose shows.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/79676b3790e4b69fc43e61dcd4379eabe389fae0">An empty translation shows nothing, not its key: no "comment-placeholder" in the editor</a>. Thanks to brlin-tw and xet7.</summary>
|
||||
|
||||
i18next 27 ([#6915](https://github.com/wekan/wekan/pull/6915), in v13.13)
|
||||
changed `returnEmptyString` to default false, so an empty translation falls
|
||||
back like a missing one - and since the English value is empty too, to its
|
||||
key. v13.13's notes said it would fall back to English; that was wrong. The
|
||||
description and comment editors showed the text "comment-placeholder"
|
||||
([#6921](https://github.com/wekan/wekan/issues/6921)), and eight Blockly
|
||||
suffixes showed their keys. `TAPi18n.init()` sets `returnEmptyString: true`
|
||||
again; no language has an empty value where English has text, so nothing that
|
||||
should fall back to English goes blank. lld, lb, haw and sc had text for the
|
||||
empty English source and are empty like the other languages.
|
||||
`tests/i18nEmptyString.test.cjs` runs the real `__()` with the options read
|
||||
from `tap.js`, and fails without the fix on i18next 27.1.1; the mocha suite and
|
||||
the description editor's Playwright spec check the placeholder is empty.
|
||||
|
||||
</details>
|
||||
|
||||
**Attachments** - what happens to the files when a card is deleted or an upload
|
||||
is renamed.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/7875220470de22f8ca5e5488ed58fe4b1c00f11d">Deleting a card soft-deletes its attachments, so they and their history can be restored</a>. Thanks to AhmedLukman and xet7.</summary>
|
||||
|
||||
Removing a card looked for attachments by a top-level `cardId`, which normal
|
||||
attachments do not have - they keep it in `meta.cardId` - so they stayed in
|
||||
the active listings. They now go through the same recoverable deletion as the
|
||||
attachment menu and the API: the bytes stay, the history row and the
|
||||
deleteAttachment activity are written, and the files leave the active lists.
|
||||
Legacy records with a top-level `cardId` keep the hard purge.
|
||||
`tests/cardAttachmentCascade.test.cjs` covers single and bulk REST deletion,
|
||||
refused requests and already deleted files.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/1051265fc893fe11abb3d5f447387b560f5ea98a">A browser test deletes a card with attachments through More, Delete and its confirmation</a>. Thanks to AhmedLukman and xet7.</summary>
|
||||
|
||||
`tests/playwright/specs/rest-card-attachment-cascade.e2e.js` uploads
|
||||
attachments in the browser, deletes their card from the card menu and checks
|
||||
the deletion markers, the history, the active list, the kept bytes and the
|
||||
other card's attachments.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/628a69c0861c20fbcb612b182ef70b7899b739fa">A renamed upload keeps its file paths consistent before it is validated</a>. Thanks to AhmedLukman and xet7.</summary>
|
||||
|
||||
When an upload's name was corrected to match its real file type, the paths
|
||||
were written to the database without waiting, and the in-memory file object
|
||||
kept the old ones, so the next write could put the old path back and the
|
||||
validator read a path that no longer existed. `rename()` now updates the
|
||||
original and version paths in memory and in the record, including the
|
||||
top-level path the validator reads, and the upload hooks and the
|
||||
file-extension migration wait for it. `tests/attachmentRenamePaths.test.cjs`
|
||||
and `attachment-upload-rename.e2e.js` cover failures, ordering, the original
|
||||
bytes and the card display.
|
||||
|
||||
</details>
|
||||
|
||||
and hardens the following security check:
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/040d853c8e7c0092db264527497a7dd8878dc248">RedirectBleed: a direct client write of an avatar URL follows the avatar dialog's rule</a>. Thanks to meifukun and xet7.</summary>
|
||||
|
||||
meifukun's five reports from July, fixed then
|
||||
([RedirectBleed](https://wekan.fi/hall-of-fame/redirectbleed/),
|
||||
[SourceBleed](https://wekan.fi/hall-of-fame/sourcebleed/),
|
||||
[LiveBleed](https://wekan.fi/hall-of-fame/livebleed/),
|
||||
[CasRaceBleed](https://wekan.fi/hall-of-fame/casbleed/),
|
||||
[MetricsBleed](https://wekan.fi/hall-of-fame/metricsbleed/)), arrived as
|
||||
GitHub security advisories and were checked again against the current code:
|
||||
all five are fixed, and `tests/securityMeifukun.test.cjs` pins each. One gap
|
||||
was found: `setAvatarUrl` refuses `javascript:`, `file:` and the rest, but the
|
||||
Users allow rule permits every `profile.*` field, so a browser-console
|
||||
`Users.update` stored what the method refuses. It was not exploitable - the
|
||||
URL is shown only as an image and fetched only through `fetchSafe` - but the
|
||||
rule is now `models/lib/avatarUrlScheme.js`, shared by both avatar methods and
|
||||
a Users deny rule that records the refused write in Admin Panel / Problems.
|
||||
`tests/avatarUrlDirectWrite.test.cjs` covers every way to write the field and
|
||||
checks no client code writes it directly.
|
||||
|
||||
</details>
|
||||
|
||||
and has the following developer-facing fixes:
|
||||
|
||||
- [The FreeBSD bundle guard follows dependabot's freebsd-vm 1.6.0, which node-patches now uses too](https://github.com/wekan/wekan/commit/5ec3aaf85f4edb605a7180593486c5edd24ac713).
|
||||
Thanks to xet7.
|
||||
- [build.sh's source test mode starts again: meteor/package/main imports resolve](https://github.com/wekan/wekan/commit/495a6faa634841f5fbb50fc1dd535d42f1c57a52).
|
||||
Thanks to xet7.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v13.13 2026-11-15 WeKan ® release
|
||||
|
||||
**In short:** **Copy Checklist** and the other destination pickers list the
|
||||
@@ -8292,452 +8449,3 @@ and has the following developer-tooling fix:
|
||||
site admin's internal hosts are not fetchSafe's. Thanks to xet7.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v12.44 2026-10-14 WeKan ® release
|
||||
|
||||
**In short:** sign in with a **passkey** or **SQRL**, and **log out
|
||||
everywhere**. **Browser push**, an **activity feed** and **ntfy** bring
|
||||
notifications anywhere, and webhooks **direct-message** on **Mattermost**. Card
|
||||
descriptions are **edited together, live**; cards can be **drawn on**, be
|
||||
**Stories** or **Tasks**, and mark **unread changes**. Boards get **column
|
||||
sets**, **linked lists** and a **Table view** that adds and drags cards, and
|
||||
**All Boards** gives each team a tab. **Nextcloud** gets **CalDAV** sync and
|
||||
**WebDAV** storage, public boards join the **fediverse**, and two **CodeQL**
|
||||
alerts are fixed.
|
||||
|
||||
This release fixes the following SECURITY ISSUES found by GitHub CodeQL code scanning:
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/587efab82b">Two CodeQL alerts in a test, and every test pattern of the same shapes</a>. Thanks to GitHub CodeQL and xet7.</summary>
|
||||
|
||||
CodeQL alerts #584 (bad HTML filtering regexp) and #585 (incomplete regular
|
||||
expression for hostnames), both in `tests/accountEmailHtml.test.cjs`: it
|
||||
checked that the e-mail layout escapes markup with `/<img|<script|<b>/`, which
|
||||
a `<SCRIPT>` passes, and made the reset address into a RegExp. It now lists
|
||||
every tag of the output in any letter case and allows only the layout's own
|
||||
`div`, `p`, `a` and `br`, and compares the address as text. The renderer was
|
||||
already escaping them.
|
||||
|
||||
Both are pinned as shapes across the tree in
|
||||
`tests/securityAlerts20261012.test.cjs`, which found more: a case-sensitive
|
||||
`<script>` pattern in `jsWebLabels.test.cjs`, a path spliced into generated
|
||||
code in `singleFile.test.cjs`, and twelve test patterns with a host name's dot
|
||||
unescaped. These are in tests, so there is no attempt at runtime to record in
|
||||
Admin Panel → Problems.
|
||||
|
||||
</details>
|
||||
|
||||
and adds the following new features:
|
||||
|
||||
**Sign-in** - how members sign in and out, and who is told.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/63ef900d56">Passkey login, and Log out everywhere</a>. Thanks to xet7.</summary>
|
||||
|
||||
Member Settings / Passkeys adds a passkey on this device under a name and
|
||||
removes one; the sign-in page has "Sign in with a passkey", with no user name
|
||||
needed. Verification is @simplewebauthn/server (pinned) against ROOT_URL's host
|
||||
and origin, with a single-use challenge that expires in five minutes and a
|
||||
signature counter that must move forward. Passkeys are never published. Log out
|
||||
everywhere ends every session of the account, this one too.
|
||||
`tests/passkeys.test.cjs` signs with a software authenticator and refuses
|
||||
another key, origin, challenge or a counter that went back; a Meteor runtime
|
||||
test checks the server loads. [Passkeys](docs/Features/Login/Passkeys.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/ea256dd772">A login and registration webhook in the Admin Panel, off by default</a>. Thanks to KrunalDholakiya and xet7.</summary>
|
||||
|
||||
Admin Panel / Settings / Global Webhooks tells one address when somebody logs
|
||||
in or an account is made, only for the ticked events. It carries the event,
|
||||
the user name and the time; the email, IP address, full name and sign-in
|
||||
method only when ticked. It is sent after the login, through the SSRF guard,
|
||||
and is never published. `tests/accountWebhook.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c940b3e301">Sign in with SQRL, from a phone or a computer</a>. Thanks to xet7.</summary>
|
||||
|
||||
[SQRL](https://www.grc.com/sqrl/sqrl.htm) signs in with a SQRL app or client
|
||||
instead of a password, after a site admin turns it on (Admin Panel → Settings →
|
||||
Visibility → Features, off by default). A member adds their identity once in
|
||||
Member Settings → SQRL; the sign-in page then shows a `sqrl://` link and its QR
|
||||
code and signs in by itself when the client has answered. WeKan keeps only the
|
||||
identity's public keys, never published and not writable from the client.
|
||||
|
||||
Every nut is random and used once, each request must carry the server's
|
||||
previous reply unchanged, and every request is checked with Ed25519 (Node.js's
|
||||
own `crypto`). An unknown identity can neither make an account nor sign in;
|
||||
disable, enable, remove and rekey follow the protocol, the last three only
|
||||
with the rescue code's unlock key. `tests/sqrl.test.cjs` drives the real
|
||||
handler with a software SQRL client, forged signatures, replays and altered
|
||||
replies included, and `server/lib/tests/sqrl.tests.js` adds an identity and
|
||||
signs in through the running server. Documented in
|
||||
[SQRL.md](docs/Features/Login/SQRL.md).
|
||||
|
||||
</details>
|
||||
|
||||
**Notifications** - where they arrive and how they look.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d873af70e8">ntfy phone notifications, per member</a>. Thanks to xet7.</summary>
|
||||
|
||||
Member Settings / Notification Settings takes a member's ntfy topic address
|
||||
and token; each notification they get also arrives in the ntfy app, with a tap
|
||||
opening the card. JSON publishing, through the SSRF guard, best effort, and the
|
||||
topic is never published. `tests/ntfy.test.cjs`,
|
||||
[ntfy](docs/Features/Notifications/ntfy.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/058677e078">E-mails in the clear HTML layout by default</a>. Thanks to Meeques and xet7.</summary>
|
||||
|
||||
Notification e-mail defaults to the clearly arranged layout of \#5171, classic
|
||||
one choice away; account e-mails (reset password, verify, new account,
|
||||
invitations) get an HTML part built from the same translated text, everything
|
||||
escaped and only http(s) linked. `tests/accountEmailHtml.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/349d6dc5e6">Webhooks can also direct-message the card's people on Mattermost</a>. Thanks to xet7.</summary>
|
||||
|
||||
A webhook's new tick sends each message about a card to its members and
|
||||
assignees as `@username`, never to whoever made the change, at most 50.
|
||||
`tests/mattermostDirectMessages.test.cjs`,
|
||||
[Mattermost](docs/Features/Webhooks/Chat/Mattermost.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0a5ae3e205">Browser push notifications, per device</a>. Thanks to saurabharch, hingerl and xet7.</summary>
|
||||
|
||||
Member Settings → Notification Settings → Browser notifications on this
|
||||
device: every notification the member gets also pops up from that browser,
|
||||
even with WeKan closed, and a click opens the card. web-push 3.6.7 (pinned)
|
||||
sends it with this WeKan's own VAPID keys. A subscription is accepted only over
|
||||
https and only at the push services browsers use, checked when saved and
|
||||
before every send. Not offered on Sandstorm.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/656af74b2c">An activity feed across all of a member's boards</a>. Thanks to xet7.</summary>
|
||||
|
||||
Member menu → Activity on all my boards lists what happened on every board the
|
||||
member sees, newest first, 50 at a time, in the sentences the notifications
|
||||
use. It never carries a field's value, follows the assigned-only rule, and is
|
||||
empty when the Admin Panel turns activities off. `tests/activityFeed.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c3321926ab">Webhooks: pick which activities a webhook is sent</a>. Thanks to xet7.</summary>
|
||||
|
||||
The webhook form gets "Send this webhook:" with Every activity and a tick per
|
||||
kind of activity - the groups notifications are muted by. Nothing ticked stays
|
||||
"all", so a webhook never silently gets nothing.
|
||||
`tests/webhookActivityPicker.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Rules** - who sees them, and who their e-mails go to.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/f4a3690256">Board members can be shown the Rules, read-only</a>. Thanks to justinr1234 and xet7.</summary>
|
||||
|
||||
An Admin Panel option, off by default, lets board admins tick "Show these
|
||||
Rules to board members, read-only"; members then read the rules list and
|
||||
details with no control that changes them. Without both ticks only admins see
|
||||
the Rules page. `tests/rulesReadOnly.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/75e260966b">Pick board members for a rule e-mail's To field</a>. Thanks to chenghongxi and xet7.</summary>
|
||||
|
||||
A member picker with autocomplete adds `@username`, which becomes that member's
|
||||
current address when the rule runs; free addresses still work, and a name of
|
||||
somebody outside the board is dropped. `tests/ruleEmailMembers.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Boards** - subtasks, teams and leaving a board.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/740c3920eb">Board Settings / Subtasks picks the swimlane new subtasks land in</a>. Thanks to BjoernLudwig and xet7.</summary>
|
||||
|
||||
Beside the landing list; unset keeps the parent's swimlane title, else the
|
||||
default. `tests/subtaskLandingSwimlane.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/1acc9f2b9f">Leaving a board that came through a team hides it, restorably</a>. Thanks to LaureHades and xet7.</summary>
|
||||
|
||||
Such a board goes into the member's hidden list, out of All Boards, and Member
|
||||
Settings / Hidden boards restores it; the team membership is untouched.
|
||||
`tests/hiddenBoards.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/ed2649f702">A board admin may add only the organizations and teams they belong to</a>. Thanks to chrisi51 and xet7.</summary>
|
||||
|
||||
Site admins may add any; links already on a board stay, and removing is always
|
||||
allowed. The pickers offer only the admin's own groups.
|
||||
`tests/boardGroupLinks.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/2fd3993538">A linked whole list: a live mirror of another board's list</a>. Thanks to javen9881 and xet7.</summary>
|
||||
|
||||
The add-list form can link a list from another board: its cards appear live
|
||||
and stay the source board's cards, under its rules, and a card typed into the
|
||||
mirror is added to the source list only for somebody who may write there. The
|
||||
cards are published only to a subscriber who sees both boards. No self links,
|
||||
archived or foreign lists, or mirrors of mirrors. `tests/linkedList.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Cards and checklists** - kinds of card, subtasks from other boards, and
|
||||
who does each checklist item.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0d77882c3b">Story and Task cards, with custom fields of their own</a>. Thanks to nightwind27 and xet7.</summary>
|
||||
|
||||
Card menu / Card kind makes a card a Story or a Task, with a badge on the
|
||||
minicard. A custom field limited to a kind is added to a card when it gets
|
||||
that kind and shown only on cards of it. `tests/cardKinds.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/e9af50ff07">An existing card from another board as a subtask</a>. Thanks to TiibCD and xet7.</summary>
|
||||
|
||||
The existing-card picker gets a board picker; another board's card is
|
||||
attached on the server, which checks write access to both boards and loops
|
||||
through every parent. `tests/crossBoardSubtasks.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/7ca1489279">A person responsible for each checklist item, and dated items in the calendar and Gantt</a>. Thanks to martinbruno90 and xet7.</summary>
|
||||
|
||||
Each item gets a responsible board member. Items with a due date appear in
|
||||
the calendar and both Gantt views as "card: item"; moving one moves only the
|
||||
item's date. `tests/checklistItemSchedule.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/9138e85091">Edit a card description together, live</a>. Thanks to dalareo and xet7.</summary>
|
||||
|
||||
Everybody with a card's description open edits one shared Yjs document, so two
|
||||
people typing at once both keep what they typed instead of the later Save
|
||||
replacing the earlier. The editor stays the Markdown textarea, with the caret
|
||||
kept where it was; Save writes the description as before. The document is
|
||||
published only to people who may edit the card, merged with a conditional
|
||||
write, size-limited and rate-limited, and started again when the description
|
||||
changes some other way. yjs 13.6.33 (pinned). `tests/sharedDescription.test.cjs`
|
||||
runs the real Yjs.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c772769c0e">Draw or write by hand on a card, saved as PNG and SVG</a>. Thanks to aleroot and xet7.</summary>
|
||||
|
||||
Card menu → Drawing: draw with a mouse, pen or finger, undo and clear. The
|
||||
strokes stay on the card so the drawing can be edited later, and a PNG is
|
||||
uploaded as an attachment; Download as SVG builds the SVG from the strokes.
|
||||
Only numbers and the allowed colours and widths reach the SVG.
|
||||
`tests/cardDrawing.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d8690a26f5">Cards changed since a member last opened them are marked</a>. Thanks to Lacour20, martinpospech and xet7.</summary>
|
||||
|
||||
Member Settings → Mark cards changed since I last opened them, off by default:
|
||||
a minicard gets a blue edge when its fields, checklists, attachments or
|
||||
comments changed after the member last opened it. Turning it on does not mark
|
||||
every old card, and the member's own edits do not mark it.
|
||||
`tests/unreadChanges.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Board views** - the Table and Swimlanes views.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0a566dc9ac">The Table view adds cards, and moves them by dragging a row onto another</a>. Thanks to guakamole and xet7.</summary>
|
||||
|
||||
An add row under the table takes a title, list and swimlane, checked on the
|
||||
server; dropping a row puts its card just before the target card.
|
||||
`tests/tableViewDrop.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/9d95bda245">One shared, sticky list header row for all swimlanes</a>. Thanks to mikesutton and xet7.</summary>
|
||||
|
||||
A Board Settings / Swimlane setting, off by default: the first swimlane's list
|
||||
headers stay at the top, through the existing sticky rule, and the others are
|
||||
not repeated. `tests/sharedListHeaders.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/03d0144538">Column sets: the same cards in several named sets of columns</a>. Thanks to kentonv and xet7.</summary>
|
||||
|
||||
A new board view. A board keeps named column sets - say Completion, Priority,
|
||||
Milestone - and every card is in one column of each set. Dragging a card moves
|
||||
it only within the shown set, and each card shows its columns in the other sets
|
||||
as coloured labels. Board admins make the sets; the Admin Panel can turn the
|
||||
view off. Documented in [Column-Sets.md](docs/Features/Board/Column-Sets.md).
|
||||
|
||||
</details>
|
||||
|
||||
**All Boards** - finding boards among many.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/000bc1c490">Boards grouped by first character, organization, team and board label</a>. Thanks to xet7.</summary>
|
||||
|
||||
A facet bar shows each group with its count, and a click shows only that
|
||||
group. Board labels are the member's own, applied to every board whose name
|
||||
includes some text. `tests/allBoardsFacets.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d04b8444a6">A tab per organization and team, where their admins manage members</a>. Thanks to xet7.</summary>
|
||||
|
||||
The left menu of All Boards gets a tab for each organization and team the
|
||||
member is in, with its boards and its members. The group's admins and site
|
||||
admins add and remove members there; a group that comes from LDAP or another
|
||||
directory is read-only, because WeKan never writes directory groups back.
|
||||
`tests/groupMembers.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Platforms** - phones, Sandstorm and free JavaScript.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/52b0ea0d81">Share to WeKan from other Android apps</a>. Thanks to memeplex and xet7.</summary>
|
||||
|
||||
The manifest's share target opens "Add to WeKan": pick a board and list and
|
||||
what was shared becomes a card. The server checks the right to write in that
|
||||
list. `tests/shareTarget.test.cjs`,
|
||||
[Android](docs/Platforms/FOSS/OS/Android.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d1d806de2c">On Sandstorm, Copy card URL shares the card through Sandstorm</a>. Thanks to AlexanderZobkov and xet7.</summary>
|
||||
|
||||
It opens Sandstorm's Share Access dialog for the card's page, whose link opens
|
||||
the grain there; elsewhere it copies as before. `tests/sandstormShare.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/631a7fdfe2">LibreJS license information for the browser bundle</a>. Thanks to alexgleason and xet7.</summary>
|
||||
|
||||
`/jslicense.html` is a JS Web Labels table of the scripts actually served, and
|
||||
every page links it with `rel="jslicense"`. `tests/jsWebLabels.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Nextcloud and the fediverse** - calendars, files and followers outside WeKan.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c76f3e2e98">CalDAV: card due dates in Nextcloud Calendar or any CalDAV calendar</a>. Thanks to scriptPilot and xet7.</summary>
|
||||
|
||||
Board Settings → Date → Calendar sync: each card with a due date is one event
|
||||
in the chosen calendar, removed when the due date goes, and a due date moved in
|
||||
the calendar comes back to the card every 15 minutes. The calendar's password
|
||||
is never published and only a board admin sees the link; requests go through
|
||||
the SSRF guard. `tests/caldavSync.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/4234081752">WebDAV attachment storage: Nextcloud Files or any WebDAV server</a>. Thanks to scriptPilot and xet7.</summary>
|
||||
|
||||
Admin Panel → Attachments → WebDAV (Nextcloud Files), beside S3, Azure and
|
||||
Google Cloud Storage, with the same switches, connection test, default storage
|
||||
and Move Attachment. The password is a secret field like the others, and
|
||||
redirects are refused. With CalDAV this completes #687; the Nextcloud ExApp is
|
||||
built by `.github/workflows/nextcloud.yml`. `tests/webdavStorage.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/bf633b9c72">ActivityPub: a public board can be followed from Mastodon</a>. Thanks to ASLLR and xet7.</summary>
|
||||
|
||||
Admin Panel → Settings → Visibility → Features → ActivityPub, off by default:
|
||||
each public board is an actor, `@board-<id>` at this WeKan, and its new card
|
||||
activity reaches its followers as signed Notes. It is read-only - only signed
|
||||
Follow and Undo Follow are acted on - and a private board is never an actor.
|
||||
Outgoing requests go through the SSRF guard. `tests/activityPub.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
**Speed** - finding a card's subtasks.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0c6c0c6021">Finding subtasks no longer scans every card</a>. Thanks to Raymond-Voogt and xet7.</summary>
|
||||
|
||||
Subtasks of several parents are found with `{ $or: [{ parentId }, { parentIds }]
|
||||
}`,
|
||||
and only `parentId` had an index - a `$or` uses indexes only when every branch
|
||||
has one, so removing, copying and exporting cards scanned the whole collection.
|
||||
`parentIds` has its own index now, and `tests/cardQueryIndexes.test.cjs`
|
||||
requires
|
||||
an index for every branch of every subtask `$or`.
|
||||
|
||||
</details>
|
||||
|
||||
**Startup** - a schema WeKan could not start with.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d3966fa6b9">Story and Task cards no longer stop WeKan at startup</a>. Thanks to xet7.</summary>
|
||||
|
||||
The unreleased Story and Task commit declared `cardKinds` as `type: [String]`,
|
||||
which the schema library refuses at startup. It is `type: Array` with a
|
||||
`cardKinds.$` entry, and `tests/cardKinds.test.cjs` pins the form.
|
||||
|
||||
</details>
|
||||
|
||||
**Accessibility** - screen readers.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/8d71c6f925">Every icon-only link and button has a name for screen readers</a>. Thanks to ndarilek and xet7.</summary>
|
||||
|
||||
21 controls showed only an icon and had no name: the drag handles, the inline
|
||||
forms' close buttons, a card's date buttons, the notification drawer, History's
|
||||
previous and next and others. Each has a translated title, which becomes its
|
||||
`aria-label`, and `tests/iconOnlyControlLabels.test.cjs` scans every template
|
||||
for an unnamed icon-only control. Part of #337.
|
||||
|
||||
</details>
|
||||
|
||||
and has the following developer-tooling and translation changes:
|
||||
|
||||
- [The new strings translated in all 234 locales](https://github.com/wekan/wekan/commit/fdc52787e1). Thanks to xet7.
|
||||
- [The Mattermost, Share to WeKan, passkey and hidden board strings translated](https://github.com/wekan/wekan/commit/5409e059ae). Thanks to xet7.
|
||||
- [The risk baseline allows the Sandstorm share helper's addresses](https://github.com/wekan/wekan/commit/a4727e6764). Thanks to xet7.
|
||||
- [The cross-board subtask, checklist owner, shared header, facet and card kind strings translated](https://github.com/wekan/wekan/commit/946f032883). Thanks to xet7.
|
||||
- [The push, linked-list, column-set, drawing and team-tab strings translated](https://github.com/wekan/wekan/commit/2b84e6b616). Thanks to xet7.
|
||||
- [The ActivityPub, CalDAV and WebDAV strings, translated](https://github.com/wekan/wekan/commit/2c9df4db88). Thanks to xet7.
|
||||
- [The SQRL strings translated](https://github.com/wekan/wekan/commit/b0e47537e0). Thanks to xet7.
|
||||
- [A test pins the issue's own example of keeping #label and @member](https://github.com/wekan/wekan/commit/cd4c4ad9ce), which shipped in v12.43. Thanks to biji and xet7.
|
||||
- [A guard skips every rspack output directory, not only _build](https://github.com/wekan/wekan/commit/5f2dd80f41). Thanks to xet7.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
+10
-7
@@ -5,6 +5,16 @@ each one changed and the project status are in
|
||||
Written by `node releases/changelog-short.mjs` from CHANGELOG-big.md:
|
||||
make changes there.
|
||||
|
||||
# v13.14 2026-11-16 WeKan ® release
|
||||
|
||||
a **checklist folded on a minicard** stays folded, and every
|
||||
profile preference survives a reconnect. The **card shortcuts** open only their
|
||||
popup, **one shared list header row** really hides the other swimlanes'
|
||||
headers, and the editors no longer show "comment-placeholder" after the
|
||||
**i18next 27** update. **Deleting a card** keeps its attachments recoverable.
|
||||
|
||||
[All changes in v13.14](CHANGELOG-big.md#v1314-2026-11-16-wekan--release)
|
||||
|
||||
# v13.13 2026-11-15 WeKan ® release
|
||||
|
||||
**Copy Checklist** and the other destination pickers list the
|
||||
@@ -44,10 +54,3 @@ The release's **Snap Store** credential check bounds each
|
||||
snapcraft install attempt, so a Snap Store that hangs no longer stops a release.
|
||||
|
||||
[All changes in v13.10](CHANGELOG-big.md#v1310-2026-11-13-wekan--release)
|
||||
|
||||
# v13.09 2026-11-12 WeKan ® release
|
||||
|
||||
The release's **Snap Store** credential check retries installing
|
||||
snapcraft, so one Snap Store timeout no longer stops a release.
|
||||
|
||||
[All changes in v13.09](CHANGELOG-big.md#v1309-2026-11-12-wekan--release)
|
||||
+1
-1
@@ -38,7 +38,7 @@ FROM --platform=$BUILDPLATFORM debian:trixie AS bundle
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG VERSION=13.13
|
||||
ARG VERSION=13.14
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY --chmod=755 releases/check-telemetry.py /tmp/check-telemetry.py
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
appId: wekan-public/apps/77b94f60-dec9-0136-304e-16ff53095928
|
||||
appVersion: "v13.13.0"
|
||||
appVersion: "v13.14.0"
|
||||
files:
|
||||
userUploads:
|
||||
- README.md
|
||||
|
||||
@@ -463,7 +463,13 @@ body.swimlane-resizing-active * {
|
||||
/* #2805: one shared list header row for all swimlanes (Board Settings /
|
||||
Swimlane). The other swimlanes do not repeat the first swimlane's list
|
||||
headers; those stay at the top through the same sticky rule as Sticky list
|
||||
headers (#3847, lists/list.css), which the setting turns on. */
|
||||
headers (#3847, lists/list.css), which the setting turns on.
|
||||
!important: the desktop list header layout sets `display: block !important`
|
||||
(lists/list.css `.list:not(.list-collapsed):not(.mobile-view) .list-header`,
|
||||
boardHeader.css `.desktop-mode .list-header`), and a plain `display: none`
|
||||
loses to any !important one, so every swimlane kept its headers. Between
|
||||
!important declarations specificity decides, and this selector (0,5,0)
|
||||
outranks those (0,4,0 at most). tests/sharedListRow6902.test.cjs. */
|
||||
.board-canvas.shared-list-headers .js-swimlane:not(.is-first-swimlane) .list-header {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// #6924: the card shortcuts open ONLY their popup. `d` (Due date), Shift+M
|
||||
// (Move card) and Shift+C (Copy card) on a hovered or selected minicard used
|
||||
// to open the card first, and Shift+M / Shift+C went through the card's
|
||||
// hamburger menu too - three things for one key. Now the popup opens by
|
||||
// itself, next to the minicard, as a click on a minicard's due date or label
|
||||
// opens only its popup; on an opened card, Move / Copy open next to the card's
|
||||
// hamburger without showing the menu first.
|
||||
//
|
||||
// The popup is opened directly, so these are the rules a click would meet.
|
||||
// Each one is the condition the opened card renders that control under, and
|
||||
// tests/cardShortcutPopup.test.cjs ties every rule to that template:
|
||||
// due cardDetails.jade: `if currentBoard.allowsDueDate`, then the date
|
||||
// badge (`if canModifyCard`) when the card has a due date, or the add
|
||||
// `+` (`if canModifyCard` / `unless currentUser.isWorker`) when not;
|
||||
// move cardDetailsActionsPopup: `if cardMenuWrites` / `if currentUser.isBoardAdmin`;
|
||||
// copy cardDetailsActionsPopup: `if cardMenuWrites` / `unless currentUser.isWorker`.
|
||||
// cardMenuWrites (cardDetails.js) is: may modify the card, or is a member who
|
||||
// is neither read-only nor read-assigned-only.
|
||||
//
|
||||
// Pure, no Meteor imports, so the test drives it without a browser.
|
||||
|
||||
export const CARD_SHORTCUT_POPUPS = Object.freeze({
|
||||
due: 'editCardDueDate',
|
||||
move: 'moveCard',
|
||||
copy: 'copyCard',
|
||||
});
|
||||
|
||||
// facts: { canModifyCard, isBoardAdmin, isWorker, isReadOnly,
|
||||
// isReadAssignedOnly, allowsDueDate, hasDue } - booleans.
|
||||
// Returns the popup name to open, or null when a click could not open it.
|
||||
export function cardShortcutPopup(action, facts = {}) {
|
||||
const f = facts || {};
|
||||
const cardMenuWrites = Boolean(f.canModifyCard) || !(f.isReadOnly || f.isReadAssignedOnly);
|
||||
switch (action) {
|
||||
case 'due':
|
||||
if (f.allowsDueDate === false || !f.canModifyCard) return null;
|
||||
if (!f.hasDue && f.isWorker) return null;
|
||||
return CARD_SHORTCUT_POPUPS.due;
|
||||
case 'move':
|
||||
return cardMenuWrites && f.isBoardAdmin ? CARD_SHORTCUT_POPUPS.move : null;
|
||||
case 'copy':
|
||||
return cardMenuWrites && !f.isWorker ? CARD_SHORTCUT_POPUPS.copy : null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const SAFE_ID = /^[A-Za-z0-9_-]+$/;
|
||||
|
||||
// The minicard element of a card, to anchor its popup: the hovered one when it
|
||||
// is that card (a card can be on the board more than once), else the first.
|
||||
// null for an id that is not a plain id, so it never reaches a selector.
|
||||
export function findMinicard(root, cardId, hovered = null) {
|
||||
if (!root || typeof cardId !== 'string' || !SAFE_ID.test(cardId)) return null;
|
||||
if (hovered && hovered.getAttribute && hovered.getAttribute('data-card-id') === cardId) return hovered;
|
||||
return root.querySelector(`.js-minicard[data-card-id="${cardId}"]`) || null;
|
||||
}
|
||||
+54
-29
@@ -10,7 +10,8 @@ import { Utils } from '/client/lib/utils';
|
||||
import { newHistoryRequestId, runKeystroke } from '/client/lib/historyKeyRequest';
|
||||
import { historyRequestStorage, refreshPendingHistoryRequest } from '/client/lib/historyKeyRecovery';
|
||||
import { findDueDateControl } from '/client/lib/dueDateHotkey';
|
||||
import { cardMenuStep } from '/client/lib/cardMenuHotkey';
|
||||
import { findCardMenuOpener } from '/client/lib/cardMenuHotkey';
|
||||
import { cardShortcutPopup, findMinicard } from '/client/lib/cardShortcutPopup';
|
||||
|
||||
// Late-bind Sidebar to avoid circular dependency (sidebar.js needs its template first)
|
||||
let _Sidebar;
|
||||
@@ -424,39 +425,67 @@ export function openDueDateEditorOfOpenedCard() {
|
||||
return true;
|
||||
}
|
||||
// #6755: with no card opened, `d` on a hovered or selected minicard - the
|
||||
// card every other card shortcut here acts on - opens that card and then
|
||||
// its Due date editor, rather than doing nothing until the card is opened.
|
||||
const minicardId = Session.get('selectedCard') || getHoveredCardId();
|
||||
const minicard = minicardId && ReactiveCache.getCard(minicardId);
|
||||
if (!minicard || !Utils.canModifyCard(minicard)) return false;
|
||||
Utils.goCardId(minicardId);
|
||||
setTimeout(() => clickDueDateControlWhenRendered(minicardId), 0);
|
||||
return true;
|
||||
// card every other card shortcut here acts on - opens its Due date editor.
|
||||
// #6924: only the editor, next to the minicard, as a click on the
|
||||
// minicard's due date does; the card itself stays closed.
|
||||
return openCardShortcutPopupAtMinicard('due');
|
||||
}
|
||||
hotkeys('d, shift+d', (event) => {
|
||||
event.preventDefault();
|
||||
openDueDateEditorOfOpenedCard();
|
||||
});
|
||||
|
||||
// #6904: Shift+M opens Move card and Shift+C opens Copy card, through the
|
||||
// opened card's own hamburger menu (client/lib/cardMenuHotkey.js), so the
|
||||
// menu's permissions decide whether there is anything to open. With no card
|
||||
// opened, the hovered or selected minicard is opened first, as for `d`.
|
||||
// Shift keeps them apart from `m` (assign yourself) and `c` (archive).
|
||||
function runCardMenuActionWhenRendered(cardId, action) {
|
||||
// #6904: Shift+M opens Move card and Shift+C opens Copy card. Shift keeps them
|
||||
// apart from `m` (assign yourself) and `c` (archive).
|
||||
// #6924: each opens ONLY its popup. The popup is opened directly, so
|
||||
// cardShortcutPopup (client/lib/cardShortcutPopup.js) applies the rules the
|
||||
// controls a click would use are rendered under - the hamburger menu's Move
|
||||
// card / Copy card items, the due date badge and its `+` - and without them
|
||||
// nothing opens.
|
||||
function cardShortcutFacts(card) {
|
||||
const user = ReactiveCache.getCurrentUser();
|
||||
const board = ReactiveCache.getBoard(card.boardId);
|
||||
return {
|
||||
canModifyCard: Utils.canModifyCard(card),
|
||||
isBoardAdmin: Boolean(user && user.isBoardAdmin && user.isBoardAdmin()),
|
||||
isWorker: Boolean(user && user.isWorker && user.isWorker()),
|
||||
isReadOnly: Boolean(user && user.isReadOnly && user.isReadOnly()),
|
||||
isReadAssignedOnly: Boolean(user && user.isReadAssignedOnly && user.isReadAssignedOnly()),
|
||||
allowsDueDate: !board || board.allowsDueDate !== false,
|
||||
hasDue: Boolean(card.getDue && card.getDue()),
|
||||
};
|
||||
}
|
||||
// Opens the popup next to `anchor`, with the card as its data context - as
|
||||
// the minicard's own menu and date badges open theirs (minicard.js,
|
||||
// cardDate.js openDateEditor).
|
||||
function openCardShortcutPopup(action, card, anchor) {
|
||||
const name = cardShortcutPopup(action, cardShortcutFacts(card));
|
||||
if (!name || !anchor) return false;
|
||||
Popup.open(name).call(card, { currentTarget: anchor, target: anchor, preventDefault() {} });
|
||||
return true;
|
||||
}
|
||||
// With no card opened: the hovered or selected minicard, the card every other
|
||||
// card shortcut here acts on. The card is not opened.
|
||||
function openCardShortcutPopupAtMinicard(action) {
|
||||
const minicardId = Session.get('selectedCard') || getHoveredCardId();
|
||||
const minicard = minicardId && ReactiveCache.getCard(minicardId);
|
||||
if (!minicard) return false;
|
||||
const anchor = findMinicard(document, minicardId, $('.js-minicard:hover').get(0));
|
||||
return openCardShortcutPopup(action, minicard, anchor);
|
||||
}
|
||||
// #6840: an opened card's details render a moment after the route names it,
|
||||
// so the popup waits for the card's hamburger to anchor to, and gives up
|
||||
// after 3 seconds.
|
||||
function openCardShortcutPopupWhenRendered(cardId, action) {
|
||||
const started = Date.now();
|
||||
let menuOpened = false;
|
||||
const step = () => {
|
||||
if (Utils.getCurrentCardId() !== cardId) return;
|
||||
const result = cardMenuStep(document, {
|
||||
cardId, action, menuOpened, dataOf: element => Blaze.getData(element),
|
||||
});
|
||||
if (result === 'clicked-item') return;
|
||||
if (result === 'no-item') {
|
||||
Popup.close();
|
||||
const card = ReactiveCache.getCard(cardId);
|
||||
const anchor = card && findCardMenuOpener(document, { cardId, dataOf: element => Blaze.getData(element) });
|
||||
if (anchor) {
|
||||
openCardShortcutPopup(action, card, anchor);
|
||||
return;
|
||||
}
|
||||
if (result === 'opened-menu') menuOpened = true;
|
||||
if (Date.now() - started < 3000) setTimeout(step, 50);
|
||||
};
|
||||
step();
|
||||
@@ -466,14 +495,10 @@ export function openCardMenuActionOfOpenedCard(action) {
|
||||
const cardId = Utils.getCurrentCardId();
|
||||
if (cardId) {
|
||||
if (!ReactiveCache.getCard(cardId)) return false;
|
||||
runCardMenuActionWhenRendered(cardId, action);
|
||||
openCardShortcutPopupWhenRendered(cardId, action);
|
||||
return true;
|
||||
}
|
||||
const minicardId = Session.get('selectedCard') || getHoveredCardId();
|
||||
if (!minicardId || !ReactiveCache.getCard(minicardId)) return false;
|
||||
Utils.goCardId(minicardId);
|
||||
setTimeout(() => runCardMenuActionWhenRendered(minicardId, action), 0);
|
||||
return true;
|
||||
return openCardShortcutPopupAtMinicard(action);
|
||||
}
|
||||
hotkeys('shift+m', (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
+5
-2
@@ -884,9 +884,12 @@ export const Utils = {
|
||||
// never chosen. The three states matter — see showDragHandles() below.
|
||||
dragHandlesPreference() {
|
||||
// #6745: read by every minicard - one field, not the whole user document.
|
||||
const currentUser = currentUserWith(['profile.showDesktopDragHandles']);
|
||||
// #6919: the profile's own value when the client has the profile, else the
|
||||
// one userDesktopDragHandles publishes under a top-level field of its own.
|
||||
const currentUser = currentUserWith(['profile.showDesktopDragHandles', 'desktopDragHandlesPreference']);
|
||||
const fromProfile = currentUser && (currentUser.profile || {}).showDesktopDragHandles;
|
||||
const stored = currentUser
|
||||
? (currentUser.profile || {}).showDesktopDragHandles
|
||||
? (fromProfile !== undefined ? fromProfile : currentUser.desktopDragHandlesPreference)
|
||||
// Not logged in: the same three states, kept in localStorage. A MISSING
|
||||
// key is "never chosen"; the string 'false' is a deliberate "off".
|
||||
: window.localStorage.getItem('showDesktopDragHandles');
|
||||
|
||||
@@ -10,7 +10,7 @@ This is without container (without Docker or Snap).
|
||||
|
||||
Right click and download files 1-4:
|
||||
|
||||
1. [wekan-13.13-win64.zip](https://github.com/wekan/wekan/releases/download/v13.13/wekan-13.13-win64.zip) or newest available at https://github.com/wekan/wekan/releases/
|
||||
1. [wekan-13.14-win64.zip](https://github.com/wekan/wekan/releases/download/v13.14/wekan-13.14-win64.zip) or newest available at https://github.com/wekan/wekan/releases/
|
||||
|
||||
2. [node.exe](https://nodejs.org/dist/latest-v26.x/win-x64/node.exe)
|
||||
|
||||
@@ -22,7 +22,7 @@ Right click and download files 1-4:
|
||||
|
||||
6. Double click `mongodb-windows-x86_64-7.0.34-signed.msi` . In installer, uncheck downloading MongoDB compass.
|
||||
|
||||
7. Unzip `wekan-13.13-win64.zip` , inside it is directory `bundle`, to it copy other files:
|
||||
7. Unzip `wekan-13.14-win64.zip` , inside it is directory `bundle`, to it copy other files:
|
||||
|
||||
```
|
||||
bundle (directory)
|
||||
|
||||
@@ -500,13 +500,36 @@ PATH="$T/node-v26.9.0-linux-arm64/bin:$PATH" MONGO_URL="mongodb://127.0.0.1:2701
|
||||
# -> http://localhost:8080 serves once startup finishes (~10-30s).
|
||||
```
|
||||
|
||||
### Docker is NOT available inside this Flatpak sandbox
|
||||
### Docker: the host's, through `flatpak-spawn --host`
|
||||
|
||||
`docker` / `docker-compose` / `podman` are not present in the VSCodium Flatpak sandbox, so
|
||||
`docker compose up` cannot be run here. To reproduce a `docker-compose.yml`-style setup,
|
||||
run FerretDB and the bundle manually as shown above (the compose `ferretdb` service just
|
||||
downloads and runs the same `ferretdb-<arch>` binary; the `wekan` service just runs the
|
||||
same bundle). The Docker-only startup race in #6500 (WeKan starting before FerretDB is
|
||||
`docker` / `docker-compose` / `podman` are not installed inside the VSCodium Flatpak
|
||||
sandbox. `vscodium-sandbox.sh` grants `--talk-name=org.freedesktop.Flatpak`, so the
|
||||
HOST's Docker can be reached as `flatpak-spawn --host docker ...`. `build.sh`'s
|
||||
`docker_available` and `docker_exec` use exactly that when `docker` is not in `PATH`,
|
||||
which is how Playwright Firefox and WebKit run in the official Playwright image when
|
||||
they cannot start inside the sandbox (Firefox needs user namespaces the sandbox
|
||||
refuses; WebKit needs `libgtk-4`):
|
||||
|
||||
```bash
|
||||
flatpak-spawn --host docker version # check: the host's Docker answers
|
||||
WEKAN_PLAYWRIGHT_DOCKER=1 ./build.sh # all browsers in the Playwright image
|
||||
```
|
||||
|
||||
Docker must be installed on the host, and the host user must be in the `docker`
|
||||
group (`sudo usermod -aG docker $USER`, then log in again).
|
||||
|
||||
**This is a hole in the sandbox, on purpose.** `flatpak-spawn --host` runs ANY
|
||||
command on the host, outside every restriction above, and the Docker socket is
|
||||
root-equivalent on the host. An AI assistant's own permission settings should
|
||||
therefore allow only `flatpak-spawn --host docker ...`, never `flatpak-spawn
|
||||
--host` in general. To keep the sandbox closed, launch it with
|
||||
`WEKAN_SANDBOX_HOST_DOCKER=0 ./vscodium-sandbox.sh`; then `flatpak-spawn --host`
|
||||
fails, and the browsers that need Docker have to be run on the host.
|
||||
|
||||
Without Docker, reproduce a `docker-compose.yml`-style setup by running FerretDB and
|
||||
the bundle manually as shown above (the compose `ferretdb` service just downloads and
|
||||
runs the same `ferretdb-<arch>` binary; the `wekan` service just runs the same
|
||||
bundle). The Docker-only startup race in #6500 (WeKan starting before FerretDB is
|
||||
ready) is fixed in `docker-compose.yml` with a ferretdb healthcheck + `depends_on:
|
||||
condition: service_healthy`; when running manually, always start FerretDB first.
|
||||
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
# Reset previous attempts
|
||||
#flatpak kill com.vscodium.codium
|
||||
flatpak install -y com.vscodium.codium
|
||||
flatpak override --reset com.vscodium.codium
|
||||
|
||||
# Block EVERYTHING except the display and the wekan folder
|
||||
# ... and one deliberate exception: --talk-name=org.freedesktop.Flatpak lets
|
||||
# `flatpak-spawn --host docker ...` reach the HOST's Docker, which build.sh's
|
||||
# docker_available/docker_exec use to run Playwright Firefox and WebKit in the
|
||||
# official Playwright image when they cannot start inside this sandbox. It is
|
||||
# a host escape (flatpak-spawn --host runs any host command, and the Docker
|
||||
# socket is root-equivalent); set WEKAN_SANDBOX_HOST_DOCKER=0 to leave it out.
|
||||
# README.md beside this file says what it costs.
|
||||
HOST_DOCKER_ARGS=()
|
||||
if [ "${WEKAN_SANDBOX_HOST_DOCKER:-1}" != 0 ]; then
|
||||
HOST_DOCKER_ARGS=(--talk-name=org.freedesktop.Flatpak)
|
||||
else
|
||||
HOST_DOCKER_ARGS=(--no-talk-name=org.freedesktop.Flatpak)
|
||||
fi
|
||||
flatpak override com.vscodium.codium \
|
||||
--nofilesystem=home \
|
||||
--nofilesystem=host \
|
||||
@@ -15,4 +29,5 @@ flatpak override com.vscodium.codium \
|
||||
--socket=x11 \
|
||||
--share=network \
|
||||
--user \
|
||||
--nosocket=ssh-auth
|
||||
--nosocket=ssh-auth \
|
||||
"${HOST_DOCKER_ARGS[@]}"
|
||||
@@ -646,7 +646,7 @@
|
||||
"unset-color": "unakeka",
|
||||
"comments": "Nā manaʻo",
|
||||
"comment": "Manaʻo",
|
||||
"comment-placeholder": "Ma ka ʻōlelo Hawaiʻi: ",
|
||||
"comment-placeholder": "",
|
||||
"comment-only": "manaʻo wale nō",
|
||||
"comment-only-desc": "hiki manaʻo ma nā kāleka wale nō.",
|
||||
"comment-assigned-only": "wale nō akakikaneka manaʻo",
|
||||
|
||||
@@ -646,7 +646,7 @@
|
||||
"unset-color": "Net festgelegt",
|
||||
"comments": "Kommentaren",
|
||||
"comment": "Kommentar",
|
||||
"comment-placeholder": "Optioun: ",
|
||||
"comment-placeholder": "",
|
||||
"comment-only": "Nur Kommentaren",
|
||||
"comment-only-desc": "Kann Kaarten nëmmen kommentieren.",
|
||||
"comment-assigned-only": "Nur zugewiesener Kommentar",
|
||||
|
||||
@@ -646,7 +646,7 @@
|
||||
"unset-color": "Nia stabilì",
|
||||
"comments": "Comënc",
|
||||
"comment": "Coment",
|
||||
"comment-placeholder": "Scrî n coment...",
|
||||
"comment-placeholder": "",
|
||||
"comment-only": "Mé comënc",
|
||||
"comment-only-desc": "Possa mé scrì comënc sun la ciartes.",
|
||||
"comment-assigned-only": "Mé comënc sun ciartes dates",
|
||||
|
||||
@@ -646,7 +646,7 @@
|
||||
"unset-color": "No impostadu",
|
||||
"comments": "Cummentos",
|
||||
"comment": "Cummentu",
|
||||
"comment-placeholder": "Iscrie unu cummentu",
|
||||
"comment-placeholder": "",
|
||||
"comment-only": "Petzi cummentos",
|
||||
"comment-only-desc": "Podet petzi cummentare sas cartas.",
|
||||
"comment-assigned-only": "Petzi cummentos in sas assignadas",
|
||||
|
||||
@@ -320,6 +320,14 @@ describe('TAPi18n', () => {
|
||||
expect(result).to.be.equal('Hello');
|
||||
});
|
||||
|
||||
it('keeps an empty translation empty instead of returning its key (#6921)', () => {
|
||||
TAPi18n.i18n.addResourceBundle('fr', 'translation', { 'empty-on-purpose': '' });
|
||||
TAPi18n.i18n.addResourceBundle('en', 'translation', { 'empty-on-purpose': '' });
|
||||
expect(TAPi18n.__('empty-on-purpose')).to.be.equal('');
|
||||
expect(TAPi18n.__('empty-on-purpose', null, 'en')).to.be.equal('');
|
||||
expect(TAPi18n.__('comment-placeholder', null, 'en')).to.be.equal('');
|
||||
});
|
||||
|
||||
it('works with simple keys and custom language', async () => {
|
||||
TAPi18n.i18n.addResourceBundle('de', 'translation', {
|
||||
'simple': 'Hola',
|
||||
|
||||
@@ -62,6 +62,13 @@ export const TAPi18n = {
|
||||
await this.i18n.init({
|
||||
fallbackLng: DEFAULT_LANGUAGE,
|
||||
cleanCode: true,
|
||||
// i18next 27 changed this default to false, and an empty translation then
|
||||
// falls back to the KEY: the description and comment editors showed the
|
||||
// text "comment-placeholder" (#6921), and Blockly's empty suffixes showed
|
||||
// their keys. Every empty value in en.i18n.json is empty on purpose, and
|
||||
// no other language has an empty value where English has text
|
||||
// (tests/i18nEmptyString.test.cjs), so an empty string stays empty.
|
||||
returnEmptyString: true,
|
||||
// Show translations debug messages only when DEBUG=true
|
||||
// OLD: debug: Meteor.isDevelopment,
|
||||
debug: process.env.DEBUG === 'true',
|
||||
|
||||
@@ -203,7 +203,7 @@ Attachments.onAfterUpload = async function (fileObj) {
|
||||
const originalName = fileObj.name;
|
||||
const correctedName = sanitizeUploadFileName(originalName, detectedMime || fileObj.type);
|
||||
if (correctedName && correctedName !== originalName) {
|
||||
rename(fileObj, correctedName, fileStoreStrategyFactory);
|
||||
await rename(fileObj, correctedName, fileStoreStrategyFactory);
|
||||
fileObj.name = correctedName;
|
||||
// Log to Admin Panel / Problems: who uploaded, why, when, where.
|
||||
try {
|
||||
@@ -464,7 +464,7 @@ Meteor.methods({
|
||||
const cleanName = cleanFileName(newName);
|
||||
if (!cleanName) throw new Meteor.Error('invalid-filename', 'This file name is not allowed.');
|
||||
|
||||
rename(fileObj, cleanName, fileStoreStrategyFactory);
|
||||
await rename(fileObj, cleanName, fileStoreStrategyFactory);
|
||||
},
|
||||
async validateAttachment(fileObjId) {
|
||||
check(fileObjId, String);
|
||||
|
||||
@@ -107,7 +107,7 @@ Avatars.onAfterUpload = async function (fileObj) {
|
||||
const originalName = fileObj.name;
|
||||
const correctedName = sanitizeUploadFileName(originalName, detectedMime || fileObj.type);
|
||||
if (correctedName && correctedName !== originalName) {
|
||||
rename(fileObj, correctedName, fileStoreStrategyFactory);
|
||||
await rename(fileObj, correctedName, fileStoreStrategyFactory);
|
||||
fileObj.name = correctedName;
|
||||
try {
|
||||
await require('/server/lib/filenameSanitizeLog').logFilenameSanitized({
|
||||
|
||||
+9
-2
@@ -4088,8 +4088,15 @@ async function cardRemover(userId, doc) {
|
||||
await Cards.direct.updateAsync(shared._id, { $set: withParentRemoved(shared, doc._id) });
|
||||
}
|
||||
await Cards.removeAsync(onlyChildrenSelector(doc._id));
|
||||
// Attachments keep the normal remove so the underlying file is deleted from the
|
||||
// configured storage backend.
|
||||
// Normal attachments store their card id in meta. Use the same recoverable
|
||||
// deletion as the attachment UI/API so files and history remain restorable.
|
||||
if (Meteor.isServer) {
|
||||
const { softDeleteAttachment } = require('/server/attachmentSoftDelete');
|
||||
for (const attachment of await Attachments.collection.find(liveAttachments({ 'meta.cardId': doc._id })).fetchAsync()) {
|
||||
await softDeleteAttachment({ userId, attachment });
|
||||
}
|
||||
}
|
||||
// Keep the existing hard purge for legacy top-level cardId records.
|
||||
await Attachments.removeAsync({ cardId: doc._id });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
'use strict';
|
||||
|
||||
// Which values profile.avatarUrl may hold, and whether a client modifier tries
|
||||
// to store anything else. Pure, no Meteor and no Node built-ins, so the
|
||||
// setAvatarUrl method, the Users deny rule and the tests share one rule.
|
||||
//
|
||||
// profile.avatarUrl is rendered as an <img src> and, once external, fetched by
|
||||
// the server for localization (fetchSafe, http/https only). Accepted: an empty
|
||||
// value (clearing), a WeKan-local path such as /cdn/storage/avatars/..., an
|
||||
// http(s) URL, or a data:image URI. Refused: javascript:, data:text/html,
|
||||
// file:, protocol-relative //host and every other scheme.
|
||||
|
||||
function isStorableAvatarUrl(avatarUrl) {
|
||||
if (typeof avatarUrl !== 'string') return false;
|
||||
if (avatarUrl === '') return true;
|
||||
if (avatarUrl.startsWith('/') && !avatarUrl.startsWith('//')) return true;
|
||||
const m = /^([a-z][a-z0-9+.\-]*):/i.exec(avatarUrl);
|
||||
const scheme = m ? m[1].toLowerCase() : '';
|
||||
if (scheme === 'http' || scheme === 'https') return true;
|
||||
return scheme === 'data' && /^data:image\//i.test(avatarUrl);
|
||||
}
|
||||
|
||||
function avatarUrlScheme(avatarUrl) {
|
||||
const m = /^([a-z][a-z0-9+.\-]*):/i.exec(String(avatarUrl));
|
||||
return m ? m[1].toLowerCase() : '';
|
||||
}
|
||||
|
||||
const AVATAR_PATH = 'profile.avatarUrl';
|
||||
|
||||
// True when a client modifier would store an avatar URL setAvatarUrl refuses.
|
||||
// The Users allow rule permits every profile.* field, so without this a direct
|
||||
// Users.update({$set: {'profile.avatarUrl': 'javascript:...'}}) stored what the
|
||||
// method rejects. $set and $setOnInsert are checked by value, whether written
|
||||
// as the dotted path or inside a whole profile object; $unset clears it, which
|
||||
// is fine; any other operator on the field ($rename onto it, $push, $inc, ...)
|
||||
// is never how an avatar is set and is refused.
|
||||
function writesUnsafeAvatarUrl(modifier) {
|
||||
if (!modifier || typeof modifier !== 'object') return false;
|
||||
return Object.entries(modifier).some(([operator, value]) => {
|
||||
if (!value || typeof value !== 'object') return false;
|
||||
if (operator === '$rename') {
|
||||
return Object.values(value).some(to => to === AVATAR_PATH || to === 'profile');
|
||||
}
|
||||
return Object.keys(value).some(path => {
|
||||
const touchesAvatar = path === AVATAR_PATH || path.startsWith(`${AVATAR_PATH}.`);
|
||||
const wholeProfile = path === 'profile';
|
||||
if (!touchesAvatar && !wholeProfile) return false;
|
||||
if (operator === '$unset') return false;
|
||||
if (operator !== '$set' && operator !== '$setOnInsert') return true;
|
||||
if (wholeProfile) {
|
||||
const profile = value[path];
|
||||
if (!profile || typeof profile !== 'object') return false;
|
||||
return Object.prototype.hasOwnProperty.call(profile, 'avatarUrl') &&
|
||||
!isStorableAvatarUrl(profile.avatarUrl);
|
||||
}
|
||||
// profile.avatarUrl.something would turn the URL into an object.
|
||||
return path !== AVATAR_PATH || !isStorableAvatarUrl(value[path]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { isStorableAvatarUrl, avatarUrlScheme, writesUnsafeAvatarUrl };
|
||||
@@ -1345,7 +1345,7 @@ export const copyFile = async function(fileObj, newCardId, fileStoreStrategyFact
|
||||
})));
|
||||
};
|
||||
|
||||
export const rename = function(fileObj, newName, fileStoreStrategyFactory) {
|
||||
export const rename = async function(fileObj, newName, fileStoreStrategyFactory) {
|
||||
// Sanitize the new name to prevent path traversal
|
||||
const safeName = sanitizeFilename(newName);
|
||||
|
||||
@@ -1353,18 +1353,28 @@ export const rename = function(fileObj, newName, fileStoreStrategyFactory) {
|
||||
const extension = lastDot === -1 ? '' : safeName.substring(lastDot + 1).toLowerCase();
|
||||
const extensionWithDot = extension ? `.${extension}` : '';
|
||||
|
||||
Object.keys(fileObj.versions).forEach(versionName => {
|
||||
for (const versionName of Object.keys(fileObj.versions)) {
|
||||
const strategy = fileStoreStrategyFactory.getFileStrategy(fileObj, versionName);
|
||||
const newFilePath = strategy.getNewPath(fileStoreStrategyFactory.storagePath, safeName);
|
||||
strategy.rename(newFilePath);
|
||||
|
||||
(fileStoreStrategyFactory.collection || Attachments).updateAsync({ _id: fileObj._id }, { $set: {
|
||||
// Upload hooks keep using this object and persist its versions again before
|
||||
// validation. Keep it in sync with the renamed bytes and database record.
|
||||
fileObj.versions[versionName].path = newFilePath;
|
||||
const set = {
|
||||
"name": safeName,
|
||||
"extension": extension,
|
||||
"extensionWithDot": extensionWithDot,
|
||||
[`versions.${versionName}.path`]: newFilePath,
|
||||
} }).catch(error => {
|
||||
console.error('Failed to persist renamed attachment path:', error);
|
||||
});
|
||||
});
|
||||
};
|
||||
// Meteor-Files also records the original at the top level; the upload
|
||||
// validator reads that path rather than versions.original.path.
|
||||
if (versionName === 'original') {
|
||||
fileObj.path = newFilePath;
|
||||
set.path = newFilePath;
|
||||
}
|
||||
await (fileStoreStrategyFactory.collection || Attachments).updateAsync(
|
||||
{ _id: fileObj._id }, { $set: set },
|
||||
);
|
||||
}
|
||||
};
|
||||
+450
-1
@@ -14,7 +14,456 @@ Releases per day:
|
||||
| 11 | 6 |
|
||||
| 12 | 5 |
|
||||
| 13 | 1 |
|
||||
| 14 | 4 |
|
||||
| 14 | 5 |
|
||||
|
||||
# v12.44 2026-10-14 WeKan ® release
|
||||
|
||||
**In short:** sign in with a **passkey** or **SQRL**, and **log out
|
||||
everywhere**. **Browser push**, an **activity feed** and **ntfy** bring
|
||||
notifications anywhere, and webhooks **direct-message** on **Mattermost**. Card
|
||||
descriptions are **edited together, live**; cards can be **drawn on**, be
|
||||
**Stories** or **Tasks**, and mark **unread changes**. Boards get **column
|
||||
sets**, **linked lists** and a **Table view** that adds and drags cards, and
|
||||
**All Boards** gives each team a tab. **Nextcloud** gets **CalDAV** sync and
|
||||
**WebDAV** storage, public boards join the **fediverse**, and two **CodeQL**
|
||||
alerts are fixed.
|
||||
|
||||
This release fixes the following SECURITY ISSUES found by GitHub CodeQL code scanning:
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/587efab82b">Two CodeQL alerts in a test, and every test pattern of the same shapes</a>. Thanks to GitHub CodeQL and xet7.</summary>
|
||||
|
||||
CodeQL alerts #584 (bad HTML filtering regexp) and #585 (incomplete regular
|
||||
expression for hostnames), both in `tests/accountEmailHtml.test.cjs`: it
|
||||
checked that the e-mail layout escapes markup with `/<img|<script|<b>/`, which
|
||||
a `<SCRIPT>` passes, and made the reset address into a RegExp. It now lists
|
||||
every tag of the output in any letter case and allows only the layout's own
|
||||
`div`, `p`, `a` and `br`, and compares the address as text. The renderer was
|
||||
already escaping them.
|
||||
|
||||
Both are pinned as shapes across the tree in
|
||||
`tests/securityAlerts20261012.test.cjs`, which found more: a case-sensitive
|
||||
`<script>` pattern in `jsWebLabels.test.cjs`, a path spliced into generated
|
||||
code in `singleFile.test.cjs`, and twelve test patterns with a host name's dot
|
||||
unescaped. These are in tests, so there is no attempt at runtime to record in
|
||||
Admin Panel → Problems.
|
||||
|
||||
</details>
|
||||
|
||||
and adds the following new features:
|
||||
|
||||
**Sign-in** - how members sign in and out, and who is told.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/63ef900d56">Passkey login, and Log out everywhere</a>. Thanks to xet7.</summary>
|
||||
|
||||
Member Settings / Passkeys adds a passkey on this device under a name and
|
||||
removes one; the sign-in page has "Sign in with a passkey", with no user name
|
||||
needed. Verification is @simplewebauthn/server (pinned) against ROOT_URL's host
|
||||
and origin, with a single-use challenge that expires in five minutes and a
|
||||
signature counter that must move forward. Passkeys are never published. Log out
|
||||
everywhere ends every session of the account, this one too.
|
||||
`tests/passkeys.test.cjs` signs with a software authenticator and refuses
|
||||
another key, origin, challenge or a counter that went back; a Meteor runtime
|
||||
test checks the server loads. [Passkeys](docs/Features/Login/Passkeys.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/ea256dd772">A login and registration webhook in the Admin Panel, off by default</a>. Thanks to KrunalDholakiya and xet7.</summary>
|
||||
|
||||
Admin Panel / Settings / Global Webhooks tells one address when somebody logs
|
||||
in or an account is made, only for the ticked events. It carries the event,
|
||||
the user name and the time; the email, IP address, full name and sign-in
|
||||
method only when ticked. It is sent after the login, through the SSRF guard,
|
||||
and is never published. `tests/accountWebhook.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c940b3e301">Sign in with SQRL, from a phone or a computer</a>. Thanks to xet7.</summary>
|
||||
|
||||
[SQRL](https://www.grc.com/sqrl/sqrl.htm) signs in with a SQRL app or client
|
||||
instead of a password, after a site admin turns it on (Admin Panel → Settings →
|
||||
Visibility → Features, off by default). A member adds their identity once in
|
||||
Member Settings → SQRL; the sign-in page then shows a `sqrl://` link and its QR
|
||||
code and signs in by itself when the client has answered. WeKan keeps only the
|
||||
identity's public keys, never published and not writable from the client.
|
||||
|
||||
Every nut is random and used once, each request must carry the server's
|
||||
previous reply unchanged, and every request is checked with Ed25519 (Node.js's
|
||||
own `crypto`). An unknown identity can neither make an account nor sign in;
|
||||
disable, enable, remove and rekey follow the protocol, the last three only
|
||||
with the rescue code's unlock key. `tests/sqrl.test.cjs` drives the real
|
||||
handler with a software SQRL client, forged signatures, replays and altered
|
||||
replies included, and `server/lib/tests/sqrl.tests.js` adds an identity and
|
||||
signs in through the running server. Documented in
|
||||
[SQRL.md](docs/Features/Login/SQRL.md).
|
||||
|
||||
</details>
|
||||
|
||||
**Notifications** - where they arrive and how they look.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d873af70e8">ntfy phone notifications, per member</a>. Thanks to xet7.</summary>
|
||||
|
||||
Member Settings / Notification Settings takes a member's ntfy topic address
|
||||
and token; each notification they get also arrives in the ntfy app, with a tap
|
||||
opening the card. JSON publishing, through the SSRF guard, best effort, and the
|
||||
topic is never published. `tests/ntfy.test.cjs`,
|
||||
[ntfy](docs/Features/Notifications/ntfy.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/058677e078">E-mails in the clear HTML layout by default</a>. Thanks to Meeques and xet7.</summary>
|
||||
|
||||
Notification e-mail defaults to the clearly arranged layout of \#5171, classic
|
||||
one choice away; account e-mails (reset password, verify, new account,
|
||||
invitations) get an HTML part built from the same translated text, everything
|
||||
escaped and only http(s) linked. `tests/accountEmailHtml.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/349d6dc5e6">Webhooks can also direct-message the card's people on Mattermost</a>. Thanks to xet7.</summary>
|
||||
|
||||
A webhook's new tick sends each message about a card to its members and
|
||||
assignees as `@username`, never to whoever made the change, at most 50.
|
||||
`tests/mattermostDirectMessages.test.cjs`,
|
||||
[Mattermost](docs/Features/Webhooks/Chat/Mattermost.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0a5ae3e205">Browser push notifications, per device</a>. Thanks to saurabharch, hingerl and xet7.</summary>
|
||||
|
||||
Member Settings → Notification Settings → Browser notifications on this
|
||||
device: every notification the member gets also pops up from that browser,
|
||||
even with WeKan closed, and a click opens the card. web-push 3.6.7 (pinned)
|
||||
sends it with this WeKan's own VAPID keys. A subscription is accepted only over
|
||||
https and only at the push services browsers use, checked when saved and
|
||||
before every send. Not offered on Sandstorm.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/656af74b2c">An activity feed across all of a member's boards</a>. Thanks to xet7.</summary>
|
||||
|
||||
Member menu → Activity on all my boards lists what happened on every board the
|
||||
member sees, newest first, 50 at a time, in the sentences the notifications
|
||||
use. It never carries a field's value, follows the assigned-only rule, and is
|
||||
empty when the Admin Panel turns activities off. `tests/activityFeed.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c3321926ab">Webhooks: pick which activities a webhook is sent</a>. Thanks to xet7.</summary>
|
||||
|
||||
The webhook form gets "Send this webhook:" with Every activity and a tick per
|
||||
kind of activity - the groups notifications are muted by. Nothing ticked stays
|
||||
"all", so a webhook never silently gets nothing.
|
||||
`tests/webhookActivityPicker.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Rules** - who sees them, and who their e-mails go to.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/f4a3690256">Board members can be shown the Rules, read-only</a>. Thanks to justinr1234 and xet7.</summary>
|
||||
|
||||
An Admin Panel option, off by default, lets board admins tick "Show these
|
||||
Rules to board members, read-only"; members then read the rules list and
|
||||
details with no control that changes them. Without both ticks only admins see
|
||||
the Rules page. `tests/rulesReadOnly.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/75e260966b">Pick board members for a rule e-mail's To field</a>. Thanks to chenghongxi and xet7.</summary>
|
||||
|
||||
A member picker with autocomplete adds `@username`, which becomes that member's
|
||||
current address when the rule runs; free addresses still work, and a name of
|
||||
somebody outside the board is dropped. `tests/ruleEmailMembers.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Boards** - subtasks, teams and leaving a board.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/740c3920eb">Board Settings / Subtasks picks the swimlane new subtasks land in</a>. Thanks to BjoernLudwig and xet7.</summary>
|
||||
|
||||
Beside the landing list; unset keeps the parent's swimlane title, else the
|
||||
default. `tests/subtaskLandingSwimlane.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/1acc9f2b9f">Leaving a board that came through a team hides it, restorably</a>. Thanks to LaureHades and xet7.</summary>
|
||||
|
||||
Such a board goes into the member's hidden list, out of All Boards, and Member
|
||||
Settings / Hidden boards restores it; the team membership is untouched.
|
||||
`tests/hiddenBoards.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/ed2649f702">A board admin may add only the organizations and teams they belong to</a>. Thanks to chrisi51 and xet7.</summary>
|
||||
|
||||
Site admins may add any; links already on a board stay, and removing is always
|
||||
allowed. The pickers offer only the admin's own groups.
|
||||
`tests/boardGroupLinks.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/2fd3993538">A linked whole list: a live mirror of another board's list</a>. Thanks to javen9881 and xet7.</summary>
|
||||
|
||||
The add-list form can link a list from another board: its cards appear live
|
||||
and stay the source board's cards, under its rules, and a card typed into the
|
||||
mirror is added to the source list only for somebody who may write there. The
|
||||
cards are published only to a subscriber who sees both boards. No self links,
|
||||
archived or foreign lists, or mirrors of mirrors. `tests/linkedList.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Cards and checklists** - kinds of card, subtasks from other boards, and
|
||||
who does each checklist item.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0d77882c3b">Story and Task cards, with custom fields of their own</a>. Thanks to nightwind27 and xet7.</summary>
|
||||
|
||||
Card menu / Card kind makes a card a Story or a Task, with a badge on the
|
||||
minicard. A custom field limited to a kind is added to a card when it gets
|
||||
that kind and shown only on cards of it. `tests/cardKinds.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/e9af50ff07">An existing card from another board as a subtask</a>. Thanks to TiibCD and xet7.</summary>
|
||||
|
||||
The existing-card picker gets a board picker; another board's card is
|
||||
attached on the server, which checks write access to both boards and loops
|
||||
through every parent. `tests/crossBoardSubtasks.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/7ca1489279">A person responsible for each checklist item, and dated items in the calendar and Gantt</a>. Thanks to martinbruno90 and xet7.</summary>
|
||||
|
||||
Each item gets a responsible board member. Items with a due date appear in
|
||||
the calendar and both Gantt views as "card: item"; moving one moves only the
|
||||
item's date. `tests/checklistItemSchedule.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/9138e85091">Edit a card description together, live</a>. Thanks to dalareo and xet7.</summary>
|
||||
|
||||
Everybody with a card's description open edits one shared Yjs document, so two
|
||||
people typing at once both keep what they typed instead of the later Save
|
||||
replacing the earlier. The editor stays the Markdown textarea, with the caret
|
||||
kept where it was; Save writes the description as before. The document is
|
||||
published only to people who may edit the card, merged with a conditional
|
||||
write, size-limited and rate-limited, and started again when the description
|
||||
changes some other way. yjs 13.6.33 (pinned). `tests/sharedDescription.test.cjs`
|
||||
runs the real Yjs.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c772769c0e">Draw or write by hand on a card, saved as PNG and SVG</a>. Thanks to aleroot and xet7.</summary>
|
||||
|
||||
Card menu → Drawing: draw with a mouse, pen or finger, undo and clear. The
|
||||
strokes stay on the card so the drawing can be edited later, and a PNG is
|
||||
uploaded as an attachment; Download as SVG builds the SVG from the strokes.
|
||||
Only numbers and the allowed colours and widths reach the SVG.
|
||||
`tests/cardDrawing.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d8690a26f5">Cards changed since a member last opened them are marked</a>. Thanks to Lacour20, martinpospech and xet7.</summary>
|
||||
|
||||
Member Settings → Mark cards changed since I last opened them, off by default:
|
||||
a minicard gets a blue edge when its fields, checklists, attachments or
|
||||
comments changed after the member last opened it. Turning it on does not mark
|
||||
every old card, and the member's own edits do not mark it.
|
||||
`tests/unreadChanges.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Board views** - the Table and Swimlanes views.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0a566dc9ac">The Table view adds cards, and moves them by dragging a row onto another</a>. Thanks to guakamole and xet7.</summary>
|
||||
|
||||
An add row under the table takes a title, list and swimlane, checked on the
|
||||
server; dropping a row puts its card just before the target card.
|
||||
`tests/tableViewDrop.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/9d95bda245">One shared, sticky list header row for all swimlanes</a>. Thanks to mikesutton and xet7.</summary>
|
||||
|
||||
A Board Settings / Swimlane setting, off by default: the first swimlane's list
|
||||
headers stay at the top, through the existing sticky rule, and the others are
|
||||
not repeated. `tests/sharedListHeaders.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/03d0144538">Column sets: the same cards in several named sets of columns</a>. Thanks to kentonv and xet7.</summary>
|
||||
|
||||
A new board view. A board keeps named column sets - say Completion, Priority,
|
||||
Milestone - and every card is in one column of each set. Dragging a card moves
|
||||
it only within the shown set, and each card shows its columns in the other sets
|
||||
as coloured labels. Board admins make the sets; the Admin Panel can turn the
|
||||
view off. Documented in [Column-Sets.md](docs/Features/Board/Column-Sets.md).
|
||||
|
||||
</details>
|
||||
|
||||
**All Boards** - finding boards among many.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/000bc1c490">Boards grouped by first character, organization, team and board label</a>. Thanks to xet7.</summary>
|
||||
|
||||
A facet bar shows each group with its count, and a click shows only that
|
||||
group. Board labels are the member's own, applied to every board whose name
|
||||
includes some text. `tests/allBoardsFacets.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d04b8444a6">A tab per organization and team, where their admins manage members</a>. Thanks to xet7.</summary>
|
||||
|
||||
The left menu of All Boards gets a tab for each organization and team the
|
||||
member is in, with its boards and its members. The group's admins and site
|
||||
admins add and remove members there; a group that comes from LDAP or another
|
||||
directory is read-only, because WeKan never writes directory groups back.
|
||||
`tests/groupMembers.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Platforms** - phones, Sandstorm and free JavaScript.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/52b0ea0d81">Share to WeKan from other Android apps</a>. Thanks to memeplex and xet7.</summary>
|
||||
|
||||
The manifest's share target opens "Add to WeKan": pick a board and list and
|
||||
what was shared becomes a card. The server checks the right to write in that
|
||||
list. `tests/shareTarget.test.cjs`,
|
||||
[Android](docs/Platforms/FOSS/OS/Android.md).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d1d806de2c">On Sandstorm, Copy card URL shares the card through Sandstorm</a>. Thanks to AlexanderZobkov and xet7.</summary>
|
||||
|
||||
It opens Sandstorm's Share Access dialog for the card's page, whose link opens
|
||||
the grain there; elsewhere it copies as before. `tests/sandstormShare.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/631a7fdfe2">LibreJS license information for the browser bundle</a>. Thanks to alexgleason and xet7.</summary>
|
||||
|
||||
`/jslicense.html` is a JS Web Labels table of the scripts actually served, and
|
||||
every page links it with `rel="jslicense"`. `tests/jsWebLabels.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
**Nextcloud and the fediverse** - calendars, files and followers outside WeKan.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/c76f3e2e98">CalDAV: card due dates in Nextcloud Calendar or any CalDAV calendar</a>. Thanks to scriptPilot and xet7.</summary>
|
||||
|
||||
Board Settings → Date → Calendar sync: each card with a due date is one event
|
||||
in the chosen calendar, removed when the due date goes, and a due date moved in
|
||||
the calendar comes back to the card every 15 minutes. The calendar's password
|
||||
is never published and only a board admin sees the link; requests go through
|
||||
the SSRF guard. `tests/caldavSync.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/4234081752">WebDAV attachment storage: Nextcloud Files or any WebDAV server</a>. Thanks to scriptPilot and xet7.</summary>
|
||||
|
||||
Admin Panel → Attachments → WebDAV (Nextcloud Files), beside S3, Azure and
|
||||
Google Cloud Storage, with the same switches, connection test, default storage
|
||||
and Move Attachment. The password is a secret field like the others, and
|
||||
redirects are refused. With CalDAV this completes #687; the Nextcloud ExApp is
|
||||
built by `.github/workflows/nextcloud.yml`. `tests/webdavStorage.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/bf633b9c72">ActivityPub: a public board can be followed from Mastodon</a>. Thanks to ASLLR and xet7.</summary>
|
||||
|
||||
Admin Panel → Settings → Visibility → Features → ActivityPub, off by default:
|
||||
each public board is an actor, `@board-<id>` at this WeKan, and its new card
|
||||
activity reaches its followers as signed Notes. It is read-only - only signed
|
||||
Follow and Undo Follow are acted on - and a private board is never an actor.
|
||||
Outgoing requests go through the SSRF guard. `tests/activityPub.test.cjs`.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
**Speed** - finding a card's subtasks.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/0c6c0c6021">Finding subtasks no longer scans every card</a>. Thanks to Raymond-Voogt and xet7.</summary>
|
||||
|
||||
Subtasks of several parents are found with `{ $or: [{ parentId }, { parentIds }]
|
||||
}`,
|
||||
and only `parentId` had an index - a `$or` uses indexes only when every branch
|
||||
has one, so removing, copying and exporting cards scanned the whole collection.
|
||||
`parentIds` has its own index now, and `tests/cardQueryIndexes.test.cjs`
|
||||
requires
|
||||
an index for every branch of every subtask `$or`.
|
||||
|
||||
</details>
|
||||
|
||||
**Startup** - a schema WeKan could not start with.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/d3966fa6b9">Story and Task cards no longer stop WeKan at startup</a>. Thanks to xet7.</summary>
|
||||
|
||||
The unreleased Story and Task commit declared `cardKinds` as `type: [String]`,
|
||||
which the schema library refuses at startup. It is `type: Array` with a
|
||||
`cardKinds.$` entry, and `tests/cardKinds.test.cjs` pins the form.
|
||||
|
||||
</details>
|
||||
|
||||
**Accessibility** - screen readers.
|
||||
|
||||
<details>
|
||||
<summary><a href="https://github.com/wekan/wekan/commit/8d71c6f925">Every icon-only link and button has a name for screen readers</a>. Thanks to ndarilek and xet7.</summary>
|
||||
|
||||
21 controls showed only an icon and had no name: the drag handles, the inline
|
||||
forms' close buttons, a card's date buttons, the notification drawer, History's
|
||||
previous and next and others. Each has a translated title, which becomes its
|
||||
`aria-label`, and `tests/iconOnlyControlLabels.test.cjs` scans every template
|
||||
for an unnamed icon-only control. Part of #337.
|
||||
|
||||
</details>
|
||||
|
||||
and has the following developer-tooling and translation changes:
|
||||
|
||||
- [The new strings translated in all 234 locales](https://github.com/wekan/wekan/commit/fdc52787e1). Thanks to xet7.
|
||||
- [The Mattermost, Share to WeKan, passkey and hidden board strings translated](https://github.com/wekan/wekan/commit/5409e059ae). Thanks to xet7.
|
||||
- [The risk baseline allows the Sandstorm share helper's addresses](https://github.com/wekan/wekan/commit/a4727e6764). Thanks to xet7.
|
||||
- [The cross-board subtask, checklist owner, shared header, facet and card kind strings translated](https://github.com/wekan/wekan/commit/946f032883). Thanks to xet7.
|
||||
- [The push, linked-list, column-set, drawing and team-tab strings translated](https://github.com/wekan/wekan/commit/2b84e6b616). Thanks to xet7.
|
||||
- [The ActivityPub, CalDAV and WebDAV strings, translated](https://github.com/wekan/wekan/commit/2c9df4db88). Thanks to xet7.
|
||||
- [The SQRL strings translated](https://github.com/wekan/wekan/commit/b0e47537e0). Thanks to xet7.
|
||||
- [A test pins the issue's own example of keeping #label and @member](https://github.com/wekan/wekan/commit/cd4c4ad9ce), which shipped in v12.43. Thanks to biji and xet7.
|
||||
- [A guard skips every rspack output directory, not only _build](https://github.com/wekan/wekan/commit/5f2dd80f41). Thanks to xet7.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v12.43 2026-10-14 WeKan ® release
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "wekan",
|
||||
"version": "v13.13.0",
|
||||
"version": "v13.14.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "wekan",
|
||||
"version": "v13.13.0",
|
||||
"version": "v13.14.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wekan",
|
||||
"version": "v13.13.0",
|
||||
"version": "v13.14.0",
|
||||
"description": "Open-Source kanban",
|
||||
"private": true,
|
||||
"repository": {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf8" />
|
||||
<title>WeKan REST API v13.13</title>
|
||||
<title>WeKan REST API v13.14</title>
|
||||
<!-- needed for adaptive design -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
@@ -494,11 +494,11 @@ data-styled.g652[id="sc-LDhwn"]{content:"cirFq,"}/*!sc*/
|
||||
|
||||
<body>
|
||||
|
||||
<div id="redoc"><div class="sc-jlWaFk kDulYG redoc light" style="--navbar-height:0px;--navbar-stack-height:0px"><div hidden=""><script>try{var r=document.querySelectorAll(".redoc");r=r[r.length-1];var h=document.documentElement,p=h.classList,a=[h.getAttribute("data-bs-theme"),h.getAttribute("data-theme")];var m=p.contains("dark")||a.indexOf("dark")>-1?"dark":p.contains("light")||a.indexOf("light")>-1?"light":localStorage.getItem("redoc.colorMode");if(m!=="light"&&m!=="dark")m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";r.classList.remove("light","dark");r.classList.add(m)}catch(e){}</script></div><div class="sc-NPrTd fpSCXb menu-content"><div class="sc-bJapvR eXtYur"><div data-testid="search-trigger" class="sc-eavxOQ bStpwo"><div class="sc-dGYDtq hRGWCd"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-component-name="icons/SearchIcon/SearchIcon" class="sc-gJaedx dpfGSp"><path d="M14.5 13.7931L10.724 10.017C11.6313 8.9277 12.0838 7.5305 11.9872 6.11608C11.8907 4.70165 11.2525 3.37891 10.2055 2.423C9.15857 1.4671 7.78336 0.951637 6.36602 0.983845C4.94867 1.01605 3.5983 1.59345 2.59582 2.59593C1.59335 3.5984 1.01595 4.94877 0.983738 6.36612C0.95153 7.78347 1.46699 9.15867 2.4229 10.2057C3.3788 11.2526 4.70155 11.8908 6.11597 11.9873C7.53039 12.0839 8.92759 11.6314 10.0169 10.7241L13.793 14.5001L14.5 13.7931ZM2.00001 6.50012C2.00001 5.6101 2.26393 4.74007 2.7584 4.00005C3.25286 3.26003 3.95567 2.68325 4.77794 2.34266C5.6002 2.00207 6.505 1.91295 7.37792 2.08658C8.25083 2.26022 9.05266 2.6888 9.68199 3.31814C10.3113 3.94747 10.7399 4.7493 10.9135 5.62221C11.0872 6.49513 10.9981 7.39993 10.6575 8.22219C10.3169 9.04446 9.7401 9.74726 9.00008 10.2417C8.26006 10.7362 7.39003 11.0001 6.50001 11.0001C5.30694 10.9988 4.16312 10.5243 3.31949 9.68064C2.47587 8.83701 2.00133 7.69319 2.00001 6.50012Z"></path></svg><span>Loading...</span></div></div></div><div class="sc-kLsiYl kAUzfx"><ul data-component-name="Menu/Menu" class="sc-jfJzNu hoWuXt"><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-default" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="true" class="sc-cToEys eWEtkC"><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="WeKan REST API" class="sc-hgJgCR dWgUkd">WeKan REST API</span></span></div></li></a></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-default" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/section/production-security-concerns" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys iVTRMP"><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="Production Security Concerns" class="sc-hgJgCR dlVNdD">Production Security Concerns</span></span></div></li></a></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-group" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/login" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys jYycQW"><div class="sc-dGPMcj PCvEP"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" color="--tree-content-color-default" data-component-name="icons/ChevronRightIcon/ChevronRightIcon" class="sc-kLEbxe eRqACJ"><path d="M11 8L6.00002 13L5.30002 12.3L9.60002 8L5.30002 3.7L6.00002 3L11 8Z"></path></svg></div><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="Login" class="sc-hgJgCR dlVNdD">Login</span></span></div></li></a><div style="display:none;height:0px;overflow:hidden" class="sc-fKDFlh joxUYR"></div></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-group" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/attachmentstoragesettings" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys jYycQW"><div class="sc-dGPMcj PCvEP"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" color="--tree-content-color-default" data-component-name="icons/ChevronRightIcon/ChevronRightIcon" class="sc-kLEbxe eRqACJ"><path d="M11 8L6.00002 13L5.30002 12.3L9.60002 8L5.30002 3.7L6.00002 3L11 8Z"></path></svg></div><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="AttachmentStorageSettings" class="sc-hgJgCR dlVNdD">AttachmentStorageSettings</span></span></div></li></a><div style="display:none;height:0px;overflow:hidden" class="sc-fKDFlh joxUYR"></div></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-group" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/settings" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys jYycQW"><div class="sc-dGPMcj PCvEP"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" color="--tree-content-color-defLine truncated
|
||||
<div id="redoc"><div class="sc-jlWaFk kDulYG redoc light" style="--navbar-height:0px;--navbar-stack-height:0px"><div hidden=""><script>try{var r=document.querySelectorAll(".redoc");r=r[r.length-1];var h=document.documentElement,p=h.classList,a=[h.getAttribute("data-bs-theme"),h.getAttribute("data-theme")];var m=p.contains("dark")||a.indexOf("dark")>-1?"dark":p.contains("light")||a.indexOf("light")>-1?"light":localStorage.getItem("redoc.colorMode");if(m!=="light"&&m!=="dark")m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";r.classList.remove("light","dark");r.classList.add(m)}catch(e){}</script></div><div class="sc-NPrTd fpSCXb menu-content"><div class="sc-bJapvR eXtYur"><div data-testid="search-trigger" class="sc-eavxOQ bStpwo"><div class="sc-dGYDtq hRGWCd"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" data-component-name="icons/SearchIcon/SearchIcon" class="sc-gJaedx dpfGSp"><path d="M14.5 13.7931L10.724 10.017C11.6313 8.9277 12.0838 7.5305 11.9872 6.11608C11.8907 4.70165 11.2525 3.37891 10.2055 2.423C9.15857 1.4671 7.78336 0.951637 6.36602 0.983845C4.94867 1.01605 3.5983 1.59345 2.59582 2.59593C1.59335 3.5984 1.01595 4.94877 0.983738 6.36612C0.95153 7.78347 1.46699 9.15867 2.4229 10.2057C3.3788 11.2526 4.70155 11.8908 6.11597 11.9873C7.53039 12.0839 8.92759 11.6314 10.0169 10.7241L13.793 14.5001L14.5 13.7931ZM2.00001 6.50012C2.00001 5.6101 2.26393 4.74007 2.7584 4.00005C3.25286 3.26003 3.95567 2.68325 4.77794 2.34266C5.6002 2.00207 6.505 1.91295 7.37792 2.08658C8.25083 2.26022 9.05266 2.6888 9.68199 3.31814C10.3113 3.94747 10.7399 4.7493 10.9135 5.62221C11.0872 6.49513 10.9981 7.39993 10.6575 8.22219C10.3169 9.04446 9.7401 9.74726 9.00008 10.2417C8.26006 10.7362 7.39003 11.0001 6.50001 11.0001C5.30694 10.9988 4.16312 10.5243 3.31949 9.68064C2.47587 8.83701 2.00133 7.69319 2.00001 6.50012Z"></path></svg><span>Loading...</span></div></div></div><div class="sc-kLsiYl kAUzfx"><ul data-component-name="Menu/Menu" class="sc-jfJzNu hoWuXt"><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-default" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="true" class="sc-cToEys eWEtkC"><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="WeKan REST API" class="sc-hgJgCR dWgUkd">WeKan REST API</span></span></div></li></a></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-default" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/section/production-security-concerns" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys iVTRMP"><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="Production Security Concerns" class="sc-hgJgCR dlVNdD">Production Security Concerns</span></span></div></li></a></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-group" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/login" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys jYycQW"><div class="sc-dGPMcj PCvEP"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" color="--tree-content-color-default" data-component-name="icons/ChevronRightIcon/ChevronRightIcon" class="sc-kLEbxe eRqACJ"><path d="M11 8L6.00002 13L5.30002 12.3L9.60002 8L5.30002 3.7L6.00002 3L11 8Z"></path></svg></div><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="Login" class="sc-hgJgCR dlVNdD">Login</span></span></div></li></a><div style="display:none;height:0px;overflow:hidden" class="sc-fKDFlh joxUYR"></div></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-group" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/attachmentstoragesettings" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys jYycQW"><div class="sc-dGPMcj PCvEP"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" color="--tree-content-color-default" data-component-name="icons/ChevronRightIcon/ChevronRightIcon" class="sc-kLEbxe eRqACJ"><path d="M11 8L6.00002 13L5.30002 12.3L9.60002 8L5.30002 3.7L6.00002 3L11 8Z"></path></svg></div><div class="sc-fIruOr dBwuTA"><span class="sc-gwVKcS efjekG"><span data-text="AttachmentStorageSettings" class="sc-hgJgCR dlVNdD">AttachmentStorageSettings</span></span></div></li></a><div style="display:none;height:0px;overflow:hidden" class="sc-fKDFlh joxUYR"></div></div><div data-component-name="Menu/MenuItem" class="sc-jEekwy kJsUv menu-item-type-group" role="listitem"><a class="sc-gzhUzI kKmXTr" href="/settings" data-discover="true"><li role="none" data-testid="menu-item-label" data-active="false" class="sc-cToEys jYycQW"><div class="sc-dGPMcj PCvEP"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" color="--tree-content-color-defLine truncated
|
||||
<script type="module">
|
||||
import { hydrate } from "https://cdn.redocly.com/redoc/v3.1.0/bundles/redoc.standalone.js";
|
||||
|
||||
const __redoc_definition = {"openapi":"3.2.0","info":{"title":"WeKan REST API","version":"v13.13","description":"The REST API allows you to control and extend WeKan with ease.\n\nIf you are an end-user and not a dev or a tester, [create an issue](https://github.com/wekan/wekan/issues/new) to request new APIs.\n\n> All API calls in the documentation are made using `curl`. However, you are free to use Java / Python / PHP / Golang / Ruby / Swift / Objective-C / Rust / Scala / C# or any other programming languages.\n\n# Production Security Concerns\nWhen calling a production WeKan server, ensure it is running via HTTPS and has a valid SSL Certificate. The login method requires you to post your username and password in plaintext, which is why we highly suggest only calling the REST login api over HTTPS. Also, few things to note:\n\n* Only call via HTTPS\n* Implement a timed authorization token expiration strategy\n* Ensure the calling user only has permissions for what they are calling and no more\n"},"paths":{"/users/login":{"post":{"operationId":"login","summary":"Login with REST API","tags":["Login"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["username","password"],"properties":{"username":{"description":"Your username\n","type":"string"},"password":{"description":"Your password\n","type":"string","format":"password"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["username","password"],"properties":{"username":{"description":"Your username\n","type":"string"},"password":{"description":"Your password\n","type":"string","format":"password"}}}}},"description":"Login credentials","required":true},"responses":{"200":{"description":"Successful authentication","content":{"*/*":{"schema":{"type":"object","required":["id","token","tokenExpires"],"properties":{"id":{"type":"string","description":"User ID"},"token":{"type":"string","description":"Authentication token\n"},"tokenExpires":{"type":"string","format":"date-time","description":"Token expiration date\n"}}}}}},"400":{"description":"Error in authentication\n","content":{"*/*":{"schema":{"type":"object","properties":{"error":{"type":"string"},"reason":{"type":"string"}}}}}},"default":{"description":"Error in authentication\n"}}}},"/users/register":{"post":{"operationId":"register","summary":"Register with REST API","description":"Notes:\n - You will need to provide the token for any of the authenticated methods.\n","tags":["Login"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"username":{"description":"Your username\n","type":"string"},"password":{"description":"Your password\n","type":"string","format":"password"},"email":{"description":"Your email\n","type":"string"}},"required":["username","password","email"]}}},"required":true},"responses":{"200":{"description":"Successful registration","content":{"*/*":{"schema":{"items":{"properties":{"id":{"type":"string"},"token":{"type":"string"},"tokenExpires":{"type":"string"}}}}}}},"400":{"description":"Error in registration\n","content":{"*/*":{"schema":{"items":{"properties":{"error":{"type":"number"},"reason":{"type":"string"}}}}}}},"default":{"description":"Error in registration\n"}}}},"/api/admin/attachment-settings":{"get":{"operationId":"get_attachment_settings","summary":"Get the attachment storage / upload-block settings (GlobalAdmin)","description":"Only the global admin can call this. Returns the Admin Panel >\n Attachments settings document, including `limitSettings.attachmentsUploadBlocked`\n and `limitSettings.avatarsUploadBlocked` plus the size limits. Cloud-storage\n secret keys (S3 secretAccessKey, Azure accountKey/connectionString, GCS\n credentials) are masked and never returned; a boolean `\u003cfield>Set` marker\n shows whether a value exists.\n","tags":["AttachmentStorageSettings","Settings"],"security":[{"UserSecurity":[]}],"responses":{"200":{"description":"200 response","content":{"application/json":{"schema":{"type":"Object"}}}}}},"put":{"operationId":"update_attachment_settings","summary":"Update the attachment storage / upload-block settings (GlobalAdmin)","description":"Only the global admin can call this. The request body is a\n partial settings object (for example\n `{\"limitSettings\": {\"avatarsUploadBlocked\": true}}`). It is applied through\n the same update path as the `updateAttachmentStorageSettings` Meteor method,\n so validation and `$set` semantics are identical: cloud-storage secrets left\n blank are preserved. The masked, updated settings document is returned.\n","tags":["AttachmentStorageSettings","Settings"],"security":[{"UserSecurity":[]}],"responses":{"200":{"description":"200 response","content":{"application/json":{"schema":{"type":"Object"}}}}}}},"/api/admin/domains":{"get":{"operationId":"get_admin_domains","summary":"List email domains with their user counts (GlobalAdmin)","description":"Only the global admin can call this. CountsLine truncated
|
||||
const __redoc_definition = {"openapi":"3.2.0","info":{"title":"WeKan REST API","version":"v13.14","description":"The REST API allows you to control and extend WeKan with ease.\n\nIf you are an end-user and not a dev or a tester, [create an issue](https://github.com/wekan/wekan/issues/new) to request new APIs.\n\n> All API calls in the documentation are made using `curl`. However, you are free to use Java / Python / PHP / Golang / Ruby / Swift / Objective-C / Rust / Scala / C# or any other programming languages.\n\n# Production Security Concerns\nWhen calling a production WeKan server, ensure it is running via HTTPS and has a valid SSL Certificate. The login method requires you to post your username and password in plaintext, which is why we highly suggest only calling the REST login api over HTTPS. Also, few things to note:\n\n* Only call via HTTPS\n* Implement a timed authorization token expiration strategy\n* Ensure the calling user only has permissions for what they are calling and no more\n"},"paths":{"/users/login":{"post":{"operationId":"login","summary":"Login with REST API","tags":["Login"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["username","password"],"properties":{"username":{"description":"Your username\n","type":"string"},"password":{"description":"Your password\n","type":"string","format":"password"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["username","password"],"properties":{"username":{"description":"Your username\n","type":"string"},"password":{"description":"Your password\n","type":"string","format":"password"}}}}},"description":"Login credentials","required":true},"responses":{"200":{"description":"Successful authentication","content":{"*/*":{"schema":{"type":"object","required":["id","token","tokenExpires"],"properties":{"id":{"type":"string","description":"User ID"},"token":{"type":"string","description":"Authentication token\n"},"tokenExpires":{"type":"string","format":"date-time","description":"Token expiration date\n"}}}}}},"400":{"description":"Error in authentication\n","content":{"*/*":{"schema":{"type":"object","properties":{"error":{"type":"string"},"reason":{"type":"string"}}}}}},"default":{"description":"Error in authentication\n"}}}},"/users/register":{"post":{"operationId":"register","summary":"Register with REST API","description":"Notes:\n - You will need to provide the token for any of the authenticated methods.\n","tags":["Login"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"username":{"description":"Your username\n","type":"string"},"password":{"description":"Your password\n","type":"string","format":"password"},"email":{"description":"Your email\n","type":"string"}},"required":["username","password","email"]}}},"required":true},"responses":{"200":{"description":"Successful registration","content":{"*/*":{"schema":{"items":{"properties":{"id":{"type":"string"},"token":{"type":"string"},"tokenExpires":{"type":"string"}}}}}}},"400":{"description":"Error in registration\n","content":{"*/*":{"schema":{"items":{"properties":{"error":{"type":"number"},"reason":{"type":"string"}}}}}}},"default":{"description":"Error in registration\n"}}}},"/api/admin/attachment-settings":{"get":{"operationId":"get_attachment_settings","summary":"Get the attachment storage / upload-block settings (GlobalAdmin)","description":"Only the global admin can call this. Returns the Admin Panel >\n Attachments settings document, including `limitSettings.attachmentsUploadBlocked`\n and `limitSettings.avatarsUploadBlocked` plus the size limits. Cloud-storage\n secret keys (S3 secretAccessKey, Azure accountKey/connectionString, GCS\n credentials) are masked and never returned; a boolean `\u003cfield>Set` marker\n shows whether a value exists.\n","tags":["AttachmentStorageSettings","Settings"],"security":[{"UserSecurity":[]}],"responses":{"200":{"description":"200 response","content":{"application/json":{"schema":{"type":"Object"}}}}}},"put":{"operationId":"update_attachment_settings","summary":"Update the attachment storage / upload-block settings (GlobalAdmin)","description":"Only the global admin can call this. The request body is a\n partial settings object (for example\n `{\"limitSettings\": {\"avatarsUploadBlocked\": true}}`). It is applied through\n the same update path as the `updateAttachmentStorageSettings` Meteor method,\n so validation and `$set` semantics are identical: cloud-storage secrets left\n blank are preserved. The masked, updated settings document is returned.\n","tags":["AttachmentStorageSettings","Settings"],"security":[{"UserSecurity":[]}],"responses":{"200":{"description":"200 response","content":{"application/json":{"schema":{"type":"Object"}}}}}}},"/api/admin/domains":{"get":{"operationId":"get_admin_domains","summary":"List email domains with their user counts (GlobalAdmin)","description":"Only the global admin can call this. CountsLine truncated
|
||||
const __redoc_options = {"skipBundle":true,"disableTelemetry":false};
|
||||
|
||||
hydrate(__redoc_definition, __redoc_options, document.getElementById('redoc'));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
title: WeKan REST API
|
||||
version: v13.13
|
||||
version: v13.14
|
||||
description: |
|
||||
The REST API allows you to control and extend WeKan with ease.
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ const pkgdef :Spk.PackageDefinition = (
|
||||
appTitle = (defaultText = "Wekan"),
|
||||
# The name of the app as it is displayed to the user.
|
||||
|
||||
appVersion = 1313,
|
||||
appVersion = 1314,
|
||||
# Increment this for every release.
|
||||
|
||||
appMarketingVersion = (defaultText = "13.13~2026-11-15"),
|
||||
appMarketingVersion = (defaultText = "13.14~2026-11-16"),
|
||||
# Human-readable presentation of the app version.
|
||||
|
||||
minUpgradableAppVersion = 0,
|
||||
|
||||
@@ -208,6 +208,11 @@ require(path.join(tool, "tools/utils/fiber-helpers")).makeGlobalAsyncLocalStorag
|
||||
const resolve = Module._resolveFilename;
|
||||
Module._resolveFilename = function (id, parent, ...args) {
|
||||
if (id.startsWith('meteor/') && Package[id.slice(7)]) return path.join(state, 'meteor', id.slice(7) + '.js');
|
||||
// `meteor/<package>/main` (server/main.js loads aldeed:collection2 that
|
||||
// way, before the models) names the package's main module. image.load
|
||||
// above already ran every package, so it is the same exports object.
|
||||
const mainModule = /^meteor\/([^/]+)\/main$/.exec(id);
|
||||
if (mainModule && Package[mainModule[1]]) return path.join(state, 'meteor', mainModule[1] + '.js');
|
||||
if (id.startsWith('/') && !id.startsWith(root + '/') && (fs.existsSync(root + id) || fs.existsSync(root + id + '.js'))) id = root + id;
|
||||
return resolve.call(this, id, parent, ...args);
|
||||
};
|
||||
|
||||
+3
-1
@@ -16,6 +16,7 @@ import Swimlanes from '/models/swimlanes';
|
||||
import Boards from '/models/boards';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { visibleAllBoards } from '/server/allBoardsFacets';
|
||||
const { notCurrentUser } = require('/server/lib/notCurrentUser');
|
||||
|
||||
const { isAssignedOnlyMember } = require('/models/lib/boardCardScope');
|
||||
|
||||
@@ -144,7 +145,8 @@ Meteor.publish('chatViewCardComments', async function (cardId) {
|
||||
if (isAssignedOnlyMember(board, this.userId) && !(card.assignees || []).includes(this.userId)) return this.ready();
|
||||
const comments = CardComments.find({ cardId, boardId: card.boardId });
|
||||
const authors = [...new Set((await comments.fetchAsync()).map(c => c.userId).filter(Boolean))];
|
||||
return [comments, Meteor.users.find({ _id: { $in: authors } },
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
return [comments, Meteor.users.find(notCurrentUser({ _id: { $in: authors } }, this.userId),
|
||||
{ fields: { username: 1, 'profile.fullname': 1, 'profile.avatarUrl': 1, 'profile.initials': 1 } })];
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
// #6919: a publication that sends users with only a few `profile.*` fields must
|
||||
// never send the CURRENT user. DDP merges only top-level fields, so such a
|
||||
// publication competes with the accounts publication of the user's whole
|
||||
// profile; Meteor re-runs named subscriptions before the accounts one on every
|
||||
// login - a reconnect included - and the narrow one then wins. The client's
|
||||
// profile shrank to those few fields until the page was reloaded, and every
|
||||
// preference in it went back to its default: a checklist folded on a minicard
|
||||
// unfolded half a second later, and #6691 had found the same for the board
|
||||
// view. The current user's own document is published in full already (and its
|
||||
// other top-level fields by `user-admin`), so leaving it out loses nothing.
|
||||
// tests/noNarrowProfileForCurrentUser6919.test.cjs finds every such
|
||||
// publication and requires this.
|
||||
function notCurrentUser(selector, userId) {
|
||||
if (!userId) return selector;
|
||||
return { $and: [selector || {}, { _id: { $ne: userId } }] };
|
||||
}
|
||||
|
||||
module.exports = { notCurrentUser };
|
||||
@@ -38,7 +38,7 @@ async function correctBatch(collection, factory, limit) {
|
||||
const { name, changed, detectedMime } = await correctedNameForStoredFile(fileObj, factory);
|
||||
if (changed && name) {
|
||||
const from = fileObj.name;
|
||||
rename(fileObj, name, factory);
|
||||
await rename(fileObj, name, factory);
|
||||
result.corrected++;
|
||||
if (result.examples.length < 20) {
|
||||
result.examples.push({ from, to: name });
|
||||
|
||||
@@ -258,27 +258,32 @@ WebApp.handlers.put(
|
||||
// The item has to be one of this board's field's items: the update below
|
||||
// matches nothing otherwise, and that was answered 200.
|
||||
const field = await ReactiveCache.getCustomField({ _id: paramCustomFieldId, boardIds: { $in: [paramBoardId] } });
|
||||
if (!field || !((field.settings && field.settings.dropdownItems) || []).some(item => item && item._id === paramDropdownItemId)) {
|
||||
const itemIndex = ((field && field.settings && field.settings.dropdownItems) || []).findIndex(item => item && item._id === paramDropdownItemId);
|
||||
if (itemIndex === -1) {
|
||||
sendJsonResult(res, { code: 404, data: { error: 'Dropdown item not found' } });
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(req.body, 'name')) {
|
||||
await CustomFields.direct.updateAsync(
|
||||
// An explicit index also works when validation previews the modifier
|
||||
// without positional match information. Match the ID at that index so
|
||||
// a concurrent removal/reorder cannot rename a different option.
|
||||
const updated = await CustomFields.direct.updateAsync(
|
||||
{
|
||||
_id: paramCustomFieldId,
|
||||
boardIds: { $in: [paramBoardId] },
|
||||
'settings.dropdownItems._id': paramDropdownItemId,
|
||||
[`settings.dropdownItems.${itemIndex}._id`]: paramDropdownItemId,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
'settings.dropdownItems.$': {
|
||||
_id: paramDropdownItemId,
|
||||
name: paramName,
|
||||
},
|
||||
[`settings.dropdownItems.${itemIndex}.name`]: paramName,
|
||||
},
|
||||
},
|
||||
);
|
||||
if (updated === 0) {
|
||||
sendJsonResult(res, { code: 404, data: { error: 'Dropdown item not found' } });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sendJsonResult(res, {
|
||||
|
||||
@@ -84,14 +84,12 @@ if (Meteor.isServer) {
|
||||
// http(s) URL, a data:image URI, an empty value (clearing), or a WeKan-local
|
||||
// relative path (e.g. /cdn/storage/avatars/…). Reject javascript:, data:text/html,
|
||||
// file:, protocol-relative //host and every other active/foreign scheme at write
|
||||
// time so a hostile scheme can never be stored.
|
||||
// time. The rule is models/lib/avatarUrlScheme.js, which the Users deny rule
|
||||
// (server/permissions/users.js) applies to a direct client write too.
|
||||
function assertSafeAvatarUrl(avatarUrl) {
|
||||
if (avatarUrl === '') return;
|
||||
if (avatarUrl.startsWith('/') && !avatarUrl.startsWith('//')) return;
|
||||
const m = /^([a-z][a-z0-9+.\-]*):/i.exec(avatarUrl);
|
||||
const scheme = m ? m[1].toLowerCase() : '';
|
||||
if (scheme === 'http' || scheme === 'https') return;
|
||||
if (scheme === 'data' && /^data:image\//i.test(avatarUrl)) return;
|
||||
const { isStorableAvatarUrl, avatarUrlScheme } = require('/models/lib/avatarUrlScheme');
|
||||
if (isStorableAvatarUrl(avatarUrl)) return;
|
||||
const scheme = avatarUrlScheme(avatarUrl);
|
||||
try {
|
||||
require('/server/lib/securityLog').record({
|
||||
key: 'file.avatar-url', action: 'blocked', source: 'setAvatarUrl',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Users, { isUserUpdateAllowed, hasForbiddenUserUpdateField, writesNotificationList } from '/models/users';
|
||||
const { writesUnsafeAvatarUrl } = require('/models/lib/avatarUrlScheme');
|
||||
|
||||
Users.allow({
|
||||
update(userId, doc, fields, modifier) {
|
||||
@@ -48,6 +49,18 @@ Users.deny({
|
||||
});
|
||||
} catch (e) { /* logging must never break the guard */ }
|
||||
}
|
||||
// The allow rule above permits every profile.* field, and WeKan's client
|
||||
// sets an avatar only through the setAvatarUrl method. A direct write of an
|
||||
// avatar URL that method refuses is an attempt, never ordinary use.
|
||||
if (writesUnsafeAvatarUrl(modifier)) {
|
||||
try {
|
||||
require('/server/lib/securityLog').record({
|
||||
key: 'file.avatar-url', action: 'blocked', source: 'ddp:user-profile-avatar', userId,
|
||||
detail: 'Client write of a profile.avatarUrl that setAvatarUrl refuses denied.',
|
||||
});
|
||||
} catch (e) { /* logging must never break the guard */ }
|
||||
return true;
|
||||
}
|
||||
return denied;
|
||||
},
|
||||
fetch: [],
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
countCardsByListId,
|
||||
buildBoardTileData,
|
||||
} from '/models/lib/boardTileData';
|
||||
const { notCurrentUser } = require('/server/lib/notCurrentUser');
|
||||
const {
|
||||
effectiveBoardCardsMode,
|
||||
DEFAULT_LAZY_THRESHOLD,
|
||||
@@ -379,7 +380,8 @@ Meteor.publish('boardsReport', async function(searchTerm = '', permission = 'all
|
||||
}
|
||||
});
|
||||
|
||||
const users = await ReactiveCache.getUsers({ _id: { $in: userIds } }, { fields: Users.safeFields }, false);
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
const users = await ReactiveCache.getUsers(notCurrentUser({ _id: { $in: userIds } }, this.userId), { fields: Users.safeFields }, false);
|
||||
const teams = await ReactiveCache.getTeams({ _id: { $in: teamIds } }, {}, false);
|
||||
const orgs = await ReactiveCache.getOrgs({ _id: { $in: orgIds } }, {}, false);
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ import { CARD_TYPES } from '../../config/const';
|
||||
import Org from "../../models/org";
|
||||
import Team from "../../models/team";
|
||||
import { MATCH_NOTHING, selectorIsInjection } from '/server/lib/selectorGuard';
|
||||
const { notCurrentUser } = require('/server/lib/notCurrentUser');
|
||||
|
||||
// Search sessions (global search, Due Cards and the other card reports) are
|
||||
// read, upserted and pruned by { userId, sessionId } and by modifiedAt on
|
||||
@@ -1535,7 +1536,8 @@ async function findCards(sessionId, query, userId) {
|
||||
await ReactiveCache.getSwimlanes({ _id: { $in: swimlanes } }, { fields: { ...fields, color: 1 } }, true),
|
||||
await ReactiveCache.getLists({ _id: { $in: lists } }, { fields: { ...fields, color: 1 } }, true),
|
||||
await ReactiveCache.getCustomFields({ _id: { $in: customFieldIds } }, {}, true),
|
||||
await ReactiveCache.getUsers({ _id: { $in: users } }, { fields: Users.safeFields }, true),
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
await ReactiveCache.getUsers(notCurrentUser({ _id: { $in: users } }, userId), { fields: Users.safeFields }, true),
|
||||
await ReactiveCache.getChecklists({ cardId: { $in: cardIds } }, {}, true),
|
||||
await ReactiveCache.getChecklistItems({ cardId: { $in: cardIds } }, {}, true),
|
||||
attachmentsResult.cursor || attachmentsResult,
|
||||
@@ -1620,7 +1622,8 @@ Meteor.publish('cardsReport', async function(searchTerm = '', limit, skip = 0) {
|
||||
const boards = await ReactiveCache.getBoards({ _id: { $in: [...boardIds] } }, { fields: { title: 1 } }, false);
|
||||
const lists = await ReactiveCache.getLists({ _id: { $in: [...listIds] } }, { fields: { title: 1 } }, false);
|
||||
const swimlanes = await ReactiveCache.getSwimlanes({ _id: { $in: [...swimlaneIds] } }, { fields: { title: 1 } }, false);
|
||||
const users = await ReactiveCache.getUsers({ _id: { $in: [...userIds] } }, { fields: Users.safeFields }, false);
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
const users = await ReactiveCache.getUsers(notCurrentUser({ _id: { $in: [...userIds] } }, this.userId), { fields: Users.safeFields }, false);
|
||||
|
||||
for (const doc of cards) { const { _id, ...fields } = doc; this.added('cards', _id, fields); }
|
||||
for (const doc of boards) { const { _id, ...fields } = doc; this.added('boards', _id, fields); }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { impersonationQuery } from '/models/lib/impersonationReportQuery';
|
||||
const { notCurrentUser } = require('/server/lib/notCurrentUser');
|
||||
|
||||
// Admin Panel / Reports / Impersonation. Impersonation events are already written
|
||||
// to the impersonatedUsers collection whenever an admin impersonates a user (e.g.
|
||||
@@ -35,8 +36,9 @@ Meteor.publish('impersonationReport', async function(searchTerm = '', limit, ski
|
||||
if (r.userId) userIds.push(r.userId);
|
||||
});
|
||||
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
const users = await ReactiveCache.getUsers(
|
||||
{ _id: { $in: [...new Set(userIds)] } },
|
||||
notCurrentUser({ _id: { $in: [...new Set(userIds)] } }, this.userId),
|
||||
{
|
||||
fields: {
|
||||
username: 1,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { canReadBoard } from '/models/lib/boardVisibility';
|
||||
const { notCurrentUser } = require('/server/lib/notCurrentUser');
|
||||
const { assignedOnlyAllowsCard } = require('/models/lib/boardCardScope');
|
||||
|
||||
// We use these when displaying notifications in the notificationsDrawer
|
||||
@@ -135,14 +136,15 @@ Meteor.publish('notificationSwimlanes', async function() {
|
||||
// gets all users associated with activities associated with the current user
|
||||
Meteor.publish('notificationUsers', async function() {
|
||||
const activityEntries = await activityDocs();
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
const ret = await ReactiveCache.getUsers(
|
||||
{
|
||||
notCurrentUser({
|
||||
_id: {
|
||||
$in: activityEntries
|
||||
.map(v => v.userId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
},
|
||||
}, this.userId),
|
||||
{
|
||||
fields: {
|
||||
username: 1,
|
||||
|
||||
@@ -7,6 +7,7 @@ import { safeSelector } from '/server/lib/selectorGuard';
|
||||
// models/lib/tenantAdmin.js, which merges the restriction with the caller's query
|
||||
// under $and so a crafted query cannot argue it away.
|
||||
import * as tenantAdmin from '/models/lib/tenantAdmin';
|
||||
const { notCurrentUser } = require('/server/lib/notCurrentUser');
|
||||
|
||||
Meteor.publish('people', async function(query, limit, skip = 0) {
|
||||
check(query, Match.OneOf(Object, null));
|
||||
@@ -22,7 +23,9 @@ Meteor.publish('people', async function(query, limit, skip = 0) {
|
||||
// execution operator, with the same "match nothing" the card window uses.
|
||||
const safeQuery = safeSelector(query, 'people');
|
||||
if (tenantAdmin.canOpenAdminPanel(user)) {
|
||||
ret = await ReactiveCache.getUsers(tenantAdmin.peopleScopeSelector(user, safeQuery), {
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js. Their
|
||||
// own row reads createdAt, loginDisabled and the rest from user-admin.
|
||||
ret = await ReactiveCache.getUsers(notCurrentUser(tenantAdmin.peopleScopeSelector(user, safeQuery), this.userId), {
|
||||
limit,
|
||||
skip: skip || 0,
|
||||
sort: { createdAt: -1 },
|
||||
|
||||
@@ -1,8 +1,40 @@
|
||||
Meteor.publish('userDesktopDragHandles', function() {
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
// #6919: DDP merges only top-level fields. This publication used to send the
|
||||
// current user `{ profile: { showDesktopDragHandles } }`; when it ran before
|
||||
// the accounts publication of the whole profile (Meteor re-runs named
|
||||
// subscriptions first on every login, a reconnect included), that one-field
|
||||
// profile won, and the client's profile stayed `{}` until the page was
|
||||
// reloaded. Every preference read from it went back to its default - a
|
||||
// checklist folded on a minicard unfolded half a second later - and #6691 had
|
||||
// found the same for the board view. So, like userBoardView, the preference is
|
||||
// published under a top-level field of its own and never competes for
|
||||
// `profile`. tests/noNarrowProfileForCurrentUser6919.test.cjs.
|
||||
Meteor.publish('userDesktopDragHandles', async function() {
|
||||
if (!this.userId) return this.ready();
|
||||
return Meteor.users.find({ _id: this.userId }, {
|
||||
fields: {
|
||||
'profile.showDesktopDragHandles': 1
|
||||
}
|
||||
let stopped = false;
|
||||
let handle;
|
||||
this.onStop(() => {
|
||||
stopped = true;
|
||||
if (handle) handle.stop();
|
||||
});
|
||||
});
|
||||
const preference = fields => {
|
||||
const value = fields.profile?.showDesktopDragHandles;
|
||||
return { desktopDragHandlesPreference: typeof value === 'boolean' ? value : null };
|
||||
};
|
||||
handle = await Meteor.users.find({ _id: this.userId }, {
|
||||
fields: { 'profile.showDesktopDragHandles': 1 },
|
||||
}).observeChangesAsync({
|
||||
added: (id, fields) => {
|
||||
if (!stopped) this.added('users', id, preference(fields));
|
||||
},
|
||||
changed: (id, fields) => {
|
||||
if (!stopped && 'profile' in fields) this.changed('users', id, preference(fields));
|
||||
},
|
||||
removed: id => {
|
||||
if (!stopped) this.removed('users', id);
|
||||
},
|
||||
});
|
||||
if (stopped) handle.stop();
|
||||
else this.ready();
|
||||
});
|
||||
@@ -10,6 +10,8 @@ DDPRateLimiter.addRule(
|
||||
10 * 1000,
|
||||
);
|
||||
|
||||
const { notCurrentUser } = require('/server/lib/notCurrentUser');
|
||||
|
||||
Meteor.publish('user-miniprofile', async function (usernames) {
|
||||
check(usernames, Array);
|
||||
|
||||
@@ -22,13 +24,14 @@ Meteor.publish('user-miniprofile', async function (usernames) {
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
// console.log('usernames:', usernames);
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
const ret = await ReactiveCache.getUsers(
|
||||
{
|
||||
notCurrentUser({
|
||||
$or: [
|
||||
{ username: { $in: usernames } },
|
||||
{ importUsernames: { $in: usernames } },
|
||||
],
|
||||
},
|
||||
}, this.userId),
|
||||
{
|
||||
fields: {
|
||||
...Users.safeFields,
|
||||
@@ -49,6 +52,12 @@ Meteor.publish('user-admin', function () {
|
||||
authenticationMethod: 1,
|
||||
// #6736: whether this user previews disabled features. Own document only.
|
||||
featurePreview: 1,
|
||||
// #6919: the People / impersonation pages leave the current user out of
|
||||
// their narrow-profile publications; their own row reads these here.
|
||||
createdAt: 1,
|
||||
loginDisabled: 1,
|
||||
lastConnectionDate: 1,
|
||||
importUsernames: 1,
|
||||
},
|
||||
});
|
||||
return ret;
|
||||
@@ -99,13 +108,14 @@ Meteor.publish('user-search', async function (searchTerm) {
|
||||
|
||||
// This general publication deliberately exposes only public identity fields.
|
||||
// Board-authorized email lookup is handled by the bounded searchUsers method.
|
||||
// #6919: never the current user - see server/lib/notCurrentUser.js.
|
||||
const ret = await ReactiveCache.getUsers(
|
||||
{
|
||||
notCurrentUser({
|
||||
$or: [
|
||||
{ username: searchRegex },
|
||||
{ 'profile.fullname': searchRegex },
|
||||
],
|
||||
},
|
||||
}, this.userId),
|
||||
{
|
||||
fields: {
|
||||
_id: 1,
|
||||
|
||||
+4
-4
@@ -19,7 +19,7 @@
|
||||
# base: core24 (not core26) · no build-base: devel · grade: stable
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
name: wekan
|
||||
version: '13.13'
|
||||
version: '13.14'
|
||||
base: core24
|
||||
confinement: strict
|
||||
grade: stable
|
||||
@@ -703,18 +703,18 @@ parts:
|
||||
armhf) WEKAN_ARCH="armhf" ;;
|
||||
*) echo "Unsupported architecture: ${CRAFT_ARCH_BUILD_FOR}"; exit 1 ;;
|
||||
esac
|
||||
WEKAN_ZIP="wekan-13.13-${WEKAN_ARCH}.zip"
|
||||
WEKAN_ZIP="wekan-13.14-${WEKAN_ARCH}.zip"
|
||||
echo "Cleaning environment first"
|
||||
rm -rf .build
|
||||
mkdir .build
|
||||
cd .build
|
||||
#wget https://github.com/wekan/wekan/releases/download/v13.13/wekan-13.13-amd64.zip
|
||||
#wget https://github.com/wekan/wekan/releases/download/v13.14/wekan-13.14-amd64.zip
|
||||
# Retry: a release asset can 404 for a short while right after it is
|
||||
# uploaded (CDN/propagation lag), and a plain wget treated that as
|
||||
# fatal. --retry-on-http-error covers the 404/5xx window; a genuinely
|
||||
# missing bundle still fails after the tries are spent.
|
||||
wget --tries=20 --waitretry=20 --retry-on-http-error=404,403,500,502,503 \
|
||||
"https://github.com/wekan/wekan/releases/download/v13.13/${WEKAN_ZIP}"
|
||||
"https://github.com/wekan/wekan/releases/download/v13.14/${WEKAN_ZIP}"
|
||||
unzip "${WEKAN_ZIP}"
|
||||
python3 ../releases/check-telemetry.py --bundle bundle
|
||||
rm "${WEKAN_ZIP}"
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { test } = require('node:test');
|
||||
const { sanitizeFilename } = require('../models/lib/filenameSanitizer');
|
||||
|
||||
// Exercise the Meteor helper itself with real files, as the copy tests do.
|
||||
const source = fs.readFileSync(path.join(__dirname, '../models/lib/fileStoreStrategy.js'), 'utf8');
|
||||
const code = source.slice(source.indexOf('export const rename = ') + 'export const rename = '.length);
|
||||
const loadRename = collection => new Function('sanitizeFilename', 'Attachments', `return (${code.replace(/;\s*$/, '')});`)(sanitizeFilename, collection);
|
||||
|
||||
for (const versions of [['original'], ['original', 'thumbnail'], ['thumbnail', 'original']]) {
|
||||
test(`rename keeps the upload object and persisted paths aligned: ${versions.join(', ')}`, async () => {
|
||||
const root = path.join(__dirname, '../.tools/tmp');
|
||||
fs.mkdirSync(root, { recursive: true });
|
||||
const directory = fs.mkdtempSync(path.join(root, 'rename-paths-'));
|
||||
const file = { _id: 'upload', name: 'long-original-name.png', versions: {} };
|
||||
const bytes = Buffer.from([0, 1, 2, 255]);
|
||||
const writes = [];
|
||||
let completedWrites = 0;
|
||||
const collection = {
|
||||
async updateAsync(selector, modifier) {
|
||||
assert.deepEqual(selector, { _id: file._id });
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
writes.push(modifier.$set);
|
||||
completedWrites++;
|
||||
},
|
||||
};
|
||||
for (const version of versions) {
|
||||
const filename = path.join(directory, `old-${version}.png`);
|
||||
fs.writeFileSync(filename, bytes);
|
||||
file.versions[version] = { path: filename, storage: 'fs' };
|
||||
}
|
||||
file.path = file.versions.original.path;
|
||||
const oldPath = file.path;
|
||||
const factory = {
|
||||
storagePath: directory,
|
||||
collection,
|
||||
getFileStrategy(fileObj, version) {
|
||||
return {
|
||||
getNewPath(storagePath, name) { return path.join(storagePath, `${version}-${name}`); },
|
||||
rename(destination) { fs.renameSync(fileObj.versions[version].path, destination); },
|
||||
};
|
||||
},
|
||||
};
|
||||
try {
|
||||
await loadRename({ updateAsync() { assert.fail('use the supplied collection'); } })(file, 'short.png', factory);
|
||||
assert.equal(completedWrites, versions.length, 'the caller must wait for persistence');
|
||||
assert.equal(file.path, file.versions.original.path, 'validation must open the renamed original');
|
||||
assert.deepEqual(fs.readFileSync(file.path), bytes);
|
||||
assert.equal(fs.existsSync(oldPath), false);
|
||||
for (const [index, version] of versions.entries()) {
|
||||
assert.equal(writes[index][`versions.${version}.path`], file.versions[version].path);
|
||||
assert.deepEqual(fs.readFileSync(file.versions[version].path), bytes);
|
||||
assert.equal(writes[index].name, 'short.png');
|
||||
assert.equal(writes[index].extension, 'png');
|
||||
assert.equal(writes[index].extensionWithDot, '.png');
|
||||
if (version === 'original') assert.equal(writes[index].path, file.path);
|
||||
else assert.equal(Object.hasOwn(writes[index], 'path'), false, 'a thumbnail must not replace the original path');
|
||||
}
|
||||
// onAfterUpload persists this object again; it must not restore old paths.
|
||||
assert.deepEqual(file.versions.original.path, writes[versions.indexOf('original')]['versions.original.path']);
|
||||
} finally {
|
||||
fs.rmSync(directory, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
test('a failed physical rename leaves paths untouched and does not write metadata', async () => {
|
||||
const file = { _id: 'missing', path: 'old.png', versions: { original: { path: 'old.png' } } };
|
||||
const before = structuredClone(file);
|
||||
const factory = {
|
||||
collection: { async updateAsync() { assert.fail('a failed rename must not persist new paths'); } },
|
||||
getFileStrategy() { return {
|
||||
getNewPath() { return 'new.png'; },
|
||||
rename() { throw new Error('no file found on disk'); },
|
||||
}; },
|
||||
};
|
||||
await assert.rejects(loadRename()(file, 'new.png', factory), /no file found on disk/);
|
||||
assert.deepEqual(file, before);
|
||||
});
|
||||
|
||||
test('rename propagates a failed metadata write to its caller', async () => {
|
||||
const file = { _id: 'upload', path: 'old.png', versions: { original: { path: 'old.png' } } };
|
||||
const collection = { async updateAsync() { throw new Error('write failed'); } };
|
||||
const factory = { getFileStrategy() { return {
|
||||
getNewPath() { return 'new.png'; }, rename() {},
|
||||
}; } };
|
||||
await assert.rejects(loadRename(collection)(file, 'new.png', factory), /write failed/);
|
||||
});
|
||||
@@ -0,0 +1,87 @@
|
||||
'use strict';
|
||||
// setAvatarUrl refuses javascript:, file:, data:text/html and the rest, but the
|
||||
// Users allow rule permits every profile.* field, so a direct client
|
||||
// Users.update({$set: {'profile.avatarUrl': ...}}) stored what the method
|
||||
// refuses. models/lib/avatarUrlScheme.js is now the one rule for both, and the
|
||||
// Users deny rule applies it to the client write.
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const test = require('node:test');
|
||||
const { isStorableAvatarUrl, writesUnsafeAvatarUrl } = require('../models/lib/avatarUrlScheme');
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
const read = rel => fs.readFileSync(path.join(root, rel), 'utf8');
|
||||
|
||||
test('accepted avatar URLs: empty, local path, http(s), data:image', () => {
|
||||
for (const url of ['', '/cdn/storage/avatars/abc', 'https://example.com/a.png',
|
||||
'HTTP://example.com/a.png', 'data:image/png;base64,AAAA']) {
|
||||
assert.equal(isStorableAvatarUrl(url), true, url);
|
||||
}
|
||||
});
|
||||
|
||||
test('negative: refused avatar URLs: active and foreign schemes', () => {
|
||||
for (const url of ['javascript:alert(1)', 'JavaScript:alert(1)', 'data:text/html,<script>',
|
||||
'file:///etc/passwd', '//evil.example/a.png', 'ftp://host/a.png', 'gopher://x',
|
||||
'vbscript:x', 'no-scheme.png', null, undefined, 42, {}]) {
|
||||
assert.equal(isStorableAvatarUrl(url), false, String(url));
|
||||
}
|
||||
});
|
||||
|
||||
test('a client write of a safe avatar URL, or clearing it, is allowed', () => {
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { 'profile.avatarUrl': 'https://example.com/a.png' } }), false);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { 'profile.avatarUrl': '' } }), false);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $unset: { 'profile.avatarUrl': '' } }), false);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { profile: { fullname: 'A', avatarUrl: '/cdn/x' } } }), false);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { profile: { fullname: 'A' } } }), false);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { 'profile.fullname': 'javascript:' } }), false,
|
||||
'another profile field is not the avatar');
|
||||
assert.equal(writesUnsafeAvatarUrl(null), false);
|
||||
});
|
||||
|
||||
test('negative: every way to store a refused avatar URL directly is denied', () => {
|
||||
const bad = 'javascript:alert(document.cookie)';
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { 'profile.avatarUrl': bad } }), true);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $setOnInsert: { 'profile.avatarUrl': bad } }), true);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { profile: { avatarUrl: bad } } }), true);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { 'profile.avatarUrl': { $gt: '' } } }), true, 'not a string');
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { 'profile.avatarUrl.x': 'https://a' } }), true);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $rename: { 'profile.fullname': 'profile.avatarUrl' } }), true);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $push: { 'profile.avatarUrl': 'https://a' } }), true);
|
||||
assert.equal(writesUnsafeAvatarUrl({ $set: { 'profile.avatarUrl': 'file:///etc/passwd' } }), true);
|
||||
});
|
||||
|
||||
test('the Users deny rule applies it and logs the attempt to Admin Panel / Problems', () => {
|
||||
const rule = read('server/permissions/users.js');
|
||||
const deny = rule.slice(rule.indexOf('Users.deny({'));
|
||||
assert.match(deny, /if \(writesUnsafeAvatarUrl\(modifier\)\) \{[\s\S]*?key: 'file\.avatar-url', action: 'blocked'[\s\S]*?catch \(e\) \{ \/\* logging must never break the guard \*\/ \}[\s\S]*?return true;/);
|
||||
assert.match(read('models/lib/securityCategories.js'), /'file\.avatar-url':/);
|
||||
});
|
||||
|
||||
test('both avatar methods use the same rule as the deny rule', () => {
|
||||
const methods = read('server/models/users.js');
|
||||
assert.match(methods, /function assertSafeAvatarUrl\(avatarUrl\) \{\s*const \{ isStorableAvatarUrl, avatarUrlScheme \} = require\('\/models\/lib\/avatarUrlScheme'\);/);
|
||||
for (const name of ['setAvatarUrl', 'adminSetAvatarUrl']) {
|
||||
const start = methods.indexOf(`async ${name}(`);
|
||||
assert.ok(start > 0, `${name} exists`);
|
||||
const body = methods.slice(start, methods.indexOf('\n },', start));
|
||||
assert.match(body, /assertSafeAvatarUrl\(avatarUrl\);/, `${name} validates the URL`);
|
||||
}
|
||||
});
|
||||
|
||||
test('negative: no client code writes profile.avatarUrl directly, so the deny breaks nothing', () => {
|
||||
const offenders = [];
|
||||
const walk = dir => {
|
||||
for (const entry of fs.readdirSync(path.join(root, dir), { withFileTypes: true })) {
|
||||
const rel = path.join(dir, entry.name);
|
||||
if (entry.isDirectory()) walk(rel);
|
||||
else if (/\.js$/.test(entry.name)) {
|
||||
const src = read(rel);
|
||||
if (/(update|updateAsync)\([^)]*['"]profile\.avatarUrl['"]/.test(src) ||
|
||||
/\$set:\s*\{\s*['"]profile\.avatarUrl['"]/.test(src)) offenders.push(rel);
|
||||
}
|
||||
}
|
||||
};
|
||||
walk('client');
|
||||
assert.deepEqual(offenders, [], 'the client sets an avatar only through Meteor.call(setAvatarUrl)');
|
||||
});
|
||||
@@ -57,10 +57,11 @@ test('the workflow: skip without a Node.js, verify every download, build and sta
|
||||
assert.match(workflow, /mount -u -o wxallowed "\$\(df -P \. \| awk 'NR==2 \{print \$6\}'\)"/);
|
||||
assert.match(workflow, /CC=\/usr\/pkg\/gcc14\/bin\/gcc CXX=\/usr\/pkg\/gcc14\/bin\/g\+\+/);
|
||||
// The same FreeBSD VM that built the Node.js builds the native modules. A
|
||||
// dependabot bump of one (v1.5.9, #6781) has to be made in the other too.
|
||||
// dependabot bump of one (v1.5.9, #6781; v1.6.0, #6907) has to be made in
|
||||
// the other too.
|
||||
const pin = workflow.match(/uses: vmactions\/freebsd-vm@([0-9a-f]{40})/);
|
||||
assert.ok(pin, 'FreeBSD VM pinned to a commit');
|
||||
assert.equal(pin[1], 'c46abacb49f09938ca4e1702d15d836285d694cc', 'FreeBSD VM pinned to the commit node-patches uses');
|
||||
assert.equal(pin[1], '811efaaac0668df8bfb8308c3ec997b5ab50037b', 'FreeBSD VM pinned to the commit node-patches uses');
|
||||
const np = path.join(__dirname, '..', '.tools', 'w', 'node-patches', '.github', 'workflows', 'release-all.yml');
|
||||
if (fs.existsSync(np)) {
|
||||
assert.match(fs.readFileSync(np, 'utf8'), new RegExp(`uses: vmactions/freebsd-vm@${pin[1]}`), 'node-patches uses the same commit');
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { test } = require('node:test');
|
||||
const { liveAttachments } = require('../models/lib/attachmentSoftDelete');
|
||||
|
||||
// Exercise the shared remover used by REST single/bulk deletion and the
|
||||
// collection hook. The storage/lifecycle helper is tested in its own suites.
|
||||
const source = fs.readFileSync(path.join(__dirname, '../models/cards.js'), 'utf8');
|
||||
const start = source.indexOf('async function cardRemover(');
|
||||
const body = source.slice(start, source.indexOf('\n// #5323:', start));
|
||||
|
||||
function remover({ attachments = [], softDelete, isServer = true }) {
|
||||
const calls = [];
|
||||
const direct = { removeAsync: async () => {} };
|
||||
const load = new Function(
|
||||
'Meteor', 'ChecklistItems', 'Checklists', 'CardComments', 'Cards', 'Attachments',
|
||||
'require', 'liveAttachments', 'onlyChildrenSelector', 'sharedChildrenSelector',
|
||||
`${body}; return cardRemover;`,
|
||||
);
|
||||
const remove = load({ isServer }, { direct }, { direct }, { direct }, {
|
||||
find: () => ({ fetchAsync: async () => [] }), removeAsync: async () => {},
|
||||
}, {
|
||||
collection: { find(selector) {
|
||||
calls.push(['find', selector]);
|
||||
return { fetchAsync: async () => attachments };
|
||||
} },
|
||||
async removeAsync(selector) { calls.push(['legacyRemove', selector]); },
|
||||
}, name => {
|
||||
if (name === '/server/attachmentSoftDelete') return { softDeleteAttachment: softDelete };
|
||||
if (name === '/models/changeHistory') return { default: { record: async () => {} } };
|
||||
throw new Error(`Unexpected module: ${name}`);
|
||||
}, liveAttachments, () => ({}), () => ({}));
|
||||
return { remove, calls };
|
||||
}
|
||||
|
||||
test('card deletion awaits recoverable deletion of attachments selected by meta.cardId', async () => {
|
||||
const attachments = [{ _id: 'first' }, { _id: 'second' }];
|
||||
const completed = [];
|
||||
const { remove, calls } = remover({ attachments, softDelete: async input => {
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
completed.push(input);
|
||||
} });
|
||||
await remove('actor', { _id: 'card' });
|
||||
assert.deepEqual(calls[0], ['find', { 'meta.cardId': 'card', deletedAt: null }]);
|
||||
assert.deepEqual(completed, attachments.map(attachment => ({ userId: 'actor', attachment })));
|
||||
assert.deepEqual(calls[1], ['legacyRemove', { cardId: 'card' }], 'keep legacy purge behavior');
|
||||
});
|
||||
|
||||
test('an empty live attachment set performs no lifecycle writes', async () => {
|
||||
const { remove, calls } = remover({ softDelete: async () => assert.fail('no live attachments') });
|
||||
await remove(null, { _id: 'empty' });
|
||||
assert.deepEqual(calls[0], ['find', { 'meta.cardId': 'empty', deletedAt: null }]);
|
||||
});
|
||||
|
||||
test('a failed attachment deletion is propagated before the card can be removed', async () => {
|
||||
const { remove, calls } = remover({ attachments: [{ _id: 'failed' }], softDelete: async () => {
|
||||
throw new Error('attachment write failed');
|
||||
} });
|
||||
await assert.rejects(remove('actor', { _id: 'card' }), /attachment write failed/);
|
||||
assert.equal(calls.length, 1, 'do not continue the purge after a failed lifecycle write');
|
||||
});
|
||||
|
||||
test('the shared model does not load the server attachment helper on the client', async () => {
|
||||
const { remove, calls } = remover({ isServer: false, softDelete: async () => assert.fail('server-only helper') });
|
||||
await remove(null, { _id: 'card' });
|
||||
assert.deepEqual(calls, [['legacyRemove', { cardId: 'card' }]]);
|
||||
});
|
||||
@@ -107,13 +107,20 @@ test('Shift+M and Shift+C are bound once, and the plain m and c keep their own a
|
||||
assert.deepEqual(bindings.filter(b => keysOf(b).includes('m')), ['m'], 'm stays assign yourself');
|
||||
assert.deepEqual(bindings.filter(b => keysOf(b).includes('c')), ['c'], 'c stays archive');
|
||||
|
||||
const fn = keyboard.slice(keyboard.indexOf('function runCardMenuActionWhenRendered'), keyboard.indexOf("hotkeys('shift+m'"));
|
||||
// #6924 changed the route, not the permission: Shift+M / Shift+C no longer
|
||||
// click the card's hamburger menu and then its item - which showed the card,
|
||||
// the menu and the popup - but open only the Move card / Copy card popup.
|
||||
// It is allowed exactly when the menu would render the item
|
||||
// (client/lib/cardShortcutPopup.js, tests/cardShortcutPopup.test.cjs), and
|
||||
// without the item nothing opens, so no menu is left open either.
|
||||
const fn = keyboard.slice(keyboard.indexOf('function cardShortcutFacts'), keyboard.indexOf("hotkeys('shift+m'"));
|
||||
assert.match(fn, /if \(Utils\.getCurrentCardId\(\) !== cardId\) return;/,
|
||||
'negative: stops when another card was opened meanwhile');
|
||||
assert.match(fn, /Date\.now\(\) - started < 3000/, 'gives up rather than waiting forever');
|
||||
assert.match(fn, /result === 'no-item'\) \{\s*\n\s*Popup\.close\(\);/, 'a menu without the item is closed again');
|
||||
assert.match(fn, /const name = cardShortcutPopup\(action, cardShortcutFacts\(card\)\);\s*\n\s*if \(!name \|\| !anchor\) return false;/,
|
||||
'nothing opens where the menu has no such item');
|
||||
assert.match(fn, /Meteor\.userId\(\) === null \|\| !Utils\.canModifyBoard\(\)\) return false;/);
|
||||
assert.doesNotMatch(fn, /Popup\.open/, 'never opens the popup past the menu item');
|
||||
assert.doesNotMatch(fn, /cardMenuStep|Utils\.goCardId/, 'negative: #6924 - no menu first, no card opened');
|
||||
assert.match(fn, /Session\.get\('selectedCard'\) \|\| getHoveredCardId\(\)/, 'with no opened card, the same card as d');
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
'use strict';
|
||||
// #6924: `d`, Shift+M and Shift+C open ONLY their popup - next to a hovered or
|
||||
// selected minicard without opening the card, and on an opened card without
|
||||
// showing its hamburger menu first. The popup is opened directly, so
|
||||
// cardShortcutPopup must allow exactly what a click on the rendered control
|
||||
// would: these tests drive it, and tie each rule to the template condition the
|
||||
// control is rendered under.
|
||||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
const read = rel => fs.readFileSync(path.join(root, rel), 'utf8');
|
||||
const load = () => import('../client/lib/cardShortcutPopup.js');
|
||||
|
||||
const editor = { canModifyCard: true, isBoardAdmin: false, isWorker: false, isReadOnly: false,
|
||||
isReadAssignedOnly: false, allowsDueDate: true, hasDue: false };
|
||||
|
||||
test('each shortcut opens its own popup for somebody a click would let open it', async () => {
|
||||
const { cardShortcutPopup } = await load();
|
||||
assert.equal(cardShortcutPopup('due', editor), 'editCardDueDate');
|
||||
assert.equal(cardShortcutPopup('due', { ...editor, hasDue: true }), 'editCardDueDate');
|
||||
assert.equal(cardShortcutPopup('move', { ...editor, isBoardAdmin: true }), 'moveCard');
|
||||
assert.equal(cardShortcutPopup('copy', editor), 'copyCard');
|
||||
// A Worker edits an existing due date through its badge.
|
||||
assert.equal(cardShortcutPopup('due', { ...editor, isWorker: true, hasDue: true }), 'editCardDueDate');
|
||||
// cardMenuWrites: a member who may not modify the card but is not read-only.
|
||||
assert.equal(cardShortcutPopup('copy', { ...editor, canModifyCard: false }), 'copyCard');
|
||||
});
|
||||
|
||||
test('negative: nothing opens where the control a click would use is not rendered', async () => {
|
||||
const { cardShortcutPopup } = await load();
|
||||
assert.equal(cardShortcutPopup('due', { ...editor, canModifyCard: false }), null, 'no badge or + without canModifyCard');
|
||||
assert.equal(cardShortcutPopup('due', { ...editor, allowsDueDate: false }), null, 'board has due dates off');
|
||||
assert.equal(cardShortcutPopup('due', { ...editor, isWorker: true }), null, 'a Worker gets no + to add one');
|
||||
assert.equal(cardShortcutPopup('move', editor), null, 'Move card is for board admins');
|
||||
assert.equal(cardShortcutPopup('copy', { ...editor, isWorker: true }), null, 'no Copy card for a Worker');
|
||||
for (const ro of [{ isReadOnly: true }, { isReadAssignedOnly: true }]) {
|
||||
const facts = { ...editor, ...ro, canModifyCard: false, isBoardAdmin: true };
|
||||
assert.equal(cardShortcutPopup('move', facts), null, 'read-only: no cardMenuWrites');
|
||||
assert.equal(cardShortcutPopup('copy', facts), null, 'read-only: no cardMenuWrites');
|
||||
}
|
||||
assert.equal(cardShortcutPopup('archive', editor), null, 'only the three shortcuts');
|
||||
assert.equal(cardShortcutPopup('due'), null, 'no facts, no popup');
|
||||
});
|
||||
|
||||
test('the rules are the conditions the controls are rendered under', () => {
|
||||
const jade = read('client/components/cards/cardDetails.jade');
|
||||
const menu = jade.slice(jade.indexOf('template(name="cardDetailsActionsPopup")'));
|
||||
assert.match(menu, /if cardMenuWrites\s*\n\s*if currentUser\.isBoardAdmin\s*\n\s*li\s*\n\s*a\.js-move-card/);
|
||||
assert.match(menu, /unless currentUser\.isWorker\s*\n\s*li\s*\n\s*a\.js-copy-card/);
|
||||
const due = jade.slice(jade.indexOf('if $eq field "dueDate"'), jade.indexOf('if $eq field "endDate"'));
|
||||
assert.match(due, /if currentBoard\.allowsDueDate/);
|
||||
assert.match(due, /if getDue\s*\n\s*\+cardDueDate\(card=this canModifyCard=canModifyCard\)/);
|
||||
assert.match(due, /if canModifyCard\s*\n\s*unless currentUser\.isWorker\s*\n\s*a\.card-label\.add-label\.js-due-date/);
|
||||
assert.match(read('client/components/cards/cardDate.jade'), /template\(name="dateBadgeBody"\)\s*\n\s*if canModifyCard\s*\n\s*a\.js-edit-date/);
|
||||
const js = read('client/components/cards/cardDetails.js');
|
||||
assert.match(js, /cardMenuWrites\(\) \{\s*\n\s*if \(Utils\.canModifyCard\(this\)\) return true;[\s\S]{0,200}isReadOnly[\s\S]{0,80}isReadAssignedOnly/);
|
||||
// The same popups the controls open.
|
||||
assert.match(js, /'click \.js-move-card': Popup\.open\('moveCard'\)/);
|
||||
assert.match(js, /'click \.js-copy-card': Popup\.open\('copyCard'\)/);
|
||||
assert.match(js, /'click \.js-due-date': Popup\.open\('editCardDueDate'\)/);
|
||||
});
|
||||
|
||||
test('the popup is anchored to the minicard, the hovered one first', async () => {
|
||||
const { findMinicard } = await load();
|
||||
const a = { id: 'a', getAttribute: () => 'card1' };
|
||||
const b = { id: 'b', getAttribute: () => 'card1' };
|
||||
const doc = { querySelector: sel => (sel === '.js-minicard[data-card-id="card1"]' ? a : null) };
|
||||
assert.equal(findMinicard(doc, 'card1'), a);
|
||||
assert.equal(findMinicard(doc, 'card1', b), b, 'the hovered copy of the card');
|
||||
assert.equal(findMinicard(doc, 'card1', { getAttribute: () => 'other' }), a, 'a hovered OTHER card is not it');
|
||||
assert.equal(findMinicard(doc, 'missing'), null);
|
||||
// negative: an id that is not a plain id never reaches a selector
|
||||
for (const bad of ['x"] , *', '', null, 'a b']) assert.equal(findMinicard(doc, bad), null);
|
||||
});
|
||||
|
||||
test('keyboard.js opens only the popup: the card is not opened and no menu is shown', () => {
|
||||
const kb = read('client/lib/keyboard.js');
|
||||
const due = kb.slice(kb.indexOf('export function openDueDateEditorOfOpenedCard'), kb.indexOf("hotkeys('d, shift+d'"));
|
||||
const menu = kb.slice(kb.indexOf('function cardShortcutFacts'), kb.indexOf("hotkeys('shift+m'"));
|
||||
// An opened card's `d` still clicks its own rendered control (#6750, #6840).
|
||||
assert.match(due, /clickDueDateControlWhenRendered\(cardId\)/);
|
||||
assert.match(due, /return openCardShortcutPopupAtMinicard\('due'\);/);
|
||||
for (const fn of [due, menu]) {
|
||||
assert.doesNotMatch(fn, /Utils\.goCardId/, 'negative: the card is not opened');
|
||||
assert.doesNotMatch(fn, /cardMenuStep|\.js-open-card-details-menu'\)\.click|opened-menu/, 'negative: no menu first');
|
||||
}
|
||||
assert.match(menu, /const name = cardShortcutPopup\(action, cardShortcutFacts\(card\)\);\s*\n\s*if \(!name \|\| !anchor\) return false;/,
|
||||
'nothing opens without permission or an anchor');
|
||||
assert.match(menu, /Popup\.open\(name\)\.call\(card,/, 'the card is the popup data context');
|
||||
assert.match(menu, /Session\.get\('selectedCard'\) \|\| getHoveredCardId\(\)/, 'the same card every card shortcut uses');
|
||||
assert.match(menu, /if \(Utils\.getCurrentCardId\(\) !== cardId\) return;/, 'negative: stops when another card was opened');
|
||||
assert.match(menu, /Date\.now\(\) - started < 3000/, 'gives up rather than waiting forever');
|
||||
assert.match(menu, /Meteor\.userId\(\) === null \|\| !Utils\.canModifyBoard\(\)\) return false;/);
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
// build.sh's source test mode (scripts/dev-source) stopped at startup with
|
||||
// "Cannot find module 'meteor/aldeed:collection2/main'": server/main.js loads
|
||||
// collection2's main module before the models (2699f4deea), and the source
|
||||
// runtime resolved only a bare `meteor/<package>`. It now maps
|
||||
// `meteor/<package>/main` to the same package exports.
|
||||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
const runtime = fs.readFileSync(path.join(root, 'scripts/dev-source/runtime.cjs'), 'utf8');
|
||||
const mainJs = fs.readFileSync(path.join(root, 'server/main.js'), 'utf8');
|
||||
|
||||
// The resolver's own regular expression, taken from the runtime.
|
||||
const pattern = new RegExp(runtime.match(/const mainModule = \/(.+)\/\.exec\(id\);/)[1]);
|
||||
|
||||
test('the runtime maps meteor/<package>/main to the package', () => {
|
||||
assert.match(runtime, /if \(mainModule && Package\[mainModule\[1\]\]\) return path\.join\(state, 'meteor', mainModule\[1\] \+ '\.js'\);/);
|
||||
assert.equal(pattern.exec('meteor/aldeed:collection2/main')[1], 'aldeed:collection2');
|
||||
});
|
||||
|
||||
test('every meteor/<package>/<path> import in the server entry is one the runtime resolves', () => {
|
||||
const ids = [...mainJs.matchAll(/require\('(meteor\/[^']+\/[^']+)'\)/g)].map(m => m[1]);
|
||||
assert.ok(ids.includes('meteor/aldeed:collection2/main'), 'the import this fixes is still there');
|
||||
for (const id of ids) assert.ok(pattern.test(id), `${id} resolves in source mode`);
|
||||
});
|
||||
|
||||
test('negative: deeper or other sub-paths are not taken for the main module', () => {
|
||||
for (const id of ['meteor/aldeed:collection2/lib/x', 'meteor/aldeed:collection2/main/x', 'meteor/aldeed:collection2', 'aldeed:collection2/main']) {
|
||||
assert.equal(pattern.test(id), false, id);
|
||||
}
|
||||
});
|
||||
@@ -115,15 +115,20 @@ test('d is bound once, through the shared filter, to the opened card with canMod
|
||||
assert.doesNotMatch(fn, /Popup\.open/, 'never opens the popup past the rendered control');
|
||||
});
|
||||
|
||||
test('#6755: with no card opened, d opens the hovered or selected minicard first', () => {
|
||||
// #6924 changed the minicard half: `d` on a hovered or selected minicard used
|
||||
// to open the card and then click its Due date control (#6755); now it opens
|
||||
// only the Due date popup next to the minicard, as a click on the minicard's
|
||||
// date does, and the card stays closed. The permission it needs is the
|
||||
// control's own, in client/lib/cardShortcutPopup.js
|
||||
// (tests/cardShortcutPopup.test.cjs). An opened card still clicks its control.
|
||||
test('#6755 / #6924: with no card opened, d opens only the popup of the hovered or selected minicard', () => {
|
||||
const fn = keyboard.slice(keyboard.indexOf('export function openDueDateEditorOfOpenedCard'), keyboard.indexOf("hotkeys('d, shift+d'"));
|
||||
assert.match(fn, /if \(cardId\) \{\n\s+const card = ReactiveCache\.getCard\(cardId\);\n\s+if \(!card \|\| !Utils\.canModifyCard\(card\)\) return false;\n\s+clickDueDateControlWhenRendered\(cardId\);/,
|
||||
'an opened card wins, and #6840: its click waits until its details are rendered');
|
||||
assert.match(fn, /Session\.get\('selectedCard'\) \|\| getHoveredCardId\(\)/, 'the same card the other card shortcuts use');
|
||||
assert.match(fn, /if \(!minicard \|\| !Utils\.canModifyCard\(minicard\)\) return false;/,
|
||||
'negative: a card the user may not edit is not even opened');
|
||||
assert.match(fn, /Utils\.goCardId\(minicardId\)/);
|
||||
assert.match(fn, /setTimeout\(\(\) => clickDueDateControlWhenRendered\(minicardId\), 0\)/);
|
||||
assert.match(fn, /return openCardShortcutPopupAtMinicard\('due'\);/);
|
||||
assert.doesNotMatch(fn, /Utils\.goCardId/, 'negative: #6924 - the minicard\'s card is not opened');
|
||||
const atMinicard = keyboard.slice(keyboard.indexOf('function openCardShortcutPopupAtMinicard'), keyboard.indexOf('function openCardShortcutPopupWhenRendered'));
|
||||
assert.match(atMinicard, /Session\.get\('selectedCard'\) \|\| getHoveredCardId\(\)/, 'the same card the other card shortcuts use');
|
||||
const wait = keyboard.slice(keyboard.indexOf('function clickDueDateControlWhenRendered'), keyboard.indexOf('export function openDueDateEditorOfOpenedCard'));
|
||||
assert.match(wait, /if \(Utils\.getCurrentCardId\(\) !== cardId\) return;/,
|
||||
'negative: stops when another card was opened meanwhile - never clicks for a card no longer open');
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
'use strict';
|
||||
// i18next 27 changed `returnEmptyString` to default false: an empty translation
|
||||
// falls back like a missing one, to the KEY. en.i18n.json keeps some values
|
||||
// empty on purpose - "comment-placeholder" (the description and comment
|
||||
// editors have no placeholder) and Blockly's empty suffixes - so after the
|
||||
// i18next 27 update the editor showed the text "comment-placeholder" (#6921).
|
||||
// This runs the real __() from imports/i18n/tap.js with the init() options
|
||||
// read from that same file, so dropping `returnEmptyString: true` fails here.
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const vm = require('node:vm');
|
||||
const test = require('node:test');
|
||||
const i18next = require('i18next');
|
||||
const sprintf = require('i18next-sprintf-postprocessor');
|
||||
|
||||
const DATA = path.join(__dirname, '..', 'imports', 'i18n', 'data');
|
||||
const source = fs.readFileSync(path.join(__dirname, '..', 'imports', 'i18n', 'tap.js'), 'utf8');
|
||||
const en = JSON.parse(fs.readFileSync(path.join(DATA, 'en.i18n.json'), 'utf8'));
|
||||
const emptyInEnglish = Object.keys(en).filter(k => en[k] === '');
|
||||
|
||||
// The object literal passed to this.i18n.init({...}) in TAPi18n.init().
|
||||
function initOptions() {
|
||||
const start = source.indexOf('await this.i18n.init({');
|
||||
assert.ok(start > 0, 'TAPi18n.init() calls this.i18n.init({...})');
|
||||
let depth = 0;
|
||||
let i = source.indexOf('{', start);
|
||||
const from = i;
|
||||
for (; i < source.length; i++) {
|
||||
if (source[i] === '{') depth++;
|
||||
else if (source[i] === '}' && --depth === 0) break;
|
||||
}
|
||||
return vm.runInNewContext(`(${source.slice(from, i + 1)})`, {
|
||||
DEFAULT_LANGUAGE: 'en', DEFAULT_NAMESPACE: 'translation', process: { env: {} }, languages: {},
|
||||
});
|
||||
}
|
||||
|
||||
function makeTap(resources) {
|
||||
const method = source.slice(source.indexOf(' __(key, options, language) {'), source.lastIndexOf('\n};'));
|
||||
const tap = vm.runInNewContext('({' + method + '})', { DEFAULT_LANGUAGE: 'en' });
|
||||
tap.current = { dep: { depend() {} } };
|
||||
tap.revision = { get() {} };
|
||||
tap.toI18nCode = code => code;
|
||||
tap.i18n = i18next.createInstance().use(sprintf);
|
||||
tap.i18n.init({ ...initOptions(), supportedLngs: false, initImmediate: false, lng: 'fi', resources });
|
||||
return tap;
|
||||
}
|
||||
|
||||
test('the fixture: English really has values that are empty on purpose', () => {
|
||||
assert.ok(emptyInEnglish.includes('comment-placeholder'), 'the editor placeholder is empty in English');
|
||||
assert.ok(emptyInEnglish.length > 1, 'and it is not the only one (Blockly suffixes)');
|
||||
});
|
||||
|
||||
test('TAPi18n.init() keeps an empty translation empty (i18next 27 default is false)', () => {
|
||||
assert.equal(initOptions().returnEmptyString, true);
|
||||
});
|
||||
|
||||
test('an empty translation renders as empty, not as its key (#6921)', () => {
|
||||
const fi = Object.fromEntries(emptyInEnglish.map(k => [k, '']));
|
||||
const tap = makeTap({ en: { translation: en }, fi: { translation: { ...fi, comments: 'Kommentit' } } });
|
||||
for (const key of emptyInEnglish) {
|
||||
assert.equal(tap.__(key, { sprintf: [] }), '', `${key} in the user's language`);
|
||||
assert.equal(tap.__(key, { sprintf: [] }, 'en'), '', `${key} in English`);
|
||||
}
|
||||
});
|
||||
|
||||
test('negative: a missing translation still falls back to English, not to blank or the key', () => {
|
||||
const tap = makeTap({ en: { translation: en }, fi: { translation: { comments: 'Kommentit' } } });
|
||||
assert.equal(tap.__('comments'), 'Kommentit');
|
||||
assert.equal(tap.__('comment'), en.comment, 'a key the language lacks shows English');
|
||||
assert.equal(tap.__('no-such-key-6921'), 'no-such-key-6921', 'an unknown key is still the key');
|
||||
});
|
||||
|
||||
test('negative: no language has an empty value where English has text', () => {
|
||||
// With returnEmptyString:true such a value would render blank instead of
|
||||
// falling back to English, so none may exist.
|
||||
const blank = [];
|
||||
for (const file of fs.readdirSync(DATA).filter(f => f.endsWith('.i18n.json'))) {
|
||||
const strings = JSON.parse(fs.readFileSync(path.join(DATA, file), 'utf8'));
|
||||
for (const [key, value] of Object.entries(strings)) {
|
||||
if (value === '' && en[key] !== '' && key in en) blank.push(`${file}: ${key}`);
|
||||
}
|
||||
}
|
||||
assert.deepEqual(blank, []);
|
||||
});
|
||||
|
||||
test('every language leaves the editor placeholder empty, as English does', () => {
|
||||
// A non-empty value here is not a translation of anything: lb had
|
||||
// "Optioun: " and haw "Ma ka ʻōlelo Hawaiʻi: " for an empty English source.
|
||||
const filled = [];
|
||||
for (const file of fs.readdirSync(DATA).filter(f => f.endsWith('.i18n.json'))) {
|
||||
const strings = JSON.parse(fs.readFileSync(path.join(DATA, file), 'utf8'));
|
||||
if ('comment-placeholder' in strings && strings['comment-placeholder'] !== '') filled.push(file);
|
||||
}
|
||||
assert.deepEqual(filled, []);
|
||||
});
|
||||
@@ -0,0 +1,93 @@
|
||||
'use strict';
|
||||
// #6919: a checklist folded on a minicard unfolded half a second later. The
|
||||
// fold was stored; the client never saw it, because its copy of the current
|
||||
// user's profile had shrunk to a few fields. DDP merges only top-level fields,
|
||||
// and Meteor re-runs named subscriptions before the accounts publication of the
|
||||
// whole profile on every login, a reconnect included - so a publication that
|
||||
// sent the current user `profile.fullname` / `.avatarUrl` / ... or
|
||||
// `profile.showDesktopDragHandles` won, and every preference in the profile
|
||||
// went back to its default until a reload (#6691 found the same for the board
|
||||
// view). This test finds every users query with profile subfields in a server
|
||||
// file that publishes, anywhere, and requires it to leave the current user out.
|
||||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
const read = rel => fs.readFileSync(path.join(root, rel), 'utf8');
|
||||
const { notCurrentUser } = require('../server/lib/notCurrentUser');
|
||||
|
||||
test('notCurrentUser keeps the selector and leaves out only the current user', () => {
|
||||
assert.deepEqual(notCurrentUser({ _id: { $in: ['a', 'b'] } }, 'me'),
|
||||
{ $and: [{ _id: { $in: ['a', 'b'] } }, { _id: { $ne: 'me' } }] });
|
||||
assert.deepEqual(notCurrentUser({ username: 'x' }, null), { username: 'x' }, 'no user, nothing to leave out');
|
||||
assert.deepEqual(notCurrentUser(undefined, 'me'), { $and: [{}, { _id: { $ne: 'me' } }] });
|
||||
});
|
||||
|
||||
function serverFiles(dir) {
|
||||
const out = [];
|
||||
for (const entry of fs.readdirSync(path.join(root, dir), { withFileTypes: true })) {
|
||||
const rel = path.join(dir, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
if (!['tests', 'node_modules'].includes(entry.name) && !entry.name.startsWith('_build')) out.push(...serverFiles(rel));
|
||||
} else if (entry.name.endsWith('.js')) out.push(rel);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// The text of a call from its opening parenthesis to the matching one.
|
||||
function callText(src, open) {
|
||||
let depth = 0;
|
||||
for (let i = open; i < src.length; i++) {
|
||||
if (src[i] === '(') depth++;
|
||||
else if (src[i] === ')' && --depth === 0) return src.slice(open, i + 1);
|
||||
}
|
||||
return src.slice(open);
|
||||
}
|
||||
|
||||
// Publications that send the current user's preference under a top-level
|
||||
// field of their own, never as `profile` (see their comments).
|
||||
const REMAPPED = new Set(['server/publications/userBoardView.js', 'server/publications/userDesktopDragHandles.js']);
|
||||
|
||||
test('negative: no publication sends the current user a narrow profile', () => {
|
||||
const offenders = [];
|
||||
let checked = 0;
|
||||
for (const file of serverFiles('server')) {
|
||||
const src = read(file);
|
||||
if (!/Meteor\.publish\(|publishComposite\(/.test(src) || REMAPPED.has(file)) continue;
|
||||
for (const m of src.matchAll(/(?:ReactiveCache\.getUsers|Meteor\.users\.find|Users\.find)\(/g)) {
|
||||
const call = callText(src, m.index + m[0].length - 1);
|
||||
if (!/'profile\.[A-Za-z]+'\s*:|Users\.safeFields/.test(call)) continue;
|
||||
checked++;
|
||||
// Either form: notCurrentUser() in the selector, or the id list built
|
||||
// just above it without the current user (boards.js, before this test).
|
||||
const before = src.slice(Math.max(0, m.index - 400), m.index);
|
||||
if (/notCurrentUser\(/.test(call) || /!==\s*thisUserId/.test(call) || /=>\s*[^;]*!==\s*thisUserId\)\)?\]?;?\s*\n[\s\S]*$/.test(before)) continue;
|
||||
offenders.push(`${file}:${src.slice(0, m.index).split('\n').length}`);
|
||||
}
|
||||
}
|
||||
assert.ok(checked >= 9, `the scan found the narrow-profile user queries (${checked})`);
|
||||
assert.deepEqual(offenders, [], 'each must leave the current user out: server/lib/notCurrentUser.js');
|
||||
});
|
||||
|
||||
test('userDesktopDragHandles publishes a top-level field, never profile', () => {
|
||||
const src = read('server/publications/userDesktopDragHandles.js');
|
||||
assert.match(src, /return \{ desktopDragHandlesPreference: typeof value === 'boolean' \? value : null \};/);
|
||||
assert.match(src, /this\.added\('users', id, preference\(fields\)\)/);
|
||||
assert.match(src, /this\.changed\('users', id, preference\(fields\)\)/);
|
||||
assert.doesNotMatch(src.replace(/\/\/.*$/gm, ''), /return Meteor\.users\.find/, 'negative: no plain cursor of profile fields');
|
||||
const utils = read('client/lib/utils.js');
|
||||
const fn = utils.slice(utils.indexOf('dragHandlesPreference() {'), utils.indexOf('return readDragHandlesPreference(stored);'));
|
||||
assert.match(fn, /currentUserWith\(\['profile\.showDesktopDragHandles', 'desktopDragHandlesPreference'\]\)/);
|
||||
assert.match(fn, /fromProfile !== undefined \? fromProfile : currentUser\.desktopDragHandlesPreference/);
|
||||
});
|
||||
|
||||
test('the current user\'s own row keeps its columns: user-admin publishes them', () => {
|
||||
const src = read('server/publications/users.js');
|
||||
const admin = src.slice(src.indexOf("Meteor.publish('user-admin'"), src.indexOf("Meteor.publish('user-authenticationMethod'"));
|
||||
for (const field of ['isAdmin', 'teams', 'orgs', 'authenticationMethod', 'createdAt', 'loginDisabled', 'lastConnectionDate', 'importUsernames']) {
|
||||
assert.match(admin, new RegExp(`${field}: 1`), field);
|
||||
}
|
||||
assert.match(admin, /Meteor\.users\.find\(this\.userId,/, 'own document only');
|
||||
});
|
||||
@@ -138,6 +138,15 @@ test.describe('Card members & description', () => {
|
||||
// The description form inside: .js-new-description with form.js-new-description-form
|
||||
const descForm = cp.root.locator('.js-card-description, .js-new-description').first();
|
||||
await expect(descForm).toBeVisible({ timeout: 6_000 });
|
||||
|
||||
// #6921: the placeholder is empty in en.i18n.json on purpose. i18next 27
|
||||
// turned an empty translation into its key, so the editor showed the
|
||||
// text "comment-placeholder"; it has no placeholder text at all.
|
||||
const editor = descForm.locator('textarea.editor').first();
|
||||
await expect(editor).toBeVisible({ timeout: 6_000 });
|
||||
const placeholder = await editor.getAttribute('placeholder');
|
||||
expect(placeholder || '').not.toContain('comment-placeholder');
|
||||
expect(placeholder || '').toBe('');
|
||||
} else {
|
||||
console.log('Note: description pencil-open trigger not found');
|
||||
await expect(cp.root).toBeVisible({ timeout: 3_000 });
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
const { test, expect } = require('../fixtures');
|
||||
const db = require('../helpers/db');
|
||||
const { solidPng } = require('../helpers/images');
|
||||
|
||||
test('normalized upload names retain their attachment, bytes and card display', async ({ request, user, board, boardPage: page }) => {
|
||||
const png = await solidPng(page, 20, 20, '#3366aa');
|
||||
const card = db.findOne('cards', { boardId: board.boardId, title: 'Alpha Card' });
|
||||
const headers = { Authorization: `Bearer ${user.token}` };
|
||||
for (const fileName of ['short.png', 'a'.repeat(37) + '.png', 'wrong-extension.txt']) {
|
||||
const query = new URLSearchParams({
|
||||
boardId: board.boardId, swimlaneId: board.swimlaneId,
|
||||
listId: card.listId, cardId: card._id, fileName, fileType: 'image/png',
|
||||
});
|
||||
const response = await request.post(`/api/attachment/upload?${query}`, {
|
||||
headers: { ...headers, 'Content-Type': 'application/octet-stream' }, data: png,
|
||||
});
|
||||
expect(response.status()).toBe(200);
|
||||
const { success, attachmentId } = await response.json();
|
||||
expect(success).toBe(true);
|
||||
const name = fileName.endsWith('.txt') ? 'wrong-extension.png'
|
||||
: fileName.length > 30 ? `${fileName.slice(0, 26)}.png` : fileName;
|
||||
await expect.poll(() => {
|
||||
const stored = db.findOne('attachments', { _id: attachmentId });
|
||||
return stored && { name: stored.name, matchingPaths: stored.path === stored.versions.original.path };
|
||||
}).toEqual({ name, matchingPaths: true });
|
||||
|
||||
const metadata = await request.get(`/api/attachment/info/${attachmentId}`, { headers });
|
||||
expect(metadata.status()).toBe(200);
|
||||
const download = await request.get(`/api/attachment/download/${attachmentId}?raw=1`, { headers });
|
||||
expect(download.status()).toBe(200);
|
||||
expect(await download.body()).toEqual(png);
|
||||
|
||||
await page.reload();
|
||||
await page.locator('.minicard', { hasText: 'Alpha Card' }).first().locator('.minicard-title').click();
|
||||
await expect(page.locator(`img.attachment-thumbnail[title="${name}"]`)).toBeVisible();
|
||||
expect(db.findOne('attachments', { _id: attachmentId })).not.toBeNull();
|
||||
}
|
||||
});
|
||||
@@ -87,19 +87,26 @@ test.describe('#6750 due date keyboard shortcut', () => {
|
||||
});
|
||||
|
||||
// #6755: "d" did nothing until the card was opened. On a hovered minicard it
|
||||
// opens that card and its Due date editor.
|
||||
test('d on a hovered minicard opens the card and its Due date editor (#6755)', async ({ page, user, board }) => {
|
||||
// opens its Due date editor - and #6924: ONLY the editor, next to the
|
||||
// minicard, as a click on the minicard's date does. The card stays closed.
|
||||
test('d on a hovered minicard opens only its Due date editor, not the card (#6755, #6924)', async ({ page, user, board }) => {
|
||||
// #6755: a user whose profile has no keyboardShortcuts value has them ON.
|
||||
db.updateOne('users', { _id: user.id }, { $unset: { 'profile.keyboardShortcuts': '' } });
|
||||
const card = db.findOne('cards', { boardId: board.boardId, title: 'Alpha Card' });
|
||||
await loginWithToken(page, user.id, user.token);
|
||||
await openBoard(page, board.boardId, board.slug);
|
||||
const url = page.url();
|
||||
await page.locator('.js-minicard', { hasText: 'Alpha Card' }).first().hover();
|
||||
await page.evaluate(() => document.activeElement && document.activeElement.blur());
|
||||
await page.keyboard.press('d');
|
||||
await expect(page).toHaveURL(new RegExp(`/${card._id}$`));
|
||||
await expect(dueDatePopup(page)).toBeVisible({ timeout: 8_000 });
|
||||
expect(page.url(), 'the card is not opened').toBe(url);
|
||||
await expect(page.locator('.js-card-details')).toHaveCount(0);
|
||||
// The popup edits THIS card's due date.
|
||||
await dueDatePopup(page).locator('.js-calendar-day, .selected-calendar-picker').first().waitFor();
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(dueDatePopup(page)).toHaveCount(0);
|
||||
expect(db.findOne('cards', { _id: card._id }).dueAt || null).toBe(null);
|
||||
});
|
||||
|
||||
// #6840: on a slow server the card's details render a few hundred
|
||||
@@ -160,9 +167,12 @@ test.describe('#6750 due date keyboard shortcut', () => {
|
||||
expect(await page.evaluate(() => document.activeElement?.matches('a.js-minicard[href]')),
|
||||
'the minicard link has the focus').toBe(true);
|
||||
await minicard.hover();
|
||||
const url = page.url();
|
||||
await page.keyboard.press('d');
|
||||
await expect(page).toHaveURL(new RegExp(`/${card._id}$`));
|
||||
await expect(dueDatePopup(page)).toBeVisible({ timeout: 8_000 });
|
||||
// #6924: only the popup; the card stays closed.
|
||||
expect(page.url()).toBe(url);
|
||||
expect(card._id).toBeTruthy();
|
||||
await page.keyboard.press('Escape');
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
'use strict';
|
||||
// #6919: the checklist caret on a minicard folded the checklist and, half a
|
||||
// second later, unfolded it again - the client applied the fold and the
|
||||
// server's answer took it back. The reporter's board is Persian (right to
|
||||
// left), in the Swimlanes view with one shared list header row, and the user
|
||||
// is a member of the cards. Every shape here is a board like that, opened as a
|
||||
// returning user opens it (a page load that logs in from the cookie), and each
|
||||
// fold must still be there seconds later, in the database and on the client.
|
||||
const { test, expect } = require('../fixtures');
|
||||
const db = require('../helpers/db');
|
||||
|
||||
function addChecklist(cardId, boardId, title, items = 3) {
|
||||
const id = db.uid('check');
|
||||
db.insertOne('checklists', { _id: id, cardId, boardId, title, sort: 0,
|
||||
showChecklistAtMinicard: true, createdAt: new Date() });
|
||||
for (let i = 0; i < items; i++) {
|
||||
db.insertOne('checklistItems', { _id: db.uid('item'), checklistId: id, cardId, boardId,
|
||||
title: `${title} ${i + 1}`, sort: i, isFinished: false, createdAt: new Date(), modifiedAt: new Date() });
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
function addSecondLane(board, user) {
|
||||
const lane = db.uid('swim'); const cardId = db.uid('card'); const now = new Date();
|
||||
db.insertOne('swimlanes', { _id: lane, title: 'Second lane', boardId: board.boardId, sort: 2, type: 'swimlane',
|
||||
archived: false, createdAt: now, updatedAt: now, modifiedAt: now });
|
||||
db.insertOne('cards', { _id: cardId, title: 'Second lane card', boardId: board.boardId, swimlaneId: lane,
|
||||
listId: board.listIds[0], sort: 0, archived: false, userId: user.id, members: [user.id],
|
||||
type: 'cardType-card', createdAt: now, modifiedAt: now, dateLastActivity: now });
|
||||
return cardId;
|
||||
}
|
||||
|
||||
const alpha = board => db.findOne('cards', { boardId: board.boardId, title: 'Alpha Card' });
|
||||
|
||||
// Each returns the minicard to click on and the checklist shown on it.
|
||||
const shapes = {
|
||||
'the reporter\'s card': ({ board, user }) => {
|
||||
const card = alpha(board);
|
||||
db.updateOne('cards', { _id: card._id }, { $set: { members: [user.id] } });
|
||||
const checklistId = addChecklist(card._id, board.boardId, 'Group 1', 4);
|
||||
addChecklist(card._id, board.boardId, 'Group 2', 5);
|
||||
return { cardId: card._id, title: 'Group 1', checklistId };
|
||||
},
|
||||
'the second of two checklists': ({ board }) => {
|
||||
const card = alpha(board);
|
||||
addChecklist(card._id, board.boardId, 'Group 1');
|
||||
const checklistId = addChecklist(card._id, board.boardId, 'Group 2', 5);
|
||||
return { cardId: card._id, title: 'Group 2', checklistId };
|
||||
},
|
||||
'a linked card': ({ board }) => {
|
||||
const card = alpha(board);
|
||||
const checklistId = addChecklist(card._id, board.boardId, 'Group 1');
|
||||
const linkedId = db.uid('link');
|
||||
db.insertOne('cards', { ...card, _id: linkedId, listId: board.listIds[1], linkedId: card._id,
|
||||
type: 'cardType-linkedCard', title: 'Linked Alpha', sort: 50 });
|
||||
return { cardId: linkedId, title: 'Group 1', checklistId };
|
||||
},
|
||||
'a user with many earlier folds': ({ board, user }) => {
|
||||
const card = alpha(board);
|
||||
const checklistId = addChecklist(card._id, board.boardId, 'Group 1');
|
||||
const folds = {};
|
||||
for (let i = 0; i < 300; i++) folds[db.uid('old')] = { 'checklist-old': true, labels: false };
|
||||
db.updateOne('users', { _id: user.id }, { $set: { 'profile.collapsedCardSections': folds } });
|
||||
return { cardId: card._id, title: 'Group 1', checklistId, earlierFolds: 300 };
|
||||
},
|
||||
'one shared list header row, first swimlane': ({ board, user }) => {
|
||||
db.updateOne('users', { _id: user.id }, { $set: { 'profile.boardView': 'board-view-swimlanes' } });
|
||||
db.updateOne('boards', { _id: board.boardId }, { $set: { sharedListHeaders: true } });
|
||||
const card = alpha(board);
|
||||
const checklistId = addChecklist(card._id, board.boardId, 'Group 1');
|
||||
addSecondLane(board, user);
|
||||
return { cardId: card._id, title: 'Group 1', checklistId };
|
||||
},
|
||||
'one shared list header row, second swimlane': ({ board, user }) => {
|
||||
db.updateOne('users', { _id: user.id }, { $set: { 'profile.boardView': 'board-view-swimlanes' } });
|
||||
db.updateOne('boards', { _id: board.boardId }, { $set: { sharedListHeaders: true } });
|
||||
const cardId = addSecondLane(board, user);
|
||||
const checklistId = addChecklist(cardId, board.boardId, 'Group 1');
|
||||
return { cardId, title: 'Group 1', checklistId };
|
||||
},
|
||||
};
|
||||
|
||||
async function expectFold(page, caret, items, folded, count) {
|
||||
await expect(caret).toHaveAttribute('aria-expanded', folded ? 'false' : 'true');
|
||||
await expect(items).toHaveCount(folded ? 0 : count);
|
||||
// The server's answer arrives after the click: the fold must survive it.
|
||||
await page.waitForTimeout(2500);
|
||||
await expect(caret, 'the server did not take the fold back')
|
||||
.toHaveAttribute('aria-expanded', folded ? 'false' : 'true');
|
||||
}
|
||||
|
||||
for (const [shape, setup] of Object.entries(shapes)) {
|
||||
for (const reconnect of [false, true]) {
|
||||
test(`minicard checklist caret: ${shape}${reconnect ? ', after a reconnect' : ''} (#6919)`, async ({ boardPage: page, board, user }) => {
|
||||
db.updateOne('users', { _id: user.id }, { $set: { 'profile.language': 'fa' } });
|
||||
const { cardId, title, checklistId, earlierFolds } = setup({ board, user });
|
||||
const count = db.countDocuments('checklistItems', { checklistId });
|
||||
|
||||
await page.reload();
|
||||
if (reconnect) {
|
||||
// The connection drops and comes back (sleep, a network change, a
|
||||
// server restart), and the client logs in again on the new one.
|
||||
await expect.poll(() => page.evaluate(() => !!window.Meteor?.userId())).toBe(true);
|
||||
await page.evaluate(() => { window.Meteor.disconnect(); window.Meteor.reconnect(); });
|
||||
await expect.poll(() => page.evaluate(() =>
|
||||
window.Meteor.status().connected && !!window.Meteor.userId() && !window.Meteor.loggingIn())).toBe(true);
|
||||
}
|
||||
const minicard = page.locator(`.js-minicard[data-card-id="${cardId}"]`).first();
|
||||
const group = minicard.locator('.minicard-checklist').filter({ hasText: title }).first();
|
||||
const caret = group.locator('.js-collapse-checklist');
|
||||
const items = group.locator('.js-checklist-item');
|
||||
await expectFold(page, caret, items, false, count);
|
||||
|
||||
await caret.click();
|
||||
await expectFold(page, caret, items, true, count);
|
||||
const key = `checklist-${checklistId}`;
|
||||
const stored = db.findOne('users', { _id: user.id }).profile.collapsedCardSections;
|
||||
expect(stored[cardId][key]).toBe(true);
|
||||
expect(await page.evaluate(([c, k]) =>
|
||||
window.Meteor.user().profile.collapsedCardSections?.[c]?.[k], [cardId, key])).toBe(true);
|
||||
// Folding keeps the user's other folds, and does not open the card.
|
||||
if (earlierFolds) expect(Object.keys(stored)).toHaveLength(earlierFolds + 1);
|
||||
await expect(page.locator('.card-details')).toHaveCount(0);
|
||||
|
||||
await caret.click();
|
||||
await expectFold(page, caret, items, false, count);
|
||||
|
||||
// Folded again, it stays folded across another page load.
|
||||
await caret.click();
|
||||
await expectFold(page, caret, items, true, count);
|
||||
await page.reload();
|
||||
await expect(caret).toHaveAttribute('aria-expanded', 'false');
|
||||
await expect(items).toHaveCount(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -48,9 +48,11 @@ test.describe('#6904 Move and Copy card keyboard shortcuts', () => {
|
||||
expect(db.getCard(card._id).archived).not.toBe(true);
|
||||
|
||||
await page.goto('/shortcuts');
|
||||
const items = page.locator('.shortcuts-list-item');
|
||||
await expect(items.filter({ hasText: 'Move Card' })).toHaveCount(1);
|
||||
await expect(items.filter({ hasText: 'Copy Card' })).toHaveCount(1);
|
||||
// Exact action text: "Move Card to Archive" (the c shortcut) also contains
|
||||
// "Move Card", so a substring match counted two.
|
||||
const actions = page.locator('.shortcuts-list-item .shortcuts-list-item-action');
|
||||
await expect(actions.filter({ hasText: /^\s*Move Card\s*$/ })).toHaveCount(1);
|
||||
await expect(actions.filter({ hasText: /^\s*Copy Card\s*$/ })).toHaveCount(1);
|
||||
});
|
||||
|
||||
test('negative: nothing opens when keyboard shortcuts are disabled', async ({ page, user, board }) => {
|
||||
@@ -85,4 +87,63 @@ test.describe('#6904 Move and Copy card keyboard shortcuts', () => {
|
||||
await page.keyboard.press('Shift+C');
|
||||
await expect(picker(page)).toBeVisible({ timeout: 8_000 });
|
||||
});
|
||||
|
||||
// #6924: the shortcut opens ONLY its popup. On an opened card, the hamburger
|
||||
// menu is not shown first; on a hovered minicard, the card is not opened.
|
||||
const cardMenu = page => page.locator('.js-pop-over .pop-over-list .js-move-card, .js-pop-over .pop-over-list .js-copy-card');
|
||||
|
||||
test('on an opened card, Shift+M opens Move card without showing the card menu (#6924)', async ({ page, user, board }) => {
|
||||
await openAlphaCard(page, user, board, true);
|
||||
await page.keyboard.press('Shift+M');
|
||||
await expect(picker(page)).toBeVisible({ timeout: 8_000 });
|
||||
await expect(cardMenu(page)).toHaveCount(0);
|
||||
await expect(page.locator('.js-pop-over')).toHaveCount(1);
|
||||
});
|
||||
|
||||
async function hoverAlpha(page, who, board, shortcutsOn = true) {
|
||||
db.updateOne('users', { _id: who.id }, { $set: { 'profile.keyboardShortcuts': shortcutsOn } });
|
||||
await loginWithToken(page, who.id, who.token);
|
||||
await openBoard(page, board.boardId, board.slug);
|
||||
await page.locator('.js-minicard', { hasText: 'Alpha Card' }).first().hover();
|
||||
await page.evaluate(() => document.activeElement && document.activeElement.blur());
|
||||
return page.url();
|
||||
}
|
||||
|
||||
test('on a hovered minicard, Shift+M and Shift+C open only their popup, and the card stays closed (#6924)', async ({ page, user, board }) => {
|
||||
const url = await hoverAlpha(page, user, board);
|
||||
await page.keyboard.press('Shift+M');
|
||||
await expect(picker(page)).toBeVisible({ timeout: 8_000 });
|
||||
await expect(picker(page).locator('#move-card-title')).toHaveValue('Alpha Card');
|
||||
expect(page.url(), 'the card is not opened').toBe(url);
|
||||
await expect(page.locator('.js-card-details')).toHaveCount(0);
|
||||
await expect(cardMenu(page)).toHaveCount(0);
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(picker(page)).toHaveCount(0);
|
||||
|
||||
await page.locator('.js-minicard', { hasText: 'Alpha Card' }).first().hover();
|
||||
await page.evaluate(() => document.activeElement && document.activeElement.blur());
|
||||
await page.keyboard.press('Shift+C');
|
||||
await expect(picker(page)).toBeVisible({ timeout: 8_000 });
|
||||
await expect(picker(page).locator('#copy-card-title')).toHaveValue('Alpha Card');
|
||||
expect(page.url()).toBe(url);
|
||||
await expect(page.locator('.js-card-details')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('negative: on a hovered minicard, a member who is not a board admin gets no Move card (#6924)', async ({ page, user2, board }) => {
|
||||
db.addBoardMember({ boardId: board.boardId, userId: user2.id, isAdmin: false });
|
||||
const url = await hoverAlpha(page, user2, board);
|
||||
await page.keyboard.press('Shift+M');
|
||||
await page.waitForTimeout(1500);
|
||||
await expect(page.locator('.js-pop-over')).toHaveCount(0);
|
||||
expect(page.url()).toBe(url);
|
||||
});
|
||||
|
||||
test('negative: on a hovered minicard, nothing opens when keyboard shortcuts are disabled (#6924)', async ({ page, user, board }) => {
|
||||
const url = await hoverAlpha(page, user, board, false);
|
||||
await page.keyboard.press('Shift+M');
|
||||
await page.keyboard.press('Shift+C');
|
||||
await page.waitForTimeout(800);
|
||||
await expect(page.locator('.js-pop-over')).toHaveCount(0);
|
||||
expect(page.url()).toBe(url);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,136 @@
|
||||
'use strict';
|
||||
|
||||
const { test, expect } = require('../fixtures');
|
||||
const db = require('../helpers/db');
|
||||
const { solidPng } = require('../helpers/images');
|
||||
const CardPage = require('../pages/CardPage');
|
||||
|
||||
const headers = token => ({ Authorization: `Bearer ${token}` });
|
||||
const cardPath = card => `/api/boards/${card.boardId}/lists/${card.listId}/cards/${card._id}`;
|
||||
|
||||
test.afterEach(async ({ board }) => {
|
||||
db.deleteMany('changeHistory', { boardId: board.boardId });
|
||||
});
|
||||
|
||||
for (const bulk of [false, true]) {
|
||||
test(`${bulk ? 'bulk' : 'single'} card deletion soft-deletes its attachments and keeps other cards' files`, async ({ request, user, user2, board, boardPage: page }) => {
|
||||
const card = db.findOne('cards', { boardId: board.boardId, title: 'Alpha Card' });
|
||||
const sibling = db.findOne('cards', { boardId: board.boardId, title: 'Beta Card' });
|
||||
const png = await solidPng(page, 16, 16, '#3366aa');
|
||||
async function upload(target, name) {
|
||||
const query = new URLSearchParams({
|
||||
boardId: board.boardId, swimlaneId: board.swimlaneId,
|
||||
listId: target.listId, cardId: target._id, fileName: name, fileType: 'image/png',
|
||||
});
|
||||
const response = await request.post(`/api/attachment/upload?${query}`, {
|
||||
headers: { ...headers(user.token), 'Content-Type': 'application/octet-stream' }, data: png,
|
||||
});
|
||||
expect(response.status()).toBe(200);
|
||||
const { attachmentId } = await response.json();
|
||||
const download = await request.get(`/api/attachment/download/${attachmentId}?raw=1`, { headers: headers(user.token) });
|
||||
expect(download.status()).toBe(200);
|
||||
expect(await download.body()).toEqual(png);
|
||||
return attachmentId;
|
||||
}
|
||||
const attachmentId = await upload(card, 'removed.png');
|
||||
const alreadyDeletedId = await upload(card, 'earlier.png');
|
||||
const siblingId = await upload(sibling, 'retained.png');
|
||||
const earlierDelete = await request.delete(`/api/attachment/delete/${alreadyDeletedId}`, { headers: headers(user.token) });
|
||||
expect(earlierDelete.status()).toBe(200);
|
||||
const alreadyDeleted = db.findOne('attachments', { _id: alreadyDeletedId });
|
||||
expect(alreadyDeleted.deletedAt).toBeTruthy();
|
||||
const before = db.findOne('attachments', { _id: attachmentId });
|
||||
const otherBefore = db.findOne('attachments', { _id: siblingId });
|
||||
db.updateOne('cards', { _id: card._id }, { $set: { coverId: attachmentId } });
|
||||
|
||||
// Rejected requests must not reach the attachment cascade.
|
||||
const route = bulk ? `/api/boards/${board.boardId}/cards/bulk` : cardPath(card);
|
||||
const data = bulk ? { cardIds: [card._id] } : undefined;
|
||||
const denied = await request.delete(route, { headers: headers(user2.token), data });
|
||||
expect(denied.status()).toBe(403);
|
||||
if (!bulk) {
|
||||
const wrongList = await request.delete(cardPath({ ...card, listId: sibling.listId }), { headers: headers(user.token) });
|
||||
expect(wrongList.status()).toBe(404);
|
||||
}
|
||||
expect(db.findOne('attachments', { _id: attachmentId })).toEqual(before);
|
||||
|
||||
await page.locator('.minicard', { hasText: 'Alpha Card' }).first().locator('.minicard-title').click();
|
||||
await expect(page.locator('img.attachment-thumbnail[title="removed.png"]')).toBeVisible();
|
||||
const response = await request.delete(route, { headers: headers(user.token), data });
|
||||
expect(response.status()).toBe(200);
|
||||
expect(await response.json()).toEqual(bulk ? { deleted: [card._id], notFound: [] } : { _id: card._id });
|
||||
expect(db.findOne('cards', { _id: card._id })).toBeNull();
|
||||
const deleted = db.findOne('attachments', { _id: attachmentId });
|
||||
expect(deleted).toMatchObject({ deletedBy: user.id, meta: before.meta, versions: before.versions });
|
||||
expect(deleted.deletedAt).toBeTruthy();
|
||||
expect(deleted.deleteBatchId).toBeTruthy();
|
||||
expect(db.findOne('attachments', { _id: alreadyDeletedId })).toEqual(alreadyDeleted);
|
||||
expect(db.findOne('attachments', { _id: siblingId })).toEqual(otherBefore);
|
||||
expect(db.countDocuments('changeHistory', { entityType: 'attachment', entityId: attachmentId, changeType: 'removed', userId: user.id })).toBe(1);
|
||||
expect(db.countDocuments('activities', { attachmentId, activityType: 'deleteAttachment' })).toBe(1);
|
||||
|
||||
const list = await request.get(`/api/attachment/list/${board.boardId}`, { headers: headers(user.token) });
|
||||
expect(list.status()).toBe(200);
|
||||
expect((await list.json()).attachments.map(a => a.attachmentId)).toEqual([siblingId]);
|
||||
// Soft-deleted files remain readable for history/recovery; only active
|
||||
// attachment listings must stop returning them.
|
||||
const retained = await request.get(`/api/attachment/download/${attachmentId}?raw=1`, { headers: headers(user.token) });
|
||||
expect(retained.status()).toBe(200);
|
||||
expect(await retained.body()).toEqual(png);
|
||||
const download = await request.get(`/api/attachment/download/${siblingId}?raw=1`, { headers: headers(user.token) });
|
||||
expect(download.status()).toBe(200);
|
||||
expect(await download.body()).toEqual(png);
|
||||
await page.reload();
|
||||
await expect(page.locator('.minicard', { hasText: 'Alpha Card' })).toHaveCount(0);
|
||||
await page.locator('.minicard', { hasText: 'Beta Card' }).first().locator('.minicard-title').click();
|
||||
await expect(page.locator('img.attachment-thumbnail[title="retained.png"]')).toBeVisible();
|
||||
});
|
||||
}
|
||||
|
||||
test('deleting a card through its UI soft-deletes uploaded attachments and preserves sibling files', async ({ request, user, board, boardPage: page }) => {
|
||||
const details = new CardPage(page);
|
||||
const card = db.findOne('cards', { boardId: board.boardId, title: 'Alpha Card' });
|
||||
const sibling = db.findOne('cards', { boardId: board.boardId, title: 'Beta Card' });
|
||||
const png = await solidPng(page, 16, 16, '#3366aa');
|
||||
async function upload(target, name) {
|
||||
await page.locator('.minicard', { hasText: target.title }).first().locator('.minicard-title').click();
|
||||
await details.waitForOpen();
|
||||
await details.openAttachmentPanel();
|
||||
await page.locator('.js-pop-over input.js-attach-file').setInputFiles({ name, mimeType: 'image/png', buffer: png });
|
||||
await expect(details.root.locator(`img.attachment-thumbnail[title="${name}"]`)).toBeVisible();
|
||||
await expect.poll(() => db.countDocuments('attachments', { 'meta.cardId': target._id, name })).toBe(1);
|
||||
const attachment = db.findOne('attachments', { 'meta.cardId': target._id, name });
|
||||
const download = await request.get(`/api/attachment/download/${attachment._id}?raw=1`, { headers: headers(user.token) });
|
||||
expect(download.status()).toBe(200);
|
||||
expect(await download.body()).toEqual(png);
|
||||
return attachment;
|
||||
}
|
||||
const otherBefore = await upload(sibling, 'retained.png');
|
||||
await details.close();
|
||||
const before = await upload(card, 'removed.png');
|
||||
await details.openActionsMenu();
|
||||
await details.clickAction('.js-more');
|
||||
await details.clickAction('.js-delete');
|
||||
await page.locator('.js-pop-over button.js-confirm').click();
|
||||
|
||||
await expect.poll(() => db.findOne('cards', { _id: card._id })).toBeNull();
|
||||
await expect(page.locator('.minicard', { hasText: 'Alpha Card' })).toHaveCount(0);
|
||||
await expect(details.root).toBeHidden();
|
||||
const deleted = db.findOne('attachments', { _id: before._id });
|
||||
expect(deleted).toMatchObject({ deletedBy: user.id, meta: before.meta, versions: before.versions });
|
||||
expect(deleted.deletedAt).toBeTruthy();
|
||||
expect(deleted.deleteBatchId).toBeTruthy();
|
||||
expect(db.findOne('attachments', { _id: otherBefore._id })).toEqual(otherBefore);
|
||||
expect(db.countDocuments('changeHistory', { entityType: 'attachment', entityId: before._id, changeType: 'removed', userId: user.id })).toBe(1);
|
||||
expect(db.countDocuments('activities', { attachmentId: before._id, activityType: 'deleteAttachment' })).toBe(1);
|
||||
const list = await request.get(`/api/attachment/list/${board.boardId}`, { headers: headers(user.token) });
|
||||
expect(list.status()).toBe(200);
|
||||
expect((await list.json()).attachments.map(a => a.attachmentId)).toEqual([otherBefore._id]);
|
||||
const retained = await request.get(`/api/attachment/download/${before._id}?raw=1`, { headers: headers(user.token) });
|
||||
expect(retained.status()).toBe(200);
|
||||
expect(await retained.body()).toEqual(png);
|
||||
await page.reload();
|
||||
await expect(page.locator('.minicard', { hasText: 'Alpha Card' })).toHaveCount(0);
|
||||
await page.locator('.minicard', { hasText: 'Beta Card' }).first().locator('.minicard-title').click();
|
||||
await expect(details.root.locator('img.attachment-thumbnail[title="retained.png"]')).toBeVisible();
|
||||
});
|
||||
@@ -0,0 +1,130 @@
|
||||
'use strict';
|
||||
|
||||
const { test: base, expect } = require('../fixtures');
|
||||
const db = require('../helpers/db');
|
||||
const BoardPage = require('../pages/BoardPage');
|
||||
const CardPage = require('../pages/CardPage');
|
||||
|
||||
const headers = token => ({ Authorization: `Bearer ${token}` });
|
||||
const fieldPath = (boardId, id) => `/api/boards/${boardId}/custom-fields/${id}`;
|
||||
const items = [{ _id: 'first', name: 'First option' }, { _id: 'second', name: 'Second option' }];
|
||||
|
||||
const test = base.extend({
|
||||
dropdown: async ({ request, user, board }, use) => {
|
||||
const response = await request.post(`/api/boards/${board.boardId}/custom-fields`, {
|
||||
headers: headers(user.token),
|
||||
data: { name: 'Priority', type: 'dropdown', settings: { dropdownItems: items }, showOnCard: true },
|
||||
});
|
||||
expect(response.status()).toBe(200);
|
||||
const { _id } = await response.json();
|
||||
try {
|
||||
await use({ id: _id, path: fieldPath(board.boardId, _id) });
|
||||
} finally {
|
||||
db.deleteOne('customFields', { _id });
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
test('renaming dropdown options persists their names without changing siblings or card selections', async ({ request, user, board, dropdown }) => {
|
||||
const card = db.findOne('cards', { boardId: board.boardId, title: 'Alpha Card' });
|
||||
db.updateOne('cards', { _id: card._id }, { $set: { customFields: [{ _id: dropdown.id, value: 'second' }] } });
|
||||
const before = db.getCard(card._id);
|
||||
const expected = items.map(item => ({ ...item }));
|
||||
for (const [index, name] of [[1, 'Renamed option'], [0, 'First renamed'], [1, 'Renamed again']]) {
|
||||
const response = await request.put(`${dropdown.path}/dropdown-items/${items[index]._id}`, {
|
||||
headers: headers(user.token), data: { name },
|
||||
});
|
||||
expect(response.status()).toBe(200);
|
||||
expect(await response.json()).toEqual({ _id: items[index]._id });
|
||||
expected[index].name = name;
|
||||
expect(db.findOne('customFields', { _id: dropdown.id }).settings.dropdownItems).toEqual(expected);
|
||||
const read = await request.get(dropdown.path, { headers: headers(user.token) });
|
||||
expect(read.status()).toBe(200);
|
||||
expect((await read.json()).settings.dropdownItems).toEqual(expected);
|
||||
expect(db.getCard(card._id)).toEqual(before);
|
||||
}
|
||||
});
|
||||
|
||||
test('missing options, missing fields and wrong boards return JSON 404 without mutations', async ({ request, user, board, dropdown }) => {
|
||||
const other = db.seedBoard({ ownerId: user.id });
|
||||
try {
|
||||
const before = db.findOne('customFields', { _id: dropdown.id });
|
||||
for (const path of [
|
||||
`${dropdown.path}/dropdown-items/missing`,
|
||||
`${fieldPath(board.boardId, 'missing-field')}/dropdown-items/second`,
|
||||
`${fieldPath(other.boardId, dropdown.id)}/dropdown-items/second`,
|
||||
]) {
|
||||
const response = await request.put(path, { headers: headers(user.token), data: { name: 'Rejected' } });
|
||||
expect(response.status()).toBe(404);
|
||||
expect(response.headers()['content-type']).toContain('application/json');
|
||||
expect(await response.json()).toEqual({ error: 'Dropdown item not found' });
|
||||
expect(db.findOne('customFields', { _id: dropdown.id })).toEqual(before);
|
||||
}
|
||||
} finally {
|
||||
db.cleanup({ boardIds: [other.boardId] });
|
||||
}
|
||||
});
|
||||
|
||||
test('dropdown renaming preserves write authorization and protected-field restrictions', async ({ request, user, user2, board, dropdown }) => {
|
||||
const path = `${dropdown.path}/dropdown-items/second`;
|
||||
const before = db.findOne('customFields', { _id: dropdown.id });
|
||||
expect((await request.put(path, { data: { name: 'Rejected' } })).status()).toBe(401);
|
||||
expect((await request.put(path, { headers: headers(user2.token), data: { name: 'Rejected' } })).status()).toBe(403);
|
||||
expect(db.findOne('customFields', { _id: dropdown.id })).toEqual(before);
|
||||
const member = db.seedUser();
|
||||
try {
|
||||
db.addBoardMember({ boardId: board.boardId, userId: member.id });
|
||||
const renamed = await request.put(path, { headers: headers(member.token), data: { name: 'Member rename' } });
|
||||
expect(renamed.status()).toBe(200);
|
||||
for (const protection of ['adminOnly', 'readOnly']) {
|
||||
db.updateOne('customFields', { _id: dropdown.id }, { $set: { adminOnly: false, readOnly: false, [protection]: true } });
|
||||
const protectedField = db.findOne('customFields', { _id: dropdown.id });
|
||||
const rejected = await request.put(path, { headers: headers(member.token), data: { name: 'Rejected' } });
|
||||
expect(rejected.ok()).toBe(false);
|
||||
expect(db.findOne('customFields', { _id: dropdown.id })).toEqual(protectedField);
|
||||
const allowed = await request.put(path, { headers: headers(user.token), data: { name: 'Admin rename' } });
|
||||
expect(allowed.status()).toBe(200);
|
||||
expect(db.findOne('customFields', { _id: dropdown.id }).settings.dropdownItems).toEqual([items[0], { ...items[1], name: 'Admin rename' }]);
|
||||
}
|
||||
} finally {
|
||||
db.cleanup({ userIds: [member.id] });
|
||||
}
|
||||
});
|
||||
|
||||
test('URL-encoded option IDs can be renamed and invalid names remain rejected', async ({ request, user, dropdown }) => {
|
||||
const id = 'option / % +';
|
||||
db.updateOne('customFields', { _id: dropdown.id }, { $set: { 'settings.dropdownItems.1._id': id } });
|
||||
const path = `${dropdown.path}/dropdown-items/${encodeURIComponent(id)}`;
|
||||
const renamed = await request.put(path, { headers: headers(user.token), data: { name: 'Encoded option' } });
|
||||
expect(renamed.status()).toBe(200);
|
||||
expect(await renamed.json()).toEqual({ _id: id });
|
||||
const before = db.findOne('customFields', { _id: dropdown.id });
|
||||
expect(before.settings.dropdownItems).toEqual([items[0], { _id: id, name: 'Encoded option' }]);
|
||||
const rejected = await request.put(path, { headers: headers(user.token), data: { name: '' } });
|
||||
expect(rejected.ok()).toBe(false);
|
||||
expect(db.findOne('customFields', { _id: dropdown.id })).toEqual(before);
|
||||
});
|
||||
|
||||
test('renamed dropdown choices appear on the card while retaining the selected option', async ({ request, user, board, dropdown, boardPage: page }) => {
|
||||
const card = db.findOne('cards', { boardId: board.boardId, title: 'Alpha Card' });
|
||||
db.updateOne('cards', { _id: card._id }, { $set: { customFields: [{ _id: dropdown.id, value: 'second' }] } });
|
||||
await new BoardPage(page).clickCard(board.listIds[0], 'Alpha Card');
|
||||
const cardPage = new CardPage(page);
|
||||
await cardPage.waitForOpen();
|
||||
const section = cardPage.root.locator('.card-details-group-custom-fields');
|
||||
await expect(section).toContainText('Second option');
|
||||
const response = await request.put(`${dropdown.path}/dropdown-items/second`, {
|
||||
headers: headers(user.token), data: { name: 'Renamed option' },
|
||||
});
|
||||
expect(response.status()).toBe(200);
|
||||
await page.reload();
|
||||
await new BoardPage(page).clickCard(board.listIds[0], 'Alpha Card');
|
||||
await cardPage.waitForOpen();
|
||||
await expect(section).toContainText('Renamed option');
|
||||
await section.locator('a.js-edit-card-custom-field-value').click();
|
||||
const select = section.locator('.js-card-customfield-dropdown select');
|
||||
await expect(select.locator('option[value="first"]')).toHaveText('First option');
|
||||
await expect(select.locator('option[value="second"]')).toHaveText('Renamed option');
|
||||
await expect(select).toHaveValue('second');
|
||||
expect(db.getCard(card._id).customFields).toEqual([{ _id: dropdown.id, value: 'second' }]);
|
||||
});
|
||||
@@ -0,0 +1,93 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const vm = require('node:vm');
|
||||
const { test } = require('node:test');
|
||||
|
||||
const route = '/api/boards/:boardId/custom-fields/:customFieldId/dropdown-items/:dropdownItemId';
|
||||
const plain = value => JSON.parse(JSON.stringify(value));
|
||||
|
||||
function fixture({ deny = false, fail = false, stale = false } = {}) {
|
||||
const calls = [];
|
||||
const document = { _id: 'field', boardIds: ['board'], settings: {
|
||||
dropdownItems: [{ _id: 'first', name: 'First' }, { _id: 'second', name: 'Second' }],
|
||||
} };
|
||||
let handler;
|
||||
const context = {
|
||||
WebApp: { handlers: Object.fromEntries(['get', 'post', 'put', 'delete'].map(verb => [verb, (url, fn) => {
|
||||
if (verb === 'put' && url === route) handler = fn;
|
||||
}])) },
|
||||
Authentication: { async checkBoardWriteAccess(userId, boardId) {
|
||||
calls.push(['access', userId, boardId]);
|
||||
if (deny) throw new Error('Forbidden');
|
||||
} },
|
||||
ReactiveCache: { async getCustomField(selector) {
|
||||
calls.push(['read', plain(selector)]);
|
||||
if (selector._id !== document._id || !selector.boardIds.$in.some(id => document.boardIds.includes(id))) return null;
|
||||
return plain(document);
|
||||
} },
|
||||
CustomFields: { direct: { async updateAsync(selector, modifier) {
|
||||
calls.push(['update', plain(selector), plain(modifier)]);
|
||||
if (fail) throw new Error('Update failed');
|
||||
// A concurrent removal/reorder no longer matches the captured index.
|
||||
if (stale) return 0;
|
||||
return 1;
|
||||
} } },
|
||||
sendJsonResult(res, result) { res.responses.push(plain(result)); },
|
||||
};
|
||||
const source = fs.readFileSync(path.join(__dirname, '../server/models/customFields.js'), 'utf8');
|
||||
vm.runInNewContext(source.slice(source.indexOf('WebApp.handlers.get(')), context);
|
||||
assert.equal(typeof handler, 'function');
|
||||
return {
|
||||
calls, document,
|
||||
async rename(params = {}, body = { name: 'Renamed' }, res = { responses: [] }) {
|
||||
await handler({ userId: 'member', params: { boardId: 'board', customFieldId: 'field', dropdownItemId: 'second', ...params }, body }, res);
|
||||
assert.equal(res.responses.length, 1);
|
||||
return res.responses[0];
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
test('rename uses an explicit index and changes only the name, guarded by the option ID at that index', async () => {
|
||||
for (const [index, id] of ['first', 'second'].entries()) {
|
||||
for (const name of ['Renamed', 'Renamed again']) {
|
||||
const f = fixture();
|
||||
assert.deepEqual(await f.rename({ dropdownItemId: id }, { name }), { code: 200, data: { _id: id } });
|
||||
assert.deepEqual(f.calls.at(-1), ['update', {
|
||||
_id: 'field', boardIds: { $in: ['board'] }, [`settings.dropdownItems.${index}._id`]: id,
|
||||
}, { $set: { [`settings.dropdownItems.${index}.name`]: name } }]);
|
||||
assert.equal(f.calls[0][0], 'access');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (const params of [{ dropdownItemId: 'missing' }, { customFieldId: 'missing' }, { boardId: 'other' }]) {
|
||||
test(`unmatched dropdown rename returns 404 without writing: ${JSON.stringify(params)}`, async () => {
|
||||
const f = fixture();
|
||||
assert.deepEqual(await f.rename(params), { code: 404, data: { error: 'Dropdown item not found' } });
|
||||
assert.ok(!f.calls.some(call => call[0] === 'update'));
|
||||
});
|
||||
}
|
||||
|
||||
test('a concurrent removal or reorder returns 404 instead of acknowledging an unmatched update', async () => {
|
||||
const f = fixture({ stale: true });
|
||||
assert.deepEqual(await f.rename(), { code: 404, data: { error: 'Dropdown item not found' } });
|
||||
});
|
||||
|
||||
test('omitting the name retains the existing no-op response without writing', async () => {
|
||||
const f = fixture();
|
||||
assert.deepEqual(await f.rename({}, {}), { code: 200, data: { _id: 'second' } });
|
||||
assert.ok(!f.calls.some(call => call[0] === 'update'));
|
||||
});
|
||||
|
||||
test('authorization runs before reading and database failures never send success', async () => {
|
||||
for (const options of [{ deny: true }, { fail: true }]) {
|
||||
const f = fixture(options);
|
||||
const res = { responses: [] };
|
||||
await assert.rejects(f.rename({}, undefined, res), options.deny ? /Forbidden/ : /Update failed/);
|
||||
assert.deepEqual(res.responses, []);
|
||||
if (options.deny) assert.deepEqual(f.calls, [['access', 'member', 'board']]);
|
||||
}
|
||||
});
|
||||
@@ -42,8 +42,12 @@ check('#1 setAvatarUrl validates the URL scheme at write time', () => {
|
||||
assert.ok(/assertSafeAvatarUrl\(avatarUrl\)/.test(setter), 'setAvatarUrl must validate');
|
||||
const adminSetter = src.slice(src.indexOf('async adminSetAvatarUrl('));
|
||||
assert.ok(/assertSafeAvatarUrl\(avatarUrl\)/.test(adminSetter), 'adminSetAvatarUrl must validate');
|
||||
// the validator must reject a javascript: scheme (only http/https/data:image/local allowed)
|
||||
assert.ok(/scheme === 'http' \|\| scheme === 'https'/.test(src));
|
||||
// the validator must reject a javascript: scheme (only http/https/data:image/local allowed).
|
||||
// The rule moved to models/lib/avatarUrlScheme.js so the Users deny rule can
|
||||
// apply it to a direct client write too (tests/avatarUrlDirectWrite.test.cjs).
|
||||
assert.ok(/require\('\/models\/lib\/avatarUrlScheme'\)/.test(src), 'assertSafeAvatarUrl uses the shared rule');
|
||||
assert.ok(/scheme === 'http' \|\| scheme === 'https'/.test(read('models/lib/avatarUrlScheme.js')));
|
||||
assert.equal(require('../models/lib/avatarUrlScheme').isStorableAvatarUrl('javascript:alert(1)'), false);
|
||||
});
|
||||
|
||||
// ── #2 Trello import source URL stored XSS — SourceBleed ────────────────────
|
||||
|
||||
@@ -34,7 +34,10 @@ console.log(' ok - the first swimlane\'s headers stay at the top');
|
||||
// Negative: the one rule is scoped to the setting, so a board without it is
|
||||
// drawn exactly as before, and no second sticky mechanism exists.
|
||||
const rules = css.slice(css.indexOf('/* #2805: one shared'));
|
||||
assert.match(rules, /\*\/\n\.board-canvas\.shared-list-headers \.js-swimlane:not\(\.is-first-swimlane\) \.list-header \{\s*display: none;\s*\}\s*$/);
|
||||
// `!important` on purpose (#6902): a plain `display: none` lost to the desktop
|
||||
// list header's `display: block !important`, so every swimlane kept its
|
||||
// headers. tests/sharedListRow6902.test.cjs pins why it must win.
|
||||
assert.match(rules, /\*\/\n\.board-canvas\.shared-list-headers \.js-swimlane:not\(\.is-first-swimlane\) \.list-header \{\s*display: none !important;\s*\}\s*$/);
|
||||
assert.doesNotMatch(rules, /position: sticky/);
|
||||
console.log(' ok - only boards with the setting change');
|
||||
console.log('\nsharedListHeaders: all tests passed');
|
||||
@@ -111,3 +111,45 @@ test('the Swimlanes view uses it: lists, empty state, opened list, list drop and
|
||||
assert.match(read('client/components/lists/listBody.jade'), /each \(cardsWithLimit \(idOrNull containerSwimlaneId\)\)/);
|
||||
assert.match(read('models/lists.js'), /return cardSwimlaneId === swimlaneId;/);
|
||||
});
|
||||
|
||||
// The setting's whole point is ONE header row, and a plain `display: none` lost
|
||||
// to the desktop list header layout's `display: block !important`, so every
|
||||
// swimlane kept its headers. Every !important display rule on a .list-header
|
||||
// anywhere in the client CSS must be outranked by the hiding rule.
|
||||
test('the other swimlanes\' list headers stay hidden: the hiding rule outranks every !important header display', () => {
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const root = path.join(__dirname, '..');
|
||||
const css = [];
|
||||
const walk = dir => {
|
||||
for (const e of fs.readdirSync(path.join(root, dir), { withFileTypes: true })) {
|
||||
const rel = path.join(dir, e.name);
|
||||
if (e.isDirectory() && !e.name.startsWith('_build') && e.name !== 'node_modules') walk(rel);
|
||||
else if (e.name.endsWith('.css')) css.push([rel, fs.readFileSync(path.join(root, rel), 'utf8')]);
|
||||
}
|
||||
};
|
||||
walk('client');
|
||||
const specificity = sel => {
|
||||
const s = sel.replace(/:not\(([^)]*)\)/g, ' $1');
|
||||
return (s.match(/#[\w-]+/g) || []).length * 100 + (s.match(/\.[\w-]+|\[[^\]]+\]|:[\w-]+/g) || []).length * 10
|
||||
+ (s.replace(/[.#][\w-]+|\[[^\]]+\]|:[\w-]+/g, ' ').match(/(^|[\s>+~])[a-z][\w-]*/gi) || []).length;
|
||||
};
|
||||
const HIDE = '.board-canvas.shared-list-headers .js-swimlane:not(.is-first-swimlane) .list-header';
|
||||
let hide = null;
|
||||
const rivals = [];
|
||||
for (const [file, src] of css) {
|
||||
for (const m of src.replace(/\/\*[\s\S]*?\*\//g, '').matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
|
||||
const body = m[2];
|
||||
for (const sel of m[1].split(',').map(x => x.trim())) {
|
||||
if (sel === HIDE) hide = body;
|
||||
else if (/\.list-header$/.test(sel) && /display\s*:[^;]*!important/.test(body)) rivals.push([file, sel]);
|
||||
}
|
||||
}
|
||||
}
|
||||
assert.ok(hide, 'the hiding rule exists');
|
||||
assert.match(hide, /display\s*:\s*none\s*!important/, 'it must be !important to beat them');
|
||||
assert.ok(rivals.length >= 1, 'the scan finds the !important header display rules');
|
||||
for (const [file, sel] of rivals) {
|
||||
assert.ok(specificity(HIDE) > specificity(sel), `${file}: "${sel}" (${specificity(sel)}) must not outrank ${specificity(HIDE)}`);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
'use strict';
|
||||
|
||||
// docs/Security/Sandboxes/vscodium/vscodium-sandbox.sh closes the VSCodium
|
||||
// Flatpak to this checkout, with ONE deliberate exception:
|
||||
// --talk-name=org.freedesktop.Flatpak, so `flatpak-spawn --host docker ...`
|
||||
// reaches the host's Docker and build.sh can run Playwright Firefox and WebKit
|
||||
// in the Playwright image when they cannot start inside the sandbox.
|
||||
// WEKAN_SANDBOX_HOST_DOCKER=0 must close that again. This runs the script with
|
||||
// a stub `flatpak` in PATH and checks the arguments it would have passed.
|
||||
// Run: node tests/vscodiumSandboxHostDocker.test.cjs
|
||||
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { spawnSync } = require('child_process');
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
const scriptPath = path.join(root, 'docs/Security/Sandboxes/vscodium/vscodium-sandbox.sh');
|
||||
const readme = fs.readFileSync(path.join(root, 'docs/Security/Sandboxes/vscodium/README.md'), 'utf8');
|
||||
const buildSh = fs.readFileSync(path.join(root, 'build.sh'), 'utf8');
|
||||
let passed = 0;
|
||||
const test = (name, fn) => { const r = fn(); if (r === 'skip') { console.log(' skip -', name); return; } passed += 1; console.log(' ok -', name); };
|
||||
|
||||
const tmpBase = path.join(root, '.tools', 'tmp');
|
||||
fs.mkdirSync(tmpBase, { recursive: true });
|
||||
const tmp = fs.mkdtempSync(path.join(tmpBase, 'vscodium-sandbox-test-'));
|
||||
const stubDir = path.join(tmp, 'bin');
|
||||
fs.mkdirSync(stubDir);
|
||||
const logFile = path.join(tmp, 'flatpak.log');
|
||||
// One line per `flatpak` call, its arguments separated by tabs.
|
||||
fs.writeFileSync(path.join(stubDir, 'flatpak'),
|
||||
'#!/bin/sh\n(IFS="\t"; printf "%s\\n" "$*") >> "$FLATPAK_LOG"\n', { mode: 0o755 });
|
||||
|
||||
function overrideArgs(env) {
|
||||
fs.rmSync(logFile, { force: true });
|
||||
const r = spawnSync('bash', [scriptPath], {
|
||||
env: { ...process.env, ...env, PATH: `${stubDir}:${process.env.PATH}`, FLATPAK_LOG: logFile },
|
||||
encoding: 'utf8',
|
||||
});
|
||||
assert.strictEqual(r.status, 0, r.stderr);
|
||||
const calls = fs.readFileSync(logFile, 'utf8').trim().split('\n').map((l) => l.split('\t'));
|
||||
const override = calls.find((c) => c[0] === 'override' && c.includes('--nofilesystem=home'));
|
||||
assert.ok(override, 'the closing `flatpak override` was called');
|
||||
return override;
|
||||
}
|
||||
|
||||
try {
|
||||
test('the script is bash (it uses an array) and parses', () => {
|
||||
assert.match(fs.readFileSync(scriptPath, 'utf8'), /^#!\/usr\/bin\/env bash\n/);
|
||||
assert.strictEqual(spawnSync('bash', ['-n', scriptPath]).status, 0);
|
||||
});
|
||||
|
||||
test('by default the host Docker route is granted', () => {
|
||||
const args = overrideArgs({ WEKAN_SANDBOX_HOST_DOCKER: '' });
|
||||
assert.ok(args.includes('--talk-name=org.freedesktop.Flatpak'), args.join(' '));
|
||||
assert.ok(!args.includes('--no-talk-name=org.freedesktop.Flatpak'));
|
||||
});
|
||||
|
||||
test('negative: WEKAN_SANDBOX_HOST_DOCKER=0 refuses it', () => {
|
||||
const args = overrideArgs({ WEKAN_SANDBOX_HOST_DOCKER: '0' });
|
||||
assert.ok(args.includes('--no-talk-name=org.freedesktop.Flatpak'), args.join(' '));
|
||||
assert.ok(!args.includes('--talk-name=org.freedesktop.Flatpak'));
|
||||
});
|
||||
|
||||
test('negative: the grant opens nothing else - home, host and the SSH agent stay closed', () => {
|
||||
for (const env of [{ WEKAN_SANDBOX_HOST_DOCKER: '' }, { WEKAN_SANDBOX_HOST_DOCKER: '0' }]) {
|
||||
const args = overrideArgs(env);
|
||||
for (const closed of ['--nofilesystem=home', '--nofilesystem=host', '--nosocket=ssh-auth']) {
|
||||
assert.ok(args.includes(closed), `${closed} missing`);
|
||||
}
|
||||
assert.ok(!args.some((a) => /docker\.sock/.test(a)), 'no Docker socket is mounted');
|
||||
assert.ok(!args.some((a) => /^--filesystem=(home|host|~\/?$)/.test(a)), 'no home/host filesystem');
|
||||
}
|
||||
});
|
||||
|
||||
test('build.sh reaches Docker through flatpak-spawn --host docker, not a general host shell', () => {
|
||||
assert.match(buildSh, /flatpak-spawn --host docker "\$@"/);
|
||||
});
|
||||
|
||||
test('the README documents the grant, its cost and the opt-out', () => {
|
||||
assert.match(readme, /--talk-name=org\.freedesktop\.Flatpak/);
|
||||
assert.match(readme, /root-equivalent/);
|
||||
assert.match(readme, /WEKAN_SANDBOX_HOST_DOCKER=0/);
|
||||
assert.ok(!/Docker is NOT available inside this Flatpak sandbox/.test(readme), 'stale claim removed');
|
||||
});
|
||||
} finally {
|
||||
fs.rmSync(tmp, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
console.log(`vscodiumSandboxHostDocker: ${passed} passed`);
|
||||
Reference in new issue
Block a user