Commit Graph
2116 Commits
Author SHA1 Message Date
Lauri Ojansivu c50d7b4ea7 Authorize subtask deposit reads and destination writes
Remove unvalidated deposit and null board IDs from source-card scope. Publish deposit content beneath its own reactive visibility-filtered board cursor, applying destination assignment restrictions and reactive card children. Filter status counts by visible assigned scopes.

Require destination write access before pointer changes and subtask landing structures, and deny client pointer rename bypasses. Summarize blocked writes in Problems. Positive decisions, scope/dispatcher inventory and existing subtask/status suites pass; browser regression syntax-check passes with live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 12:09:35 +03:00
Lauri Ojansivu 26e9e70304 Prevent linked cards from promoting non-writing source roles
Require source write access for authoritative and DDP link creation, including pointer changes. Treat explicit non-writing source roles as a ceiling on delegated writes, covering legacy self-created links. Match UI permissions and remove the link action from the non-writer menu. Record denied writes in bounded Problems summaries.

Actual shared permission decisions for every role, creation/deny inventory and existing link and role suites pass. Browser regression syntax-check passes; live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 12:05:14 +03:00
Lauri Ojansivu af93621261 Authorize every board grant before sending registration invitations
Domain-approved inviters must hold an allowed inviter role on each requested board. Site admins retain access to real boards; missing boards fail closed. Validate the complete grant before creating or changing any invitation code or sending mail, and summarize rejected grants in Problems.

Role and grant inventory plus invitation email suites pass. Browser regression syntax-check passes; live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 12:02:59 +03:00
Lauri Ojansivu 055cf42d49 Protect server-issued invitations from client profile updates
Reject invitation field writes, array mutations, parent replacement and rename destinations. Inspect actual modifier paths so top-level profile field reporting does not block ordinary preference updates. Record denied invitation changes through bounded Problems summaries.

Profile guard and existing invitation suites pass. Browser regression syntax-check passes; live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:55:21 +03:00
Lauri Ojansivu 64123a603a Bind manual rule execution to a writable board and its card
Check write capability and authoritative card board before button dispatch and again in the shared action dispatcher. Board buttons without a card remain supported. Record denied contexts in bounded Problems summaries.

Role and boundary decisions plus dispatcher inventory and existing rule suites pass. Browser regression syntax-check passes; live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:53:05 +03:00
Lauri Ojansivu c33e9c3bf9 Require administrator privileges for REST board management
Align board title, card settings and all rule mutations with existing DDP administrator policy. Preserve site-admin access and record refused management attempts in bounded Problems summaries.

Actual guard and endpoint inventory tests pass along with card-settings and rule suites. Browser regression syntax-check passes; live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:51:24 +03:00
Lauri Ojansivu d7ac619d63 Bind comment inserts to the authorized card board
Reject foreign-card REST and DDP comment inserts and prevent DDP rebinding from bypassing the boundary. Keep card-authoritative legacy comment listing. Add bounded Problems summaries and attack, negative insert inventory and browser regression coverage.

Targeted Node suites pass; browser regression is syntax-checked with live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:49:40 +03:00
Lauri Ojansivu 9b1fb5214f Require board write capability for list moves and sibling mutations
Enforce the canonical role policy for both sides of list, swimlane and checklist moves, scoped imports, attachment renames and history writes. Record denied attempts through bounded Problems summaries without allowing logging failures to bypass authorization.

Add role-matrix decisions, the reported moveList attack, sibling guard inventory and a browser regression. Targeted Node suites pass; live browser execution remains pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:47:29 +03:00
Lauri Ojansivu 962debc12d Enforce private-only board visibility across server creation methods
Apply instance visibility policy to direct board creation and card-to-board conversion. Record blocked public overrides with bounded Problems summaries, preserving enforcement if logging fails. Positive policy and negative insert-inventory suites pass; browser regression is syntax-checked but live execution remains pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:43:10 +03:00
Lauri Ojansivu 4c59f03725 Restrict Search All Boards to active board memberships
Apply membership-only scope to search selectors and pagination while retaining public discovery for other callers. Add regression coverage for shared access and public boards.

Thanks to xet7 !
2026-09-14 03:21:22 +03:00
Lauri Ojansivu 1e328a98de Copy rendered template cards without submitting runtime ID caches 2026-09-13 15:11:56 +03:00
Lauri Ojansivu 5057a0a2c1 Add member-selected calendars and accessible date and time controls
Apply the selected calendar to shared date displays, calendar month views and date inputs. Provide mouse and keyboard date navigation and hour/minute selection while preserving native date storage. Document the supported offline calendars and add display, picker and browser regressions.

Thanks to mimZD and xet7 !
2026-09-12 21:01:41 +03:00
Lauri Ojansivu 49eaade957 Fix board JSON exports containing HTML card text
Use a Node-compatible HTML sanitizer so both attachment modes complete instead of throwing at the first HTML-bearing card. Abort partial HTTP transfers on failure and cover complete JSON, attachment bytes and browser downloads.

Thanks to xet7 !
2026-09-11 23:28:44 +03:00
Lauri Ojansivu bbe8b40d90 Board View: the default menu order is the order it had before views became orderable.
Thanks to xet7 !
2026-09-11 21:53:50 +03:00
Lauri Ojansivu 859771a10e Card Settings: the default card and minicard field order is the order they had before fields became orderable.
The default of CARD_LAYOUT and MINICARD_LAYOUT - what a board with no
stored cardFieldOrder / minicardFieldOrder renders, and what
applyLayoutOrder() falls back to for the keys a stored order does not
name - is now pinned literally to the render order of cardDetails.jade
and minicard.jade at 59f7d61df, the commit before #4448 made fields
orderable. Reading those templates gives exactly the sequence the layout
module already holds, so no board changes shape; the module, the tests
and the docs now say where that order comes from and a new suite pins
both sequences so a reshuffle cannot pass by reshuffling the template
with it. The two fields newer than that commit stay beside their
closest older neighbour: Text notes in the card's tail, Swimlane name
last on the minicard.

Thanks to xet7 !
2026-09-11 21:53:38 +03:00
Lauri Ojansivu faaa83ed09 Explain and remediate the MongoDB 8.2 crash loop that follows a full disk.
A reported test environment (mongo:8.2.2 in Kubernetes) filled its data
volume: the checkpoint's fdatasync returned ENOSPC, WiredTiger panicked and
mongod aborted - and then it kept failing on every start, with the disk long
since freed. MongoDB 8.2 keeps a throwaway WiredTiger instance under
<dbPath>/_tmp/spilldb for queries that spill to disk and empties it itself on
each start; after the abort that emptying failed ("Failed to clear dbpath of
the internal WiredTiger instance: Directory not empty"), mongod opened the
half-emptied directory, found no version file, reported "Failed to open the
spill WiredTiger instance ... database corruption detected" and fasserted.
Nothing retries, so the pod restarts forever. The data itself is intact;
deleting that one directory is the whole fix.

- snap-src/bin/mongodb-control deletes _tmp/spilldb before every mongod
  start (no mongod is running at that point, and mongod recreates it), and
  its start-failure handler recognises the log line and names the directory.
  The snap ships MongoDB 7 today, so this is a no-op until it does not.
- Admin Panel / Problems: the db.restart row now says what a "No space left
  on device" abort means for a full disk as well as for a network
  filesystem, and both it and db.disk-space name the exact spill directory
  to delete when MongoDB 8.2 will not start afterwards. The probe looks the
  data directory up once and passes it to both rows.
- docs/Databases/MongoDB/Storage-Requirements.md gets the log signature of
  both stages, why the second one never ends, the one command, what must
  not be touched, and that Docker/Kubernetes users run it themselves since
  the database container is MongoDB's own image.
- tests/databaseHealth.test.cjs pins the spill path, both rows' advice, the
  probe wiring, the snap's pre-start deletion (before the first start, after
  the running-instance check, and the only recursive delete apart from the
  existing FerretDB reset) and the documentation.

