Commit Graph
2663 Commits
Author SHA1 Message Date
Lauri Ojansivu db9c06dc5e monday.com, Businessmap and Wrike workbooks are streamed a page at a time too.
Every workbook export is now written by ExcelJS's streaming workbook
writer, a row at a time, instead of a whole workbook in memory.

- monday.com and Businessmap: one sheet each; the columns any card fills
  (monday.com's custom fields; Businessmap's optional columns, comment
  columns and other fields) and Businessmap's parent Card IDs are found
  over the whole board from the light first pass, the header written on
  the first page (server/lib/streamSheetWorkbook.js, shared).
- Wrike: the lanes' order, the folder rows and every row's Key are planned
  over the whole board (wrikePlan, wrikePageOrder); the pages come in that
  order and a lane's folder row goes before its first card. The date
  columns are date cells, as in the whole workbook.

tests/workbookStream.test.cjs checks every page size against the whole
sheet and reads each streamed workbook back as the whole one; the
import/export audit (173) and the admin-only custom field specs (12) pass.

Thanks to xet7 !
2026-11-20 11:41:28 +02:00
Lauri Ojansivu a2257442a8 Teamwork and Planner workbooks are written a page of cards at a time with ExcelJS's streaming writer.
The workbook exports were built whole, as an ExcelJS workbook in memory.
Teamwork's and Planner's are now written to the response by
ExcelJS.stream.xlsx.WorkbookWriter, each row committed as it comes
(server/lib/renderExternalExport.js STREAMED_WORKBOOKS), every page's rows
through the export boundary as the whole workbook's are.

Teamwork's rows are a task tree: its order and each card's depth are
planned over the whole board from the light first pass (teamworkPlan,
teamworkPageOrder), the pages come in that order, and each page writes its
own rows. Planner's rows stand on their own: its head on the first page,
each card's row after it.

tests/workbookStream.test.cjs checks every page size against the whole
sheet, and that the streamed workbook reads back - and is read by
Teamwork's own parser - as the whole one; the import/export audit (173)
and the admin-only custom field specs (12) pass.

Thanks to xet7 !
2026-11-20 11:21:50 +02:00
Lauri Ojansivu 4666bb60f4 Nullboard exports are written a page at a time, each list around its notes.
Nullboard's formatter writes its JSON as text, so the nested writer reads
it as JSON (text: true) and ends the file with its newline. Its lists -
the board's, then one per title of a list its cards name that is not
exported - are found over the whole board, so every page has the same
lists, and the pages come list by list with those cards grouped by the
title (byList: 'listIdsThenTitles'). tests/exportPaging.test.cjs checks
every page size; the import/export audit (173) and the admin-only custom
field specs (12) pass.

Thanks to xet7 !
2026-11-20 11:01:03 +02:00
Lauri Ojansivu 21c64e092d Deck and Kanri exports are written a page at a time, each list around its cards.
Deck's stacks and Kanri's columns hold their cards. The pages come list
by list in the board's order by list id (byListIdOrder, a list only a card
names after them); the document around the lists and each list around its
cards are made on the first page from the board's lists and its light
first pass, and each list is opened at its first card and closed after its
last, a list with no cards written where it stands. Every part passes the
export boundary and the admin-only field redaction.

A Deck card is in the stack of its own list by id: two lists of one name
each carried the other's cards. Kanri's cards of no list are one column,
where each such card made a column of its own; its tags in use are found
over the whole board, list by list.

tests/exportPaging.test.cjs checks every page size against the whole
document; the import/export audit (173) and the admin-only custom field
specs (12) pass.

Thanks to xet7 !
2026-11-20 10:42:24 +02:00
Lauri Ojansivu f293ae4076 JSON exports whose cards are one array are written a page at a time: Trello, Jira, Asana, Zenkit, OpenProject, GitHub, Gitea, Forgejo, GitLab.
The first page writes the document around the card array, with the array
left open, and every page then writes its own cards into it
(server/lib/renderExternalExport.js JSON_PAGED, streamJsonExport). Each
part passes the export boundary (secureTransfer) and the admin-only field
redaction, as sendJsonResult does for a whole document; the headers are
sendJsonResult's.

What a card refers to on another page is counted over the whole board from
the light first pass: Jira's issue keys and custom field names, and
OpenProject's numbers, positions and custom field columns.

tests/exportPaging.test.cjs checks, for every page size, that the pages'
arrays together are the whole array and the document around them the
first page's, and that nothing is written without passing the boundary and
the redaction. The import/export audit (173) and the admin-only custom
field specs (12) pass.

Thanks to xet7 !
2026-11-20 10:23:16 +02:00
Lauri Ojansivu bad71f9a1e Focalboard and Mattermost exports are written a page of cards at a time.
Both are NDJSON. Focalboard's board record names its status, label and
custom field options over the whole board, and Mattermost's head names
every channel and user over the whole board: each is written on the first
page from the board's light first pass, and every page then writes its own
cards' blocks or posts. tests/exportPaging.test.cjs checks every page size
against the whole file; the import/export audit passes, 173/173.

Thanks to xet7 !
2026-11-20 10:02:25 +02:00
Lauri Ojansivu e1261ef5fb Leo outlines are written a page of cards at a time too.
Leo's file holds the outline (<vnodes>) and, after it, the card texts
(<tnodes>) under the outline's node numbers. The outline holds only titles
and checklists, which the board's light first pass already has, so the
first page writes the whole outline from it, and every page then writes
its own cards' texts, numbered the same pre-order way as before: a list,
its cards, each card's checklists and their items. tests/exportPaging.test.cjs
checks every page size against the whole file, and the import/export audit
passes, 173/173.

Thanks to xet7 !
2026-11-20 09:52:05 +02:00
Lauri Ojansivu ce40b56abd The Markdown, Obsidian, OPML and Org mode outlines and the Notion CSV are written a page of cards at a time.
The outlines group cards under their lists, so their pages come list by
list in the board's order (byList: 'lists', models/lib/exportPaging.js
byListOrder): a list's heading opens before its first card and closes
after its last, wherever the page boundary falls, and a list with no cards
is written where it stands, from the board's light first pass
(outlineMarks). Lines are joined with the separator before each line
(joinPage), so the pages together are byte for byte the whole file. The
Notion CSV counts its swimlane and custom field columns over the whole
board and writes its header on the first page.

Every page also passes the board's, lists' and swimlanes' titles through
the export boundary, as the whole-file export does; before, a paged
format's list titles came straight from the database.

Markdown and Obsidian write a list title once: two lists of one name used
to write their heading twice, each with the cards of both.

Leo stays whole: its card texts are a second section after the whole
outline. tests/exportPaging.test.cjs checks every page size against the
whole file, with empty lists and a card of a list the board does not have;
tests/playwright/specs/import-export-format-audit.e2e.js passes, 173/173.

Thanks to xet7 !
2026-11-20 09:43:18 +02:00
Lauri Ojansivu fd5c207006 Lists split into Doing and Done.
A list can be split into Doing and Done (models/lib/boardFlowPolicies.js):
a card of it marked Done here, with the circle at its minicard's corner,
waits dimmed and edged green to be pulled into the next list, and the
list header counts Doing and Done. The mark names the list it was made in
(card.flow.splitDoneListId, written by setCardFlow from the card's own
list, and only in a split list), so a card moved on is in Doing of its new
list without anybody clearing it.

A board admin allows split lists in Board Settings / List, and each list
is split from its menu. Admin Panel / Settings / Visibility / Features /
Split lists hides it on every board. Translated in every language.

Thanks to xet7 !
2026-11-20 09:16:10 +02:00
Lauri Ojansivu 2f7a4e210f Daily standup timer and retrospective board in the board menu.
Two Scrum meeting helpers, offline and with no AI
(models/lib/scrumMeetings.js, docs/Features/Scrum/Meetings.md):

- Daily standup: the board's active members in a shuffled order, each
  with the same timebox (Minutes per person in the Scrum settings, 1-15,
  2 by default), counted down and red once over; Next hands over, and the
  end says how long it took. It runs in the browser and writes nothing.
- Retrospective board: a new private board, titled with this board's name
  and the day, with the lists Start doing, Stop doing, Keep doing and
  Action items, made through createBoardWithInitialSwimlanes so "who may
  create boards" applies.

Both are in the board menu for every member, next to Summary. Each is
turned off for one board in its Scrum settings and for the instance in
Admin Panel / Settings / Visibility / Features. Translated in every
language.

Thanks to xet7 !
2026-11-20 08:54:34 +02:00
Lauri Ojansivu 9ac7b916c0 List policies, the commitment point, a WIP limit per person, and the Definition of Ready.
Kanban practices for a board's lists (models/lib/boardFlowPolicies.js,
docs/Features/Lists/Flow-Policies.md), offline and with no AI:

- List policy: each list's own entry and exit criteria, written from the
  list menu and shown as a gavel at the list header, its tooltip the text.
- Commitment point: the list from which work is committed to, flagged at
  its header; the lists before it are options.
- WIP limit per person: how many open cards one person may hold on the
  board; an opened card names each of its people over it.

Each is off until a board admin turns it on in Board Settings / List, and
each is a feature of Admin Panel / Settings / Visibility / Features, which
hides it on every board.

The Scrum settings get a Definition of Ready beside the Definition of
Done, and both are now readable by every member in the Scrum views once
written. The four Scrum translation guards count 128 keys with it.

Translated in every language.

Thanks to xet7 !
2026-11-20 08:32:10 +02:00
Lauri Ojansivu 0071dde0f3 Flow fields on cards: Blocked with a reason, Class of service with Expedite's WIP limit, MoSCoW and WSJF.
Four Kanban and Scrum practices other tools have, kept on the card
(card.flow, models/lib/cardFlow.js), offline and with no AI:

- Blocked: ticked with a reason; who marked it and since when are the
  server's. A red Blocked badge on the minicard, the reason its tooltip.
- Class of service: Standard, Fixed date, Expedite, Intangible. Expedite
  has a WIP limit of one open card per board; a second is refused.
- MoSCoW priority: Must, Should, Could, Won't have.
- WSJF score: business value, time criticality and risk reduction divided
  by job size, each on the 1-20 scale; shown once every part is set.

Each is a row of Board Settings / Card in the Card section, off on the
card and the minicard until a board turns it on, and an Admin Panel /
Features / Card field that hides it on every board. Written only by the
setCardFlow method, which checks the card edit right, an assigned-only
member's own cards and the values; a client write of flow is denied.
Translated in every language.

Thanks to xet7 !
2026-11-20 08:08:26 +02:00
Lauri Ojansivu 4fad2a9000 Fix InviteBleed's remainder: six-digit invitation codes and the unthrottled sign-up method.
GHSA-rg85-qx5c-qx67 reported the InviteBleed brute force again, now as a
GitHub Security Advisory. The 128-bit code of the first fix was still in
place, but two things it left were open:

- An invitation made before the fix, and not used yet, kept its six-digit
  Math.random() code and was still accepted at sign-up; a re-invite even
  mailed the same code again. A code shorter than the 22 base64url
  characters of a 128-bit code is now refused at sign-up, in both places it
  is looked up, and hasUsableCode() treats it as missing, so a re-invite
  replaces it with a strong one (models/lib/invitationCodeEmail.js
  isStrongInvitationCode).