Thanks to xet7 !
2026-09-11 21:31:10 +03:00
Lauri Ojansivu 15b2b6c533 Board Settings / Card: one "Card field order" heading over two lists, with arrows on every row.
Board Settings / Card was a three-column table (Show on Card, Show on
Minicard, the name) with a separate "Card field order" list of arrows at the
bottom that reordered five sections of the opened card. It is one heading,
"Card field order", over two lists now: "Show on Minicard" in the board's
minicard order and "Show on Card" in its card order, every row of either
`[checkbox] [up] [down] icon label`. The checkbox is whether that side shows
the field, the arrows move it on that side only, and the icon and name are
the field's own. The two lists are independent because the two orders are: a
field can be third on the minicard and last on the card.

models/lib/cardFieldOrder.js is the arithmetic, pure and tested without
Meteor: each surface is a fixed head, reorderable sections of fields, and a
fixed tail. A field moves within its section; at the section's edge it moves
the whole section; a section's header (Labels, Members, Sort number,
Description title) stays first. What is stored is one flat array of field
keys per surface - `cardFieldOrder`, which the first #4448 filled with five
section keys that stay valid and expand to what they rendered (Members
carried Dependencies and Sort, Custom Fields carried Vote/Poker), and the new
`minicardFieldOrder`. Two board setters normalise before storing; the update
allow rule keeps them to a board admin. The REST cardFieldOrder endpoints
still speak in section keys, eight now.

cardDetails.jade renders its eight sections in the board's order and, inside
Labels, Dates, Members, Sort and Vote/Poker, the fields in theirs;
Dependencies and Sort are their own templates. minicard.jade renders every
block under the title through the minicard order, with the dates line and
the badge strip ordering their own fields. Every gate is unchanged.

The popup's rows are a table, models/lib/cardSettingsRows.js, that the
template draws twice, so no row is written out by hand and each checkbox
reads the helper it always read. The tests that looked for a row's class in
the template look in the table now; tests/cardSettingsCoverage.test.cjs
derives each layout's default order from the templates and pins the popup's
shape; tests/cardFieldOrderLayout.test.cjs pins the arithmetic and its
negatives. No new translation keys: the heading and arrow keys already
existed in every locale.

Thanks to xet7 !
2026-09-11 21:18:35 +03:00
Lauri Ojansivu c64d3454ac Add REST API for Board Settings / Board View, and OpenAPI blocks for the card settings routes.
GET /api/boards/:boardId/boardViewSettings answers which entries of the
Board View menu a board offers, which one it opens in, separately for a
public and a private board, and the menu order - in the normalised shape the
menu renders with: every view once with both showOnPublic and showOnPrivate
explicit, the two defaults resolved (missing or unknown reads as Swimlanes),
boardViewOrder made whole, and `keys` listing the known views. Board access.

PUT /api/boards/:boardId/boardViewSettings takes any subset of
boardViewSettings, defaultPublicBoardView, defaultPrivateBoardView and
boardViewOrder, through the same pure modifiers the popup's clicks apply
(showBoardViewModifier, defaultBoardViewModifier, normalizeBoardViewOrder),
now composed by boardViewSettingsRequest() in models/lib/boardViewSettings.js:
a default is always shown on its side, hiding a side's current default is a
400 (set another default first - or in the same request, since defaults are
applied before the show flags), an unknown view key anywhere in the body is a
400 and nothing of that request is written, and the order is normalised so the
menu lists every view exactly once. Board admin (or site admin), the same
check as cardFieldOrder. Both answer boardViewSettingsSnapshot().

The existing GET/PUT /api/boards/:boardId/cardSettings routes get the JSDoc
@operation blocks the OpenAPI generator reads (get_board_card_settings,
update_board_card_settings), so the hand-written copy in
openapi/extra_paths.yml - which now duplicated the operationId - is removed.
public/api/wekan.yml and wekan.html are regenerated with the release
workflow's own commands: 158 operations. docs/API/REST-API.md documents both
endpoints with curl examples, and docs/Features/Board/Board-View-Settings.md
links to them.

tests/restApiNewFeatureRoutes.test.cjs pins the four routes to their method,
path, @operation and auth check, that the PUT writes only the helper's $set,
the snapshot's shape, the request helper's positive cases (setting a default
shows it, one request may move the default and hide the old one, the order is
normalised, the input board is not mutated) and negatives (unknown view key in
the order, the settings or a default; hiding a side's default; malformed
bodies; a partly-invalid body applies nothing), and that the generated and the
committed spec carry the four operations exactly once with the old
edit_board_card_settings gone.

Thanks to xet7 !
2026-09-11 21:18:35 +03:00
Lauri Ojansivu 82646e4bc0 Board Settings / Board View: reorder the Board View menu with up/down arrows.
Each row of the Board View table now carries an up and a down arrow in front
of its name - real links, so the keyboard reaches them, titled with the
existing "Move up" / "Move down" keys of Card Settings' card field order -
and the Board View menu lists its entries in that order for everybody on the
board. Stored per board as boardViewOrder; normalizeBoardViewOrder() drops
unknown keys and duplicates and appends missing views in default order, and
moveBoardView() is a no-op for the first row up, the last row down and an
unknown view, so the menu always lists every view exactly once.

The menu itself is now rendered from the same table as the popup (one
`each boardViewMenuEntries` loop over models/lib/boardViewSettings.js)
instead of 25 static entries, keeping the per-view js-open-<view>-view class
each click handler listens for; the group separators are drawn only while
the order is the default one, since a custom order has no groups.
tests/boardViewMenu.test.cjs's order/icon/label/separator pins read that
table now, the same thing the template reads, and
tests/boardViewSettings.test.cjs pins the arrows, the schema field, the
setter and the normalize/move logic with positive and negative cases.
docs/Features/Board/Board-View-Settings.md describes it.