- The DDPRateLimiter rule was on createUser, which a client is refused
  anyway, while the sign-up form creates the account through useraccounts'
  ATCreateUserServer, which had no limit. It now takes at most 10 attempts
  a minute per address, and each refusal is an InviteBleed row in Admin
  Panel -> Problems (brute.invite).

The other two advisories of the same report were checked against the
current code and are already fixed: GHSA-6944-p22h-3qpx (OIDC shared
serviceData race) since #4897 on 2026-07-17, whose per-login objects are
locals of the callback, and GHSA-j4x8-689m-h4hv (stale impersonation record
allows export), where every export route authorizes through
canExportBoardData() only and the impersonation record is just the audit
row written after it.

Thanks to meifukun and xet7 !
2026-11-20 07:48:22 +02:00
Lauri Ojansivu e2cbbe5104 Ten more exports are written a page of cards at a time, their references read in a light first pass.
Todoist, TickTick, ClickUp, MeisterTask, Linear, Pivotal, Redmine,
Quire, Taskwarrior and todo.txt refer from one row to others - a parent's
number, columns counted over the board, the order of the lists - so a
page could not be written without the rest. The export now reads the
board once lightly (no descriptions, comments only counted,
models/lib/exportPaging.js) and then the cards 500 at a time, each page
with those references; a formatter writes its head on the first page and
its tail on the last, Todoist's cards come list by list. The pages
together are byte for byte the file the whole board is written as,
whatever the page size (tests/exportPaging.test.cjs). TODO.md lists the
formats still built whole.

Thanks to xet7 !
2026-11-20 07:30:06 +02:00
Lauri Ojansivu 60bbf69164 Jira and CSV / TSV files are uploaded too; their people and columns are read from the file on the server.
They were the last files the Import page read itself and sent whole. A
chosen Jira file is now uploaded like the other sources: the people of
its map-members step are read from it by the server (the Jira mapper is
shared, models/lib/jiraMembersMapper.js), and the estimate mapping goes
with the import call. A CSV / TSV file's header, sample rows and guessed
mapping come from the server (csvUploadPreview), its people from the
columns chosen (csvUploadPeople), and the import parses it there. Both
methods read only the sender's own upload, signed in and while import is
enabled, and leave it for the import that follows.

Thanks to xet7 !
2026-11-20 06:46:46 +02:00
Lauri Ojansivu 11992ac951 Fix the server failing to start: the streamed export's collect had a parameter named like a const in its body.
The page-at-a-time export (3b1c7ce7bb) gave collect() a parameter
cardIds while its body already declares const cardIds - a SyntaxError
("Identifier 'h' has already been declared" once minified), so the
server bundle did not load. No node suite loads that ES module, which is
why they all passed. The parameter is pageCardIds, and
tests/serverBundleSyntax.test.cjs checks the built server bundle with
node --check whenever a build is there. TODO.md says why most other
export formats cannot simply be paged.

Thanks to xet7 !
2026-11-20 06:29:47 +02:00
Lauri Ojansivu 640e492593 Uploaded JSON is parsed from the file a chunk at a time; a Mattermost export a line at a time.
A JavaScript string cannot be longer than about 512 MB, so reading an
uploaded JSON export with readFile and JSON.parse could not read a larger
one at all. server/lib/streamJson.js builds the value from the file as it
is read - every escape, surrogate pairs and chunk boundaries anywhere,
the same value and the same refusals as JSON.parse, a __proto__ key as
an own property, nesting bounded. A Mattermost bulk export is read a line
at a time; the other text formats are read as one text up to 256 MB and
refused with that reason beyond it.

Thanks to xet7 !
2026-11-20 06:14:07 +02:00
Lauri Ojansivu 3b1c7ce7bb WeKan and Trello .zip imports use the shared upload, limit and disk check; .mbox and .enex export a page at a time.
The WeKan .zip route and the Trello package route wrote their uploads
with caps of their own (5 GB and 200 MB, 1 GB unpacked). They now go
through the same receiver as every Import page upload: the Admin Panel's
largest import (else WEKAN_IMPORT_ZIP_MAX_BYTES for the WeKan zip), or
with none the free disk space, checked before and while the file is
written, and a Trello package may unpack to as much as that.

The .mbox and .enex exports are written to the response 500 cards at a
time, waiting for the socket when it is full, instead of being built
whole in memory; the pages together are the same file. TODO.md keeps
what is left: streamed reading of large JSON and text, and the other
formats' exports.

Thanks to xet7 !
2026-11-20 06:10:37 +02:00
Lauri Ojansivu 63b5e089f5 Twelve Board View reports: Created vs. Resolved, Net Flow, Time in List, Average Age, Throughput Run, Due Date Performance and more.
Added after comparing WeKan's charts with the reports of Jira, Azure
DevOps, Nave, ActionableAgile and the Flow Framework: Created vs.
Resolved, Net Flow, Time in List, Average Age, Throughput Run Chart and
Due Date Performance under Kanban flow; Release Burndown and Epic
Progress under Scrum; Workload, Distribution, Dependency Map and Activity
Heatmap under Overview. Each opens like the other charts, with the export
bar at its top, a Chart.js chart and its data table, which is also what
its PDF and Excel export write.

The calculations are pure (models/lib/boardReports.js) and answer one
shape, { bars, table }, so the chart view and both exports read every
report the same way; the server loads only what a report reads. A member
who may see only their assigned cards gets none of them, as with the
other charts. The report names and table headings are translated into
every language.