Thanks to xet7 !
2026-09-11 21:18:35 +03:00
Lauri Ojansivu 349c7490e7 Board Settings / Board View: which views a public or private board offers, and which one it opens in.
A new "Board View" entry at the top of Board Settings, above Swimlane, opens
a table like Card Settings: one row per entry of the Board View menu, in the
menu's order, with the columns Default on Public Board, Show on Public Board,
Default on Private Board, Show on Private Board and Description. The Default
columns are radio groups drawn as checkboxes (one default per side, and
setting one also shows it; the default's Show box cannot be un-ticked), and
the two public columns are not rendered when Admin Panel / Settings /
Visibility hides public boards.

The Board View menu lists only the views ticked for the board's current
visibility, and Utils.boardView() resolves the stored choice through the
board, falling back to that side's default, so nobody is left on a hidden
view. Stored per board as boardViewSettings, defaultPublicBoardView and
defaultPrivateBoardView; the decisions are the pure module
models/lib/boardViewSettings.js, applied by the Board setters
setBoardViewShown and setDefaultBoardView, guarded by the existing
board-admin allow rule. The schema fields, setters and popup template were
swept into 148f8a2aa by the Card Settings commit made from the same checkout;
this commit carries the rest.

Four new column-header keys, translated in every locale (low confidence for
the languages without a WeKan translator: Cherokee, Inuktitut, Klingon,
Volapük, Wolaytta, Bambara, Ewe, Fulah, Nahuatl and the other small ones).
docs/Features/Board/Board-View-Settings.md describes the design; tests/
boardViewSettings.test.cjs pins it, and boardSettingsSwimlaneListCard's
hr/gate guards now anchor on the group's new first entry.

Thanks to xet7 !
2026-09-11 21:17:34 +03:00
Lauri Ojansivu 9702130100 Board Settings / Card: a toggle for every card section and minicard badge, in card order.
Flowtime, Pomodoro, Stickers and Location shipped without an allows* board
toggle, so they rendered on every card and Card Settings had no way to hide
them. Dependencies, Vote, Planning Poker, Text Notes and the activity history
on the opened card had the same gap, as did the dependencies, stickers,
comment-count, vote and poker badges on the minicard.

Each now has a Boards field (default true, so an existing board keeps showing
what it showed), a setter, a REST card-setting key, a healed true-default in
the schema upgrade, a row in Board Settings / Card with its click handler,
and a gate in cardDetails.jade / minicard.jade. allowsActivities already
existed but gated nothing and its row was commented out; it is wired now.

The rows of the popup are in the order the fields appear on the opened card
(Mark complete, number, cover; then the reorderable sections through the
same orderedCardFieldSections source the card renders from, so a board's own
order applies to both; then checklists ... comments, activities), with the
minicard-only rows beside the card row they belong with. No new i18n keys:
every row reuses the field's existing name.

tests/cardSettingsCoverage.test.cjs derives the card's order from the
template and pins the popup to it, checks every gate has a row and every new
row is read, and that none of the four sections is unconditional.

Thanks to rmb82 and xet7 !

Fixes #6688.
2026-09-11 21:17:34 +03:00
Lauri Ojansivu dce2898382 Attachments: soft delete on the card, restore from the card history, hard delete only with the archived board.
Delete on an attachment used to remove the document and its file at once.
It is now the 'attachments.softDelete' method (History.md section 12): the
document gets deletedAt/deletedBy/deleteBatchId with the same helpers lists
use, the file is kept, and the card's cover is unset if this was it. Every
card-facing read - the opened card's gallery and "Attachments (N)" count,
the minicard paperclip badge, the slideshow, the cover, the board-background
picker, My Attachments, the API list endpoints and the exporters - filters
to live attachments with liveAttachments(); the publications keep sending
the deleted ones so the card history can reach them.

The card history records who deleted it and when, with the filename in the
row. Restore - the table's selection + Restore, or the row's own Restore
button, both through changeHistory.restore and applyAttachmentContent -
clears the mark, so the card, its count and the minicard badge include the
attachment again; the cover is never re-set. An attachment row previews
with the existing attachmentViewer slideshow and downloads with the same
link the gallery draws, and never offers cover or background. Uploads and
renames are recorded through the existing history hooks.

There is no per-attachment hard delete any more: api.attachment.delete,
DELETE /api/attachment/delete/:id and removeBoardBackground soft-delete,
permanentlyDeleteAttachmentFromFilesReport and the Files report's delete
button are gone, Attachments.allow remove and onBeforeRemove refuse every
client remove and log the attempt under Admin Panel / Problems. The one
hard delete is Admin Panel / Problems / Delete enabled, board archived,
board deleted from the archive: boardRemover now removes every attachment
of the board, live and soft-deleted, with its file.

One new i18n key, attachment-soft-delete-pop, replaces the "permanent, no
undo" confirmation text; it is inserted in English into every locale at
the same position for translation.

Thanks to xet7 !
2026-09-11 21:17:33 +03:00
Lauri Ojansivu 83d2a7fc75 Add Google, GitHub, Facebook, X, Meteor Developer, Weibo, Meetup and passwordless login.
Meteor's own accounts packages - accounts-google, accounts-github,
accounts-facebook, accounts-twitter, accounts-meteor-developer,
accounts-weibo, accounts-meetup and accounts-passwordless - are added, so
every way to log in that Meteor's accounts system offers is available.

models/lib/oauthProviders.js is the pure catalog of the seven providers
(env var names, ServiceConfiguration id field, login method, icon, label
key) with the decisions built on it: OAUTH_<PROVIDER>_ENABLED plus id and
secret (each also read from a <NAME>_FILE Docker secret), the Admin Panel
override winning over the env var, OAUTH_PROVIDERS_LOGIN_STYLE,
OAUTH_PROVIDERS_MERGE_EXISTING_USERS and PASSWORDLESS_ENABLED.

server/lib/oauthProviders.js writes ServiceConfiguration for every enabled
provider at startup and on demand (reconfigureOauthProviders, called by the
Admin Panel after a save) and removes it for a disabled one, so switching a
provider off takes effect without a restart. A first login through a
provider becomes a WeKan user the way OIDC does, fail-closed: an existing
account of another login method is only linked when merging is on and the
provider verified the address, otherwise the login is refused and the
attempt recorded on the new oauth.account-conflict canary for Admin Panel
-> Problems. Passwordless is gated on both the token-request method and
the login attempt while it is off.

getAuthenticationsEnabled reports each enabled provider key and
passwordless, and the login form shows one button per provider and a
two-step e-mailed-code form under the SAML button, with errors in the same
region as the password form. No credential ever reaches the client.

tests/oauthProviders.test.cjs covers the catalog, the env/_FILE/admin
resolution, the enabled and takeover decisions, the ServiceConfiguration
upsert/remove, the canary, the login form and the no-secret-on-the-client
negative checks.

Thanks to xet7 !
2026-09-11 11:52:04 +03:00
Lauri Ojansivu d1b5d0a75c Admin Panel: override the OAuth login provider and passwordless env vars.
Admin Panel / People / Login gets a section for Meteor's own accounts-*
login services (Google, GitHub, Facebook, X/Twitter, Meteor Developer, Weibo,
Meetup) and for passwordless login, built the same way as the LDAP section:
every OAUTH_<PROVIDER>_ENABLED / _CLIENT_ID / _SECRET env var, the shared
OAUTH_PROVIDERS_LOGIN_STYLE and OAUTH_PROVIDERS_MERGE_EXISTING_USERS, and
PASSWORDLESS_ENABLED can be set there, a value set in the Admin Panel wins
over the env var, and a badge beside each field names the source in effect.

The secret is stored in Settings.oauthProviders.<key>.secret and, like the
LDAP bind password, is never published: only the boolean secretSet is, an
empty secret submission leaves the stored one untouched, and the sources
method reports it through hasConfigValue() only. saveOauthProviderSettings
validates the provider key against the catalog and both save methods call
reconfigureOauthProviders() so a change takes effect without a restart.

Tests: tests/oauthProvidersAdminOverride.test.cjs, and the whole-tree secret
sweep in tests/ldapAdminOverrideSecurity.test.cjs now also matches
hyphenated sub-document keys.

Thanks to xet7 !
2026-09-11 11:49:48 +03:00
Lauri Ojansivu 4a09551397 Report database health in Admin Panel / Problems, and fix a missing index automatically.
The reported crash series (.tools/crash) was invisible from inside WeKan:
MongoDB aborting on every checkpoint, restarting, aborting again, with
every query in between slow - and the admin found it in the container log.
Admin Panel / Problems / Database problems now gets a row for each thing
WeKan can measure from its side of the socket, from a probe that runs 30 s
after startup and every five minutes (server/lib/databaseHealth.js, the
pure decisions in models/lib/databaseHealth.js):

- db.restart: serverStatus.uptime went down while WeKan kept running - the
  database process restarted; points at the fatal-assertion/fsync cause and
  the storage page.
- db.network-filesystem: getCmdLineOpts' dbPath, when it is a directory
  this process can see (snap, embedded database, shared volume), is on a
  CIFS/SMB, NFS or FUSE filesystem (fs.statfs f_type).
- db.slow-storage: serverStatus.opLatencies reads averaged over 100 ms
  across the interval, on a real number of reads - the storage latency
  behind the "Slow query" lines.
- db.disk-space: dbStats fsUsedSize/fsTotalSize below 5% or 512 MiB free -
  the real "no space left on device", before it happens.
- db.index-created: the one remediation WeKan can do itself. ensureIndex
  (server/lib/mongoStartup.js) now reports an index it created on a
  collection that already held documents - until then every query on it
  was a collection scan - as found and fixed; a new, empty collection
  getting its indexes at first start stays silent.

All rows go through the existing `database` stream (recordDatabaseHealth in
server/lib/databaseProblems.js: same shape, same per-minute quieting per
type), so they land on the same page as what the database itself says.
FerretDB answers only some of these commands; each step is independent and
what it cannot answer is skipped. Nothing here can throw into startup or
sits on a request path.

tests/databaseHealth.test.cjs drives every decision (including the
reported case: 519 MB used, 10 GiB free is NOT a space problem) and pins
the wiring.

Thanks to xet7 !
2026-09-11 11:23:53 +03:00
Lauri Ojansivu 278db0ada3 Write dates as real date cells in every Excel export.
Reported directly, with a LibreOffice screenshot: the Frappe Gantt view's
Excel export showed Start/Due/End as ISO text ("2026-09-23T09:00:00.000Z").
ExporterChartExcel wrote cell.toISOString() into the cell. A date is now a
real date cell with a date number format (yyyy-mm-dd hh:mm), so the
spreadsheet shows it in its own date format, sorts it as a date and can do
arithmetic on it; the "-" placeholder for an unset date stays text. Every
chart export (Gantt, Time, the report charts) shares this exporter.

The follow-up ask - every other Excel export too:
- The board and card Excel exports draw the shared card document
  (models/lib/cardDocument.js), whose meta pairs were pre-formatted text
  (fmtDate), so Created/Received/Start/Due/End/Last activity were text
  there as well. A date pair now carries the raw Date as a third element
  ([label, text, Date]); renderCardDocumentExcel writes that as a date cell
  and the PDF keeps printing the text. ExporterExcelBoard's own
  Created/Modified lines get the same treatment.
- The legacy whole-board Excel export (ExporterExcel.js) already wrote Date
  values into numFmt columns; nothing to change, pinned as such.

tests/chartExcelDateCells.test.cjs drives the chart row-writing branch
against a stand-in worksheet and pins the other exporters' shapes;
tests/pdfExport.test.cjs updated for add()'s third argument.

Thanks to xet7 !
2026-09-11 10:49:27 +03:00
Lauri Ojansivu e487f8d913 Keep each chart PDF export row on one line, in fixed columns.
Reported directly: in the Frappe Gantt view's PDF export a row's text was
not on one line. ExporterChartPDF wrote every header and data row as ONE
text line - "title  |  start  |  due  |  end" - with no width limit, so a
long card title pushed the dates off the page edge in the Unicode PDF and
past the line in the base-font fallback, and nothing lined up from row to
row.

New models/lib/pdfDocument.js tableRow(): a row with fixed column widths
(the name column twice the others), a cell that does not fit clipped with
an ellipsis rather than wrapped, so a row is always exactly one line.
buildUnicodePdf draws it as measured cells (PDFKit width + ellipsis); the
base-font fallback gets the same row as padded monospaced runs within the
text width. ExporterChartPDF uses it for the header (grey bar, bold) and
every row of every chart export - Gantt, Time and the report charts share
this exporter.

tests/chartPdfTableRows.test.cjs pins the one-line/aligned-columns/clipping
behaviour and that the exporter no longer joins rows into unbounded text.

Thanks to xet7 !
2026-09-11 10:42:40 +03:00
Lauri Ojansivu 7930da455a Fix a boot-crashing invalid SimpleSchema property on customFields.sort.
The user's own ./build.sh run reproduced it directly: "[uncaughtException]
WeKan is stopping: Error: Invalid definition for sort field: 'decimal' is
not a supported property", thrown from SimpleSchema's own constructor the
moment the server started - before any board could load. `decimal: true`
is not, and has never been, a property SimpleSchema recognizes (its
schemaDefinitionOptions list is autoValue/defaultValue/label/optional/
required/type, plus WeKan's own extendOptions(['index', 'unique']) in
imports/simpleSchema.js); nothing exercises that validation under a plain
Node test, which is why it slipped through review. `type: Number` already
allows fractional values with no extra flag - the same as Lists' own
`sort` field, which this one was deliberately written to mirror (see the
field's own comment) and which never had this property either - so
removing it changes nothing about what the field accepts.

tests/customFieldsSortSchema.test.cjs pins the sort field's definition
against SimpleSchema's actual valid-property list and sweeps every other
file under models/ for the same shape, so it cannot reappear anywhere else
undetected by a Node-only test run.

Verified against a real Meteor boot (`meteor run`) in-sandbox: reproduced
the crash before this commit, starts cleanly after.

Thanks to xet7 !
2026-09-10 23:43:06 +03:00
Lauri Ojansivu e15f531352 Give Admin Panel / People's Notifications row a URL of its own.
peopleMenu() draws a "Notifications" row (the admin-level default for the
3-tier Notification Settings system) right below Email, but
ADMIN_PAGES.people.panes had no slug for notify-setting, so the row could
not be linked to or deep-linked the way every other row on the page can be.

Thanks to xet7 !
2026-09-10 22:49:11 +03:00
Lauri Ojansivu 563a0a6edc Guard toLowerCase() call sites reached by non-string values.
Fix TypeError: string.toLowerCase is not a function server unhandledRejections
reported in production. The registration invitation-code check in
Users.after.insert() read doc.authenticationMethod.toLowerCase() unguarded,
but authenticationMethod is only set for oauth2/ldap signups - a normal
password/invitation signup left it undefined and crashed this hook on every
insert whenever disableRegistration was on; doc.emails[0].address was also
read unguarded. The buffered notification-email sender likewise read
user.emails[0].address.toLowerCase() unguarded, crashing when a user (e.g. a
header-auth/LDAP account) has an empty emails array. The CSV/TSV importer's
header-row mapping read headerRow[i].toLowerCase() unguarded, which could
throw on a sparse row cell that isn't a string.

A full audit of every server-reachable .toLowerCase() call site (server/,
models/, packages/) found the rest already guarded (typeof checks, ||
'' fallbacks, or values sourced from validated schema fields).

Thanks to xet7 !
2026-09-10 22:37:03 +03:00
Lauri Ojansivu 2e09565376 Add Kanboard-style whole-card recurrence.
A card can now be set to automatically spawn a fresh copy of itself, in the
same list, on a recurring schedule (daily/weekly/monthly) - the same idea
Kanboard has for a recurring task, applied on-premise with no external
dependency. Reuses the exact mechanism already built for a checklist's
automatic reset: a recurrenceInterval field on the card, the same
quave:synced-cron job infrastructure, and the same due-date arithmetic
pattern (models/lib/cardRecurrenceSchedule.js mirrors
models/lib/checklistResetSchedule.js). The card's "..." menu gets a new
"Card recurrence" entry, next to Save card as template, opening a popup
shaped exactly like the checklist's "Automatic reset" popup.

Thanks to xet7 !
2026-09-10 22:11:01 +03:00
Lauri Ojansivu 12cd826c37 Add the Timeline board view (read-only history + restore to a past state).
Board View / Timeline (Step 1 of the maintainer's spec): a new menu entry
right after Time, wired end to end like every other view - the
boardChangeViewPopup entry, Utils.setBoardView('board-view-timeline'), an
isViewTimeline() helper and boardBody.jade branch, the two client/lib/utils.js
whitelist arrays, the profile.boardView schema allowedValues, a tooltip-name-
map entry, and template/stylesheet registration in client/features/boards.js.

The view renders a horizontal row of clickable markers built from the
board's distinct activity timestamps (sampled to 50 when there are more),
plus a "Now" marker for the live board. Clicking a marker calls the already-
built, already-tested models/lib/boardTimeline.js's pure
reconstructBoardStateAt(cards, activities, timestamp) - this file does not
reimplement history reconstruction - and renders the result read-only,
grouped by reconstructed list: title, description snippet, labels, members,
due date and an archived badge.

Step 2: each card in a historical view gets a "Restore to this state"
button. It applies the RECONSTRUCTED field values to the card's CURRENT
document by calling only the card's own existing setters one at a time
(setTitle, setDescription, move, addLabel/removeLabel, assignMember/
unassignMember, setDue) - never a bulk update that bypasses them - so each
write is logged as its own Activity by the existing hooks and the restore
itself becomes new, fully visible history. Nothing is deleted. A
confirmation popup (Popup.afterConfirm, the same pattern used elsewhere)
gates the action since it changes the board's current state.

Deliberately deferred, per the task's own scope discipline: "selective
per-member change removal within a time period" is a separate, higher-risk
mutation feature left for a dedicated future pass.

tests/boardViewMenu.test.cjs's VIEWS table gets the new entry (icon
fa-history, template timelineView, helper isViewTimeline) and its HR_AFTER
separator moves from Time to Timeline. tests/boardTimelineRestore.test.cjs
pins that the restore path only calls the card's own setters (with a
negative test scanning for a direct Cards.update/updateAsync bypass), that
the restore button only renders while viewing a historical timestamp, and
that a confirmation step is required before restoring.

Added "Timeline" and its five other UI strings to en.i18n.json and to every
other locale file with real per-language translations (not English
placeholders); verified with fill-translations.mjs --missing.

Thanks to xet7 !
2026-09-10 22:06:38 +03:00
Lauri Ojansivu f361668573 Add pure board-timeline reconstruction from the Activities log.
models/lib/boardTimeline.js's reconstructBoardStateAt(currentCards,
activities, asOfTimestamp) computes what each card's title, description,
listId, swimlaneId, labelIds, members, assignees, dueAt and archived flag
would have been at a given moment, by taking the card's CURRENT state and
undoing every activity after that moment in reverse-chronological order.
It reads the board's existing Activities log as the source of truth rather
than storing separate snapshots, and is pure/read-only: no Mongo/Meteor
access, no mutation of its inputs, and no Activity is ever written or
deleted.

Covers createCard, a-changedTitle, a-changedDescription, a-dueAt, moveCard,
archivedCard/restoredCard, joinMember/unjoinMember, joinAssignee/
unjoinAssignee and addedLabel/removedLabel - every activityType that
currently records enough old/new detail to be reversed. moveCardBoard,
setCustomField/unsetCustomField and deleteCard are known but not reversed;
cross-board moves are surfaced via unreversedActivityTypes rather than
silently left unhandled.

This is Step 1 of the "Board View / Timeline" feature only: the read-only
reconstruction function and its tests. The Timeline board-view UI, the
per-card restore action and the selective per-member change removal
described in the same request are not implemented in this commit - see the
CHANGELOG entry for what is and is not delivered.

tests/boardTimeline.test.cjs pins each activityType's undo transform, a
multi-step history reconstructed at several points, that the function
never mutates its inputs, and a negative test scanning the module's source
for any Activities removal call.

Thanks to xet7 !
2026-09-10 21:41:46 +03:00
Lauri Ojansivu a01e8478c3 Add a list-sync job that keeps a list up to date from Jira (and GitHub/GitLab/Gitea).
A WeKan list can be marked with a syncSource (type/url/projectKey) and a
server-only credential (models/listSyncCredentials.js, never published).
server/listSync.js registers a quave:synced-cron job, reusing the SAME
scheduling infrastructure the checklist-auto-reset job uses, that fetches
each synced list's current items and reconciles them against WeKan
(models/lib/listSyncReconcile.js, pure/unit-tested): new items create
cards, changed items update them, and items that disappeared upstream are
ARCHIVED rather than deleted, so old entries stay in the list's history.