Thanks to xet7 !
2026-11-20 06:10:13 +02:00
Lauri Ojansivu 32c24ed84e Import page uploads stream to the server's disk, checked against the free space and an Admin Panel limit.
A file chosen on the Import page for the generalized importer's sources
is POSTed to /api/import/upload/:source and written to
WRITABLE_PATH/import-uploads a part at a time, instead of being read in
the browser and sent whole, as text or base64, through importBoard. The
size the browser announces is checked before the first byte against the
largest import set in Admin Panel / Settings / Security (none: no limit)
and against the free space of that disk less a reserve, and the space is
checked again every 64 MB while it is written; a refused or interrupted
upload leaves no file behind. importBoard then reads the file by its
id: a .zip export (Slack, Google Takeout, Vikunja, Notion, Plane) is
opened from the disk, its entries inflating up to the limit or the free
space, and a mailbox is read a message at a time, also inside a Takeout
zip. The upload is removed once read, or after an hour.

The HTML-only mail text is read through the parsed document rather than
stripped with a pattern. TODO.md says what is left of large files, and
which locale files hold another language.

Thanks to xet7 !
2026-11-20 05:42:27 +02:00
Lauri Ojansivu 257835733b Board View menu and the Import and Export lists are grouped under headings.
The Board View menu, and Board Settings / Board View, show the views in six
groups - Board, Calendar and time, Scrum, Kanban flow, Overview, and
Communication and code - with the board's own order inside each; the six
separators of the old order are the headings now. The Import page and the
Export menu list the other tools under the same headings from one table,
models/lib/toolGroups.js: Kanban and project tools, Issue trackers and
version control, Task and to-do apps, Spreadsheets and tables, Text and
outlines, Mail, calendars, chats and notes, and Fetched from a service.
The thirteen headings are translated into every language; "Scrum" stays
as it is, like the other method names. The Tigre instructions of the new
imports keep the attested plural for files.

Thanks to xet7 !
2026-11-20 05:18:02 +02:00
Lauri Ojansivu ccfa6cf362 Import and export mail, calendars, chats and notes: mbox/.eml, iCalendar, Google Takeout, Slack, Mattermost, Telegram, WhatsApp, Discord, Evernote.
The Import page reads nine more kinds of export, each into the view it
is for: mail (mbox, .eml) as cards of Board View / Email, one per
conversation with the replies as comments; an .ics file's tasks by
status and its events, with their dates; a Google Takeout .zip as one
board with a swimlane per product (Mail, Tasks, Keep, Calendar, Google
Chat); a Slack workspace export, a Mattermost bulk export, Telegram
Desktop's JSON, a WhatsApp chat .txt and a DiscordChatExporter JSON as
channels whose messages are comments, for Board View / Chat; and an
Evernote .enex as notes with their to-dos as checklists. The Export menu
writes a board as an .mbox, an .enex and a Mattermost bulk import file,
each read back by the same import.

MIME is decoded with mailparser and ENEX with htmlparser2 on the server,
and the zips are read under the zip-bomb guards of the other zip imports.
An imported message's Message-IDs pass the import sanitizer without
their brackets, so a later reply to the board joins the thread. The
instructions of the nine are translated into every language. TODO.md
also gets the next items: grouped menus, large-file import and export,
and the reports to add.

Thanks to xet7 !
2026-11-20 05:03:27 +02:00
Lauri Ojansivu c0339ccc59 Shared templates: the group kinds to share with are an instance setting, and the targets appear.
Which group kinds - Organizations, Teams, email Domains - Admin Panel /
People / Shared templates allows came from the browser's localStorage,
so it differed per browser and was empty for every user but the admin
who ticked it. It is Settings.sharedTemplatesScopes now, published to
every client, and an admin's earlier ticks are carried over once.

The All Boards / Templates targets were empty for everyone anyway:
getMyShareableGroups did not await ReactiveCache.getUser, so it read
orgs, teams and emails from a Promise.

Thanks to xet7 !
2026-11-20 04:20:22 +02:00
Lauri Ojansivu 97809cbb33 REST: list and swimlane card lists carry modifiedAt, labelIds, members and customFields.
GET /api/boards/:boardId/lists/:listId/cards and
GET /api/boards/:boardId/swimlanes/:swimlaneId/cards now also return each
card's modifiedAt, dateLastActivity, labelIds, members and customFields
([{ _id, value }]), so a syncing client can skip unchanged cards instead
of a GET per card. Both routes build their items in
models/lib/restCardListItem.js, so they stay alike.

Same board access check, and no extra query. Admin-only custom field
values stay concealed by sendJsonResult's redaction, as on the single-card
GET; each item carries its boardId so that redaction is scoped to this
board, and an admin of it still reads a field shared with other boards.

Thanks to rmb82 and xet7 !

Fixes #6928,
2026-11-19 22:10:43 +02:00
Lauri Ojansivu 80fb1c65fc Admin Panel / Problems: a row's address, location and user are one occurrence.
A summary row keeps the LATEST occurrence's username, address, location
and detail, but a field the newest occurrence did not carry was left
from an older one: summaryUpdate only dropped the other address family
from $set, so the old value stayed in the database. Security Report
showed a German IPv4 as "Vancouver, CA" - the location of somebody
else's IPv6 beside it - and JamBleed's "gerald" beside a lockout of
account trottola. The newest occurrence now replaces all the latest
fields and $unset clears the ones it does not carry, in the fold and in
the in-memory fold the legacy migration uses. Existing rows are correct
from their next occurrence on.