Fetching (server/lib/listSyncFetch.js) and parsing reuse the existing
one-time-import parsers in models/lib/externalParsers.js (parseJira is
new there; parseGithub/parseGitlab/parseGitea gained externalId) instead
of a second implementation. Jira works end to end; GitHub/GitLab/Gitea
share the same job and reconcile logic via their existing parsers.

Thanks to xet7 !
2026-09-10 21:41:20 +03:00
Lauri Ojansivu ac363f979f Add Admin Panel overrides for LDAP_* environment variables, and a Test
LDAP Connection button.

Every LDAP_* setting server/authentication.js and packages/wekan-ldap read
straight from process.env can now be overridden from Admin Panel / Login,
with an explicit admin value winning over the env var and the env var
winning over nothing (models/lib/configResolver.js's resolveConfigValue(),
pure and unit-tested for the precedence and for its 'admin'/'env'/'default'
source tag). The Admin Panel LDAP section shows, next to every field,
which source is currently in effect - an env var name, "Admin Panel", or
"Unset" - so it is always clear whether a value comes from the environment
or from an admin override.

The bind password never reaches the browser: it is stored in the new
Settings.ldap.bindPassword field, which server/publications/settings.js
deliberately never publishes (only the boolean ldap.bindPasswordSet is).
The password input starts empty and an empty submission leaves the
existing value/source untouched, matching the existing mail-server
password field's pattern. hasConfigValue() is the parallel, secret-safe
resolver: it returns only a boolean and a source, never the value, and a
negative test fuzzes several secret shapes through it to prove that.

Found while wiring this up: packages/wekan-ldap/server/testConnection.js's
existing ldap_test_connection method had its isAdmin check commented out
("TODO: this needs to be fixed - security issue"), so any authenticated
user - not only an admin - could trigger a real LDAP bind attempt against
the configured directory. Fixed to require isAdmin, the same check every
other admin-only Settings method uses, before any connection is attempted.
A new "Test LDAP Connection" button in Admin Panel / Login calls this
method against whichever config (admin override or env var) is currently
resolved and shows the result - success or the directory's own error -
inline, satisfying the "get back error message visible at admin panel"
request without adding a second LDAP client dependency.

Switching between LDAP, OAuth2, SAML and password login already has its
own UI (the Login pane's "Default Authentication Method" selector plus
each method's own enabled flag) and needed no separate switcher; this only
extends "enabled" itself to be admin-overridable, the same as every other
LDAP field.

Scope: LDAP is covered end to end (override + test-connection). OAuth2/
SAML/CAS's env vars are unchanged and stay env-only for now - the resolver
is written to extend to them, but doing so was out of scope for this pass.

Tests: tests/configResolver.test.cjs (precedence, source tagging,
hasConfigValue's secret non-leak, redactCredentialsInUrl for the composite-
connection-string case); tests/ldapAdminOverrideSecurity.test.cjs (the
publication never sends ldap.bindPassword, a whole-tree negative sweep for
any OTHER publication doing the same, the isAdmin gate on
ldap_test_connection runs before any connection attempt, and the method's
response never carries the password); tests/settingPublishedFields.test.cjs
extended to understand dotted/sub-document published fields so it keeps
checking the LDAP section's currentSetting.ldap.* reads against what is
actually published.

Thanks to xet7 !
2026-09-10 21:37:53 +03:00
Lauri Ojansivu bc8caeba5d Add a per-card markdown text note, editable in a popup (#595).
A card's own description was the only place to put markdown text, so anything
beyond a single block had to be crammed into it. This adds CardTextNotes: a
small collection of named markdown notes per card, modeled on Checklists (a
denormalized boardId, the same publish/allow/deny shape, the same
GHSA-gv8h-5p3p-6hx7 cross-board-move guard).

Each note renders as a tile with its title and a markdown-rendered preview
(the `viewer` template). "Add text note" and a note's "Edit" open a popup
that reuses the description's own `editor`/`viewer` widgets verbatim - no new
markdown editor was written. "Delete" removes the note, scoped to its own
_id.

Wired into the reactive cache (getCardTextNote/getCardTextNotes, matching the
CardComments pattern), the board/linked-card/lazy-window/single-card
publications, and server/permissions/cardTextNotes.js.

tests/cardTextNotes.test.cjs pins: the model's cardId/boardId scoping, the
allow/deny permission shape, the popup's reuse of `editor`/`viewer` (positive:
+editor is used; negative: exactly one `editor` and one `viewer` template is
declared anywhere under client/components/{cards,main} - the whole tree, not
just the new files, so a competing widget cannot be introduced elsewhere
either), and that add/edit/delete are scoped calls rather than broad
selectors.

Thanks to Lapin0t and xet7 !

Closes #595,
2026-09-10 21:29:22 +03:00
Lauri Ojansivu 9cbf67ba7c Fix 8 GitHub CodeQL code-scanning alerts: incomplete escaping, URL
substring check, an overly-permissive regex range and a no-op replace.

- models/lib/cardUrlAutolink.js and packages/markdown/src/
  template-integration.js (kept in sync, per their own comments): the
  card-title markdown-link escape only escaped ']', not the backslash
  that precedes it, so a title ending in a raw backslash escaped the
  ']' this code inserts to close the label instead of the label
  actually closing. Escape '\' before ']'.
- server/lib/documentGif.js: plainSearchText's control-character strip
  used literal raw control bytes inside the regex character class
  instead of \x escapes, so CodeQL flagged the range as unverifiable
  (adjacent control bytes are visually indistinguishable, so a
  boundary could silently shift). Rewritten with explicit \x escapes,
  byte-for-byte equivalent to the original range.
- tests/notificationEmailUrlLink.test.cjs: built a dynamic RegExp by
  hand-escaping only '/', leaving every other meta-character -
  including backslash itself - unescaped. Added the same escapeRegExp
  helper already used elsewhere in the codebase.
- tests/oauthLogoutUrl.test.cjs: asserted a returned URL did not
  contain a hostname via `.includes()`, a substring check a
  confusable/query-embedded hostname can fool either way. Compare the
  parsed `new URL().hostname` instead.
- tests/boardCreationAdminOnly.test.cjs: `.replace(/ /g, ' ')` was a
  no-op (replacing a space with itself); the actual intent was to
  collapse runs of spaces, `.replace(/ +/g, ' ')`.

Every fix has a positive test proving the corrected behaviour and a
negative test reproducing the exact bypass/bug CodeQL flagged. None of
these cross a security boundary on their own (the markdown-link title
escaping is a rendering-correctness fix - DOMPurify still sanitizes
the final HTML regardless, per the existing code comments; the rest
are test-only assertion bugs), so no Admin Panel security-log entry
applies.

Thanks to GitHub CodeQL and xet7 !
2026-09-10 21:20:46 +03:00
Lauri Ojansivu c5740e8046 Add Star/Unstar to the Swimlane, List and Card menus, a "Starred" page and a header bookmarks section for them.
Starring a board already existed (profile.starredBoards, toggleBoardStar
in models/users.js / server/models/users.js). This generalizes that same
per-user id-array shape to profile.starredSwimlanes, profile.starredLists
and profile.starredCards, each with its own toggleSwimlaneStar /
toggleListStar / toggleCardStar Meteor method that checks the id and
requires a login the same way toggleBoardStar does.

A Star/Unstar row was added to the Swimlane, List and Card hamburger menus
- a reading action, alongside Copy link and History, above the rows that
change the board. The list's own per-board `starred` field
(client/components/lists/listHeader.js isStarred()/.star(), used for the
sticky/pinned-list highlight) is untouched; the new per-user star uses its
own isListItemStarred helper and js-star-list-item row.

A new "Starred" page (/starred-items) lists everything the current user
has starred, grouped by type, reusing the "open card in place" popup
mechanism myCards/myAttachments already use for the card group. It is
reachable from the "All Pages" member menu next to My Cards / My Due
Cards / My Attachments.