Thanks to xet7 !
2026-11-19 03:33:48 +02:00
Lauri Ojansivu 0d9c8c1250 Cards of an archived swimlane stay hidden with the Archive sidebar closed.
#6927, a regression of #6659: on a board whose archived swimlane still
holds unarchived cards - archived before #2292 archived cards with their
swimlane, as on a board migrated from WeKan 6.09 - those cards appeared
in the first swimlane, and vanished while the Archive sidebar was open.
The first swimlane surfaces orphaned cards (#6443), and the client could
only exclude swimlanes in its cache; archived swimlanes reach the cache
only with the Archive sidebar.

The board's archived swimlane ids are now published on their own
(boardArchivedSwimlaneIds: one document per board, ids only, read access
as for the board) into a client-only collection, and
Lists.orphanedCardsSwimlaneIds excludes them. Nothing that lists
swimlanes starts showing archived ones, and the cards are not changed:
moving or archiving them was what brought old cards back before
(swimlane-structure, 2026-08-13).

tests/archivedSwimlaneCards6927.test.cjs replays the reporter's board;
archived-swimlane-cards-6927.e2e.js checks it with the Archive sidebar
open and closed.

Thanks to sro-lbohn, hmeunier95 and xet7 !

Fixes #6927.
2026-11-19 01:27:40 +02:00
Lauri Ojansivu e1a053d059 Admin Panel: one question per tab - Settings gains Appearance, Features, Feature profiles, Security, Activities and Delete.
Who sees and may use what was spread over three tabs: the feature
switches and feature profiles sat in Settings / Visibility beside the
logo and colours, and three settings (Security, Delete, Notifications)
sat in Problems among the reports, where they had landed when the
Features tab was removed.

- Settings / Visibility is Appearance (how this WeKan looks); its
  Features and Feature profiles groups are panes of their own. One
  template renders all three by `part`, so every field and Save is
  unchanged.
- Problems / Security, Delete and Notifications are Settings /
  Security, Delete and "Activities and notifications". Problems is
  Summary, Backup and the Reports.
- Every old address redirects (MOVED_PANES / movedPanePath in
  models/lib/adminUrls.js, applied by config/router.js).
- People, Teams and Organizations show the feature profile that
  applies, so a profile can be found from either side.
- Two new labels, Appearance and Activities and notifications, are
  translated into every language.

tests/adminPanelStructure.test.cjs and admin-panel-structure.e2e.js
cover the order, the redirects and that no feature switch is left in
Appearance or Problems; older guards and specs follow the new panes.

Thanks to xet7 !
2026-11-19 01:22:13 +02:00
Lauri Ojansivu cfd9a62466 Swap alone is not high RAM usage, and resource monitors are not named like vulnerabilities.
A developer laptop with many programs open showed in Admin Panel /
Problems / Memory usage: "RamBleed, high, high RAM usage started
(>= 90%): RAM 16.1/30.9 GB (52%), swap 18.7/30.9 GB (60%)". Swap at or
above 25% started a high-memory period by itself, made it high severity,
and the text still said ">= 90%". Idle pages in swap while RAM is free
are not pressure.

- Swap now counts only while RAM is also at or above the low threshold
  (80%), and a period ends when RAM is back under it.
- The start row says what started it: (RAM >= 90%) or (swap >= 25% with
  RAM >= 80%). Only RAM at 95% or more is high severity.
- The RAM, CPU, disk and speed monitors named their rows like Hall of
  Fame entries (RamBleed, CpuBleed, DiskBleed, SlowBleed) with CWE-400.
  They are HighRamUsage, HighCpuUsage, HighDiskUsage and SlowRequest now,
  without a CWE, and stored rows are renamed once at startup.

tests/ramHighTracker.test.cjs replays the laptop's numbers as a
negative case; tests/resourceStreamNames.test.cjs pins the names.

Thanks to xet7 !
2026-11-19 00:21:33 +02:00
Lauri Ojansivu fc21b0b177 Feature profiles: an administrator hides features from chosen users, teams and organizations.
Decided by the maintainer on 2026-11-18 (TODO.md): administrator-defined
profiles. Admin Panel / Settings / Visibility / Features gains Feature
profiles: a name, a tick for each optional feature the profile hides,
and the users, teams and organizations it applies to. A user's own
profile wins, then the first profile naming one of their teams, then one
naming one of their organizations.

Strictly opt-in, because hiding features by default was tried and
removed as a support nightmare: a user with no profile sees everything,
a profile only hides (no data or permission changes), and the member
menu tells the user which profile hides how many features. The decision
is models/lib/featureProfiles.js, applied in isFeatureAvailable, so
every existing place that hides a disabled feature follows it.

Profiles are stored in Settings (featureProfiles) and a direct
assignment on the user (featureProfileId, published to that user only
and not writable by them). tests/featureProfiles.test.cjs covers the
decision, cleaning, the admin-only methods and the wiring;
feature-profiles.e2e.js drives the page, the hidden board view and the
notice.

The 11 new strings are translated into every language. Low confidence:
 qu, rup, rn, rw, sah, se, sm, sn, ss, st (low); sd, so, si, scn (medium); sr uses standard Тимови/Организације; ff, fj, gn, gv, haw (low); ha, hsb, fur, gd, ga, fo (medium); ace, ak, ay, bm, bi, bo, bua (low); ba, bho, ar-DZ/ar-EG/ary dialect spelling (medium); iu, kl, ks, kw, lld, lg, ig, la (low); kok (medium); tig, ti, tlh, ve-PP, ve-CC, uz-AR, ve, ts, tn, to, tpi (low); szl (medium); wal, vo, zgh, wa, wo, wa-RR, yi, wuu-Hans (low); chr, dz, ee, csb, cv, co, ckb (low); cmn uses 配置 for profile; nah, nap, nd, nso, om, mai (low); mg, ny, pap, or_IN, ps (medium).

Thanks to mimZD and xet7 !

Fixes #6837.
2026-11-19 00:01:42 +02:00
Lauri Ojansivu ee24453dcb A rule action into a list that refuses the triggering user's role is skipped.
Decided by the maintainer on 2026-11-18 (TODO.md). A rule's move, archive,
unarchive, create-card, copy, link, sort-list and move-all-cards actions
checked only board write access. Each now asks the lists it writes in as
the user who triggered the rule (#4527); a refusing list skips that
action, and the rest of the rule still runs. The skip shows in Admin
Panel / Problems as ListLockRule (authz.rule-list-locked, detected, low,
never disables): it is a rule meeting a locked list, not an attack.

List Sync's journaled rule replay is not changed yet - a skip there needs
a receipt of its own - and stays in TODO.md.

tests/listLockRules.test.cjs runs the check and copyRuleCard against a
locked list and pins every action.

Thanks to xet7 !
2026-11-18 23:08:06 +02:00
Lauri Ojansivu 7459c5bde6 The History integrity audit streams each board instead of loading it whole.
Production log (v13.13): "JavaScript heap out of memory" twice, 42 and
74 seconds after the hourly History integrity audit started (its
changeHistory distinct is in the MongoDB log at 03:00:00 and 05:00:00),
both in the first hourly run of a freshly started process. The audit
fetched each board's whole History - every row with its full previous
and new content - and verified the array.

historyVerifier checks one row at a time and keeps only hashes, the first
child of each predecessor, root counts and small summaries; the audit
streams each board through a cursor with a bounded batch, pausing while
the CPU is busy. verifyHistoryRows runs on it and returns exactly what
it did. tests/historyIntegrityStreaming.test.cjs compares both on chains
with forks, a second root, a tampered and an orphan row, and fails if
the audit fetches a board whole.

Thanks to xet7 !
2026-11-18 22:25:34 +02:00
Lauri Ojansivu f23695cc1b Scheduled rules act as the board's admin, so their created cards have an author.
Production log (v13.13): "scheduledRules: error running trigger ...
User ID is required in cards insertAsync" on every run. Scheduled rules,
auto-archive and attachment retention acted as board.createdBy, but the
Boards schema has no createdBy, so it was undefined on every board: a
scheduled rule ran as nobody and its "create card" action always failed.

models/lib/boardActor.js names the board's first active admin, else its
first active member. The rule's createCard action also passes its acting
user as the card's author, since a scheduled run has no method user for
the schema's autoValue. tests/boardActor.test.cjs scans the tree so that
nothing reads board.createdBy again.

Thanks to xet7 !
2026-11-18 22:25:34 +02:00
Lauri Ojansivu ba3d94390b ListLockBulkBleed: bulk and server-side card writes ask the list's role exception.
GHSA-83w9-74mx-7v83. A board admin can refuse a role write access in one
list (#4527, roleExceptions). REST DELETE /api/boards/:boardId/cards/bulk
and POST /api/boards/:boardId/cards/labels take their cards from the
body, so no URL names a list, and asked only for board write access; the
methods archiveSelectedCards, copyCard and createLinkedCard write from
server code, past the Cards allow/deny rules. A normal member the list
refused could delete, relabel and archive its cards and copy or link new
cards into it.

- The bulk routes read every card and ask each list before the first
  write (assertCardListsNotRefused): any refusal is a 403 and nothing
  changes, recorded in Admin Panel / Problems as ListLockBulkBleed
  (authz.list-locked-bulk, medium). Each removal and relabel is keyed on
  the list that was checked.
- The methods refuse with not-authorized (assertListsWritable), not
  recorded: Copy Card and Multi-Selection reach them in ordinary use.
- The same shape, fixed with the same check: createBoardFromCard,
  addSubtaskCard, createCardWithDueDate (which also did not check that
  the list is on the board), the iCalendar import over DDP and REST,
  sending and receiving board email, vcsCreateIssue, moveBoardObjects,
  History's undo/redo/Restore, position history undo/redo of a card,
  renameAttachment, the scoped import and a card's rule button.
  Dependency lines keep their own board-wide rule.

tests/listLockBulkBleed.test.cjs runs the gate on the reporter's board
and pins every path; tests/playwright/specs/list-lock-bulk.e2e.js replays
the proof of concept. Older guards that pinned the previous shape are
updated with the reason.

Thanks to immanuwell and xet7 !
2026-11-18 22:25:34 +02:00
Lauri Ojansivu aacb2fd4d6 Clearing a card title or description can be undone and redone.
Follow-up to PR #6926. Clearing a value is an edit recorded in History,
not a deletion, so Admin Panel / Problems / Delete has no part in it and
the old value stays restorable. collection2's default clean removes ''
from $set and then throws "your modifier is now empty", so:

- History's redo and Restore of a cleared title or description threw,
  while undo worked. applyFieldContent now writes the recorded value back
  exactly (removeEmptyStrings and trimStrings off).
- The card details title and description clear, and the board
  description clear, pass removeEmptyStrings: false.
- REST card PUT always passes removeEmptyStrings: false for title and
  description: a title of only spaces was trimmed to '' and then removed,
  a 500, and the #6877 description clear had no option at all.

tests/emptyStringClearWrites.test.cjs replays undo/redo/Restore through a
collection2-like clean and pins the options at every write;
tests/playwright/specs/card-clear-undo-redo.e2e.js clears in the card
details and over REST, then undoes and redoes.

Thanks to AhmedLukman and xet7 !
2026-11-18 21:39:15 +02:00
Lauri Ojansivu 6d8d2a7699 Merge pull request #6925 from AhmedLukman/codex/card-xlsx-optional-context
Fix card Excel exports when board information is omitted
2026-11-18 21:12:06 +02:00
Ahmed Lukman 997c6d88ad Fix card Excel exports when board information is omitted
Allow the shared card export builder to read titles from optional board, list and swimlane records. Cover description-only and labels-only field selections.
2026-11-18 11:59:44 +03:00
Lauri Ojansivu c7a496c9cf Security: RaceBleed - a card's children are destroyed only for a card whose own removal happened.
GHSA-3vjg-3p4q-8fwh. The REST card DELETE looked the card up on the board
the caller was authorised for, destroyed its checklists, checklist items,
comments, attachments and subcards by cardId, and removed the card itself
last, keyed on that board and list. A move to another board landing in
between left the card alive on a board the deleter cannot read, stripped of
every child, with both requests answering 200 (CWE-367). Every hooked
removal had the same shape: collection-hooks runs Cards.before.remove (where
the cascade was) and then removes by the caller's original selector - by
swimlane, delete batch or parent - which a moved card no longer matches. The
custom-field link clean-up did the same to the cards linked to it.

The card document is now the claim (models/lib/claimedCardRemoval.js): the
single and bulk REST deletes remove the card first and cascade only when
that removal matched, and the hooked removals cascade from Cards.after.remove
only when the card is really gone. A list deletion removes a card only while
it is still in that list. The REST board move that loses to a delete is a
404 instead of a 500 from cardMove.

A delete that lost the race, or arrived after the card was moved away from
the named board, is refused and recorded in Admin Panel / Problems as
RaceBleed (authz.card-delete-race, medium, never disables the account): a
stale view is not an attack, and PurgeBleed's critical record used to
disable the member who deleted a card somebody had just moved.

tests/claimedCardRemoval.test.cjs replays the reported race and scans
server/ for any cascade before or without the card's removal;
tests/playwright/specs/race-bleed.e2e.js races 12 moves against deletes
and checks that a surviving card always keeps its checklist.

Thanks to xingmuse and xet7 !
2026-11-18 03:43:25 +02:00
Lauri Ojansivu 040d853c8e RedirectBleed hardening: a direct client write of an avatar URL follows setAvatarUrl's rule.
setAvatarUrl refuses javascript:, file:, data:text/html and every scheme but
http(s), data:image and local paths, but the Users allow rule permits every
profile.* field, so Users.update({$set: {'profile.avatarUrl': ...}}) from the
browser console stored what the method refuses. Not exploitable as reported:
the URL is rendered only as an <img src>, and the server fetches it only
through fetchSafe (http/https). The rule is now models/lib/avatarUrlScheme.js,
used by both avatar methods and by a Users deny rule, which logs the refused
write to Admin Panel / Problems as file.avatar-url. No WeKan client code
writes the field directly, which the test checks.

Verified while checking meifukun's GHSA-g98f-44gc-hqcc, GHSA-x6fh-wrr5-3426,
GHSA-28hr-j65r-grj2, GHSA-mrhx-8xm7-chrq and GHSA-83qj-w8mp-w4qf against the
current code: all five were already fixed (tests/securityMeifukun.test.cjs).

Thanks to meifukun and xet7 !
2026-11-16 13:54:08 +02:00
Lauri Ojansivu cc302acdd1 Merge pull request #6920 from AhmedLukman/codex/fix-card-attachment-cascade
Soft-delete attachments when removing their card
2026-11-16 13:32:22 +02:00
Ahmed Lukman 7875220470 Soft-delete attachments when removing their card
Find live attachments by their metadata card ID and use the existing
attachment deletion lifecycle. Preserve recoverable bytes and history while
removing the files from active attachment listings.

Cover single and bulk REST deletion, rejected requests, existing soft-deleted
files, history, byte preservation and the remaining card's browser display.

Thanks to AhmedLukman and xet7 !
2026-11-15 20:02:43 +03:00
Ahmed Lukman 628a69c086 Keep renamed upload paths consistent before validation
Update the original and version paths in memory and in the file record, and wait for metadata writes before upload hooks continue. Cover rename failures, persistence ordering, normalized uploads, original bytes and card rendering.
2026-11-15 14:11:10 +03:00
Lauri Ojansivu e46d7a2376 Destination pickers list the cards of a lazily loaded board.
Copy Checklist's card dropdown stayed empty for a board with more cards
than the lazy-loading threshold (CARDS_LOADING=auto above 500, or lazy).
The pickers read the chosen board's cards from the `board` publication,
which ships no cards for a lazy board, and a picker opens no list that
would fetch its window. A new `destinationCards` publication ships the
titles and places of one list's cards in one swimlane (or of the whole
board for the parent-card picker), whatever the card-loading mode, scoped
like the other card publications: the board must be readable, and an
assigned-only member gets only their own cards.

Copy / Move checklist, Copy checklist from a template card, Move / Copy
card, Link card and the parent-card picker subscribe to it. Done waits
until the chosen list's cards are there, a remembered card is checked
against them rather than against the board, and the open board's Filter
no longer empties the destination list.

Thanks to ChrisMagnuson and xet7 !

Fixes #6917.
2026-11-15 03:11:14 +02:00
Lauri Ojansivu ec05ff0089 File-integrity scan no longer reports files WeKan deleted itself as missing.
The daily scan keeps one baseline per stored file and reports every baseline
whose file is gone as a StorageBleed. Nothing ever removed a baseline, so
every attachment purged by retention and every avatar deleted was reported
missing on every run from then on - one finding folded 1,164 times.

The baseline is now forgotten where WeKan deletes or moves a local file:
- Attachments and Avatars onAfterRemove, for every version path. This is
  the retention purge's path: Meteor-Files unlinks the version paths itself
  after that hook, without going through the store strategy, so a fix in
  the strategy's unlink() alone would not have covered it;
- the filesystem strategy's unlink() (moving a file to GridFS or cloud);
- the filesystem strategy's rename(), for the old path.

A file that vanishes any other way keeps its baseline and is still reported.
The removal is fire-and-forget and can never break a delete.

Baselines already orphaned before this fix stay reported until removed, as
described in the issue.

Thanks to Raymond-Voogt and xet7 !

Fixes #6898.
2026-11-13 17:45:05 +02:00
Lauri Ojansivu c37575f1fa Checklists have a partial index on resetInterval for the recurring-reset cron.
The recurring-checklist reset cron queries
resetInterval: { $exists: true, $nin: [null, 'none'] } on every tick, and with
no index that read the whole checklists collection (about 45,000 documents on
the reporting instance), reported as db.collection-scan on Admin Panel ->
Problems. A partial index on resetInterval, like the one #6825 added for
recurring cards, holds only the recurring checklists.

Thanks to Raymond-Voogt and xet7 !

Fixes #6899.
2026-11-13 17:45:05 +02:00
Lauri Ojansivu a8e25952aa REST takeOwnership awaits the board update, and removeMember awaits its user lookup.
PUT /api/users/:userId with action takeOwnership called the async
board.changeOwnership() without await: the reply was sent before the board
was changed, and a failed update was an unhandled rejection behind a 200.

Boards.removeMember tested `!ReactiveCache.getUser(memberId)`. On the server
that lookup is async and returns a Promise, which is always truthy, so the
#5330 branch that hard-removes a member whose account was deleted never ran
on the server; such a member was only deactivated and lingered.

Tests pin both, and fail the tree for any un-awaited changeOwnership() or
negated un-awaited ReactiveCache lookup in server/ and models/.

Thanks to xet7 !
2026-11-13 17:45:05 +02:00
Lauri Ojansivu fefabbf113 Admin Panel Problems: a Clear button, and resolved problems age out.
The problem streams were append-only and Acknowledge only reset the "new"
count, so a problem fixed long ago stayed in the table and buried the live
ones. Clear, beside Acknowledge, calls the admin-only clearEventLog, which
deletes the checked streams' events up to now and stamps the
acknowledgement; anything that happens after the click shows as new again,
and an unknown stream clears nothing. A daily sweep, claimed once per
installation, deletes events older than EVENTLOG_RETENTION_DAYS (default 90,
0 keeps them forever); a recurring problem's folded row keeps a recent date,
so it stays. The setting is listed on every platform, and clear-problems is
translated to every language.

Thanks to Raymond-Voogt and xet7 !

Fixes #6893,
2026-11-11 22:29:01 +02:00
Lauri Ojansivu 7bb3e13ba9 ListLockAttachBleed: a list's write refusal covers the attachment API.
A board admin can refuse a role write access in one list (#4527,
roleExceptions). The attachment API's upload, delete, copy and move, over
REST and DDP, asked only for board write access and mayWriteCardAttachment,
which allows every card to a member who is not assigned-only, so a normal
member the list refused still added and removed files on that list's cards.

Every attachment write that names a card now also asks mayWriteInCardList
with that card, and a move asks both the card it takes the file from and the
card it puts it on. The card's own board decides. As for the REST card
routes, only a list's refusal counts. A refusal is recorded in Admin Panel ->
Problems as ListLockAttachBleed (authz.list-locked-attachment, medium).

tests/listLockAttachments.test.cjs runs the guard on the reported case and
the negative cases, and fails on any mayWriteCardAttachment call in the tree
without the list check beside it; list-lock-attachments.e2e.js replays the
writes against a running server.

Thanks to Furkan Derse and xet7 !
2026-11-11 20:58:01 +02:00
Lauri Ojansivu 8dc77a89d8 Indexes for the LDAP id, cards' assignees and members, and History by entity and hash.
On a large installation the database-problems page filled with collection
scans of queries WeKan makes constantly but never indexed: a user looked
up by services.ldap.id at every LDAP login and sync pass (13,000+ users,
~430 ms per login), cards by assignees or members across every board for
My Cards and the filters (1.1M cards, 1-3.7 s, dozens of times a minute),
and changeHistory by entity and by integrity hash (120,000+ rows, and
growing). Each now has an index, created at startup with ensureIndex like
every other one: services.ldap.id sparse, assignees and members both so
their $or uses an index on each branch, and changeHistory's
{ entityType, entityId, createdAt } and { integrityHash }.

Thanks to Raymond-Voogt and xet7 !

Fixes #6892.
2026-11-11 20:29:31 +02:00
Lauri Ojansivu 3e8e8039ff Spent time is shown as a duration, not decimal hours.
A card's Spent time is stored in decimal hours, and a Pomodoro or Flowtime
session adds its duration to it, so a short session left a badge such as
0.034722222222222224. The badge shows days, hours, minutes and seconds now,
the leading zero units left out (12h34m56s, 2m5s), and the tooltip that
names hours rounds them to two decimals. The stored value and the edit
popup keep their hours. models/lib/spentTimeFormat.js, with a unit test
and a UI test.

Thanks to brlin-tw and xet7 !

Fixes #6890.
2026-11-11 20:20:55 +02:00
Lauri Ojansivu 32590ee7ab Card members and assignees: adding one whose account is gone no longer throws.
#6889 guarded the removal halves of the cardMembers and cardAssignees
hooks, which read user.username after a lookup that finds nobody for a
deleted account. The joining halves had the same read: the REST route
checks the user before adding, but a client $addToSet, a copied or
imported card, or a rule can still add such an id, and the hook threw.
Both now record the join with the id and no username, as a removal does.

tests/cardMemberRemoval.test.cjs runs the real hooks: adding a member
and an assignee whose account is gone records the join without
throwing; and, tree-wide, no `const x = user.field;` follows a
ReactiveCache.getUser() lookup without a guard.

Thanks to AhmedLukman and xet7 !
2026-11-11 00:07:53 +02:00