The header bookmarks dropdown (starredBoardsPopup) gained three more
capped sections - Starred Swimlanes/Lists/Cards, five each, most-recently-
starred first - with a "see all" link to the uncapped Starred page. Both
the dropdown and the Starred page read the same starredItemsByType() query
(client/components/main/header.js, imported by starredItems.js), so there
is one definition of "what is starred" rather than two that could drift.

tests/starredItems.test.cjs pins the persistence shape for all three new
types, that starredCount() sums all five starred kinds, that the shared
query has exactly one definition, and that the new i18n keys are used by
all three menus. tests/starredPages.test.cjs's count assertion was updated
to match: the count now goes through the shared starredCount() aggregate
rather than two lengths added inline, still covering every starred kind.

The new labels (Star/Unstar, Starred Swimlanes/Lists/Cards, "See all
starred items", the empty-state message) are added to en.i18n.json and to
every other locale file with real per-language translations.

Thanks to chris-kwng and xet7 !

Closes #1172,
2026-09-10 21:12:34 +03:00
Lauri Ojansivu 2d8fb6070a Add a "Pulse" board view charting daily board activity, GitHub-Pulse-style.
Fixes #1292,
2026-09-10 21:11:34 +03:00
Lauri Ojansivu b467f17008 Add a completion-date projection to the Throughput Histogram (#1476).
#1476 asked for cycle time, lead time, throughput/velocity, bottleneck
analysis, and completion estimates based on velocity. The first four are
already covered by the existing board report charts: the Cycle Time and
Lead Time views (computeLeadCycleTime), the Throughput Histogram
(computeThroughput), and the Control Chart / Cumulative Flow Diagram / WIP
Run views, which are the standard Kanban tools for spotting a bottleneck
even though none of them is literally named "bottleneck".

The one piece that was missing is a forward-looking projection: at the
recent completion rate, when will the cards still open be done. Add
computeCompletionForecast to chartCalculations.js, reusing
computeThroughput's own weekly series rather than recomputing velocity a
second way - it averages the last 4 weeks of completions and divides the
remaining open-card count by that rate to project a date. Wire it into the
Throughput Histogram's server data (server/lib/boardChartData.js) as a
`forecast` field alongside the existing `series`, and show it as a plain-
text note under that chart (client/components/boards/charts/boardCharts.js
and .jade), with three new i18n strings for the none-remaining/no-velocity/
projected cases.
2026-09-10 21:11:34 +03:00
Lauri Ojansivu 952679f9c3 CHANGELOG: close the list/swimlane link issue (#1089).
Thanks to xet7 and xet7 !

Fixes #1089,
2026-09-10 21:01:12 +03:00
Lauri Ojansivu b420341719 Add a "card title/description contains {value}" rule trigger.
#2194 asked for a text-search rule condition combinable with other
triggers. WeKan's rules stay single-trigger/single-condition today -
combining several conditions in one rule with AND was already looked
at and explicitly deferred by #4294 (see TODO Later) - so this adds
ONE new standalone trigger type instead: "when a card's title or
description contains {value}", the same scope-down the #3092
advanced-filter trigger used.

A new pure module, models/lib/ruleTextContainsMatch.js, does a
case-insensitive substring test against a card's title/description;
server/rulesHelper.js (already wired to import and call it) evaluates
it the same way it already evaluates the advanced-filter trigger, on
card creation and the a-changedTitle/a-changedDescription activities.
This commit adds the missing pieces to complete that wiring: the pure
module itself, the card-triggers Add Rule UI row (cardTriggers.jade/
.js) with its text input, and tests/rulesTextContainsTrigger.test.cjs
pinning the match function, the trigger registration, the
rulesHelper.js wiring, the UI wiring and the i18n keys.

Thanks to sfahrenholz and xet7 !

Closes #2194,
2026-09-10 21:00:23 +03:00
Lauri Ojansivu bde66a5c7d Add a 3-tier Notification Settings popup (Member/Board/Admin).
Admin Panel / People, Board Settings and Member Settings each gain a
"Notification Settings" menu entry, right below Email in Admin Panel /
People. All three open the same reusable notificationSettingsPopup
template, letting notifications (tray/in-app and email, the two services
Notifications.notify already dispatches to) be turned on or off with the
same precedence the theme override already uses: Admin Panel default,
then Board override, then the member's own override.

models/lib/notificationSettings.js is a small pure module with the
resolution function (resolveNotificationSetting) and the notification-type
catalog; server/notifications/profile.js and server/notifications/email.js
now resolve the decision before adding to the tray or buffering an email,
so a disabled service is genuinely skipped rather than only hidden in the
UI. Settings.notifyDefaultTray/Email hold the admin default,
Board.notifyOverrideTray/Email the board override, and
profile.notifyOverrideTray/Email the member override; each is optional/
nullable so "unset" always falls through to the next level.
2026-09-10 21:00:20 +03:00
Lauri Ojansivu 453b309c72 Extend the list-header custom-field summary badge with min/max and a
date-field range (#2075).

#3319 already sums a number-type custom field flagged
showSumAtTopOfList=true across a list's (optionally swimlane-scoped)
cards and shows it as a "∑ N" badge. #2075 asked for a broader list-level
summary: min/max for a number field, a range for a date field, and how
many cards have the field set at all. This extends that SAME mechanism -
the same per-field checkbox, the same badge area - rather than adding a
second configuration surface:

- models/lib/customFieldsSum.js gains numberFieldStats() (sum/min/max/
  count-of-total, reusing the exact numeric-parsing rules of the existing
  sumCustomFieldValues()) and dateFieldRange() (earliest/latest among the
  cards, same count/total). Neither touches sumCustomFieldValues() itself.
- client/components/lists/listHeader.js's numberFieldsSum()/
  hasNumberFieldsSum() now share their field/card lookup with the new
  numberFieldsSumTooltip() (adds "(min–max, N/total)" to the sum badge's
  tooltip, wordless so it needs no new i18n key) and the new
  hasDateFieldsRange()/dateFieldsRangeLabel()/dateFieldsRangeTooltip() for
  a date-type field flagged the same way - shown as an earliest–latest
  badge instead of a sum, since summing dates has no meaning.
- listHeader.jade adds the date-range badge next to the existing sum
  badge (both mini-screen and full layouts), and points the sum badge's
  title at the new tooltip helper.
- One new i18n key, "date-range-of-fields", mirroring the existing
  "sum-of-number-fields" tooltip label; min/max/count are numeric-only so
  they need no new translatable words. Added to en.i18n.json and to all
  245 other locale files - a direct translation for the ~65 base
  languages covered by a curated dictionary (reused across their locale
  variants), an English placeholder for the remainder per the
  no-translation-anywhere-yet policy, to be filled the normal way via
  releases/translations/fill-translations.mjs.
- tests/customFieldsSum.test.cjs: a #3319 regression test proving
  sumCustomFieldValues()'s own result is untouched, plus coverage for
  numberFieldStats() (sum/min/max, several flagged fields combined,
  card-count-with-value, non-numeric values ignored, empty input) and
  dateFieldRange() (earliest/latest, Date and ISO-string values, count,
  an unparseable value ignored rather than corrupting the range, empty
  input). node tests/customFieldsSum.test.cjs: 21/21 passed.

Thanks to rlach and xet7 !

Closes #2075,
2026-09-10 20:59:36 +03:00
Lauri Ojansivu 0a9277ce06 CHANGELOG: add the checklist-item-to-linked-subtask entry (#2422). 2026-09-10 20:56:43 +03:00
Lauri Ojansivu 0c7524db05 Add reply-by-email: replying to a notification email comments on the card.
WeKan only ever sent email; there was no way to receive it, so replying to a
notification email went nowhere. This adds the webhook-based half of #2414 -
not an IMAP-polling mail client, which would need a running mailbox,
credentials and a polling loop the self-hoster would have to operate. Instead
a self-hoster points a mail provider's inbound-parse webhook (Mailgun Routes,
SendGrid Inbound Parse, Postmark inbound - documented in
docs/Features/Email/Reply-By-Email.md) at a new POST /api/inbound-email.

Every outbound notification email's Reply-To now carries
reply+<cardId>-<hmac>@<domain> (server/lib/inboundEmailReplyToken.js), the
HMAC keyed by INBOUND_EMAIL_HMAC_SECRET so it cannot be forged or guessed.
The webhook verifies that token, resolves the card, strips the reply's quoted
text (server/lib/inboundEmailQuoteStrip.js), matches the sender's address to
an existing WeKan user (server/lib/inboundEmailUserMatch.js - no match is
rejected, never an anonymous comment), and inserts a CardComments document.

Unauthenticated by design, so every rejection (bad/forged token, unmatched
sender) is logged via securityLog under the new authn.inbound-email catalog
key, wrapped so logging can never break the guard.

Both INBOUND_EMAIL_HMAC_SECRET and INBOUND_EMAIL_DOMAIN are opt-in; unset
(the default), no Reply-To is added and existing installs are unchanged.

Thanks to vasyugan and xet7 !

Closes #2414,
2026-09-10 20:51:52 +03:00
Lauri Ojansivu 632a107f33 CHANGELOG: triage remaining open Rules (IFTTT) issues to TODO Later.
Copy/link rule actions (#4160, #3235), email attachments (#3948),
custom-field rule values (#3195), GitLab sync (#2698), a scheduled
due-date rule action (#4278) and more template variables (#3815) are
each a real feature or need external infrastructure this sandbox
cannot stand up, so they are recorded with their reasons rather than
forced.
2026-09-10 20:50:08 +03:00
Lauri Ojansivu 6f79e87914 Add the missing acting-user module and UI button for rule "add member" (#2522).
The "add member" rule action's acting-user option (issue #2522 - "add
whoever just moved the card as a member") landed on main missing its
shared module: server/rulesHelper.js and cardActions.js already import
RULE_ACTING_USER_SENTINEL/resolveActingUserId from
/models/lib/ruleActingUser, but that file was never committed, breaking
the import on main. It also landed without the actual UI button that
saves the sentinel action.

models/lib/ruleActingUser.js resolves "who triggered this rule" from
activity.userId - the exact same source buildRuleVars() already uses for
the {username} template variable (#3304/#3301) - so both call one shared
function instead of two implementations of the same concept.
cardActions.jade gets the missing trigger button, wired to the existing
js-add-actinguser-member-action handler in cardActions.js.

tests/ruleAddMemberActingUser.test.cjs pins the sentinel resolution, that
rulesHelper.js and buildRuleVars() both call the one shared resolver (with
a negative, whole-tree source-pattern check that no other file
re-implements the same activity.userId shape), that the ordinary
fixed-member path is unaffected, the client/jade wiring, and that every
locale file has a real (non-English-placeholder) translation of the new
label. tests/ruleRemoveMemberAction.test.cjs and
tests/rulesApiTriggerNormalize.test.cjs are updated for the addMember
block's new if/else shape around the sentinel check.

Thanks to arisjr and xet7 !

Closes #2522,
2026-09-10 20:46:04 +03:00
Lauri Ojansivu 187a3df1ce Add a WIP limit shared across several lists together (WIP limit groups).
WeKan already limits work-in-progress per list (models/lists.js wipLimit),
but a workflow that splits "in progress" into several columns (e.g. three
middle columns together) had no way to cap the total across them - only
each column on its own. Boards.wipLimitGroups adds a small array of
{_id, name, listIds, limit, enabled} groups, settable from a new "WIP
Limit Groups" panel in Board Settings (reusing the existing Swimlane/
List/Card settings popup pattern), where 2+ of the board's lists are
picked to share one combined numeric limit.

models/lib/wipLimitGroupDecision.js is the pure arithmetic behind it -
combinedWipLimitGroupCount sums the current card count across a group's
member lists, isWipLimitGroupExceeded mirrors the per-list "exceeded"
threshold (value < count), and isListInExceededWipLimitGroup answers
whether a given list belongs to any group that is currently over its
own shared limit, independent of that list's own individual wipLimit.

The list header reuses the exact same `.highlight` over-limit styling
the per-list WIP counter already uses (client/components/lists/list.css)
rather than a second visual language: every list that is a member of an
exceeded group gets its title highlighted, not only the list that
happens to be over on its own.
2026-09-10 20:45:03 +03:00
Lauri Ojansivu 521cb4e332 Add an admin-configurable external issue-tracker autolink for card text.
Admin Panel -> Settings -> Visibility gets a new "External Issue Tracker
Autolink" group: a token prefix (e.g. "#") and a URL template containing
"{number}" (e.g. https://issues.example.com/browse/PROJ-{number}). When both
are set, a bare "<prefix><digits>" token found in card descriptions/comments
is rendered as a link to that external tracker, the same idea as the
Mattermost autolink plugin. Either field left empty keeps the feature off.

WeKan does not autolink bare "#NNNN" to its own cards anywhere - confirmed by
reading the whole markdown pipeline (packages/markdown) and every client
template before adding this, per models/lib/externalLinkAutolink.js's own
comment - so there is nothing internal for this to collide with. It stays
safe regardless: off by default, and it never rewrites a token that already
sits inside an existing markdown link target or an href="..." attribute.

models/lib/externalLinkAutolink.js is the pure, unit-tested matching/URL-
building function; packages/markdown/src/template-integration.js cannot
import app code, so it carries its own small mirror of the same algorithm,
bridged from the setting via a ReactiveVar the same way alwaysShowCodeAsText
already is, kept in sync by client/components/main/editor.js.

server/publications/settings.js publishes the two new fields - a setting a
template reads that the publication does not send always renders empty and
makes "Save" look like it did nothing.

Adds the "external-link-pattern"/-description/-prefix/-url keys to
en.i18n.json and all 245 other locale files, translated directly (no
placeholder service), preserving the "{number}" placeholder untouched in
every language. tests/externalLinkAutolink.test.cjs covers the pure function
(matching, URL building, no-op when unconfigured, the existing-link
collision guard), the settings/publication/bridge wiring, i18n key placement
and placeholder preservation across every locale file, and confirms by
source inspection that no internal #NNNN-to-card autolinker exists anywhere
in the tree.
2026-09-10 20:44:45 +03:00